DeedNFT
Source: contracts/core/DeedNFT.sol · Guide: smart-contracts · Upgradeable (UUPS proxy)
Functions that change state
Function
Who can call
Also
addMinter(address minter)onlyRole(DEFAULT_ADMIN_ROLE)addValidator(address validator)onlyAdminOrRegistryapprove(address to, uint256 tokenId)Anyone
burnAsset(uint256 tokenId)onlyDeedOwner(tokenId)whenNotPausedburnBatchAssets(uint256[] tokenIds)Checked inside the function
whenNotPausedgrantRole(bytes32 role, address account)The role's admin role (
DEFAULT_ADMIN_ROLE unless set otherwise)initialize(address _defaultValidator, address _validatorRegistry)Once, when the proxy is initialised
mintAsset(address owner, uint8 assetType, string uri, string definition, string configuration, address validatorAddress, address token, uint256 salt)onlyRole(MINTER_ROLE)whenNotPausedpause()onlyRole(DEFAULT_ADMIN_ROLE)removeMinter(address minter)onlyRole(DEFAULT_ADMIN_ROLE)removeTrait(uint256 tokenId, string traitName)onlyValidatorOrOwner(tokenId)removeValidator(address validator)onlyAdminOrRegistryrenounceRole(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)safeTransferFrom(address from, address to, uint256 tokenId, bytes data)The holder, or an approved operator
safeTransferFrom(address from, address to, uint256 tokenId)The holder, or an approved operator
setApprovalForAll(address operator, bool approved)Anyone
setApprovedMarketplace(address marketplace, bool approved)onlyRole(DEFAULT_ADMIN_ROLE)setContractURI(string newURI)onlyRole(DEFAULT_ADMIN_ROLE)setDefaultValidator(address validator)onlyRole(DEFAULT_ADMIN_ROLE)setFundManager(address _fundManager)onlyRole(DEFAULT_ADMIN_ROLE)setMetadataRenderer(address renderer)onlyRole(DEFAULT_ADMIN_ROLE)setRoyaltyEnforcement(bool enforced)onlyRole(DEFAULT_ADMIN_ROLE)setToDefaultSecurityPolicy()onlyRole(DEFAULT_ADMIN_ROLE)setTrait(uint256 tokenId, bytes traitKey, bytes traitValue, uint8 valueType)onlyValidatorOrOwner(tokenId)setTraitName(bytes32 traitKey, string traitName)onlyRole(DEFAULT_ADMIN_ROLE)setTransferValidator(address validator)onlyRole(DEFAULT_ADMIN_ROLE)setValidatorRegistry(address registry)onlyRole(DEFAULT_ADMIN_ROLE)transferFrom(address from, address to, uint256 tokenId)The holder, or an approved spender
unpause()onlyRole(DEFAULT_ADMIN_ROLE)updateMetadata(uint256 tokenId, string uri, string operatingAgreement, string definition, string configuration)onlyValidatorOrOwner(tokenId)whenNotPausedupdateValidationStatus(uint256 tokenId, bool isValid, address validatorAddress)onlyRole(VALIDATOR_ROLE)upgradeTo(address newImplementation)onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)upgradeToAndCall(address newImplementation, bytes data)onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)payable
Read functions
Anyone can call these; they change nothing.
Function
Returns
balanceOf(address owner)uint256
contractURI()string
DEFAULT_ADMIN_ROLE()bytes32
fundManager()address
generateUniqueTokenId(address owner, uint8 assetType, string definition, uint256 salt)uint256
getApproved(uint256 tokenId)address
getRoleAdmin(bytes32 role)bytes32
getTraitKeys(uint256 tokenId)bytes32[]
getTraitMetadataURI()string
getTraitName(bytes32 traitKey)string
getTraitValue(uint256 tokenId, bytes32 traitKey)bytes
getTraitValues(uint256 tokenId, bytes32[] traitKeys)bytes[]
getTransferValidationFunction()bytes4 functionSignature, bool isViewFunction
getTransferValidator()address validator
getValidationStatus(uint256 tokenId)bool isValidated, address validator
hasRole(bytes32 role, address account)bool
isApprovedForAll(address owner, address operator)bool
isApprovedMarketplace(address marketplace)bool
isRoyaltyEnforced()bool
metadataRenderer()address
MINTER_ROLE()bytes32
name()string
nexttokenId()uint256
ownerOf(uint256 tokenId)address
paused()bool
proxiableUUID()bytes32
royaltyInfo(uint256 tokenId, uint256 salePrice)address receiver, uint256 royaltyAmount
supportsInterface(bytes4 interfaceId)bool
symbol()string
tokenByIndex(uint256 index)uint256
tokenOfOwnerByIndex(address owner, uint256 index)uint256
tokenURI(uint256 tokenId)string
totalSupply()uint256
VALIDATOR_ROLE()bytes32
Events
Event
AdminChanged(address previousAdmin, address newAdmin)Approval(address owner indexed, address approved indexed, uint256 tokenId indexed)ApprovalForAll(address owner indexed, address operator indexed, bool approved)BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId)BeaconUpgraded(address beacon indexed)ContractURIUpdated(string newURI)DeedNFTBurned(uint256 tokenId indexed)DeedNFTMinted(uint256 tokenId indexed, uint8 assetType, address minter indexed, address validator)DeedValidated(uint256 tokenId indexed, bool isValid)Initialized(uint8 version)MarketplaceApproved(address marketplace indexed, bool approved)MetadataRendererUpdated(address renderer indexed)MetadataUpdate(uint256 _tokenId)Paused(address account)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)RoyaltyEnforcementChanged(bool enforced)TraitUpdated(bytes32 traitKey indexed, uint256 tokenId indexed, bytes traitValue)Transfer(address from indexed, address to indexed, uint256 tokenId indexed)TransferValidatorUpdated(address oldValidator, address newValidator)Unpaused(address account)Upgraded(address implementation indexed)Errors
No custom errors; failures revert with a reason string.