Add ERC1155Holder to prevent Packs.reveal abuse#40
Merged
ScreamingHawk merged 8 commits intomasterfrom Oct 9, 2025
Merged
Conversation
Comment on lines
+113
to
+114
| unchecked { | ||
| ++i; |
There was a problem hiding this comment.
I'm surprised that Solidity doesn't recognize that the previous i++ version was already bound by i < packContent.tokenAddresses.length and cannot overflow :)
Feels like Solidity could do this optimization by itself?
Contributor
Author
There was a problem hiding this comment.
Haha. Yes, it does in some scenarios. This change saved a bit of gas so I guess this isn't one of them.
Usually I wouldn't bother with it but we are so close to the bytecode limit for this contract that it's worth including.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds ERC1155Holder, which accepts ERC1155 tokens and allows them to be claimed by the claimant encoded in the data.
This prevents the user from denying certain tokens when interacting with
packs.reveal(), which would allow them to retry for a better reveal.Includes some trivial optimizations to keep bytecode size within the limits.
This change does not require any ABI updates.
This includes NC-03, flipping the
_commitmentnested mapping keys.Future optimizations if we can reduce bytecode size further:
abi.encodePacked(recipient)updateERC1155Holder()to configure the holder after deployment