These are the goals we had in mind when designing the protocol:
Make it as accessible as possible to sellers by not requiring them to perform blockchain transactions when listing their NFTs for sale, hence saving on gas fees.
Temporarily suspend the smart contract in the event of an emergency.
Behind the scenes, tradeForCoins
and tradeForTokens
functions are actually calling canPerformTrade
and determine whether or not the user is allowed to perform a trade with the specified parameters, but the reason for why canPerformTrade
is exposed publicly is to allow the user to check if the trade is possible without actually performing it. This avoids having to pay gas fees if the transaction fails due to unmet conditions.
canPerformTrade
is executed to check if the user is allowed to perform a trade using the specified parameters.
This function validates the following conditions:
The smart contract is not paused;
The collection
smart contract is a valid ERC-721 smart contract;
The owner approved this smart contract to transfer the NFT identified by tokenId
on their behalf;
The royalty fee for the creator and marketplaceFee
do not exceed 100%;
The ECDSA signature
that encodes all these parameters and a few others has been signed by an authorized user.
tradeForCoins
is used to perform a trade using coins (the native cryptocurrency of the platform, i.e.: ETH).This function performs the following actions:
Guards against reentrancy;
Executes canPerformTrade
to validate the parameters;
Sends the proceeds to each party involved if the amount is greater than zero:
Owner: The owner of the NFT;
Investor:
The investor who minted the NFT on behalf of the creator.
Note: The investor is payed from the proceeds of the creator.
Creator: The creator of the NFT if the royalty fee is greater than 0% and the creator is no longer the owner.
Marketplace: The Autentica Marketplace.
Transfers the NFT to the buyer.
Emits the TradedForCoins
event.
tradeForTokens
is used to perform a trade using tokens (i.e. : AUT/USDT/USDC).This function performs the following actions:
Guards against reentrancy;
Validates that the ERC-20 token
address is allowed to be used for trading;
Executes canPerformTrade
to validate the parameters;
Sends the proceeds to each party involved if the amount is greater than zero:
Owner: The owner of the NFT;
Investor:
The investor who minted the NFT on behalf of the creator.
Note: The investor is payed from the proceeds of the creator.
Creator: The creator of the NFT if the royalty fee is greater than 0% and the creator is no longer the owner.
Marketplace: The Autentica Marketplace.
Transfers the NFT to the buyer.
Emits the TradedForTokens
event.
TradedForCoins
is emitted when a trade is performed using coins (the native cryptocurrency of the platform, i.e. : ETH).TradedForTokens
is emitted when a trade is performed using tokens (i.e. : AUT/USDT/USDC).Ethereum
Binance Smart Chain
Ethereum (Rinkeby)
Binance Smart Chain (testnet)
is a decentralized NFT exchange that allows users to buy any compatible NFTs with coins and tokens.
Pay royalties by implementing the standard as well as our own solution detailed in the interface.
The smart contract's main public functions are canPerformTrade
, tradeForCoins
and tradeForTokens
. All of these functions are meant to be called by the Buyer via . The first function called canPerformTrade
is used to check if the user is allowed to perform a trade using the specified parameters, while the remaining two functions, tradeForCoins
and tradeForTokens
are used to perform an actual trade using coins (the native cryptocurrency of the platform, i.e.: ETH) or tokens (i.e.: AUT/USDT/USDC).
The source code for the smart contract can be found in the file located in the contracts
folder within our repository.