-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Bundle ERC721 extensions into base contract #2149
Merged
Merged
Conversation
This file contains 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
Also, I haven't yet updated the documentation generators, so some links will be broken. I'll address that once we have the final code in place. |
frangio
reviewed
Mar 27, 2020
Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>
frangio
approved these changes
Mar 27, 2020
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.
Looks good!
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.
Part of #2086.
The goal behind this initiative is to have all optional extensions for tokens baked into the base implementation (that is, for
ERC20
to includeERC20Detailed
, andERC721
to include bothERC721Metadata
andERC721Enumerable
). These optional extensions were often (always?) used along the base implementation, and the changes in Solidity around inheritance mean that forcing our users to use multiple inheritance create unnecessary friction.As a side effect, we should be able to use the newly added
EnumerableSet
and the proposals aroundEnumerableMap
(#2072) to improve code readability, gas efficiency and overall security.Because the tokens are some of the library's biggest contracts, these changes are not trivial. I thought it best to approach this in a step-by-step manner, by:
This PR contains just the first step of the three described above. To make reviewing easier, I split the changes to the contracts code in different commits. The tests refactor is unfortunately hard to review, though I am confident it was performed correctly (I copy-pasted the tests from ERC721.behavior and ERC721Full.test into ERC721.test).