Various states that an exchange can take.
Types of possible exchanges on SmartLink
Record of all ongoing and past exchanges
Owner of the Escrow smart contract
Global slashing rate for the SmartLink escrow process
exchange_states stores the various states that an exchange can take. In other words, it describes all the conducted steps during an exchange from its initialization to its validation. There are 4 steps in total. It is set at the contract origination and cannot be changed afterward.
exchange_types stores the types of exchanges that are possible on Smartlink and their respective commission percentage. The owner of the contract can add a new exchange type or update the commission percentage of an existing one through the
updateExchangeType entry point.
exchanges stores all the ongoing and past exchanges id and their related
exchange_object containing the key information about the escrow and the exchange itself.
Each time a buyer locks funds in escrow after buying an item on the marketplace or accepting a peer-to-peer offer, a new exchange is created. It is updated each time the exchange changes its state. An exchange is considered as finished when it gets the state VALIDATED (2).
Tezos address of the buyer
Tezos address of the seller
Name of the exchanged item
Type of the exchange matching those stored in exchange_types map.
Current state of the exchange
Date of the last exchange update corresponding to the last state change.
Amount put in escrow by the seller. It is made of 4 values:
owner stores the Tezos address of the owner of the escrow contract. In the Demo, the owner of the contract is the address used to originate the contract. This state variable can be changed only by the current owner who can set a new address with the
setOwner entry point.
slashing_rate is set at the contract origination and cannot be changed afterward (in the demo version). It is a percentage of the asked price that is put into escrow by the seller to incentivize them to validate the exchange at the end: if everything goes right and they validate the exchange, they get back the slashing amount. The slashing rate is the same across the platform: it does not change whether the buyer is buying an item on the marketplace or accepting a peer-to-peer offer. It also does not differ with the exchange type.