ERC721URIStorage
ERC-721 token with storage based token URI management.
State Variables
ERC4906_INTERFACE_ID
bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);
_tokenURIs
mapping(uint256 tokenId => string) private _tokenURIs;
Functions
supportsInterface
Query if a contract implements an interface
Interface identification is specified in ERC-165. This function uses less than 30,000 gas.
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceId | bytes4 |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if the contract implements interfaceID and interfaceID is not 0xffffffff, false otherwise |
tokenURI
A distinct Uniform Resource Identifier (URI) for a given asset.
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".
function tokenURI(uint256 tokenId) public view virtual override returns (string memory);
_setTokenURI
Sets _tokenURI
as the tokenURI of tokenId
.
Emits {IERC4906-MetadataUpdate}.
function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual;