ditto
ditto copied to clipboard
NFT Future protocol
ditto
Source repo: https://github.com/calvbore/dittoV0
This is the smart contract development and testing repo for Ditto Protocol.
Set up foundry
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.
Set up this repo
After cloning, run the tests:
forge test
Simplified Lifecycle of a Ditto
Buyer1makes an initial bid on thier desired NFT,NFT1.
- Funds are transferred to the smart contract, a small fee taken and set asside to whomever will eventually sell
NFT1. - A derivative of
NFT1,Ditto1, is minted and transferred toBuyer1.Ditto1gives its owner the claim onNFT1if it's sold to the smart contract. - The minimum bid is set to some multiple of the price
Buyer1paid forDitto1. It will decrease over time until it reaches some value slightly above theBuyer1's bid price.
Buyer2makes a second bid forNFT1
- the bid satisfies the minimum bid defined in the smart contract.
Buyer1's bid is refunded toBuyer1, minus the fee paid. - A fee is taken from
Buyer2's bid. Half is sent toBuyer1, and half is set aside for the sale ofNFT1. Ditto1is transferred formBuyer1toBuyer2.- The minimum bid is set to some multiple of
Buyer2's bid price. It will decrease over time again.
Seller1sellsNFT1
Seller1transfersNFT1to the smart contract.Ditto1is burned.NFT1is transferred toBuyer2.Buyer2's bid is transferred toSeller1, along with fees collected from previous bids.