-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
57 lines (53 loc) · 1.38 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
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-etherscan");
require("hardhat-gas-reporter");
require("solidity-coverage");
require('dotenv').config()
let mnemonic = process.env.MNEMONIC;
const infuraNetwork = (network, chainId, gas) => {
return {
url: `https://${network}.infura.io/v3/${process.env.PROJECT_ID}`,
chainId,
gas,
accounts: mnemonic ? { mnemonic } : undefined
};
};
module.exports = {
solidity: {
version: "0.8.0",
settings: {
optimizer: {
runs: 999999,
enabled: true
}
}
},
networks: {
hardhat: mnemonic ? { accounts: { mnemonic } } : {},
local: {
url: "http://localhost:8545",
accounts: mnemonic ? { mnemonic } : undefined
},
rinkeby: infuraNetwork("rinkeby", 4, 6283185),
kovan: infuraNetwork("kovan", 42, 6283185),
goerli: infuraNetwork("goerli", 5, 6283185),
mumbai: {
url: "https://rpc-mumbai.matic.today",
chainId: 80001,
accounts: mnemonic ? { mnemonic } : undefined
},
bsc_testnet: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545",
chainId: 97,
accounts: mnemonic ? { mnemonic } : undefined
}
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY ? process.env.ETHERSCAN_API_KEY : undefined
},
gasReporter: {
currency: 'USD',
gasPrice: 1,
coinmarketcap: process.env.CMC_APIKEY
}
};