-
Notifications
You must be signed in to change notification settings - Fork 19
/
hardhat.config.ts
116 lines (109 loc) · 2.64 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
import '@nomiclabs/hardhat-waffle'
import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-solhint'
import '@nomiclabs/hardhat-etherscan'
import '@typechain/hardhat'
import '@openzeppelin/hardhat-upgrades'
import 'solidity-coverage'
import 'hardhat-deploy'
import 'hardhat-gas-reporter'
import 'hardhat-docgen'
import '@hardhat-docgen/core'
import '@hardhat-docgen/markdown'
import 'hardhat-contract-sizer'
import { HardhatUserConfig } from 'hardhat/config'
import dotenv from 'dotenv'
dotenv.config()
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
mainnet: {
url: process.env.ALCHEMY_API || '',
gasPrice: 140 * 1000000000,
},
fuji: {
url: 'https://api.avax-test.network/ext/bc/C/rpc',
gas: 5000000,
gasPrice: 180 * 1000000000,
chainId: 43113,
},
ava_mainnet: {
url: 'https://api.avax.network/ext/bc/C/rpc',
gasPrice: 80 * 1000000000,
chainId: 43114,
},
bsc_mainnet: {
url: 'https://bsc-dataseed.binance.org/',
chainId: 56,
gasPrice: 5000000000,
},
},
solidity: {
compilers: [
{
version: '0.8.9',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
typechain: {
outDir: './build/typechain/',
target: 'ethers-v5',
},
mocha: {
timeout: 200000,
},
namedAccounts: {
deployer: {
default: 0,
},
},
docgen: {
path: './docs',
clear: true,
runOnCompile: false,
except: ['/test/*', '/mock/*', '/hardhat-proxy/*'],
},
etherscan: {
// API key for snowtrace.io
apiKey: process.env.ETHERSCAN_API_KEY,
},
}
if (process.env.ACCOUNT_PRIVATE_KEYS) {
config.networks = {
...config.networks,
mainnet: {
...config.networks?.mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
fuji: {
...config.networks?.fuji,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
ava_mainnet: {
...config.networks?.ava_mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
bsc_mainnet: {
...config.networks?.bsc_mainnet,
accounts: JSON.parse(process.env.ACCOUNT_PRIVATE_KEYS),
},
}
}
if (process.env.FORK_MAINNET && config.networks) {
config.networks.hardhat = {
forking: {
url: process.env.ALCHEMY_API ? process.env.ALCHEMY_API : '',
},
chainId: 1,
}
}
config.gasReporter = {
enabled: process.env.REPORT_GAS ? true : false,
}
export default config