Source repo: https://github.com/calvbore/dittoV0
This is the smart contract development and testing repo for Ditto Protocol.
https://github.com/gakonst/foundry/
curl -L https://foundry.paradigm.xyz | bash
Open a new terminal to load the latest PATH
, and then run:
foundryup
Use the above command to update foundry as well.
After cloning, run the tests:
forge test
Buyer1
makes an initial bid on thier desired NFT, NFT1
.
NFT1
.NFT1
, Ditto1
, is minted and transferred to Buyer1
. Ditto1
gives its owner the claim on NFT1
if it's sold to the smart contract.Buyer1
paid for Ditto1
. It will decrease over time until it reaches some value slightly above the Buyer1
's bid price.Buyer2
makes a second bid for NFT1
Buyer1
's bid is refunded to Buyer1
, minus the fee paid.Buyer2
's bid. Half is sent to Buyer1
, and half is set aside for the sale of NFT1
.Ditto1
is transferred form Buyer1
to Buyer2
.Buyer2
's bid price. It will decrease over time again.Seller1
sells NFT1
Seller1
transfers NFT1
to the smart contract.Ditto1
is burned.NFT1
is transferred to Buyer2
.Buyer2
's bid is transferred to Seller1
, along with fees collected from previous bids.