-
Notifications
You must be signed in to change notification settings - Fork 88
/
hardhat.config.ts
437 lines (419 loc) · 15.5 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
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
import '@nomiclabs/hardhat-ethers'; // aliased to hardhat-deploy-ethers
import '@nomiclabs/hardhat-etherscan';
import 'dotenv/config';
import 'hardhat-contract-sizer';
import 'hardhat-deploy';
import 'hardhat-gas-reporter';
import {HardhatUserConfig} from 'hardhat/types';
import 'solidity-coverage';
import {accounts, node_url} from './utils/network';
const config: HardhatUserConfig = {
gasReporter: {
currency: 'USD',
gasPrice: 100,
enabled: process.env.REPORT_GAS ? true : false,
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
maxMethodDiff: 10,
},
mocha: {
timeout: 0,
...(!process.env.CI ? {} : {invert: true, grep: '@skip-on-ci'}),
},
solidity: {
compilers: [
{
version: '0.8.15',
settings: {
optimizer: {
enabled: true,
runs: 2000,
},
},
},
{
version: '0.8.2',
settings: {
optimizer: {
enabled: true,
runs: 2000,
},
},
},
{
version: '0.7.5',
settings: {
optimizer: {
enabled: true,
runs: 2000,
},
},
},
{
version: '0.6.5',
settings: {
optimizer: {
enabled: true,
runs: 2000,
},
},
},
{
version: '0.5.9',
settings: {
optimizer: {
enabled: true,
runs: 2000,
},
},
},
],
},
namedAccounts: {
deployer: {
default: 1,
mainnet: '0xe19ae8F9B36Ca43D12741288D0e311396140DF6F',
polygon: '0xCba49d154b4Bb9a9aD7F5Dad396CB9a0a3a62ABc',
goerli: '0xA796AE911621E00809E0E7C8f0AD6BF118E5139e',
goerli_test: '0xA796AE911621E00809E0E7C8f0AD6BF118E5139e',
sepolia: '0xA796AE911621E00809E0E7C8f0AD6BF118E5139e',
mumbai: '0x5F890c9522dCE5670d741D4277BFCC2d9cA8Af02',
mumbai_test: '0x5F890c9522dCE5670d741D4277BFCC2d9cA8Af02',
amoy: '0x5F890c9522dCE5670d741D4277BFCC2d9cA8Af02',
}, // deploy contracts and make sure they are set up correctly
sandAdmin: {
default: 2,
mainnet: '0x6ec4090d0F3cB76d9f3D8c4D5BB058A225E560a1',
polygon: '0xfD30a48Bc6c56E24B0ebF1B0117d750e2CFf7531',
goerli: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
goerli_test: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
sepolia: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
mumbai: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
mumbai_test: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
amoy: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
}, // can add super operators and change admin
operationsAdmin: {
default: 2,
mainnet: '0x6ec4090d0F3cB76d9f3D8c4D5BB058A225E560a1',
polygon: '0xfD30a48Bc6c56E24B0ebF1B0117d750e2CFf7531',
},
upgradeAdmin: 'sandAdmin',
multiGiveawayAdmin: {
default: 'sandAdmin',
mainnet: '0x6ec4090d0F3cB76d9f3D8c4D5BB058A225E560a1',
polygon: '0xfD30a48Bc6c56E24B0ebF1B0117d750e2CFf7531',
},
liquidityRewardProvider: {
default: 'sandBeneficiary',
mainnet: '0x8FFA64FB50559c3Ff09a1022b84B2c5233ed8068',
},
liquidityRewardAdmin: 'sandAdmin',
kyberDepositor: {
default: 'sandBeneficiary',
mainnet: '0x8FFA64FB50559c3Ff09a1022b84B2c5233ed8068',
},
sandExecutionAdmin: 'sandAdmin', // can add execution extension to SAND (used for Native metatx support)
mintingFeeCollector: 'sandAdmin', // will receiver the fee from Asset minting
sandBeneficiary: 'sandAdmin', // will be the owner of all initial SAND
assetAdmin: 'sandAdmin', // can add super operator and change admin to Asset
assetMinterAdmin: 'sandAdmin', // can set metaTxProcessors & types
assetBouncerAdmin: 'sandAdmin', // setup the contract allowed to mint Assets
sandSaleAdmin: 'sandAdmin', // can pause the sandSale and withdraw SAND
genesisBouncerAdmin: 'sandAdmin', // can set who is allowed to mint
defaultMinterAdmin: 'sandAdmin', // can change the fees
genesisMinter: 'sandAdmin', // the first account allowed to mint genesis Assets
assetAuctionFeeCollector: 'sandSaleBeneficiary', // collect fees from asset auctions
assetAuctionAdmin: 'sandAdmin', // can change fee collector
sandSaleBeneficiary: {
default: 3,
mainnet: '0x0EB04462D69B1D267d269377E34f60b9De1c8510',
polygon: '0x1b47567CBE36e63293A7A2018F79687f942aB24C', // same as treasury
goerli: '0xF22455c7F2a81E197AecD951F588a9B650f5b282',
goerli_test: '0xF22455c7F2a81E197AecD951F588a9B650f5b282',
sepolia: '0xF22455c7F2a81E197AecD951F588a9B650f5b282',
mumbai: '0xa5Eb9C9Eb4F4c35B9Be8cFaAA7909F9ebe6Cb609',
mumbai_test: '0xa5Eb9C9Eb4F4c35B9Be8cFaAA7909F9ebe6Cb609',
amoy: '0xa5Eb9C9Eb4F4c35B9Be8cFaAA7909F9ebe6Cb609',
},
treasury: {
default: 'sandSaleBeneficiary',
mainnet: '0x4489590a116618B506F0EfE885432F6A8ED998E9',
polygon: '0x1b47567CBE36e63293A7A2018F79687f942aB24C',
},
landSaleBeneficiary: {
default: 'sandSaleBeneficiary',
mainnet: 'treasury',
polygon: 'treasury',
}, // updated to company treasury wallet 9th September - collect funds from land sales
catalystAssetFeeRecipient: 'treasury',
landSaleFeeRecipient: {
default: 3,
goerli: 5,
goerli_test: 5,
sepolia: 5,
mumbai: 5,
amoy: 5,
mainnet: '0x0EB04462D69B1D267d269377E34f60b9De1c8510',
polygon: '0x42a4a3795446A4c070565da201c6303fC78a2569',
}, // collect 5% fee from land sales (prior to implementation of FeeDistributor)
landAdmin: {
default: 2,
mainnet: '0x6ec4090d0F3cB76d9f3D8c4D5BB058A225E560a1',
polygon: '0xfD30a48Bc6c56E24B0ebF1B0117d750e2CFf7531',
goerli: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
goerli_test: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
sepolia: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
mumbai: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
mumbai_test: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
amoy: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
}, // can add super operators and change admin
gemsAndCatalystsAdmin: 'sandAdmin',
assetAttributesRegistryAdmin: 'sandAdmin',
proxyAdminOwner: {
default: 2,
mainnet: '0x6ec4090d0F3cB76d9f3D8c4D5BB058A225E560a1',
polygon: '0xfD30a48Bc6c56E24B0ebF1B0117d750e2CFf7531',
goerli: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
goerli_test: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
sepolia: '0x39D01ecc951C2c1f20ba0549e62212659c4d1e06',
mumbai: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
mumbai_test: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
amoy: '0x49c4D4C94829B9c44052C5f5Cb164Fc612181165',
},
landSaleAdmin: 'sandAdmin', // can enable currencies
gameTokenAdmin: 'sandAdmin', // can set minter address
gameTokenFeeBeneficiary: 'treasury', // receives fees from GAME token minting / Mods
estateAdmin: 'sandAdmin', // can add super operators and change admin
P2PERC721SaleAdmin: 'sandAdmin', // can set fees
backendReferralWallet: {
// default is computed from private key:
// "0x4242424242424242424242424242424242424242424242424242424242424242"
default: '0x17c5185167401eD00cF5F5b2fc97D9BBfDb7D025',
mainnet: '0x3044719d139F866a44c988823513eCB93060bF1b',
polygon: '0x3044719d139F866a44c988823513eCB93060bF1b',
goerli: '0xB7060D3FeCAC3AE1F0A0AA416E3e8E472257950e',
goerli_test: '0xB7060D3FeCAC3AE1F0A0AA416E3e8E472257950e',
sepolia: '0xB7060D3FeCAC3AE1F0A0AA416E3e8E472257950e',
mumbai: '0xB7060D3FeCAC3AE1F0A0AA416E3e8E472257950e',
amoy: '0xB7060D3FeCAC3AE1F0A0AA416E3e8E472257950e',
},
// To be used with AuthValidator only
backendAuthWallet: {
// default is computed from private key:
// "0x4242424242424242424242424242424242424242424242424242424242424242"
default: '0x17c5185167401eD00cF5F5b2fc97D9BBfDb7D025',
mainnet: '0x061872DFd0CAC4Ec7a7c87EEE9B950bb1fAD2906',
goerli: '0x0c72f82B46f034025622731c271bdf06B848Ed77',
goerli_test: '0x0c72f82B46f034025622731c271bdf06B848Ed77',
sepolia: '0x0c72f82B46f034025622731c271bdf06B848Ed77',
polygon: '0x061872DFd0CAC4Ec7a7c87EEE9B950bb1fAD2906',
mumbai: '0x0c72f82B46f034025622731c271bdf06B848Ed77',
amoy: '0x0c72f82B46f034025622731c271bdf06B848Ed77',
},
backendCashbackWallet: {
// default is computed from private key:
// "0x4242424242424242424242424242424242424242424242424242424242424242"
default: '0x17c5185167401eD00cF5F5b2fc97D9BBfDb7D025',
polygon: '0x564c8aADBd35b6175C0d18595cc335106AA250Dc',
},
raffleSignWallet: {
// default is computed from private key:
// "0x4242424242424242424242424242424242424242424242424242424242424242"
default: '0x17c5185167401eD00cF5F5b2fc97D9BBfDb7D025',
mainnet: '0x4e2422AC29B72290Be28C6a7c3Fad7A7fDA69e7a',
polygon: '0x4e2422AC29B72290Be28C6a7c3Fad7A7fDA69e7a',
},
sandboxAccount: {
default: 4,
mainnet: '0x7A9fe22691c811ea339D9B73150e6911a5343DcA',
polygon: '0x7A9fe22691c811ea339D9B73150e6911a5343DcA',
goerli: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
goerli_test: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
sepolia: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
amoy: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
},
sandboxFoundation: {
default: 'sandAdmin',
mainnet: '0x8FFA64FB50559c3Ff09a1022b84B2c5233ed8068',
polygon: '0x7A9fe22691c811ea339D9B73150e6911a5343DcA', //'0xfe66Ec1B46494FE49F53733a098587bf5D12BD88',
},
extraCatalystAndGemMinter: {
default: null,
mainnet: null,
goerli: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
goerli_test: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
sepolia: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
amoy: '0xC9bAbb4B452Dd9f74476cE49ee197a1Af6E803ea',
},
defaultOperatorFiltererRegistry:
'0x000000000000AAeB6D7670E522A718067333cd4E',
defaultOperatorFiltererSubscription:
'0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6',
collectionCatalystMigrationsAdmin: 'sandAdmin', // TODO use special account or deployer ?
catalystMinter: 'sandAdmin', // account that can mint catalysts
catalystAdmin: 'sandAdmin', // can set minter and admin for catatalyt, as well as super operators
gemAdmin: 'sandAdmin', // can set minter and admin for gems, as well as super operators
gemMinter: 'sandAdmin', // account that can mint gems
catalystRegistryAdmin: 'sandAdmin', // can change the minter
catalystMinterAdmin: 'sandAdmin', // control the fees and which catalyst are allowed
starterPackAdmin: 'sandAdmin', // can change price
starterPackSaleBeneficiary: 'treasury', // collect funds from starter pack sales
backendMessageSigner: 'backendReferralWallet', // account that sign message for the starter pack
kyberLiquidityProvider: 'sandBeneficiary', //TODO check what should be the value
gemsCatalystsRegistryAdmin: 'sandAdmin',
ozdRelayer: {
default: 1,
mainnet: '0x0073e6eb087019bdb7bede02d23aeb068b74af99',
polygon: '0x7051cb544c4a8d5aad1be46cc9524e48108e60b4',
goerli: '0x4751d4dc3d8cff421598592b51bb1d9a0fb116e9',
sepolia: '0x4751d4dc3d8cff421598592b51bb1d9a0fb116e9',
mumbai: '0x3c17c97f29182aec3d16a080cda94d6f773bbd91',
// TODO: add amoy when it's available on OZ defender (13th April)
},
landMigrationBatchExecutor: 'ozdRelayer',
nftCollectionAdmin: {
default: 'sandAdmin',
mainnet: null,
polygon: '0xF06dD9b61d480704Cc7bEF717e5Ea6efB6Af75bE', // Final admin should be 0xE79AF6BEb7D31c7faF7a1b891d9684960522D22e
},
},
networks: {
/**
* TAGS:
* - mainnet -> production networks
* - testnet -> non production networks
* - L1 -> Layer 1 networks
* - L2 -> Layer 2 networks
*/
hardhat: {
accounts: accounts(process.env.HARDHAT_FORK),
tags: ['testnet', 'L1', 'L2'],
forking: process.env.HARDHAT_FORK
? {
url: node_url(process.env.HARDHAT_FORK),
blockNumber: process.env.HARDHAT_FORK_NUMBER
? parseInt(process.env.HARDHAT_FORK_NUMBER)
: undefined,
}
: undefined,
deploy: ['deploy_polygon', 'deploy'],
// deploy: ['deploy-for-test', 'deploy'],
companionNetworks: {
l1: 'hardhat',
l2: 'hardhat',
},
blockGasLimit:
parseInt(process.env.HARDHAT_BLOCK_GAS_LIMIT || '0') || 30000000,
},
localhost: {
url: 'http://localhost:8545',
accounts: accounts(),
tags: ['testnet', 'L1', 'L2'],
deploy: ['deploy_polygon', 'deploy'],
companionNetworks: {
l1: 'localhost',
l2: 'localhost',
},
},
goerli: {
url: node_url('goerli'),
accounts: accounts('goerli'),
tags: ['testnet', 'L1'],
// gasPrice: 600000000000, // Uncomment in case of pending txs, and adjust gas
companionNetworks: {
l2: 'mumbai',
},
},
goerli_test: {
url: node_url('goerli'),
accounts: accounts('goerli_test'),
tags: ['testnet', 'L1'],
deploy: ['deploy'],
// gasPrice: 600000000000, // Uncomment in case of pending txs, and adjust gas
companionNetworks: {
l2: 'mumbai_test',
},
},
sepolia: {
url: node_url('sepolia'),
accounts: accounts('sepolia'),
tags: ['testnet', 'L1'],
companionNetworks: {
l2: 'amoy',
},
},
mainnet: {
url: node_url('mainnet'),
accounts: accounts('mainnet'),
tags: ['mainnet', 'L1'],
companionNetworks: {
l2: 'polygon',
},
},
mumbai: {
url: node_url('mumbai'),
accounts: accounts('mumbai'),
tags: ['testnet', 'L2'],
deploy: ['deploy_polygon'],
//gasPrice: 600000000000, // TODO: this fixes invalid sender issue
companionNetworks: {
l1: 'goerli',
},
},
mumbai_test: {
url: node_url('mumbai'),
accounts: accounts('mumbai_test'),
tags: ['testnet', 'L2'],
deploy: ['deploy_polygon'],
//gasPrice: 600000000000, // TODO: this fixes invalid sender issue
companionNetworks: {
l1: 'goerli_test',
},
},
amoy: {
url: node_url('amoy'),
accounts: accounts('amoy'),
tags: ['testnet', 'L2'],
deploy: ['deploy_polygon'],
//gasPrice: 600000000000, // TODO: this fixes invalid sender issue
companionNetworks: {
l1: 'sepolia',
},
},
polygon: {
url: node_url('polygon'),
accounts: accounts('polygon'),
tags: ['mainnet', 'L2'],
deploy: ['deploy_polygon'],
// gasPrice: 200000000000, // TODO: this fixes invalid sender issue
companionNetworks: {
l1: 'mainnet',
},
},
},
paths: {
sources: 'src',
},
contractSizer: {
alphaSort: false,
runOnCompile: false,
disambiguatePaths: false,
},
external: process.env.HARDHAT_FORK
? {
deployments: {
hardhat: ['deployments/' + process.env.HARDHAT_FORK],
},
}
: undefined,
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY_MAINNET || '',
goerli: process.env.ETHERSCAN_API_KEY_GOERLI || '',
sepolia: process.env.ETHERSCAN_API_KEY_SEPOLIA || '',
polygon: process.env.ETHERSCAN_API_KEY_POLYGON || '',
polygonMumbai: process.env.ETHERSCAN_API_KEY_MUMBAI || '',
polygonAmoy: process.env.ETHERSCAN_API_KEY_AMOY || '',
},
},
};
export default config;