We need to install openzeppelin library to our file:
$npminstall@openzeppelin/contracts
Try to compile the contract with:
$npxhardhatcompile
Step 3
We should prepare our hardhat.config.js file as:
require("@nomiclabs/hardhat-etherscan");require("@nomiclabs/hardhat-waffle");constPRIVATE_KEY="PRIVATEKEY";module.exports= { solidity:"0.8.2", defaultNetwork:"fuji", networks: { mainnet: { url:`https://api.avax.network/ext/bc/C/rpc`, accounts: [PRIVATE_KEY] }, fuji: { url:`https://api.avax-test.network/ext/bc/C/rpc`, accounts: [PRIVATE_KEY] } }, etherscan: { apiKey: { fuji:"avascan"// apiKey is not required, just set a placeholder }, customChains: [ { network:"fuji", chainId:43113, urls: { apiURL:"https://api.avascan.info/v2/network/testnet/evm/43113/etherscan", browserURL:"https://testnet.avascan.info/blockchain/c" } } ] },};
Step 4
Now letโs add the deploy script. To keep it simple weโll simply reuse the deploy script from the Hardhat tutorial, so letโs create the file scripts/deploy.js: