ERC721Metadata

Trait ERC721Metadata 

Source
pub trait ERC721Metadata: ERC721 {
    // Required methods
    fn name(&self) -> Result<String>;
    fn symbol(&self) -> Result<String>;
    fn token_uri(&self, token_id: U256) -> Result<String>;
}
Expand description

The metadata extension is OPTIONAL for ERC-721 smart contracts. This allows your smart contract to be interrogated for its name and for details about the assets which your NFTs represent.

@title ERC-721 Non-Fungible Token Standard, optional metadata extension @dev See https://eips.ethereum.org/EIPS/eip-721 Note: the ERC-165 identifier for this interface is 0x5b5e139f.

Required Methods§

Source

fn name(&self) -> Result<String>

@notice A descriptive name for a collection of NFTs in this contract

Source

fn symbol(&self) -> Result<String>

@notice An abbreviated name for NFTs in this contract

Source

fn token_uri(&self, token_id: U256) -> Result<String>

@notice A distinct Uniform Resource Identifier (URI) for a given asset. @dev Throws if _tokenId is not a valid NFT. URIs are defined in RFC 3986. The URI may point to a JSON file that conforms to the “ERC721 Metadata JSON Schema”.

Implementors§