IEscrow

This interface outlines the functions necessary for an escrow system in a marketplace trading ERC721 and ERC20 tokens.

Any contract implementing this interface can act as an escrow in the marketplace.

CreateSale

event CreateSale(uint256 saleId, enum IEscrow.State state, address buyer, address spender, address erc20, uint256 price, bytes32 tier, address seller, address erc721, uint256 tokenId, string metadata)

Emitted when a sale is created.

UpdateSale

event UpdateSale(uint256 saleId, enum IEscrow.State newState)

Emitted when a sale's state is updated.

SaleTaxesUpdated

event SaleTaxesUpdated(uint256 saleId, uint256 amount, uint256 countryCode, uint256 regionCode)

Emitted when a sale's tax is updated.

updateSaleTaxesToCollect

function updateSaleTaxesToCollect(uint256 _saleId, struct Tax _taxes) external

Updates the sales tax for a pre-pending sale.

Parameters

Name
Type
Description

_saleId

uint256

The id of the sale.

_taxes

struct Tax

The new taxes to collect in ERC20 tokens.

RoyaltyPayout

Emitted when a royalty is paid out.

CommissionPayout

Emitted when a commission is paid out.

TaxCollected

Emitted when a sale is completed and any on-chain tax are collected/to be remitted.

SaleComplete

Emitted when a sale is complete.

SaleCancelled

Emitted when a sale is cancelled.

BuyerChallengeWindowChanged

Emitted when the challenge window for buyers is changed.

SaleFundingWindowChanged

Emitted when the funding window for a sale is changed.

State

Sale

setBuyerChallengeWindow

Sets the time window during which buyers can challenge a sale.

Parameters

Name
Type
Description

_hours

uint256

The new challenge window in hours.

buyerChallengeWindow

Returns the current challenge window for buyers.

Return Values

Name
Type
Description

[0]

uint256

uint256 The challenge window in hours.

setSaleFundingWindow

Sets the time window during which a sale can be funded. Can only be called by the colle.

Parameters

Name
Type
Description

_hours

uint256

The new funding window in hours.

saleFundingWindow

Returns the current funding window for buyers.

Return Values

Name
Type
Description

[0]

uint256

uint256 The funding window in hours.

createSale

Creates a new sale.

Parameters

Name
Type
Description

_buyer

address

The buyer's address.

_spender

address

The address spending the ERC20 tokens.

_erc20

address

The address of the ERC20 token being used as currency.

_price

uint256

The price in ERC20 tokens.

_seller

address

The seller's address.

_erc721

address

The address of the ERC721 token being sold.

_tokenId

uint256

The id of the ERC721 token being sold.

getSale

Returns details of a sale.

Parameters

Name
Type
Description

_saleId

uint256

The id of the sale.

Return Values

Name
Type
Description

[0]

struct IEscrow.Sale

Sale The details of the sale.

hasActiveSale

Checks if a particular ERC721 token is currently part of an active sale.

Parameters

Name
Type
Description

_erc721

address

The address of the ERC721 token.

_tokenId

uint256

The id of the ERC721 token.

Return Values

Name
Type
Description

[0]

bool

bool Whether the token is part of an active sale or not.

updateSale

Updates the state of a sale.

Parameters

Name
Type
Description

_saleId

uint256

The id of the sale.

_newState

enum IEscrow.State

The new state of the sale.

permitUpdateSale

Allows a signer to permit the update of a sale's state.

Parameters

Name
Type
Description

_saleId

uint256

The id of the sale.

_newState

enum IEscrow.State

The new state of the sale.

_signature

struct Signature

The signer's signature, deadline and signer address.

Last updated