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

ERC20 metadata extension #1046

Merged
merged 21 commits into from
May 6, 2018

Conversation

tomasienrbc
Copy link
Contributor

This is the initial submission for an ERC20 Metadata Extension standard. The goal of this EIP is to optionally extend ERC20 token interface to support the same metadata standard as ERC721 tokens. This supports fungible crypto-collectibles that have the same metadata structure as non-fungible crypto-collectibles, amongst many other use cases.

This was a collaboration between @shrugs, @JohnZettler, and @mateosu

EIPS/eip-721.md Outdated
@@ -186,13 +186,13 @@ interface ERC721Metadata /* is ERC721 */ {

/// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
/// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC
/// 3986. The URI may point to a JSON file that conforms to the "ERC721
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't include changes to unrelated files in your PR.

@@ -0,0 +1,85 @@
---
eip: <to be assigned>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please number this 1046 and rename eip-1046.md.

eip: <to be assigned>
title: ERC20 Metadata Extension
author: Tommy Nicholas (@tomasienrbc), Matt Russo (@mateosu), John Zettler (@JohnZettler), Matt Condon (@shrugs)
discussions-to: thelab@rareart.io
Copy link
Contributor

Choose a reason for hiding this comment

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

Please supply a mailing list or discussion forum URL.

---

## Simple Summary
Optionally extend ERC20 token interface to support the same metadata standard as ERC721 tokens
Copy link

Choose a reason for hiding this comment

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

nit: period


The initial use case for the ERC721 standard was to support the creation of crypto-collectibles and gaming assets, initially for the ["Crypto Kitties"](https://www.cryptokitties.co/) collectibles game. The success of Crypto Kitties catalyzed significant application development to support the display of ERC721 assets using the `tokenURI` metadata parameter.

However, not all crypto-collectibles and gaming assets need to be unique and non-fungible. Gaming assets (items, weapons, characters), crypto-artworks with non-unique "prints", and more will function more like traditional ERC20 tokens with a fungible `supply`. Many applications such as wallets, exchanges, games, etc. will want to support both fungible and non-fungible assets containing similar metadata. This proposal will extend the ERC20 standard to optionally include a nearly identical `tokenURI` parameter supporting the same JSON metadata schema as the ERC721 standard.
Copy link

Choose a reason for hiding this comment

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

why "nearly" and not just identical?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the tokenURI param in ERC721 contracts takes in a token ID because it has to identify the specific token the metadata is associated with.

721: function tokenURI(uint256 _tokenId)

20-extended: function tokenURI()

think it's too confusing to say "nearly" - might be unnecessary.

## Rationale
This proposal will make adding metadata to ERC20 tokens straightforward for developers with minimal-to-no disruption to the overall ecosystem. By using the same parameter name and by consolidating the underlying Token JSON Metadata Standard, developers will confidently understand how to add and interpret token metadata between ERC20 and ERC721 tokens.

## Backwards Compatibility
Copy link

Choose a reason for hiding this comment

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

Mention that the token's name() and symbol() getters should be preferred over the metadata's name and (optional) symbol properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Contributor Author

@tomasienrbc tomasienrbc left a comment

Choose a reason for hiding this comment

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

Re-submitting with these fixes now

- Some grammar fixes
- Removed mentions of ERC721 standard code
- Added EIP # and discussion forum
EIPS/eip-1046.md Outdated
eip: 1046
title: ERC20 Metadata Extension
author: Tommy Nicholas (@tomasienrbc), Matt Russo (@mateosu), John Zettler (@JohnZettler), Matt Condon (@shrugs)
discussions-to: thelab@rareart.io
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this, and rename discussion-forum to discussions-to.

discussion-to instead of discussion-forum
@eip-automerger
Copy link

Hi! I'm a bot, and I wanted to automerge your PR, but couldn't because of the following issue(s):

@tomasienrbc
Copy link
Contributor Author

@Arachnid I accidentally have a file from ERC721 changed in this PR (sorry didn't catch that) - removing that and re-submitting

@tomasienrbc
Copy link
Contributor Author

@Arachnid changes to ERC721 are now fully reverted - no changes to ERC721 in this PR, auto-merge should be possible

EIPS/eip-1046.md Outdated
eip: 1046
title: ERC20 Metadata Extension
author: Tommy Nicholas (@tomasienrbc), Matt Russo (@mateosu), John Zettler (@JohnZettler), Matt Condon (@shrugs)
discussion-to: https://www.reddit.com/r/raredigitalart/comments/8hfh1g/erc20_metadata_extension_eip_1046/
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be discussions-to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes - fixed

@Arachnid Arachnid merged commit 6b2bdaa into ethereum:master May 6, 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.

5 participants