-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
72 lines (64 loc) · 1.55 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
import { config as dotenvConfig } from 'dotenv'
dotenvConfig()
import 'hardhat-gas-reporter'
import '@typechain/hardhat'
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-etherscan'
import 'hardhat-deploy'
import 'solidity-coverage'
import { NetworksUserConfig, HardhatUserConfig } from 'hardhat/types'
const INFURA_API_KEY = process.env.INFURA_API_KEY
const PRIVATE_KEY = process.env.PRIVATE_KEY || ''
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
const REPORT_GAS = Boolean(process.env.REPORT_GAS)
const networks: NetworksUserConfig = {
hardhat: {},
localhost: {},
coverage: {
url: 'http://127.0.0.1:8555', // Coverage launches its own ganache-cli client
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
},
mainnet: {
url: `https://mainnet.infura.io/v3/${INFURA_API_KEY}`,
accounts: [PRIVATE_KEY],
},
matic: {
url: `https://rpc-mainnet.matic.quiknode.pro`,
accounts: [PRIVATE_KEY],
},
bsc: {
url: `https://bsc-dataseed1.ninicoin.io/`,
accounts: [PRIVATE_KEY],
},
}
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
gasReporter: {
currency: 'EUR',
enabled: REPORT_GAS,
showTimeSpent: true,
},
networks,
}
if (ETHERSCAN_API_KEY) {
config.etherscan = {
apiKey: ETHERSCAN_API_KEY,
}
}
export default config