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-directorycd your-directory/ethereum
npm installcompile first to create json artifacts in artifacts folder
npx hardhat compile- Run
ganache-cliin separate terminal
ganache-cli- Run
npx hardhat testin main terminal
npx hardhat test test/nft.test.jsFor 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 maticMumbaiAfter a while, you would see contract address in console.