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
  • listings
  • constructor
  • list
  • Parameters
  • permitList
  • Parameters
  • delist
  • Parameters
  • permitDelist
  • Parameters
  • buy
  • Parameters
  • permitBuy
  • Parameters
  • permitOffChainPaymentBuy
  • Parameters
  • handleSaleClosed
  • Parameters
  • supportsInterface
  • Parameters
  • Return Values
  • _list
  • Parameters
  • _delist
  • Parameters
  • _buy
  • Parameters
  • getListedPrice
  • Parameters
  • Return Values
  • _getPermitListHash
  • Parameters
  • Return Values
  • _getPermitDelistHash
  • Parameters
  • Return Values
  • _getPermitBuyHash
  • Parameters
  • Return Values
  • _getPermitOffChainPaymentBuyHash
  • Parameters
  • Return Values
  1. marketplace
  2. markets

ListingMarketUpgradeable

Contract that handles the listing and buying process of tokens on a marketplace.

Inherits from BaseMarketUpgradeable. It introduces functions to list, delist and buy tokens, as well as their permit alternatives that use EIP-712 signatures.

listings

mapping(address => mapping(uint256 => mapping(address => uint256))) listings

Nested mapping from a collection address to token ID to ERC20 address to a price. It tracks the prices of listed tokens. First address represents the collection, second the token id and the third is the address of the ERC20 token used as currency.

constructor

constructor() public

The constructor initializes the base contract.

list

function list(address _collection, uint256 _tokenId, address _erc20, uint256 _price) public virtual

Allows the caller to list a token for sale.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be listed for sale.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

_price

uint256

The price for which the token is listed.

permitList

function permitList(address _collection, uint256 _tokenId, address _erc20, uint256 _price, struct Signature _signature) public virtual

Allows a trusted contract to list a token for sale on behalf of a seller.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be listed for sale.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

_price

uint256

The price for which the token is listed.

_signature

struct Signature

The seller's signature, deadline and address

delist

function delist(address _collection, uint256 _tokenId, address _erc20) public virtual

Allows the caller to delist a token.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be delisted.

_erc20

address

The address of the ERC20 token that was to be used as the payment currency.

permitDelist

function permitDelist(address _collection, uint256 _tokenId, address _erc20, struct Signature _signature) public virtual

Allows a trusted contract to delist a token on behalf of a seller.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract from which the token is to be delisted.

_tokenId

uint256

The ID of the token to be delisted.

_erc20

address

The address of the ERC20 token that was to be used as the payment currency.

_signature

struct Signature

The seller's signature, deadline and address

buy

function buy(address _collection, uint256 _tokenId, address _erc20) public virtual

Allows the caller to buy a token.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be bought.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

permitBuy

function permitBuy(address _collection, uint256 _tokenId, address _erc20, struct Signature _signature) public virtual

Allows a trusted contract to buy a token on behalf of a buyer.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract from which the token is to be bought.

_tokenId

uint256

The ID of the token to be bought.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

_signature

struct Signature

The buyer's signature, deadline and address

permitOffChainPaymentBuy

function permitOffChainPaymentBuy(address _collection, uint256 _tokenId, address _erc20, struct Signature _signature) public virtual

Allows a trusted contract to buy a token on behalf of a buyer using off-chain payment.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract from which the token is to be bought.

_tokenId

uint256

The ID of the token to be bought.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

_signature

struct Signature

The buyer's signature, deadline and address

handleSaleClosed

function handleSaleClosed(uint256 _saleId) external virtual

Handles when a token is no longer available

Notifies that a particular sale for a ERC721 has closed (i.e. successfully sold, fault/not as described, or lost/damaged in shipment)

Parameters

Name
Type
Description

_saleId

uint256

The id of the sale that has closed.

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.

_list

function _list(address _seller, address _collection, uint256 _tokenId, address _erc20, uint256 _price) internal virtual

Private function that lists a token for sale.

Parameters

Name
Type
Description

_seller

address

The address of the seller.

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be listed for sale.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

_price

uint256

The price for which the token is listed.

_delist

function _delist(address _seller, address _collection, uint256 _tokenId, address _erc20) internal virtual

Private function that delists a token.

Parameters

Name
Type
Description

_seller

address

The address of the seller.

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be delisted.

_erc20

address

The address of the ERC20 token that was to be used as the payment currency.

_buy

function _buy(address _spender, address _buyer, address _collection, uint256 _tokenId, address _erc20) internal virtual

Private function that manages the buying of a token.

Parameters

Name
Type
Description

_spender

address

The address of the spender (who actually sends the payment).

_buyer

address

The address of the buyer (who will become the new owner).

_collection

address

The address of the collection contract from which the token is to be bought.

_tokenId

uint256

The ID of the token to be bought.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

getListedPrice

function getListedPrice(address _collection, uint256 _tokenId, address _erc20) public view virtual returns (uint256)

Gets the listed price of a token.

Parameters

Name
Type
Description

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token whose price to return.

_erc20

address

The address of the ERC20 token used as the payment currency.

Return Values

Name
Type
Description

[0]

uint256

Returns the price at which the token is listed.

_getPermitListHash

function _getPermitListHash(struct Signature _signature, address _collection, uint256 _tokenId, address _erc20, uint256 _price) internal view virtual returns (bytes32)

Computes the EIP-712 hash that should be signed by the seller to allow listing a token.

Parameters

Name
Type
Description

_signature

struct Signature

The sellers signature, address and deadline

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be listed for sale.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

_price

uint256

The price for which the token is listed.

Return Values

Name
Type
Description

[0]

bytes32

Returns the EIP-712 hash.

_getPermitDelistHash

function _getPermitDelistHash(struct Signature _signature, address _collection, uint256 _tokenId, address _erc20) internal view virtual returns (bytes32)

Computes the EIP-712 hash that should be signed by the seller to delist a token.

Parameters

Name
Type
Description

_signature

struct Signature

The sellers' signature, address and deadline

_collection

address

The address of the collection contract to which the token belongs.

_tokenId

uint256

The ID of the token to be delisted.

_erc20

address

The address of the ERC20 token that was to be used as the payment currency.

Return Values

Name
Type
Description

[0]

bytes32

Returns the EIP-712 hash.

_getPermitBuyHash

function _getPermitBuyHash(struct Signature _signature, address _collection, uint256 _tokenId, address _erc20) internal view virtual returns (bytes32)

Computes the EIP-712 hash that should be signed by the buyer to buy a token.

Parameters

Name
Type
Description

_signature

struct Signature

The address of the buyer and the deadline

_collection

address

The address of the collection contract from which the token is to be bought.

_tokenId

uint256

The ID of the token to be bought.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

Return Values

Name
Type
Description

[0]

bytes32

Returns the EIP-712 hash.

_getPermitOffChainPaymentBuyHash

function _getPermitOffChainPaymentBuyHash(struct Signature _signature, address _collection, uint256 _tokenId, address _erc20) internal view virtual returns (bytes32)

Computes the EIP-712 hash that should be signed by the buyer for off-chain payment to buy a token.

Parameters

Name
Type
Description

_signature

struct Signature

The address of the buyer and the deadline

_collection

address

The address of the collection contract from which the token is to be bought.

_tokenId

uint256

The ID of the token to be bought.

_erc20

address

The address of the ERC20 token to be used as the payment currency.

Return Values

Name
Type
Description

[0]

bytes32

Returns the EIP-712 hash.

PreviousIOfferMarketNextMarketRegistry

Last updated 1 year ago