-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
98 lines (93 loc) · 2.83 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
require("@nomiclabs/hardhat-truffle5");
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-etherscan");
require("solidity-coverage");
require("hardhat-gas-reporter");
const accounts = require("./hardhatAccountsList2k.js");
const accountsList = accounts.accountsList
const fs = require('fs')
const getSecret = (secretKey, defaultValue='') => {
const SECRETS_FILE = "./secrets.js"
let secret = defaultValue
if (fs.existsSync(SECRETS_FILE)) {
const { secrets } = require(SECRETS_FILE)
if (secrets[secretKey]) { secret = secrets[secretKey] }
}
return secret
}
const alchemyUrl = () => {
return `https://eth-mainnet.alchemyapi.io/v2/${getSecret('alchemyAPIKey')}`
}
const alchemyUrlRinkeby = () => {
return `https://eth-rinkeby.alchemyapi.io/v2/${getSecret('alchemyAPIKeyRinkeby')}`
}
module.exports = {
paths: {
// contracts: "./contracts",
// artifacts: "./artifacts"
},
solidity: {
compilers: [
{
version: "0.4.23",
settings: {
optimizer: {
enabled: true,
runs: 100
}
}
},
{
version: "0.5.17",
settings: {
optimizer: {
enabled: true,
runs: 100
}
}
},
{
version: "0.6.11",
settings: {
optimizer: {
enabled: true,
runs: 100
}
}
},
]
},
networks: {
hardhat: {
accounts: accountsList,
gas: 10000000, // tx gas limit
blockGasLimit: 15000000,
gasPrice: 20000000000,
initialBaseFeePerGas: 0,
},
mainnet: {
url: alchemyUrl(),
gasPrice: process.env.GAS_PRICE ? parseInt(process.env.GAS_PRICE) : 20000000000,
accounts: [
getSecret('DEPLOYER_PRIVATEKEY', '0x60ddfe7f579ab6867cbe7a2dc03853dc141d7a4ab6dbefc0dae2d2b1bd4e487f'),
getSecret('ACCOUNT2_PRIVATEKEY', '0x3ec7cedbafd0cb9ec05bf9f7ccfa1e8b42b3e3a02c75addfccbfeb328d1b383b')
]
},
rinkeby: {
url: alchemyUrlRinkeby(),
gas: 10000000, // tx gas limit
accounts: [getSecret('RINKEBY_DEPLOYER_PRIVATEKEY', '0x60ddfe7f579ab6867cbe7a2dc03853dc141d7a4ab6dbefc0dae2d2b1bd4e487f')]
},
},
etherscan: {
apiKey: getSecret("ETHERSCAN_API_KEY")
},
mocha: { timeout: 12000000 },
rpc: {
host: "localhost",
port: 8545
},
gasReporter: {
enabled: (process.env.REPORT_GAS) ? true : false
}
};