Last active
April 25, 2020 13:42
-
-
Save snaketh4x0r/78e673a3c865ac5240aad49d4751d8dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.First deploy NFT test contract | |
2.then mint test NFT token ->Token id keeps incrementing on succesful mint function call | |
3.then deploy NFT marketplace contract with mock ERC20 token address,NFT contract address created in previous step,currentprice | |
note:currentprice is in wei ,use https://eth-converter.com/ for appropriate calculations | |
4.then first call approve function of NFT contract with to as NFTmarketplace contract address and token id which you have previously minted | |
5.then call depositToken of NFT marketplace with token id which you have minted | |
6.now your NFT token is transferred to contract | |
7.call purchaseETH or purchaseMana with right arguments | |
Note:looks like metamask can't estimate Ether amount in purchaseETH function,so call getCurrentprice to get price and send appropriate amount of ether = current price | |
8.call approve function of mana token with NFTmarkerplace address and amount=current price as arguments | |
8.call purchaseMana with appropriate tokenid and amount of ERC20 Mana tokens previously approved | |
use my ether wallet for testing if developing from web | |
truffle console if developing from cli | |
or have amount: argument specified in frontend code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment