ContractMetadataLogic

thirdweb.com

Contract Metadata

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

Name
Type
Description

_0

string

undefined

setContractURI

function setContractURI(string _uri) external nonpayable

Lets a contract admin set the URI for contract-level metadata.

Caller should be authorized to setup contractURI, e.g. contract admin. See {_canSetContractURI}. Emits {ContractURIUpdated Event}.

Parameters

Name
Type
Description

_uri

string

keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE")

Events

ContractURIUpdated

event ContractURIUpdated(string prevURI, string newURI)

Parameters

Name
Type
Description

prevURI

string

undefined

newURI

string

undefined

Last updated