Skip to content
ClearClear
Docs
Protocol/MetadataRenderer

MetadataRenderer

Source: contracts/core/MetadataRenderer.sol · Guide: metadata-renderer · Upgradeable (UUPS proxy)

2 min readUpdated View source

On this page
Network
Chain id
Address
Base Sepolia
84532

Functions that change state

Function
Who can call
Also
grantRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
initialize()
Once, when the proxy is initialised
manageTokenDocument(uint256 tokenId, string docType, string documentURI, bool isRemove)
onlyOwnerOrValidator(tokenId)
renounceOwnership()
The owner
renounceRole(bytes32 role, address account)
Only the account renouncing its own role
revokeRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
setAssetCondition(uint256 tokenId, string generalCondition, string lastInspectionDate, string[] knownIssues, string[] improvements, string additionalNotes)
onlyOwnerOrValidator(tokenId)
setAssetTypeBackgroundColor(uint8 assetType, string backgroundColor)
onlyOwner
setAssetTypeImageURI(uint8 assetType, string imageURI)
onlyOwner
setDeedNFT(address _deedNFT)
onlyRole(DEFAULT_ADMIN_ROLE)
setInvalidatedImageURI(string imageURI)
onlyOwner
setTokenAnimationURL(uint256 tokenId, string animationURL)
onlyOwnerOrValidator(tokenId)
setTokenCustomMetadata(uint256 tokenId, string metadata)
onlyOwnerOrValidator(tokenId)
setTokenExternalLink(uint256 tokenId, string externalLink)
onlyOwnerOrValidator(tokenId)
setTokenFeatures(uint256 tokenId, string[] features)
onlyOwnerOrValidator(tokenId)
setTokenGallery(uint256 tokenId, string[] imageUrls)
onlyRole(DEFAULT_ADMIN_ROLE)
setTokenLegalInfo(uint256 tokenId, string jurisdiction, string registrationNumber, string registrationDate, string[] documents, string[] restrictions, string additionalInfo)
onlyOwnerOrValidator(tokenId)
syncTraitUpdate(uint256 tokenId, bytes32 traitKey, bytes traitValue)
Checked inside the function
transferOwnership(address newOwner)
The owner
upgradeTo(address newImplementation)
onlyOwner (via _authorizeUpgrade)
upgradeToAndCall(address newImplementation, bytes data)
onlyOwner (via _authorizeUpgrade)
payable

Read functions

Anyone can call these; they change nothing.

Function
Returns
contractURI()
string
deedNFT()
address
DEFAULT_ADMIN_ROLE()
bytes32
defaultBackgroundColors(uint8)
string
defaultImageURIs(uint8)
string
getAssetCondition(uint256 tokenId)
string generalCondition, string lastInspectionDate, string[] knownIssues, string[] improvements, string additionalNotes
getRoleAdmin(bytes32 role)
bytes32
getTokenAnimationURL(uint256 tokenId)
string
getTokenDocument(uint256 tokenId, string docType)
string
getTokenDocuments(uint256 tokenId)
(string,string)[]
getTokenExternalLink(uint256 tokenId)
string
getTokenFeatures(uint256 tokenId)
string[]
getTokenGallery(uint256 tokenId)
string[]
getTokenLegalInfo(uint256 tokenId)
string jurisdiction, string registrationNumber, string registrationDate, string[] documents, string[] restrictions, string additionalInfo
hasRole(bytes32 role, address account)
bool
owner()
address
proxiableUUID()
bytes32
supportsInterface(bytes4 interfaceId)
bool
tokenURI(uint256 tokenId)
string
VALIDATOR_ROLE()
bytes32

Events

Event
AdminChanged(address previousAdmin, address newAdmin)
BeaconUpgraded(address beacon indexed)
CompatibleDeedContractAdded(address contractAddress indexed)
CompatibleDeedContractRemoved(address contractAddress indexed)
Initialized(uint8 version)
MetadataInitialized(uint256 tokenId indexed, string ipfsHash)
MetadataSynced(uint256 tokenId indexed, bytes32 traitKey indexed, bytes value)
OwnershipTransferred(address previousOwner indexed, address newOwner indexed)
RoleAdminChanged(bytes32 role indexed, bytes32 previousAdminRole indexed, bytes32 newAdminRole indexed)
RoleGranted(bytes32 role indexed, address account indexed, address sender indexed)
RoleRevoked(bytes32 role indexed, address account indexed, address sender indexed)
TokenCustomMetadataUpdated(uint256 tokenId indexed)
TokenGalleryUpdated(uint256 tokenId indexed)
TokenMetadataUpdated(uint256 tokenId indexed)
Upgraded(address implementation indexed)

Errors

Error
Empty()
Exists()
Invalid()
Unauthorized()