-
Notifications
You must be signed in to change notification settings - Fork 110
/
hardhat.config.js
228 lines (222 loc) · 6.08 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
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
require("dotenv").config();
require("ts-node").register({
files: true,
});
require("solidity-coverage");
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-truffle5");
require("@nomiclabs/hardhat-web3");
require("hardhat-contract-sizer");
require("@openzeppelin/hardhat-upgrades");
if (!process.env.TEST === "true") {
require("hardhat-gas-reporter");
}
require("./tasks/deploy");
require("./tasks/tributeERC721Tasks");
require("./signers");
module.exports = {
// Supported Networks
networks: {
// Test Networks
hardhat: {
network_id: 1337,
chainId: 1337,
accounts: {
mnemonic:
"myth like bonus scare over problem client lizard pioneer submit female collect",
},
throwOnTransactionFailures: true,
throwOnCallFailures: true,
loggingEnabled: false,
allowUnlimitedContractSize: false,
initialBaseFeePerGas: 0,
},
ganache: {
url: "http://127.0.0.1:7545",
chainId: 1337,
accounts: {
count: 10,
mnemonic:
process.env.WALLET_MNEMONIC ||
"myth like bonus scare over problem client lizard pioneer submit female collect",
},
},
goerli: {
url: process.env.ETH_NODE_URL,
network_id: 5,
chainId: 5,
skipDryRun: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
sepolia: {
url: process.env.ETH_NODE_URL,
network_id: 11155111,
chainId: 11155111,
skipDryRun: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
harmonytest: {
url: process.env.ETH_NODE_URL,
network_id: 1666700000,
chainId: 1666700000,
skipDryRun: true,
gas: 2100000,
gasPrice: 10000000000,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
polygontest: {
url: process.env.ETH_NODE_URL,
network_id: 80001,
chainId: 80001,
skipDryRun: true,
gas: 2100000,
gasPrice: 10000000000,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
coverage: {
url: "http://127.0.0.1:8555",
network_id: 1,
chainId: 1,
gas: 0xfffffffffff,
gasPrice: 10000000000,
initialBaseFeePerGas: 0,
},
avalanchetest: {
url: process.env.ETH_NODE_URL,
network_id: 43113,
chainId: 43113,
skipDryRun: true,
gas: 2100000,
gasPrice: 25000000000,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
// Main Networks
mainnet: {
url: process.env.ETH_NODE_URL,
network_id: 1,
chainId: 1,
skipDryRun: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
gnosis: {
url: process.env.ETH_NODE_URL,
network_id: 100,
chainId: 100,
skipDryRun: true,
allowUnlimitedContractSize: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
harmony: {
url: process.env.ETH_NODE_URL,
network_id: 1666600000,
chainId: 1666600000,
skipDryRun: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
polygon: {
url: process.env.ETH_NODE_URL,
network_id: 137,
chainId: 137,
skipDryRun: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
gasMultiplier: parseFloat(process.env.GAS_PRICE_MULTIPLIER) || 1,
increaseFactor: parseInt(process.env.GAS_INCREASE_FACTOR) || 135, // base 100 (35% increase by default)
maxRetries: parseInt(process.env.TX_MAX_RETRIES) || 5, // 5 maximum retries for a tx
txTimeoutMs: parseInt(process.env.TX_TIMEOUT_MS) || 5 * 60 * 1000, // 5 minutes in milliseconds (timeout for each tx send to the network)
timeout: parseInt(process.env.TX_TIMEOUT_MS) || 5 * 60 * 1000, // in milliseconds (timeout for the http request needs to match the txTimeout)
},
avalanche: {
url: process.env.ETH_NODE_URL,
network_id: 43114,
chainId: 43114,
skipDryRun: true,
accounts: {
mnemonic: process.env.WALLET_MNEMONIC || "",
count: 10,
},
signerId: process.env.SIGNER || undefined,
},
},
// External Signers configs
signers: {
googleKms: {
enabled: process.env.KMS_GCP_SIGNER_ENABLED || false,
projectId: process.env.KMS_PROJECT_ID || undefined,
locationId: process.env.KMS_LOCATION_ID || undefined,
keyRingId: process.env.KMS_KEY_RING_ID || undefined,
keyId: process.env.KMS_KEY_ID || undefined,
keyVersion: process.env.KMS_KEY_VERSION || undefined,
},
},
// Solc Settings
solidity: {
version: "0.8.9", // slither v0.8.2 does not support solc > 0.8.9
settings: {
optimizer: {
enabled: !(process.env.SOLC_OPTIMIZER === "false"),
runs: 200,
},
},
},
// Project Settings
contractSizer: {
alphaSort: true,
disambiguatePaths: false,
runOnCompile: !(process.env.SOLC_OPTIMIZER === "false"),
strict: true,
},
gasReporter: {
enabled: true,
},
paths: {
tests: "./test",
sources: "./contracts",
cache: "./build/cache",
artifacts: "./build/artifacts",
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY,
polygon: process.env.ETHERSCAN_API_KEY,
gnosis: process.env.ETHERSCAN_API_KEY,
sepolia: process.env.ETHERSCAN_API_KEY,
},
},
};