The project uses the following main frameworks:
- OpenZeppelin smart contract templates
- Yarn for package management
- Hardhat for development environment and unit test running
- Typechain for generating TypeScript types from the contracts for unit tests
- Chai & Mocha for unit tests
- Install packages:
yarn
- Compile:
npx hardhat compile
- Generate typechain artifacts:
npm run generate:typechain
- Run unit tests:
npx hardhat test
- Run coverage test:
npm run run:coverage
For static analysis we use Slither. When it's installed locally, you can run: npm run run:slither
The contracts can be deployed either directly through Hardhat or through a Fireblocks integration (with the help of Hardhat). This section explains direct Hardhat deployment - Fireblocks deployment is documented elsewhere. Deployments also verify the contracts in Etherscan.
Steps:
- Set your environment variables in
.secrets.env
. You can see.secrets.env.example
for the format. Note that you don't need any of the Fireblocks-related settings when deploying directly with Hardhat - Deploy:
npx hardhat run scripts/deployManual.ts --network goerliDirect
- Go to Etherscan and open the address given by the deployment script. Mark the contract as proxy in Etherscan.