This project implements the base Hoff Coin ERC20 contract. It uses hardhat, waffle and ether.js in order to manage testing and deployment.
Contract inheritence graph Contract inheritence graph
Contract interaction graph Contract interaction graph
In order to compile, test and deploy the project using hardhat, the following dependencies will need to be installed:
- node 12
- npm 8
First, clone the git repository into a local directory, I will be cloning to ~/Hoff-Coin
Enter the directory and install the packages using npm
cd ~/Hoff-Coin
npm installAfter installing the node packages, you should be able to utilize the hardhat commands.
Try running some of the following tasks:
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
npx hardhat helpIn order to test this contract, we only need to run the following and confirm that all 15 tests are passing and the coverage is at 100%
npx hardhat test
npx hardhat coverageRun the following commands to deploy to a local development environment and the rinkeby testnet, respectively
npx hardhat run scripts/deploy.js
npx hardhat run scripts/deploy.js --network rinkebyin order to deploy the contract on the mainnet, first edit the file hardhat.config.js to input your private key in 'accounts' space on line 26 then run the following command
npx hardhat run scripts/deploy.js --network mainnet