ColleCollectionUpgradeable
This contract represents a collection of unique tokens (NFTs) which mirror physical assets and extends ERC721 with additional functionality.
The contract is using OpenZeppelin contracts for most of the ERC721 functionality and has extra functions for additional needs.
nextTokenId
tokenSaleMetadataIPFS
constructor
The constructor initializes the base contract.
initialize
Initializes the contract.
Parameters
_name
string
The name of the token.
_symbol
string
The symbol of the token.
_authorizeUpgrade
Authorizes a contract upgrade.
Throws if the new implementation is not the target implementation.
Parameters
newImplementation
address
The address of the new contract implementation.
onlyOwnerApprovedEOAOrVault
Guards ERC721 transfers to the token owner (EOA or contract), approved EOA or approved Vault.
Restricts approved non-vault contracts from transferring tokens to break 3rd party transfers of mirrored assets.
Parameters
_tokenId
uint256
The token id to guard against.
mint
Mints a new token.
This function can only be called by a Colle.
Parameters
_uri
string
The token URI.
_receiver
address
The address that will receive the minted token.
updateSaleMetadata
Updates the sale metadata for a token.
This function can only be called by a Colle or the owner of the token.
Parameters
_tokenId
uint256
The ID of the token to update.
_ipfsHash
string
The new IPFS hash for the token metadata.
updateTokenURI
Updates the token metadata URI
This function can only be called by a Colle.
Parameters
_tokenId
uint256
The ID of the token to update.
_uri
string
The new URI for the token metadata.
getSaleMetadata
Returns the sale metadata for a token.
Parameters
_tokenId
uint256
The ID of the token to query.
Return Values
[0]
string
The IPFS hash of the sale metadata.
isSaleMetadataSet
Checks if sale metadata is set for a token.
Parameters
_tokenId
uint256
The ID of the token to check.
Return Values
[0]
bool
True if the token has sale metadata set, false otherwise.
permitApprove
Approves an address to transfer a specific token.
Parameters
_to
address
The address to approve.
_tokenId
uint256
The ID of the token to approve.
_signature
struct Signature
The signature from the approving address, the 'from', including deadline
permitSetApprovalForAll
Approves an address to transfer any tokens owned by the sender.
Parameters
_operator
address
The address to approve.
_approve
bool
Whether to approve or revoke approval
_signature
struct Signature
The signature, deadline and signer from the owner of the token.
permitSafeTransfer
Transfers a token from one address to another, verifying the validity of a signature.
Parameters
_to
address
The address to receive the token.
_tokenId
uint256
The ID of the token to transfer.
_signature
struct Signature
The signature, deadline and signer from the owner of the token.
getNextTokenId
Returns the ID of the next token that will be minted.
Return Values
[0]
uint256
The ID of the next token.
supportsInterface
Checks if the contract implements an interface.
Parameters
_interfaceId
bytes4
The ID of the interface.
Return Values
[0]
bool
True if the contract implements the interface, false otherwise.
transferFrom
Transfers a token from one address to another.
In order to prevent mirrored assets from being traded on 3rd party markets, only direct transfer or Marketplace vault transfer cause call transferFrom.
Parameters
_from
address
The current owner of the token.
_to
address
The address to receive the token.
_tokenId
uint256
The ID of the token to transfer.
safeTransferFrom
Safely transfers a token from one address to another.
In order to prevent mirrored assets from being traded on 3rd party markets, only direct transfer or Marketplace vault transfer cause call safeTransferFrom.
Parameters
_from
address
The current owner of the token.
_to
address
The address to receive the token.
_tokenId
uint256
The ID of the token to transfer.
safeTransferFrom
Safely transfers a token from one address to another.
In order to prevent mirrored assets from being traded on 3rd party markets, only direct transfer or Marketplace vault transfer cause call safeTransferFrom.
Parameters
_from
address
The current owner of the token.
_to
address
The address to receive the token.
_tokenId
uint256
The ID of the token to transfer.
_data
bytes
Additional data with no specified format.
recall
Allows relayer to forceably transfer a token from one address to another.
This function can only be called by a relayer, and a reason must be provided. This function is used to recall tokens if the NFT's association with it's physical counterpart is lost, and a user proves they are in possessio of the physical good.
Parameters
_tokenId
uint256
The ID of the token to transfer.
_to
address
The address to receive the token.
_ipfsReason
string
The IPFS hash which leads to the reason for the recall.
_getPermitApproveHash
Internal function to get the expected EIP-712 signed hash to permit approving a token transfer
Parameters
_signature
struct Signature
The signature, deadline and signer from the owner of the token.
_to
address
The address to approve.
_tokenId
uint256
The ID of the token to approve.
_getPermitSetApprovalForAllHash
Internal function to get the expected EIP-712 signed hash to permit approving a token transfer
Parameters
_signature
struct Signature
The signature, deadline and signer from the owner of the tokens.
_operator
address
The address to approve.
_approve
bool
Whether to approve or revoke approval
_getPermitSafeTransferHash
Internal function to get the expected EIP-712 signed hash to permit transfering a token
Parameters
_signature
struct Signature
The signature, deadline and signer from the owner of the tokens.
_to
address
The address to transfer to.
_tokenId
uint256
The ID of the token to transfer.
Last updated