-
Notifications
You must be signed in to change notification settings - Fork 69
/
hardhat.base.config.js
103 lines (94 loc) · 2.75 KB
/
hardhat.base.config.js
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
99
100
101
102
103
require("@nomiclabs/hardhat-solpp");
require("./script/deploy_zklink");
require("./script/deploy_lz_bridge");
require("./script/deploy_faucet");
require("./script/deploy_account_mock");
require("./script/interact");
require("./script/deploy_l1_gateway");
require("./script/deploy_l2_gateway");
require("./script/deploy_arbitrator");
require("./script/deloy_multicall");
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const hardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.18",
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 200,
},
},
},
{
version: "0.7.6",
settings: {
optimizer: {
enabled: true,
runs: 800,
},
},
},
],
},
networks: {
hardhat: {
allowUnlimitedContractSize: true,
},
},
solpp: {
defs: {
DEFAULT_FEE_ADDRESS: "0x199AaA230f18432a715528B4091120cdCc7D9779",
BLOCK_PERIOD: "1 seconds",
UPGRADE_NOTICE_PERIOD: 0,
PRIORITY_EXPIRATION: 0,
CHAIN_ID: 1,
MAX_CHAIN_ID: 4,
ALL_CHAINS: 15,
MASTER_CHAIN_ID: 1,
SYNC_TYPE: 0
},
},
gasReporter: {
enabled: !!process.env.REPORT_GAS,
},
mocha: {
timeout: 600000,
},
};
// custom hardhat user config for different net
if (process.env.NET !== undefined) {
const netName = process.env.NET;
hardhatUserConfig.defaultNetwork = netName;
const netConfig = require(`./etc/${netName}.json`);
hardhatUserConfig.networks[netName] = netConfig.network;
if (netConfig.macro !== undefined) {
hardhatUserConfig.solpp.defs = netConfig.macro;
}
// config contract verify key if exist
if (netConfig.etherscan !== undefined) {
hardhatUserConfig.etherscan = netConfig.etherscan;
}
} else if (process.env.MASTER === "true") {
hardhatUserConfig.solpp.defs.CHAIN_ID = 1;
hardhatUserConfig.solpp.defs.MAX_CHAIN_ID = 4;
hardhatUserConfig.solpp.defs.ALL_CHAINS = 11; // [1,3,4]
hardhatUserConfig.solpp.defs.MASTER_CHAIN_ID = 1;
} else if (process.env.MASTER === "false") {
hardhatUserConfig.solpp.defs.CHAIN_ID = 2;
hardhatUserConfig.solpp.defs.MAX_CHAIN_ID = 4;
hardhatUserConfig.solpp.defs.ALL_CHAINS = 11; // [1,3,4]
hardhatUserConfig.solpp.defs.MASTER_CHAIN_ID = 1;
}
if (process.env.SYNC_TYPE !== undefined) {
hardhatUserConfig.solpp.defs.SYNC_TYPE = process.env.SYNC_TYPE;
}
hardhatUserConfig.isMasterChain =
hardhatUserConfig.solpp.defs.CHAIN_ID ===
hardhatUserConfig.solpp.defs.MASTER_CHAIN_ID;
hardhatUserConfig.syncType = hardhatUserConfig.solpp.defs.SYNC_TYPE;
module.exports = hardhatUserConfig;