-
Notifications
You must be signed in to change notification settings - Fork 842
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 ERC721APausable as equivalent to ERC721Pausable #205
Conversation
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,
IMO we should use if statement with custom error instead of require
. See #73
And don't forget to add docs too.
@ahbanavi cheers, making those updates this morning. |
Adding unit tests now! |
@Vectorized fixed my formatting issues with the linter and picked up a few other fixes along the way. @ahbanavi wrote up those unit tests and added in two extra tests for checking that it composes with
|
This reverts commit 710cf78.
@Vectorized thank you for all the feedback! Tests and actions are passing now. @ahbanavi lmk if there's any other updates you'd like for me to make! 😄 pleasure teamworking with y'all so far 🤝 |
@ahbanavi why was this reverted? |
I just having some experiments on my fork, no worries. |
uint256 quantity | ||
) internal virtual override { | ||
super._beforeTokenTransfers(from, to, startTokenId, quantity); | ||
if (paused()) revert ContractPaused(); |
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.
ooc what's the reason for this check/revert being last instead of first?
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.
Good question! I believe OZ’s implementation also has it after the super call. But I see where you are coming from.
This PR
Adds
contracts/extensions/ERC721APausable.sol
as an option for giving developers an easy way to swap out their OpenZeppelin ERC721Pausable inherited contract implementations with something very similar in usage.Reference
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721Pausable.sol
Notes
Can be used alongside
ERC721ABurnable
without issues!Usage
See Mock class.