-
Notifications
You must be signed in to change notification settings - Fork 14
/
hardhat.config.js
executable file
·286 lines (278 loc) · 8.39 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
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
const {
TASK_TEST,
TASK_COMPILE_GET_COMPILER_INPUT
} = require('hardhat/builtin-tasks/task-names');
require('dotenv').config();
require('@nomiclabs/hardhat-waffle');
require('@nomiclabs/hardhat-etherscan');
require('@nomiclabs/hardhat-ethers');
require('@openzeppelin/hardhat-upgrades');
require('hardhat-gas-reporter');
require('hardhat-abi-exporter');
require('solidity-coverage');
require('hardhat-deploy-ethers');
require('hardhat-deploy');
require('hardhat-watcher');
// This must occur after hardhat-deploy!
task(TASK_COMPILE_GET_COMPILER_INPUT).setAction(async (_, __, runSuper) => {
const input = await runSuper();
input.settings.metadata.useLiteralContent = process.env.USE_LITERAL_CONTENT != 'false';
console.log(`useLiteralContent: ${input.settings.metadata.useLiteralContent}`);
return input;
});
// Task to run deployment fixtures before tests without the need of "--deploy-fixture"
// - Required to get fixtures deployed before running Coverage Reports
task(
TASK_TEST,
"Runs the coverage report",
async (args, hre, runSuper) => {
await hre.run('compile');
await hre.deployments.fixture();
return runSuper({...args, noCompile: true});
}
);
const mnemonic = {
testnet: `${process.env.TESTNET_MNEMONIC}`.replace(/_/g, ' '),
mainnet: `${process.env.MAINNET_MNEMONIC}`.replace(/_/g, ' '),
};
const optimizerDisabled = process.env.OPTIMIZER_DISABLED
module.exports = {
solidity: {
compilers: [
{
version: '0.8.2',
},
{
version: '0.6.12',
settings: {
optimizer: {
enabled: !optimizerDisabled,
runs: 200
}
},
evmVersion: 'istanbul'
},
{
version: '0.4.11', // for testing cryptopunks (matches compiler version of etherscan verified contract)
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
]
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: './build/contracts',
deploy: './deploy',
deployments: './deployments'
},
networks: {
hardhat: {
// chainId: 1,
// blockGasLimit: 200000000,
allowUnlimitedContractSize: true,
// gasPrice: 1e9,
accounts: {
mnemonic: mnemonic.testnet,
initialIndex: 0,
count: 10,
},
// forking: {
// url: 'https://eth-mainnet.g.alchemy.com/v2/onL35MUKZeTnQ3XZ3K_fbyg4ZcDyAbu5',
// blockNumber: 15400000, // MUST be after Aave V2 was deployed
// timeout: 1000000
// },
},
kovan: {
// url: `https://kovan.infura.io/v3/${process.env.INFURA_APIKEY}`,
url: `https://eth-kovan.alchemyapi.io/v2/${process.env.ALCHEMY_APIKEY}`,
gasPrice: 3e9,
blockGasLimit: 12400000,
accounts: {
mnemonic: mnemonic.testnet,
initialIndex: 0,
count: 10,
},
},
goerli: {
url: `https://eth-goerli.g.alchemy.com/v2/${process.env.ALCHEMY_APIKEY}`,
gasPrice: 'auto',
// blockGasLimit: 12400000,
accounts: {
mnemonic: mnemonic.testnet,
initialIndex: 0,
count: 10,
},
},
mumbai: {
// url: `https://rpc-mumbai.matic.today`,
// url: `https://rpc-mumbai.maticvigil.com/v1/${process.env.MATIC_APIKEY}`,
url: `https://polygon-mumbai.g.alchemy.com/v2/${process.env.ALCHEMY_APIKEY}`,
// gasPrice: 50e9,
accounts: {
mnemonic: mnemonic.testnet,
initialIndex: 0,
count: 10,
},
chainId: 80001,
},
polygon: {
// url: `https://rpc-mainnet.maticvigil.com/v1/${process.env.MATIC_APIKEY}`,
url: `https://polygon-mainnet.g.alchemy.com/v2/HFlv2m48GYEDLf9sHMTBuy2Z80xFwlVC`,
gasPrice: 80e9,
accounts: {
mnemonic: mnemonic.mainnet,
initialIndex: 0,
count: 3,
},
},
mainnet: {
// url: `https://mainnet.infura.io/v3/${process.env.INFURA_APIKEY}`,
url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_APIKEY}`,
gasPrice: 'auto',
blockGasLimit: 12487794,
accounts: {
mnemonic: mnemonic.mainnet,
initialIndex: 0,
count: 3,
},
},
zkEVMtest: {
url: 'https://rpc.public.zkevm-test.net',
gasPrice: 'auto',
accounts: {
mnemonic: mnemonic.testnet,
initialIndex: 0,
count: 10,
},
timeout: 400000,
chainId: 1442,
},
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_APIKEY,
goerli: process.env.ETHERSCAN_APIKEY,
kovan: process.env.ETHERSCAN_APIKEY,
polygon: process.env.POLYGONSCAN_APIKEY,
polygonMumbai: process.env.POLYGONSCAN_APIKEY,
zkEVMtest: process.env.ETHERSCAN_APIKEY,
},
customChains: [
{
network: 'zkEVMtest',
chainId: 1442,
urls: {
apiURL: 'https://rpc.public.zkevm-test.net',
browserURL: 'https://explorer.public.zkevm-test.net',
},
},
],
},
// polygonscan: {
// apiKey: process.env.POLYGONSCAN_APIKEY
// },
gasReporter: {
currency: 'USD',
gasPrice: 1,
enabled: (process.env.REPORT_GAS) ? true : false
},
abiExporter: {
path: './abis',
runOnCompile: true,
// Mindful of https://github.com/ItsNickBarry/hardhat-abi-exporter/pull/29/files
// and https://github.com/ItsNickBarry/hardhat-abi-exporter/pull/35 as they heavily change behavior around this package
clear: true,
flat: true,
only: [
'Universe',
'UniverseRP',
'ChargedState',
'ChargedSettings',
'ChargedManagers',
'ChargedParticles',
'ParticleSplitter',
'AaveWalletManager',
'AaveWalletManagerB',
'AaveBridgeV2',
'GenericWalletManager',
'GenericWalletManagerB',
'GenericBasketManager',
'GenericBasketManagerB',
'RewardProgram',
'Ionx',
'Proton',
'ProtonB',
'ProtonC',
'Lepton',
'Lepton2',
'ERC20',
'ExternalERC721',
'FungibleERC1155',
'NonFungibleERC1155',
'YieldFarm',
'Staking',
'YieldFarm2',
'Staking2',
'CommunityVault',
'MerkleDistributor',
'MerkleDistributor2',
'MerkleDistributor3',
'TokenInfoProxy',
'VestingClaim',
'VestingClaim2',
'VestingClaim3',
'VestingClaim4',
'VestingClaim5',
'VestingClaim6',
'VestingClaim7',
],
},
namedAccounts: {
deployer: {
default: 0,
},
protocolOwner: {
default: 1,
1: '0x0Ca678b984186b0117501C00d4A6B4F8F342D06D', // IONX Gnosis Multisig
},
initialMinter: {
default: 2,
},
user1: {
default: 3,
},
user2: {
default: 4,
},
user3: {
default: 5,
},
trustedForwarder: {
default: 7, // Account 8
1: '0x1337c0d31337c0D31337C0d31337c0d31337C0d3', // mainnet
3: '0x1337c0d31337c0D31337C0d31337c0d31337C0d3', // ropsten
4: '0x1337c0d31337c0D31337C0d31337c0d31337C0d3', // rinkeby
42: '0x1337c0d31337c0D31337C0d31337c0d31337C0d3', // kovan
137: '0x1337c0d31337c0D31337C0d31337c0d31337C0d3', // Polygon L2 Mainnet
80001: '0x1337c0d31337c0D31337C0d31337c0d31337C0d3', // Polygon L2 Testnet - Mumbai
}
},
watcher: {
compilation: {
tasks: ["compile"],
files: ["./contracts"],
verbose: true,
},
test: {
tasks: [{ command: 'test', params: { testFiles: ['{path}'] } }],
files: ['./test/**/*'],
verbose: true
}
},
};