Best paractice to add metadata for a token
ainayat1914 opened this issue · comments
We have some tokens already deployed. We encounter an issue regarding the metadata for the token on-chain.
We developed an extension to the main Token.sol and added a method to save some extra data on-chain for the token.
I was wondering if anyone uses any different approach than this. Because for the already deployed contract that's not possible.
Any suggestions?
Hey!
Regarding token data, we usually deploy an additionnal identity contract (based on the ONCHAINID specification that follow legacy ERC735 and ERC734 standards to support identity behaviors such as proof validation and revokation, but that's optional, adding custom metadata properties or a metadata URI to the contract sounds also great for use-cases that do not need full identity features).
indeed, as @Nakasar said, one of the state variables of the Token contract is address _tokenOnchainID
and is accessible through the getter function onchainID()
this address is the ONCHAINID contract of the token itself and can contain Claims
as defined in ERC-735, Claims can contain any data related to the token. The claims are signed and that signature is verifiable, making it a great way to publish certified data.
I will give it a try in this way. Thanks for the answer 🙂