forked from lobster-dao/lobster-nft-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.js
106 lines (101 loc) · 2.42 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
require('@nomiclabs/hardhat-truffle5');
require('@nomiclabs/hardhat-etherscan');
require('solidity-coverage');
require('hardhat-contract-sizer');
require('hardhat-gas-reporter');
require('./tasks/deployMinterAndNft');
const fs = require('fs');
const _ = require('lodash');
function getAccounts(network) {
const path = require('os').homedir() + '/.ethereum/' + network;
return fs.existsSync(path) ? [_.trim('0x' + fs.readFileSync(path, { encoding: 'utf8' }))] : [];
}
const config = {
analytics: {
enabled: false,
},
contractSizer: {
alphaSort: false,
runOnCompile: true,
},
defaultNetwork: 'hardhat',
gasReporter: {
currency: 'USD',
enabled: !!process.env.REPORT_GAS,
},
mocha: {
timeout: 70000,
},
networks: {
hardhat: {
chainId: 31337,
allowUnlimitedContractSize: true,
gas: 30000000,
blockGasLimit: 30000000
},
ganache: {
url: 'http://127.0.0.1:8945',
defaultBalanceEther: 1e9,
hardfork: 'muirGlacier',
},
mainnet: {
url: 'https://mainnet-eth.compound.finance',
accounts: getAccounts('mainnet'),
gasPrice: 100 * 1e9,
gasMultiplier: 1.2,
timeout: 2000000,
chainId: 1,
},
mainnetfork: {
url: 'http://127.0.0.1:8545/',
// accounts: getAccounts('mainnet'),
gasPrice: 100 * 1e9,
gasMultiplier: 2,
timeout: 2000000,
},
local: {
url: 'http://127.0.0.1:8545',
},
kovan: {
url: 'https://kovan-eth.compound.finance',
accounts: getAccounts('kovan'),
gasPrice: 1e9,
gasMultiplier: 2,
},
rinkeby: {
url: 'https://eth-rinkeby.alchemyapi.io/v2/W9wVuXYDjzn70tRBiHtDey4oKOMezvs-',
accounts: getAccounts('rinkeby'),
gasPrice: 1e9,
gasMultiplier: 2,
},
coverage: {
url: 'http://127.0.0.1:8555',
},
},
paths: {
artifacts: './artifacts',
cache: './cache',
coverage: './coverage',
coverageJson: './coverage.metadata',
root: './',
sources: process.env.SOURCES ? './' + process.env.SOURCES : './contracts',
tests: './test',
},
solidity: {
settings: {
optimizer: {
enabled: !!process.env.ETHERSCAN_KEY || process.env.COMPILE_TARGET === 'release',
runs: 200,
},
},
version: '0.6.12',
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
etherscan: {
apiKey: process.env.ETHERSCAN_KEY
}
};
module.exports = config;