@aaiello/hardhat v0.1.0
roll-smart-contracts
Smart contracts built for Roll
Instalation
npm install
VSCode
VSCode is not familiar with the solidity language, so solidity support
needs to be installed.
code --install-extension JuanBlanco.solidity
Having done that you should proceed to install prettier-vscode
.
code --install-extension esbenp.prettier-vscode
Test
Run test:
npx hardhat test
Run localhost
To run on localhost you should first start local node and then deploy to it
npx hardhat node
npx hardhat run scripts/deploy-dev.ts --network localhost
Run console
ex: get addr balance
npx hardhat console --network localhost
const value = await ethers.provider.getBalance("0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9")
value.toString()
Deploy
Deploy to any network is the same. After each deploy you can find the Json file with the Abi and address information. Be sure you set the right values on .env
npx hardhat run scripts/deploy-dev.ts --network ropsten
or
npx hardhat run scripts/deploy.ts --network mainnet
Verify on chain
Run this command with the address and the argument used when created
npx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1"
More info: https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html
npx hardhat verify --network mainnet 0xa7C098E26cbd9aAA515dF140d7020fB46a98be37 "Constructor argument 1" npx hardhat verify --network mainnet --constructor-args arguments.js 0xa7C098E26cbd9aAA515dF140d7020fB46a98be37
2 years ago