generated from adriandelgg/create-ether-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
marketplace.txt
40 lines (36 loc) · 2.07 KB
/
marketplace.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
MARKETPLACE - Market.sol
The NFTs in this marketplace are only going to be from the contract I made.
Price will be in ERC20 rather than Ether
Create feature to allow new NFT contract to work with this marketplace.
Can ONLY pay with the ERC20 token from the staking contract!
Use Dummy ERC20 Token with 9 Decimals.
Use Staking contract with the Array as reference.
Deployment
- X admin/owner set to deployer
- X set fee collector (address to send fees to)
- ! set fee in percent (5% for example) (Ex. 5% of the sale will go to the dev)
- I recommend to keep the percent in whole numbers.
- Ex: 5% = 5, don't do .9%
- Did you want the fee to always be the same thing? For example be 5% & never change it again?
- Doing so saves gas & adds confidence that you won't later change the fee to something a lot higher
in the future while a user has their NFT for sale.
- X Create function to change the fee dev address in the future only by the owner.
- X set ERC20 token (9 decimals)
- ! Create array that stores the NFT contract addresses that are allowed to trade with the contract
- The array is not necessarily needed and could be added to a backend to reduce gas cost.
Updatable
- X whitelisted NFT addresses (allow many) (entire array so they can be removed)
- X collector
- X admin/owner
- X fee in percent (update the fee amount)
- X ERC20 token
Marketplace
- X allow user to list NFT by contract address and token ID for amount in ERC20 (putting NFT up for sale)
- X safeTransferFrom NFT to/from Market contract (amount = 1, data = empty array) (putting NFT up for sale)
- ! call function that shows all NFTs for sell (NFT contract address, ID, seller, price)
- Store this in a Database by catching the events
- Can be checked by calling tokensForSale
- X allow seller to cancel listing and get their NFT back
- X allow a user to buy an NFT for the listed price (do not let person that put up for sale buy it)
- X transfer the NFT to buyer, fee to collector, and cost minus fee to seller
- X call function to show recent NFTs sold and for how much (contract, ID, buyer, price) EVENT (last 10 or 20 maybe)