Skip to content
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

ERC721 full implementation #682

Conversation

facuspagnuolo
Copy link
Contributor

@facuspagnuolo facuspagnuolo commented Jan 16, 2018

Fixes #640

This PR includes a full implementation of the ERC721 including all the required and some of the optional functionality. Moreover, it provides an approve all implementation using operatable terminology.

@facuspagnuolo
Copy link
Contributor Author

@frangio can you please review?

@TimTinkers
Copy link

@facuspagnuolo might not be my place to comment here, but I've been playing around with your contract from this PR today for an application I'm working on. OpenZeppelin has such a huge adoption this might become something of a reference implementation. As such I just wanted to clarify something. Are the implementsERC721 and setTokenMetadata functions agreed on as parts of the standard in the ERC? I couldn't find consensus on the first or any information about the second and was just curious. Thanks for all the work you're putting into this!

@facuspagnuolo
Copy link
Contributor Author

@TimTinkers thanks for reaching out! As far as I know, those functions are not agreed to part of the standard yet, but are under discussion. We are still reviewing this implementation and discussing about implementsERC721 and setTokenMetadata. We didn't decide if these functions are going to be part of our detailed implementation yet, it is still tentative. Stay tuned on this thread to be aware of any decision we make. Thanks!

@facuspagnuolo facuspagnuolo force-pushed the feature/640_detailed_erc721 branch 2 times, most recently from 860fd59 to faf04ff Compare February 26, 2018 22:06
@facuspagnuolo facuspagnuolo changed the title ERC721 detailed implementation ERC721 full implementation Feb 26, 2018
return owner;
function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) {
require(_index < balanceOf(_owner));
return tokensOf(_owner)[_index];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an order of magnitude slower as it returns the entire array and then indexes the array, and would not work on large arrays. A better way would to make ownedTokens internal and use:

return ownedTokens[_owner][_index];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spalladino
Copy link
Contributor

Closing in favour of #803

@spalladino spalladino closed this Mar 7, 2018
@spalladino spalladino removed the review label Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants