-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
98 lines (90 loc) · 2.61 KB
/
hardhat.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "hardhat-contract-sizer";
import "hardhat-gas-reporter";
import "hardhat-typechain";
import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from "hardhat/builtin-tasks/task-names";
import { subtask, task } from "hardhat/config";
const path = require("path");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const systemParams = require("./SystemConfig.json");
require("dotenv").config();
const ALCHEMY_API_KEY = process.env.ALCHEMY_API_KEY!;
const PRIVATE_KEY = process.env.PRIVATE_KEY!;
const prodConfig = {
UPGRADE_NOTICE_PERIOD: 0,
// PRIORITY_EXPIRATION: 101,
// NOTE: Should be greater than 0, otherwise zero approvals will be enough to make an instant upgrade!
SECURITY_COUNCIL_APPROVALS_FOR_EMERGENCY_UPGRADE: 1,
PRIORITY_TX_MAX_GAS_LIMIT: 72000000,
DEPLOY_L2_BRIDGE_COUNTERPART_GAS_LIMIT: 10000000,
DUMMY_VERIFIER: false,
ERA_CHAIN_ID: 324,
BLOB_VERSIONED_HASH_GETTER_ADDR: "0x0000000000000000000000000000000000001337",
};
const localConfig = {
...prodConfig,
UPGRADE_NOTICE_PERIOD: 0,
DUMMY_VERIFIER: true,
EOA_GOVERNOR: true,
ERA_CHAIN_ID: 9,
ERA_DIAMOND_PROXY: "address(0)",
ERA_TOKEN_BEACON_ADDRESS: "address(0)",
ERA_ERC20_BRIDGE_ADDRESS: "address(0)",
ERA_WETH_ADDRESS: "address(0)",
ERA_WETH_BRIDGE_ADDRESS: "address(0)",
ERC20_BRIDGE_IS_BASETOKEN_BRIDGE: true,
};
module.exports = {
networks: {
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: [PRIVATE_KEY],
},
},
solidity: {
version: "0.8.24",
settings: {
optimizer: {
enabled: true,
runs: 9999999,
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
evmVersion: "cancun",
},
},
contractSizer: {
runOnCompile: false,
},
paths: {
sources: "./contracts",
},
solpp: {
defs: (() => {
const defs = localConfig;
return {
...systemParams,
...defs,
};
})(),
},
etherscan: {
apiKey: process.env.MISC_ETHERSCAN_API_KEY,
},
gasReporter: {
enabled: true,
},
};
task("solpp", "Preprocess Solidity source files").setAction(async (_, hre) =>
hre.run(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS)
);
// Add a subtask that sets the action for the TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS task
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => {
const paths = await runSuper();
return paths.filter((p: any) => !p.includes("test/foundry/") && !p.includes("lib/forge-std/"));
});