Skip to main content

IContractMetadata

Thirdweb's ContractMetadata is a contract extension for any base contracts. It lets you set a metadata URI for you contract. Additionally, ContractMetadata is necessary for NFT contracts that want royalties to get distributed on OpenSea.

Methods

contractURI

function contractURI() external view returns (string)

Returns the metadata URI of the contract.

Returns

NameTypeDescription
_0stringundefined

setContractURI

function setContractURI(string _uri) external nonpayable

Sets contract URI for the storefront-level metadata of the contract. Only module admin can call this function.

Parameters

NameTypeDescription
_uristringundefined

Events

ContractURIUpdated

event ContractURIUpdated(string prevURI, string newURI)

Emitted when the contract URI is updated.

Parameters

NameTypeDescription
prevURIstringundefined
newURIstringundefined