-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
143 lines (139 loc) · 3.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
import '@typechain/hardhat'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle'
import '@openzeppelin/hardhat-upgrades'
import '@nomiclabs/hardhat-etherscan'
import '@nomiclabs/hardhat-solhint'
import 'hardhat-gas-reporter'
import 'solidity-coverage'
import { resolve } from 'path'
import { config as dotenvConfig } from 'dotenv'
dotenvConfig({ path: resolve(__dirname, './.env') })
const accounts = process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : []
export default {
defaultNetwork: 'hardhat',
networks: {
localhost: {
url: 'http://127.0.0.1:8545',
},
hardhat: {
allowUnlimitedContractSize: false,
hardfork: 'berlin', // Berlin is used (temporarily) to avoid issues with coverage
mining: {
auto: true,
interval: 50000,
},
gasPrice: 'auto',
},
bsc_mainnet: {
url: 'https://bsc-dataseed.binance.org/',
chainId: 56,
accounts: accounts,
},
bsc_testnet: {
url: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
chainId: 97,
accounts: accounts,
},
avalanche_mainnet: {
url: 'https://api.avax.network/ext/bc/C/rpc',
chainId: 43114,
accounts: accounts,
},
avalanche_testnet: {
url: 'https://api.avax-test.network/ext/bc/C/rpc',
chainId: 43113,
accounts: accounts,
},
fantom_mainnet: {
url: 'https://rpc.ftm.tools/',
chainId: 250,
accounts: accounts,
},
fantom_testnet: {
url: 'https://rpc.testnet.fantom.network/',
chainId: 4002,
accounts: accounts,
},
polygon_mainnet: {
url: 'https://polygon-rpc.com/',
chainId: 137,
accounts: accounts,
},
polygon_testnet: {
url: 'https://matic-mumbai.chainstacklabs.com/',
chainId: 80001,
accounts: accounts,
},
arbitrum_mainnet: {
url: 'https://arb1.arbitrum.io/rpc/',
chainId: 42161,
accounts: accounts,
},
arbitrum_testnet: {
url: 'https://rinkeby.arbitrum.io/rpc/',
chainId: 421611,
accounts: accounts,
},
optimism_mainnet: {
url: 'https://mainnet.optimism.io/',
chainId: 10,
accounts: accounts,
},
optimism_testnet: {
url: 'https://goerli.optimism.io/',
chainId: 420,
accounts: accounts,
},
},
solidity: {
version: '0.6.12',
settings: {
evmVersion: 'istanbul',
optimizer: {
enabled: true,
runs: 200,
},
},
},
paths: {
sources: './contracts',
excludeContracts: ['./contracts/deprecated/*.sol'],
tests: './test',
cache: './cache',
artifacts: './artifacts',
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_KEY,
// binance smart chain
bsc: process.env.BSCSCAN_KEY,
bscTestnet: process.env.BSCSCAN_KEY,
// avalanche
avalanche: process.env.SNOWTRACE_KEY,
avalancheFujiTestnet: process.env.SNOWTRACE_KEY,
// fantom mainnet
opera: process.env.FTMSCAN_KEY,
ftmTestnet: process.env.FTMSCAN_KEY,
// polygon
polygon: process.env.POLYGONSCAN_KEY,
polygonMumbai: process.env.POLYGONSCAN_KEY,
// arbitrum
arbitrumOne: process.env.ARBISCAN_KEY,
arbitrumTestnet: process.env.ARBISCAN_KEY,
// optimistic
optimisticEthereum: process.env.OPTIMISTIC_ETHERSCAN_KEY,
},
},
mocha: {
timeout: 20000,
},
gasReporter: {
currency: 'ETH',
enabled: true,
},
}