Sound Protocol
Module Contracts
SoundMetadata

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:
editionThe address of the SoundEdition.
tokenIdThe 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:
editionThe address of the Sound Edition.
tierThe tier.
uriThe base URI.

setUseTierTokenIdIndex

function setUseTierTokenIdIndex(address edition, bool value) external

Sets whether to use the tier token ID index Defaults to true.

Params:
editionThe address of the SoundEdition.
valueWhether 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:
editionThe 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:
editionThe 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:
editionThe address of the SoundEdition.
tierThe 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:
tokenIdThe 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:
editionThe edition address.
tierThe 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:
editionThe address of the Sound Edition.
tokenIdThe 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:
editionThe address of the Sound Edition.
tierThe tier.
uriThe base URI.

UseTierTokenIdIndexSet

event UseTierTokenIdIndexSet(address indexed edition, bool value)

Emitted when the option use the tier token ID is set.

Params:
editionThe address of the Sound Edition.
valueWhether to use the tier token ID for edition.

Errors

Unauthorized

error Unauthorized()

The caller is not authorized to perform the operation.