NFT swap Contract Product Description & Technical requirements
Product description
Sometimes users don’t want to sell their NFT but are ready to exchange it for other NFT(s).
This is exactly what we want to achieve here.
Basically from a user standpoint, it’s pretty simple:
- you find NFT you want
- you make a swap offer to the owner of that NFT offering your NFT(s) in exchange
- safe swap is performed on-chain using a smart-contract if the owner accepts your offer
We believe that the first two steps should be done off-chain and only the swap phase is done on-chain using smart-contract.
Your goal is to develop that contract.
Technical description
Smart-contract should:
- accept transfers of NFT's from both sides
- swap NFTs between owners
- support multiply NFT’s in exchange for one
- support optional fix-size fees for marketplace
- swap message should be somehow idempotent so that one can retry if some of the NFT’s require a non-standard amount of TON’s for transfer
- have the ability to return your NFT(s) if the second side has not transferred their NFT
Marketplace fees
Since we want to support marketplace fees for swapping NFT’s contract developer should come up with some solution of who is paying those fees.
One of the solutions is to split fees between two sides (share percentage should be configurable at deployment).
Development requirements
- The contract should be covered with tests
- The solution should follow the style of Getgems contracts (http://github.com/getgems-io/nft-contracts). Including tests, code for interacting with the contract, and code for setting it up.