ODCdataManagersERC1155extensions

ERC1155URI

Abstract contract that provides the URI storage of the ERC1155 Data Manager

Based on OZ ERC1155URIStorage

uri

function uri(uint256 tokenId) public view virtual returns (string)

_See {IERC1155MetadataURI-uri}.

This implementation returns the concatenation of the _baseURI and the token-specific uri if the latter is set

This enables the following behaviors:

  • if _tokenURIs[tokenId] is set, then the result is the concatenation of _baseURI and _tokenURIs[tokenId] (keep in mind that _baseURI is empty per default);

  • if _tokenURIs[tokenId] is NOT set then we fallback to super.uri() which in most cases will contain ERC1155._uri;

  • if _tokenURIs[tokenId] is NOT set, and if the parents do not have a uri value set, then the result is empty._

_setURI

function _setURI(uint256 tokenId, string tokenURI) internal virtual

Sets tokenURI as the tokenURI of tokenId

_setBaseURI

function _setBaseURI(string baseURI) internal virtual

Sets baseURI as the _baseURI for all tokens

_setDefaultURI

function _setDefaultURI(string defaultURI) internal virtual

Sets defaultURI as the _defaultURI for all tokens

On this page