Network-Goods / hypercerts-protocol

MIT License
13 stars 5 forks source link

Overflow checks on TokenID #80

Closed ryscheng closed 1 year ago

ryscheng commented 1 year ago

Since we're doing this masking technique to extract the TypeID from the TokenID, I think there's now a risk of an overflow on tokenID into TypeID, we can't just rely on built-in Solidity overflow checks.

See for example: https://github.com/Network-Goods/hypercerts-protocol/blob/dev/src/SemiFungible1155.sol#L199

@bitbeckers can you verify if I am reading this correctly?

bitbeckers commented 1 year ago

I think so, yes. We should: 1) Write tests for these cases 2) Implement restrictions on minting params.

It's a while ago, and the statement is incorrect, but I think there's a TODO here: https://github.com/Network-Goods/hypercerts-protocol/blob/dev/src/SemiFungible1155.sol#L45