Repository files navigation
Install Nodejs link
Install Ganache link
$ truffle migrate --network development
$ truffle console
Create NFT
$ const nft = await NFT.deployed();
$ await nft.mint({from: accounts[<owner of nft>]})
List Token to Market
$ const market = await Market.deployed();
$ await market.listToken(nft.address, <token Id>, {from: accounts[<owner of nft>]})
Error 'ERC721: transfer caller is not owner nor approved'
Approve to Market and repair list Token
Approve to Market
$ await nft.approve(market.address, <token Id>, {from: accounts[<owner of nft>]})
Repair list Token
$ await market.listToken(nft.address, <token Id>, {from: accounts[<owner of nft>]})
Check NFT in Market
$ market.getListing(<token Id in market>)
Buy NFT in Market
if NFT.status == Active
$ market.buyToken(<token Id>, {from: accounts[<account buy nft>], value: <price of nft>})
Cancel NFT in Market
if NFT.status == Active
$ market.cancel(<token Id in market>, {from: accounts[<account list nft to market>]})
You can’t perform that action at this time.