TokenMetadata.sol 629 B

123456789101112131415161718192021222324
  1. pragma solidity ^0.5.0;
  2. import "../../token/ERC20/IERC20.sol";
  3. /**
  4. * @title ERC-1047 Token Metadata
  5. * @dev See https://eips.ethereum.org/EIPS/eip-1046
  6. * @dev tokenURI must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047
  7. */
  8. contract ERC20TokenMetadata is IERC20 {
  9. function tokenURI() external view returns (string memory);
  10. }
  11. contract ERC20WithMetadata is ERC20TokenMetadata {
  12. string private _tokenURI;
  13. constructor (string memory tokenURI) public {
  14. _tokenURI = tokenURI;
  15. }
  16. function tokenURI() external view returns (string memory) {
  17. return _tokenURI;
  18. }
  19. }