blockchain-audit / labs

Our creative space
Other
1 stars 41 forks source link

T10-SOL NFT Swap Contract project #37

Open henry-hz opened 8 months ago

henry-hz commented 8 months ago

NFT Swap Contract

Two people want to trade their NFTs in a trustless way. A user creates a swap on the contract, which is a pair of address, ids where the address is the smart contract address of the NFT and the id is the tokenId of the NFT. One person can deposit an NFT only if the id matches the address and id. The counterparty can deposit only if their NFT matches the address and id of the swap.

Once both are deposited, either party can call swap.

Some corner cases to think about:

how long, if at all, should the traders be forced to keep their NFT in the contract?