-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.js
99 lines (97 loc) · 2.81 KB
/
hardhat.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
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomicfoundation/hardhat-toolbox");
require("hardhat-contract-sizer");
const optimizerSettings = {
enabled: true,
runs: 1000000,
details: {
// The peephole optimizer is always on if no details are given,
// use details to switch it off.
peephole: true,
// The inliner is always on if no details are given,
// use details to switch it off.
inliner: true,
// The unused jumpdest remover is always on if no details are given,
// use details to switch it off.
jumpdestRemover: true,
// Sometimes re-orders literals in commutative operations.
orderLiterals: true,
// Removes duplicate code blocks
deduplicate: true,
// Common subexpression elimination, this is the most complicated step but
// can also provide the largest gain.
cse: true,
// Optimize representation of literal numbers and strings in code.
constantOptimizer: true,
yulDetails: {
stackAllocation: true,
optimizerSteps:
"dhfoDgvulfnTUtnIf[xa[r]EscLMcCTUtTOntnfDIulLculVcul[j]Tpeulxa[rul]xa[r]cLgvifCTUca[r]LSsTOtfDnca[r]Iulc]jmul[jul]VcTOculjmul",
},
},
};
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
viaIR: true,
optimizer: {
...optimizerSettings,
},
metadata: {
bytecodeHash: "none",
},
},
},
],
},
defaultNetwork: "localhost",
networks: {
// Local
localhost: {
url: "http://localhost:8545",
chainId: 31337,
timeout: 400000000,
},
// Mainnet
mainnet: {
url: "https://rpc.ankr.com/eth",
chainId: 1,
},
// Arbitrum
arbitrum: {
url: "https://rpc.ankr.com/arbitrum",
chainId: 42161,
},
// Avalanche
avalanche: {
url: "https://rpc.ankr.com/avalanche",
chainId: 43114,
},
// Fantom
fantom: {
url: "https://rpc.ankr.com/fantom",
chainId: 250,
},
// Polygon
polygon: {
url: "https://rpc.ankr.com/polygon",
chainId: 137,
},
// Optimism
optimism: {
url: "https://rpc.ankr.com/optimism",
chainId: 10,
},
bsc: {
url: "https://rpc.ankr.com/bsc",
chainId: 56,
},
},
mocha: {
timeout: 100000000,
},
};