ERC721URIStorage
Title: ERC721URIStorage
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/extensions/ERC721URIStorage.sol)
Stateless Diamond facet for ERC-721 with per-token URI storage (EIP-4906).
Owns ONLY its own selectors — setTokenURI (new) and tokenURI, which REPLACES the base ERC721
variant to read per-token URI storage. It does NOT inherit the ERC721 facet — doing so would re-export
the base ERC-721 surface and collide with the standalone ERC721 facet in a Diamond (and is IERC721URIStorage would drag in the whole IERC721 surface, forcing a re-export). The ERC-721 base
surface comes from a separately-cut ERC721 facet; DeployERC721URIStorage composes both. The EIP-4906
metadata-update events are emitted by ERC721URIStorageLib. Pure delegator pattern.
Notes:
- lattice-version: 0.1.0
- lattice-source: OpenZeppelin v5.6.1
Functions
tokenURI
Returns the URI for tokenId.
Replaces the base ERC721 tokenURI to use per-token URI storage.
function tokenURI(uint256 tokenId) public view virtual returns (string memory);Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
setTokenURI
Sets the per-token URI for tokenId. Admin-gated.
function setTokenURI(uint256 tokenId, string memory uri) public virtual;Parameters
| Name | Type | Description |
|---|---|---|
| tokenId | uint256 | |
| uri | string |
exportSelectors
ERC-8153 selector export: this facet's cuttable selectors, tightly packed (4 bytes each).
Excludes exportSelectors() itself (0x0ef22643) - it is never cut into a diamond. Order matches
forge inspect ERC721URIStorage methodIdentifiers (alphabetical by signature); kept in exact parity by
ExportSelectorsParityTest. Chunks:
setTokenURI(uint256,string) 0x162094c4
tokenURI(uint256) 0xc87b56dd
function exportSelectors() external pure virtual returns (bytes memory selectors);Returns
| Name | Type | Description |
|---|---|---|
| selectors | bytes |