-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
97 lines (93 loc) · 2.8 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
// JS
const path = require("path");
require("@nomicfoundation/hardhat-chai-matchers");
require("@nomicfoundation/hardhat-ledger");
require("@nomicfoundation/hardhat-verify");
require("hardhat-contract-sizer");
// process.env
require("dotenv").config({ path: path.resolve(__dirname, "./.env") });
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://127.0.0.1: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,
},
// 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,
},
zkevm: {
url: "https://rpc.ankr.com/polygon_zkevm",
chainId: 1101,
},
},
mocha: { timeout: 100000000 },
};