SoundMetadata
contracts/modules/SoundMetadata.sol
(opens in a new tab)
Sound Metadata module with per-tier overrides.
Inherits:
Write Functions
setNumberedUpTo
function setNumberedUpTo(address edition, uint32 tokenId) external
Sets the maximum tokenId
for edition
that has a numbered JSON.
Params: | |
---|---|
edition | The address of the SoundEdition. |
tokenId | The maximum tokenId for edition that has a numbered JSON. |
setBaseURI
function setBaseURI(
address edition,
uint8 tier,
string calldata uri
) external
Sets the base URI for (edition
, tier
).
Params: | |
---|---|
edition | The address of the Sound Edition. |
tier | The tier. |
uri | The base URI. |
setUseTierTokenIdIndex
function setUseTierTokenIdIndex(address edition, bool value) external
Sets whether to use the tier token ID index Defaults to true.
Params: | |
---|---|
edition | The address of the SoundEdition. |
value | Whether to use the tier token ID index for edition . |
Read-only Functions
DEFAULT_NUMBER_UP_TO
function DEFAULT_NUMBER_UP_TO() external pure returns (uint32)
Returns the default maximum tokenId
for edition
that has a numbered json.
numberedUpTo
function numberedUpTo(address edition) external view returns (uint32)
Returns the maximum tokenId
for edition
that has a numbered json.
Params: | |
---|---|
edition | The address of the SoundEdition. |
useTierTokenIdIndex
function useTierTokenIdIndex(address edition) external view returns (bool)
Returns whether to use the tier token ID index. Defaults to true.
Params: | |
---|---|
edition | The address of the SoundEdition. |
baseURI
function baseURI(address edition, uint8 tier) external view returns (string memory)
Returns the base URI override for the (edition
, tier
).
Params: | |
---|---|
edition | The address of the SoundEdition. |
tier | The tier. |
tokenURI
function tokenURI(uint256 tokenId) external view returns (string memory)
When registered on a SoundEdition proxy, its tokenURI
redirects execution to this tokenURI
.
Params: | |
---|---|
tokenId | The token ID to retrieve the token URI for. |
goldenEggTokenId
function goldenEggTokenId(address edition, uint8 tier) external view returns (uint256 tokenId)
Returns token ID for the golden egg after the mintRandomness
is locked, else returns 0.
Params: | |
---|---|
edition | The edition address. |
tier | The tier of the token. |
Events
NumberUpToSet
event NumberUpToSet(address indexed edition, uint32 tokenId)
Emitted when the tokenId
for edition
with a json is set.
Params: | |
---|---|
edition | The address of the Sound Edition. |
tokenId | The maximum tokenId for edition that has a numberd json. |
BaseURISet
event BaseURISet(address indexed edition, uint8 tier, string uri)
Emitted when the base URI for (edition
, tier
) is set.
Params: | |
---|---|
edition | The address of the Sound Edition. |
tier | The tier. |
uri | The base URI. |
UseTierTokenIdIndexSet
event UseTierTokenIdIndexSet(address indexed edition, bool value)
Emitted when the option use the tier token ID is set.
Params: | |
---|---|
edition | The address of the Sound Edition. |
value | Whether to use the tier token ID for edition . |
Errors
Unauthorized
error Unauthorized()
The caller is not authorized to perform the operation.