My first steps with
Based on:
- Hardhat Hackathon Boilerplate
- Rahul Sethuram's blog post
- Typescript Solidity Dev Starter Kit
- Solidity Template
git clone https://github.com/jthoms/hardhat-openzeppelin-ts.git
cd hardhat-openzeppelin-ts
npm install
# list hardhat tasks:
npx hardhat
Clean, compile and test:
npx hardhat clean
npx hardhat compile
npx hardhat test
npx hardhat coverage
npx hardhat node
On a new terminal, go to the repository's root folder and run this to deploy your contract:
npx hardhat run --network localhost scripts/create-mytoken.ts
Edit scripts/upgrade-mytoken.ts, replace MYTOKEN_ADDRESS_FROM_create-mytoken with deployed address from above
npx hardhat run --network localhost scripts/upgrade-mytoken.ts
Get ether on Rinkeby: https://faucet.rinkeby.io/
Create free accounts on: https://infura.io https://etherscan.io
Create .env (listed in .gitignore) supplying the following values:
RINKEBY_PRIVATE_KEY=
INFURA_API_KEY=
ETHERSCAN_API_KEY=
npx hardhat run --network rinkeby scripts/create-mytoken.ts
To verify via etherscan, use the address from the .openzeppelin/rinkeby.json generated from above:
npx hardhat verify --network rinkeby <ADDRESS_FROM_.openzeppelin/rinkeby.json>
To upgrade, use contract address from create-mytoken.ts Edit scripts/upgrade-mytoken.ts, replace MYTOKEN_ADDRESS_FROM_create-mytoken with deployed address from above:
npx hardhat run --network rinkeby scripts/upgrade-mytoken.ts