This repo teaches you a basic use of hardhat
for smart contracts development. We are going to create a simple implementation of ERC20
standard, test it and deploy to testnet.
This project was bootstrapped using npx hardhat init
CLI tool. Please refer to this page for more information.
git clone https://github.com/ironsoul0/n17r-web3-day1
cd n17r-web3-day1
yarn
All scripts that you can use are defined in package.json
under scripts
. Let's go through each of them.
- Run local
hardhat
chain for deploying smart contracts.
yarn chain
- Deploy smart contracts to local chain. This requires you to have an active instance of local chain running. Refer to
scripts/deploy.js
file for implementation.
yarn deploy
- Run tests. No need for local chain running. Refer to
test/erc20.js
for implementation details.
yarn test
- You can also deploy to Ethereum Rinkeby testnet by running the following command (advanced):
yarn deploy --network rinkeby
This will require you to create .env
file inside your root folder with the following environment variables: RINKEBY_URL
pointing to your Infura node, PRIVATE_KEY
of your account.
Please refer to these links for further understanding of Smart Contracts development.