Skip to content

Commit

Permalink
Enable Hardhat contract sizer and gas reporter plugins (#72)
Browse files Browse the repository at this point in the history
This PR enables two plugins for Hardhat:
- [Hardhat Gas
Reporter](https://github.com/cgewecke/hardhat-gas-reporter)
- [Hardhat Contract
Sizer](https://github.com/ItsNickBarry/hardhat-contract-sizer)

To get cost estimates in USD, it is required to define
`COINMARKETCAP_API_KEY` environment variable with a token generated by
[CoinMarketCap](https://coinmarketcap.com/).
  • Loading branch information
r-czajkowski authored Dec 14, 2023
2 parents ee89b9e + 651bcca commit b1fd210
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ pnpm-debug.log*

# Temporary directory
tmp/

# Environment configuration files
.envrc
12 changes: 12 additions & 0 deletions core/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { HardhatUserConfig } from "hardhat/config"

import "@nomicfoundation/hardhat-toolbox"
import "hardhat-contract-sizer"
import "hardhat-deploy"

const config: HardhatUserConfig = {
Expand Down Expand Up @@ -71,6 +72,17 @@ const config: HardhatUserConfig = {
},
},

contractSizer: {
alphaSort: true,
runOnCompile: true,
strict: true,
},

gasReporter: {
enabled: true,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
},

typechain: {
outDir: "typechain",
},
Expand Down
1 change: 1 addition & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"eslint": "^8.54.0",
"ethers": "^6.8.1",
"hardhat": "^2.19.1",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-deploy": "^0.11.43",
"hardhat-gas-reporter": "^1.0.9",
"prettier": "^3.1.0",
Expand Down
30 changes: 30 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1fd210

Please sign in to comment.