Skip to content

Commit d6b6b25

Browse files
authored
add hardhat contract sizer on compilation (#363)
1 parent 86e6f92 commit d6b6b25

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed

hardhat.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { HardhatUserConfig, task } from "hardhat/config";
22
import "@typechain/hardhat";
33
import "hardhat-gas-reporter";
4+
import "hardhat-contract-sizer";
45
import "solidity-coverage";
56
import "@openzeppelin/hardhat-upgrades";
67
import "@nomicfoundation/hardhat-chai-matchers";
@@ -136,7 +137,12 @@ const config: HardhatUserConfig = {
136137
gasPriceApi: "https://api.polygonscan.com/api?module=proxy&action=eth_gasPrice", // MATIC
137138
// gasPriceAPI: "https://api.etherscan.io/api?module=proxy&action=eth_gasPrice", // ETH
138139
},
139-
140+
contractSizer: {
141+
alphaSort: false,
142+
disambiguatePaths: false,
143+
runOnCompile: true,
144+
strict: false,
145+
},
140146
ignition: {
141147
strategyConfig: {
142148
create2: {

package-lock.json

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"eslint-plugin-prettier": "^5.1.3",
3838
"eslint-plugin-promise": "^6.1.1",
3939
"hardhat": "^2.22.17",
40+
"hardhat-contract-sizer": "^2.10.0",
4041
"patch-package": "^8.0.0",
4142
"prettier": "^3.2.5",
4243
"prettier-plugin-solidity": "^1.1.1",

0 commit comments

Comments
 (0)