-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
177 lines (176 loc) · 5.15 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
require('dotenv').config()
import "@nomiclabs/hardhat-ethers"
import "@nomiclabs/hardhat-waffle"
import "@nomiclabs/hardhat-etherscan"
import "hardhat-gas-reporter"
import "hardhat-abi-exporter"
import "hardhat-preprocessor"
import "@typechain/hardhat"
import { transformConstants } from "./scripts/preprocessor/subtasks"
import "./scripts/preprocessor/subtasks/conditional"
export default {
preprocess: {
eachLine: transformConstants()
},
defaultNetwork: process.env.DEFAULT_NETWORK,
gasReporter: {
showTimeSpent: true,
currency: 'USD',
},
networks: {
test: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "http://127.0.0.1:8545",
gas: 5000000,
},
ganache: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "http://127.0.0.1:8545",
gas: 5000000,
},
polygon: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://polygon-mainnet.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
'polygon-mumbai': {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://polygon-mumbai.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
optimism: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://optimism-mainnet.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
'optimism-goerli': {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://optimism-goerli.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
'arbitrum': {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
// url: 'https://arb1.arbitrum.io/rpc',
url: "https://arbitrum-mainnet.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
'arbitrum-goerli': {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
// url: 'https://goerli-rollup.arbitrum.io/rpc',
url: "https://arbitrum-goerli.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
goerli: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://goerli.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
sepolia: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://sepolia.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
ropsten: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://ropsten.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
kovan: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://kovan.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
rinkeby: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://rinkeby.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
mainnet: {
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
timeout: 60 * 30 * 1000,
url: "https://mainnet.infura.io/v3/" + (process.env.INFURA_API_KEY),
gas: 5000000,
},
},
solidity: {
compilers: [
{
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 200
},
},
},
],
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
artifacts: './build/artifacts',
},
abiExporter: {
path: './build/abi',
clear: true,
flat: true,
spacing: 2,
},
typechain: {
outDir: './build/types',
target: 'ethers-v5',
},
etherscan: {
apiKey: {
mainnet: '[API KEY]',
goerli: '[API KEY]',
sepolia: '[API KEY]',
arbitrum: '[API KEY]',
'arbitrum-goerli': '[API KEY]',
polygon: '[API KEY]',
polygonMumbai: '[API KEY]',
optimisticEthereum: '[API KEY]',
'optimism-goerli': '[API KEY]',
},
customChains: [
{
network: "arbitrum",
chainId: 42161,
urls: {
apiURL: "https://api.arbiscan.io/api",
browserURL: "https://arbiscan.io"
}
},
{
network: "arbitrum-goerli",
chainId: 421613,
urls: {
apiURL: "https://api-goerli.arbiscan.io/api",
browserURL: "https://goerli.arbiscan.io"
}
},
{
network: "optimism-goerli",
chainId: 420,
urls: {
apiURL: "https://api-goerli-optimism.etherscan.io/api",
browserURL: "https://goerli-optimism.etherscan.io/",
},
},
]
}
}