openzeppelin-contracts
openzeppelin-contracts copied to clipboard
Support ERC-1046 by default
🧐 Motivation
ERC-1046 allows for ERC-20, ERC-721, and ERC-1155 to use a single method, tokenURI for token URIs, and adds tokenURI support to ERC-20. It's required to add ERC-721 and ERC-1155 tokens via wallet_watchAsset, or to add images to ERC-20 tokens using that same RPC method.
📝 Details
-
tokenURIshould be added to the base ERC-1155 contract and the base ERC-20 contract - The
name,symbol, anddecimalsfields should be deprecated in ERC-20, ERC-721, and ERC-1155 (if applicable to those contracts) - The constructors should take only a single argument, a string URL.
Obviously this would be a very breaking change, and would belong in a major update.
This functionality can be added with two methods that are abstract by default. Although, the second parameter that is specifically for EIP/ERC-1046 can be preferred to wrap ERC-20, 720 and 1155 tokens