Colle Marketplace
Colle.ioWebApp (Live)WebApp (Test)
  • Contracts Overview
  • Functional Requirements
  • Contract Descriptions
  • Technical Project & Audit Details
  • Test Coverage Report
  • Static Analysis
  • Royalty Pool Explained
  • Sale State Explained
  • Sales Tax Explained
  • marketplace
    • IMarketHub
    • IMarketHubRegistrar
    • MarketHub
    • MarketHubRegistrar
    • MarketHubRegistrarUpgradeable
    • collections
      • ColleCollection
      • ColleCollectionUpgradeable
      • CollectionRegistry
      • IColleCollection
      • IColleCollectionUpgradeable
      • ICollectionRegistry
    • currencies
      • BaseCurrency
      • CurrencyRegistry
      • ICurrency
      • ICurrencyRegistry
      • USDCCurrency
    • escrow
      • EscrowUpgradeable
      • IEscrow
      • IEscrowRegistry
    • kycs
      • Account
      • IKYCRegistry
      • KYCRegistry
    • markets
      • BaseMarketUpgradeable
      • IListingMarket
      • IMarket
      • IMarketRegistry
      • IOfferMarket
      • ListingMarketUpgradeable
      • MarketRegistry
      • OfferMarketUpgradeable
    • royalties
      • BaseRoyalty
      • BlackTierRoyalty
      • GoldTierRoyalty
      • GreenTierRoyalty
      • IRoyalty
      • IRoyaltyPool
      • IRoyaltyRegistry
      • PlatinumTierRoyalty
      • RoyaltyPool
      • RoyaltyRegistry
      • v1
        • BlackTierRoyaltyV1
        • GoldTierRoyaltyV1
        • GreenTierRoyaltyV1
        • PlatinumTierRoyaltyV1
    • taxes
      • ITaxPolicyRegistry
      • Tax
      • TaxPolicyRegistry
    • upgrade-gatekeeper
      • IUpgradeGatekeeper
      • UpgradeGatekeeper
    • vaults
      • IVault
      • IVaultRegistry
      • VaultUpgradeable
  • team-smart-wallet
    • ITeamSmartWallet
    • ITeamSmartWalletHelper
    • TeamSmartWallet
    • TeamSmartWalletFactory
    • TeamSmartWalletPermitHelper
  • utils
    • MarketAccess
    • MarketAccessUpgradeable
    • Signature
    • SignatureValidator
Powered by GitBook
On this page
  • nextTokenId
  • tokenSaleMetadataIPFS
  • constructor
  • initialize
  • Parameters
  • _authorizeUpgrade
  • Parameters
  • onlyOwnerApprovedEOAOrVault
  • Parameters
  • mint
  • Parameters
  • updateSaleMetadata
  • Parameters
  • updateTokenURI
  • Parameters
  • getSaleMetadata
  • Parameters
  • Return Values
  • isSaleMetadataSet
  • Parameters
  • Return Values
  • permitApprove
  • Parameters
  • permitSetApprovalForAll
  • Parameters
  • permitSafeTransfer
  • Parameters
  • getNextTokenId
  • Return Values
  • supportsInterface
  • Parameters
  • Return Values
  • transferFrom
  • Parameters
  • safeTransferFrom
  • Parameters
  • safeTransferFrom
  • Parameters
  • recall
  • Parameters
  • _getPermitApproveHash
  • Parameters
  • _getPermitSetApprovalForAllHash
  • Parameters
  • _getPermitSafeTransferHash
  • Parameters
  1. marketplace
  2. collections

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

uint256 nextTokenId

tokenSaleMetadataIPFS

mapping(uint256 => string) tokenSaleMetadataIPFS

constructor

constructor() public

The constructor initializes the base contract.

initialize

function initialize(string _name, string _symbol) public virtual

Initializes the contract.

Parameters

Name
Type
Description

_name

string

The name of the token.

_symbol

string

The symbol of the token.

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

Authorizes a contract upgrade.

Throws if the new implementation is not the target implementation.

