-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation in Governor on ERC-721 or ERC-1155 received #4314
Add validation in Governor on ERC-721 or ERC-1155 received #4314
Conversation
🦋 Changeset detectedLatest commit: 2d53fa7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, the expectRevert should not be unspecified.
@Amxx good catch! But what do you mean whit if possible, is there any specific reason for not specifying it? openzeppelin-contracts/test/governance/extensions/GovernorTimelockCompound.test.js Lines 88 to 90 in ffceb3c
|
If there is no revert string, or if the revert is a panic, then unspecified might be the way. |
oh perfect makes sense @Amxx thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good @clauBv23! Thanks. I'm adding a few suggestions and also requesting review from others.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a3e43b5
to
1c324a0
Compare
@frangio @ernestognw I merged master into this and realised the following: ERC1155 acceptance hook was written in a way that bubble error string, but not custom error. The result is that the Governor custom error ( Do we want to change the ERC1155 hook to use the syntax from ERC721 (which bubble the custom errors)? |
I'd say yes. |
Co-authored-by: Claudia Barcelo <claudiabarcelovaldes40@gmail.com>
Fixes #4307
Add validation to
onERC1155Received
,onERC1155BatchReceived
, andonERC721Received
hooks in Governor to check it is the executor.Add test to the validations.
Note: This PR should be refactored after merging #4261 and #4284
PR Checklist
npx changeset add
)