NFT Marketplace built on top of Ethereum to permit my fellow engineering students @INSAT publish and sell their art
This demo demonstrates how:
- User1 mints an NFT
- User1 pays the listing fee to have his NFT listed on the marketplace
- User1 can see his created NFTs
- User2 can see available NFTs
- User2 buys an NFTs and make sure ownership is transfered
- User1 and User2 can both see available NFTs and owned NFTs
- Web App : Next.js
- Solidity development : Hardhat
- File Storage : IPFS
- Ethereum Web Client Library : Ethers.js
- Deployment : Polygon
- install dependencies
npm install
- copy your private key to a
.secret
file : this is needed for when to deploy your smart contract on other network than localhost.
echo "<your_private_key>" > .secret
PS : obviously this not the best way to do this bcause your private key will be saved in the shell history, but we just test locally.
- run a local ethereum node with hardhat
npx hardat node
- run tests (will also compile smart contracts)
npx hardhat test
- create a new
config.js
file to hold the smart contracts addresses when you deploy
cp config.example.js config.js
- deploy to local node
npx hardhat run scripts/deploy.js --network localhost
- run the next js server
npm run dev
- When creating the first transaction on the blockchain
Nonce too high. Expected nonce to be 0 but got 2. Note that transactions can't be queued when automining.
solution: this happens because of old history saved in the accocunt from previous tests => open advanced options in Metamask and reset the account.