openzeppelin-contracts icon indicating copy to clipboard operation
openzeppelin-contracts copied to clipboard

Support ERC-1046 by default

Open Pandapip1 opened this issue 3 years ago • 2 comments

🧐 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

  • tokenURI should be added to the base ERC-1155 contract and the base ERC-20 contract
  • The name, symbol, and decimals fields 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.

Pandapip1 avatar Mar 31 '23 18:03 Pandapip1

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

yashthipsay avatar Apr 11 '23 11:04 yashthipsay