Skip to main content

Objects

Kalao Exchange smart contract Solidity essential structures

Sale

struct Sale {
// sale parameters
address seller; // address of the seller
address token_address; // address of the token sold
uint256 token_id; // token id
uint256 in_sale_amount; // amount sold (more than 1 for erc1155 for example)
uint256 unitary_price; // price in wei
uint256 expiration_ts; // expiration date of the sale
uint256 starting_ts; // starting of the sale
uint256 nonce; // sale nonce randomly generated by backend database
uint256 chain_id; // chain id parameter
uint256 min_unitary_price; // minimum unitary_price
bool managed;
// end sale parameters

// security parameters
bytes seller_signature; // creator's signature of the sale parameters
// backend security parameters + marketplace parameters
address buyer; // buyer authorized by backend to buy (can be used for private sale)
address nft_recipient; // recipient authorized by backend
uint256 amount_bought; // amountBought by buyer
uint256 sale_id; // saleId generated by kalao Backend
uint256 kalao_fees; // feesRate generated by kalao Backend will be divided by 10000
uint256 community_fees; // fees for kalao community (all sales on the marketplace)
uint256 extern_fees; // fees for other marktplaces
address extern_recipient; // address for other marketplace fees
uint256 validator_signature_expiration_ts; // expiration of the current validatorSignature
bool activate_royalties; // activateRoyalties on the transfer
bytes validator_signature; // backend's signature of sale parameters | buyer | expirationValidatorTs
}

Sale Cancellation

struct SaleCancellation {
// sale parameters
address seller; // address of the seller
address token_address; // address of the token sold
uint256 token_id; // token id
uint256 in_sale_amount; // amount sold (more than 1 for erc1155 for example)
uint256 unitary_price; // price in wei
uint256 expiration_ts; // expiration date of the sale
uint256 starting_ts; // starting of the sale
uint256 nonce; // sale nonce randomly generated by backend database
uint256 chain_id; // chain id
uint256 min_unitary_price;
bool managed;
// end sale parameters

// security parameters
bytes seller_signature; // creator's signature of the sale parameters
bytes validator_signature; // backend's signature of sale parameters | buyer | expirationValidatorTs
uint256 sale_id; // saleId generated by kalao Backend
}

Offer

struct Offer {
// sale parameters
address buyer; // address of the buyer
address token_address; // address of the token bought
bytes32 merkle_root; // merkle root of accepted token ids
address payment_token; // address of the ERC20 used as payment
uint256 amount_to_buy; // total amount bought(more than 1 for erc1155 for example)
uint256 unitary_price; // price in wei for one NFT
uint256 expiration_ts; // expiration date of the offer
uint256 starting_ts; // starting of the offer
uint256 nonce; // sale nonce randomly generated by backend database
uint256 chain_id; // chain id parameter
// end sale parameters

// security parameters
bytes buyer_signature; // creator's signature of the offer
// backend security parameters + marketplace parameters
address seller; // seller authorized by backend to sell (can be used for private offers)
uint256 token_id; // token Id exchanged
uint256 amount_sold; // amount Sold by seller
uint256 offer_id; // offer id generated by kalao Backend
uint256 fees_kalao; // feesRate generated by kalao Backend will be divided by 10000
uint256 fees_community; // fees for kalao community (all sales on the marketplace)
uint256 fees_extern; // fees for other marktplaces
address extern_recipient; // address for other marketplace fees
uint256 validator_signature_expiration_ts; // expiration of the current validatorSignature
bool activate_royalties; // activateRoyalties on the transfer
bytes validator_signature; // backend's signature of offer | buyer | expirationValidatorTs
bytes32[] merkle_proof; // merkle proof for this token id
}

Offer Cancellation

struct OfferCancellation {
// sale parameters
address buyer; // address of the buyer
address token_address; // address of the token bought
bytes32 merkle_root; // merkle root of accepted token ids
address payment_token; // address of the ERC20 used as payment
uint256 amount_to_buy; // total amount bought(more than 1 for erc1155 for example)
uint256 unitary_price; // price in wei for one NFT
uint256 expiration_ts; // expiration date of the offer
uint256 starting_ts; // starting of the offer
uint256 nonce; // sale nonce randomly generated by backend database
uint256 chain_id; // chain id parameter
// end sale parameters

// security parameters
bytes buyer_signature; // creator's signature of the offer
bytes validator_signature; // backend's signature of sale parameters | buyer | offer_id
uint256 offer_id; // offer generated by kalao Backend
}