forked from chainhop-dex/chainhop-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
327 lines (287 loc) · 10.9 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import * as dotenv from 'dotenv';
import 'hardhat-contract-sizer';
import 'hardhat-deploy';
import 'hardhat-gas-reporter';
import { HardhatUserConfig } from 'hardhat/types';
dotenv.config();
const DEFAULT_ENDPOINT = 'http://localhost:8545';
const DEFAULT_PRIVATE_KEY =
process.env.DEFAULT_PRIVATE_KEY || 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
// Testnets
const kovanEndpoint = process.env.KOVAN_ENDPOINT || DEFAULT_ENDPOINT;
const kovanPrivateKey = process.env.KOVAN_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const ropstenEndpoint = process.env.ROPSTEN_ENDPOINT || DEFAULT_ENDPOINT;
const ropstenPrivateKey = process.env.ROPSTEN_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const goerliEndpoint = process.env.GOERLI_ENDPOINT || DEFAULT_ENDPOINT;
const goerliPrivateKey = process.env.GOERLI_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const bscTestEndpoint = process.env.BSC_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const bscTestPrivateKey = process.env.BSC_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const optimismTestEndpoint = process.env.OPTIMISM_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const optimismTestPrivateKey = process.env.OPTIMISM_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const fantomTestEndpoint = process.env.FANTOM_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const fantomTestPrivateKey = process.env.FANTOM_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const avalancheTestEndpoint = process.env.AVALANCHE_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const avalancheTestPrivateKey = process.env.AVALANCHE_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const celoAlfajoresTestEndpoint = process.env.CELO_ALFAJORES_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const celoAlfajoresTestPrivateKey = process.env.CELO_ALFAJORES_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const oasisEmeraldTestEndpoint = process.env.OASIS_EMERALD_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const oasisEmeraldTestPrivateKey = process.env.OASIS_EMERALD_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const moonbaseAlphaTestEndpoint = process.env.MOONBASE_ALPHA_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const moonbaseAlphaTestPrivateKey = process.env.MOONBASE_ALPHA_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const reiTestEndpoint = process.env.REI_TEST_ENDPOINT || DEFAULT_ENDPOINT;
const reiTestPrivateKey = process.env.REI_TEST_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
// Mainnets
const ethMainnetEndpoint = process.env.ETH_MAINNET_ENDPOINT || DEFAULT_ENDPOINT;
const ethMainnetPrivateKey = process.env.ETH_MAINNET_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const bscEndpoint = process.env.BSC_ENDPOINT || DEFAULT_ENDPOINT;
const bscPrivateKey = process.env.BSC_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const arbitrumEndpoint = process.env.ARBITRUM_ENDPOINT || DEFAULT_ENDPOINT;
const arbitrumPrivateKey = process.env.ARBITRUM_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const polygonEndpoint = process.env.POLYGON_ENDPOINT || DEFAULT_ENDPOINT;
const polygonPrivateKey = process.env.POLYGON_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const fantomEndpoint = process.env.FANTOM_ENDPOINT || DEFAULT_ENDPOINT;
const fantomPrivateKey = process.env.FANTOM_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const avalancheEndpoint = process.env.AVALANCHE_ENDPOINT || DEFAULT_ENDPOINT;
const avalanchePrivateKey = process.env.AVALANCHE_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const optimismEndpoint = process.env.OPTIMISM_ENDPOINT || DEFAULT_ENDPOINT;
const optimismPrivateKey = process.env.OPTIMISM_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const bobaEndpoint = process.env.BOBA_ENDPOINT || DEFAULT_ENDPOINT;
const bobaPrivateKey = process.env.BOBA_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const harmonyEndpoint = process.env.HARMONY_ENDPOINT || DEFAULT_ENDPOINT;
const harmonyPrivateKey = process.env.HARMONY_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const moonbeamEndpoint = process.env.MOONBEAM_ENDPOINT || DEFAULT_ENDPOINT;
const moonbeamPrivateKey = process.env.MOONBEAM_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const moonriverEndpoint = process.env.MOONRIVER_ENDPOINT || DEFAULT_ENDPOINT;
const moonriverPrivateKey = process.env.MOONRIVER_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const celoEndpoint = process.env.CELO_ENDPOINT || DEFAULT_ENDPOINT;
const celoPrivateKey = process.env.CELO_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const oasisEmeraldEndpoint = process.env.OASIS_EMERALD_ENDPOINT || DEFAULT_ENDPOINT;
const oasisEmeraldPrivateKey = process.env.OASIS_EMERALD_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const metisEndpoint = process.env.METIS_ENDPOINT || DEFAULT_ENDPOINT;
const metisPrivateKey = process.env.METIS_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const auroraEndpoint = process.env.AURORA_ENDPOINT || DEFAULT_ENDPOINT;
const auroraPrivateKey = process.env.AURORA_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const xdaiEndpoint = process.env.XDAI_ENDPOINT || DEFAULT_ENDPOINT;
const xdaiPrivateKey = process.env.XDAI_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const oecEndpoint = process.env.OEC_ENDPOINT || DEFAULT_ENDPOINT;
const oecPrivateKey = process.env.OEC_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const hecoEndpoint = process.env.HECO_ENDPOINT || DEFAULT_ENDPOINT;
const hecoPrivateKey = process.env.HECO_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const astarEndpoint = process.env.ASTAR_ENDPOINT || DEFAULT_ENDPOINT;
const astarPrivateKey = process.env.ASTAR_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const shidenEndpoint = process.env.SHIDEN_ENDPOINT || DEFAULT_ENDPOINT;
const shidenPrivateKey = process.env.SHIDEN_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const syscoinEndpoint = process.env.SYSCOIN_ENDPOINT || DEFAULT_ENDPOINT;
const syscoinPrivateKey = process.env.SYSCOIN_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const milkomedaEndpoint = process.env.MILKOMEDA_ENDPOINT || DEFAULT_ENDPOINT;
const milkomedaPrivateKey = process.env.MILKOMEDA_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const evmosEndpoint = process.env.EVMOS_ENDPOINT || DEFAULT_ENDPOINT;
const evmosPrivateKey = process.env.EVMOS_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const cloverEndpoint = process.env.CLOVER_ENDPOINT || DEFAULT_ENDPOINT;
const cloverPrivateKey = process.env.CLOVER_PRIVATE_KEY || DEFAULT_PRIVATE_KEY;
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
hardhat: {
// sed_placeholder
},
localhost: { timeout: 600000 },
kovan: {
url: kovanEndpoint,
accounts: [`0x${kovanPrivateKey}`]
},
ropsten: {
url: ropstenEndpoint,
accounts: [`0x${ropstenPrivateKey}`]
},
goerli: {
url: goerliEndpoint,
accounts: [`0x${goerliPrivateKey}`]
},
bscTest: {
url: bscTestEndpoint,
accounts: [`0x${bscTestPrivateKey}`]
},
fantomTest: {
url: fantomTestEndpoint,
accounts: [`0x${fantomTestPrivateKey}`]
},
optimismTest: {
url: optimismTestEndpoint,
accounts: [`0x${optimismTestPrivateKey}`]
},
avalancheTest: {
url: avalancheTestEndpoint,
accounts: [`0x${avalancheTestPrivateKey}`]
},
celoAlfajoresTest: {
url: celoAlfajoresTestEndpoint,
accounts: [`0x${celoAlfajoresTestPrivateKey}`]
},
oasisEmeraldTest: {
url: oasisEmeraldTestEndpoint,
accounts: [`0x${oasisEmeraldTestPrivateKey}`]
},
moonbaseAlphaTest: {
url: moonbaseAlphaTestEndpoint,
accounts: [`0x${moonbaseAlphaTestPrivateKey}`]
},
reiTest: {
url: reiTestEndpoint,
accounts: [`0x${reiTestPrivateKey}`]
},
ethMainnet: {
url: ethMainnetEndpoint,
accounts: [`0x${ethMainnetPrivateKey}`]
},
bsc: {
url: bscEndpoint,
accounts: [`0x${bscPrivateKey}`]
},
arbitrum: {
url: arbitrumEndpoint,
accounts: [`0x${arbitrumPrivateKey}`]
},
polygon: {
url: polygonEndpoint,
accounts: [`0x${polygonPrivateKey}`],
gasPrice: 50000000000
},
fantom: {
url: fantomEndpoint,
accounts: [`0x${fantomPrivateKey}`]
},
avalanche: {
url: avalancheEndpoint,
accounts: [`0x${avalanchePrivateKey}`]
},
optimism: {
url: optimismEndpoint,
accounts: [`0x${optimismPrivateKey}`]
},
boba: {
url: bobaEndpoint,
accounts: [`0x${bobaPrivateKey}`]
},
harmony: {
url: harmonyEndpoint,
accounts: [`0x${harmonyPrivateKey}`]
},
moonbeam: {
url: moonbeamEndpoint,
accounts: [`0x${moonbeamPrivateKey}`]
},
moonriver: {
url: moonriverEndpoint,
accounts: [`0x${moonriverPrivateKey}`]
},
celo: {
url: celoEndpoint,
accounts: [`0x${celoPrivateKey}`]
},
oasisEmerald: {
url: oasisEmeraldEndpoint,
accounts: [`0x${oasisEmeraldPrivateKey}`]
},
metis: {
url: metisEndpoint,
accounts: [`0x${metisPrivateKey}`]
},
aurora: {
url: auroraEndpoint,
accounts: [`0x${auroraPrivateKey}`]
},
xdai: {
url: xdaiEndpoint,
accounts: [`0x${xdaiPrivateKey}`]
},
oec: {
url: oecEndpoint,
accounts: [`0x${oecPrivateKey}`]
},
heco: {
url: hecoEndpoint,
accounts: [`0x${hecoPrivateKey}`]
},
astar: {
url: astarEndpoint,
accounts: [`0x${astarPrivateKey}`]
},
shiden: {
url: shidenEndpoint,
accounts: [`0x${shidenPrivateKey}`]
},
syscoin: {
url: syscoinEndpoint,
accounts: [`0x${syscoinPrivateKey}`]
},
milkomeda: {
url: milkomedaEndpoint,
accounts: [`0x${milkomedaPrivateKey}`]
},
evmos: {
url: evmosEndpoint,
accounts: [`0x${evmosPrivateKey}`]
},
clover: {
url: cloverEndpoint,
accounts: [`0x${cloverPrivateKey}`]
}
},
namedAccounts: {
deployer: {
default: 0
}
},
solidity: {
version: '0.8.15',
settings: {
optimizer: {
enabled: true,
runs: 800,
details: {
yul: false // workaround compile-time "stack too deep"
}
}
}
},
contractSizer: {
alphaSort: true,
runOnCompile: false,
disambiguatePaths: false
},
gasReporter: {
enabled: !!process.env.REPORT_GAS,
noColors: true,
currency: 'USD',
outputFile: process.env.BENCHMARK
? `reports/gas_usage/benchmark-${process.env.BENCHMARK}.txt`
: 'reports/gas_usage/summary.txt'
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5'
},
etherscan: {
apiKey: {
goerli: process.env.ETHERSCAN_API_KEY,
avalancheFujiTestnet: process.env.SNOWTRACE_API_KEY,
bscTestnet: process.env.BSCSCAN_API_KEY,
arbitrumTestnet: process.env.ARBISCAN_API_KEY,
ftmTestnet: process.env.FTMSCAN_API_KEY,
polygonMumbai: process.env.POLYGONSCAN_API_KEY,
mainnet: process.env.ETHERSCAN_API_KEY,
optimisticEthereum: process.env.OPTIMISTIC_ETHERSCAN_API_KEY,
avalanche: process.env.SNOWTRACE_API_KEY,
bsc: process.env.BSCSCAN_API_KEY,
arbitrumOne: process.env.ARBISCAN_API_KEY,
opera: process.env.FTMSCAN_API_KEY,
polygon: process.env.POLYGONSCAN_API_KEY
}
}
};
export default config;