This project shows how to create NFTs with on chain metadata for use in an onChain gaming dApp.
- Metamask Private Key, Alchemy free account, Polygon Scan Mumbai Api Key.
- Web3 compatible browser (Brave suggested)
- Metamask
- Polygon Network Mumbai Testnet Matic Token
- Hardhat
npm install hardhat --save-dev)
- Packages: OpenZeppelin contracts, hardhat-etherscan, dotenv
npm install @openzeppelin/contracts @nomiclabs/hardhat-etherscan dotenv
- Be sure to populate .env in root project directory with TESTNET_URL, POLYGONSCAN_API_KEY, and PRIVATE_KEY
- Compile code from repository directory
npx hardhat compile
- Deploy code to Polygon Mumbai and save contract address returned
npx hardhat run scripts/deploy.js --network mumbai
- Verify contract code on Polygon Scan Mumbai, returns URL https://mumbai.polygonscan.com/address/0xb3142AD7D5D53E155d37eA87409a4A6aA215D6Bb#code (My contract code)
npx hardhat --verify <CONTACT ADDRESS FROM #8> --network mumbai
- Interact with contract in Polygon Scan, Mint.
- Verify on OpenSea
- Level up by executing train on Polygon Scan with '1' as the value (We only minted one NFT)
- Verify on OpenSea
Struct Reference Pseudo Random Functions - Danger - Deterministic