This is a Hardhat project template focused on the DeFi smart contracts development.
npm i
cp .env.example .env.<network>
code .env.<network>
Note: Where <network>
is one of the networks configured in hadhat.config.ts
(By default: hardhat
, mainnet
, goerli
or bsc
).
The hardhat
will generates typechain
code for contracts under contracts/
folder. You can also have typechain
code for external contracts (for instance, tests another DeFi protocols), you only need to put their ABIs inside of the typechain/abi
and run npm run compile
.
npm run compile
npm test
Note: By default the tests will run against a forked Ethereum mainnet.
npm run <network>:deploy
npm run <network>:verify
Note: Etherscan (or BSCScan) API KEY is required for verification.