ERC721URIStorageUpgradeable
Inherits: Initializable, IERC4906, ERC721Upgradeable
ERC-721 token with storage based token URI management.
State Variables
ERC4906_INTERFACE_ID
bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);
ERC721URIStorageStorageLocation
bytes32 private constant ERC721URIStorageStorageLocation =
0x0542a41881ee128a365a727b282c86fa859579490b9bb45aab8503648c8e7900;
Functions
_getERC721URIStorageStorage
function _getERC721URIStorageStorage() private pure returns (ERC721URIStorageStorage storage $);
__ERC721URIStorage_init
function __ERC721URIStorage_init() internal onlyInitializing;
__ERC721URIStorage_init_unchained
function __ERC721URIStorage_init_unchained() internal onlyInitializing;
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(ERC721Upgradeable, 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;
Structs
ERC721URIStorageStorage
Note: storage-location: erc7201:openzeppelin.storage.ERC721URIStorage
struct ERC721URIStorageStorage {
mapping(uint256 tokenId => string) _tokenURIs;
}