-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Query for name and symbol on ERC721 contracts regardless of whether or not they support the metadata interface #834
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.
👍
src/assets/Standards/CollectibleStandards/ERC721/ERC721Standard.ts
Outdated
Show resolved
Hide resolved
…r not they support the metadata interface
10b2c1e
to
3e0d99f
Compare
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.
Does it make sense to use metadata at all if we don't understand the format? I'm 100% behind us making this class compatible with ERC721 contracts with alternative metadata formats, or no metadata. The format described in the EIP is optional after all. But if the contract doesn't support this metadata format, should we be assuming the fields we do find can be used in the same way?
e.g. if the contract had metadata of the format { name: ___, fullName: ___
, where name
is the symbol and fullName
is a longer human-readable name. In that case we'd be wrongly using the symbol as the name.
Adding explicit support for other popular metadata formats (in later PRs) would be a safer alternate path for supporting those cases.
I don't think I understand what you mean here. We are not parsing the |
Hmm. ERC-721 seemed to imply they were optional, which led me to think they might be used for something else. But maybe you're right. Even if not explicitly guaranteed by the standard, it seems unlikely they'd be reused for some other purpose. Especially since they're also defined in ERC-20. |
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.
I am fine to approve this as long as we create issues to resolve the infinite loading problem in the extension and explore the idea of trying to parse non-standard contracts.
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!
…r not they support the metadata interface (#834) * query for name and symbol on erc721 contracts regardless of whether or not they support the metadata interface
…r not they support the metadata interface (#834) * query for name and symbol on erc721 contracts regardless of whether or not they support the metadata interface
Some ERC721 contracts (e.g. Decentraland) only partially implement the metadata interface (described in the original EIP). We should query for fields included on the interface (
name
,symbol
andtokenURI
) regardless of whether or not the interface is fully implemented.name
,symbol
andtokenURI
fields on a contract.Checklist
Issue
Resolves MetaMask/metamask-extension#14459 & MetaMask/metamask-extension#14589 & MetaMask/metamask-extension#14518