This project represents deploying of NFT (ERC721) contract & NFT Marketplace for trading NFT tokens. You can also compare this project with Truffle/Web3 version of it that published earlier in here. This would be useful for learning both pack of tools.
git clone --recursive https://github.com/0xhamedETH/hardhat-ethers-nextjs-nft-marketplace.git your-directory
cd your-directory/ethereum
npm install
compile first to create json artifacts in artifacts
folder
npx hardhat compile
- Run
ganache-cli
in separate terminal
ganache-cli
- Run
npx hardhat test
in main terminal
npx hardhat test test/nft.test.js
For this step you first need to fill .env
file with your api keys (Alchemy
, ...)
You can deploy both contracts in any network you want (make sure hardhat.config.js
contains that network)
Note: You can change buildPath
of output json file containing abi, bytecode, ... .
Note: You first need to deploy NFTMarketplace contract and pass its contract address as an argument to NFT contract.
npx hardhat run scripts/NFTMarketplace.js --network maticMumbai
npx hardhat run scripts/NFT.js --network maticMumbai
After a while, you would see contract address in console.