Parameters

Name
Type
Description

newImplementation

address

The address of the new contract implementation.

onlyOwnerApprovedEOAOrVault

modifier onlyOwnerApprovedEOAOrVault(uint256 _tokenId)

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

Name
Type
Description

_tokenId

uint256

The token id to guard against.

mint

function mint(string _uri, address _receiver) public

Mints a new token.

This function can only be called by a Colle.

Parameters

Name
Type
Description

_uri

string

The token URI.

_receiver

address

The address that will receive the minted token.

updateSaleMetadata

function updateSaleMetadata(uint256 _tokenId, string _ipfsHash) public

Updates the sale metadata for a token.

This function can only be called by a Colle or the owner of the token.

Parameters

Name
Type
Description

_tokenId

uint256

The ID of the token to update.

_ipfsHash

string

The new IPFS hash for the token metadata.

updateTokenURI

function updateTokenURI(uint256 _tokenId, string _uri) public

Updates the token metadata URI

This function can only be called by a Colle.

Parameters

Name
Type
Description

_tokenId

uint256

The ID of the token to update.

_uri

string

The new URI for the token metadata.

getSaleMetadata

function getSaleMetadata(uint256 _tokenId) public view returns (string)

Returns the sale metadata for a token.

Parameters

Name
Type
Description

_tokenId

uint256

The ID of the token to query.

Return Values

Name
Type
Description

[0]

string

The IPFS hash of the sale metadata.

isSaleMetadataSet

function isSaleMetadataSet(uint256 _tokenId) public view returns (bool)

Checks if sale metadata is set for a token.

Parameters

Name
Type
Description

_tokenId

uint256

The ID of the token to check.

Return Values

Name
Type
Description

[0]

bool

True if the token has sale metadata set, false otherwise.

permitApprove

function permitApprove(address _to, uint256 _tokenId, struct Signature _signature) public

Approves an address to transfer a specific token.

Parameters

Name
Type
Description

_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

function permitSetApprovalForAll(address _operator, bool _approve, struct Signature _signature) public

Approves an address to transfer any tokens owned by the sender.

Parameters

Name
Type
Description

_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

function permitSafeTransfer(address _to, uint256 _tokenId, struct Signature _signature) public

Transfers a token from one address to another, verifying the validity of a signature.

Parameters

Name
Type
Description

_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

function getNextTokenId() public view returns (uint256)

Returns the ID of the next token that will be minted.

Return Values

Name
Type
Description

[0]

uint256

The ID of the next token.

supportsInterface

function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool)

Checks if the contract implements an interface.

Parameters

Name
Type
Description

_interfaceId

bytes4

The ID of the interface.

Return Values

Name
Type
Description

[0]

bool

True if the contract implements the interface, false otherwise.

transferFrom

function transferFrom(address _from, address _to, uint256 _tokenId) public virtual

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

Name
Type
Description

_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

function safeTransferFrom(address _from, address _to, uint256 _tokenId) public virtual

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

Name
Type
Description

_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

function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes _data) public virtual

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

Name
Type
Description

_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

function recall(uint256 _tokenId, address _to, string _ipfsReason) public virtual

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

Name
Type
Description

_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

function _getPermitApproveHash(struct Signature _signature, address _to, uint256 _tokenId) internal view virtual returns (bytes32)

Internal function to get the expected EIP-712 signed hash to permit approving a token transfer

Parameters

Name
Type
Description

_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

function _getPermitSetApprovalForAllHash(struct Signature _signature, address _operator, bool _approve) internal view virtual returns (bytes32)

Internal function to get the expected EIP-712 signed hash to permit approving a token transfer

Parameters

Name
Type
Description

_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

function _getPermitSafeTransferHash(struct Signature _signature, address _to, uint256 _tokenId) internal view virtual returns (bytes32)

Internal function to get the expected EIP-712 signed hash to permit transfering a token

Parameters

Name
Type
Description

_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.

PreviousColleCollectionNextCollectionRegistry

Last updated 1 year ago