-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
224 lines (210 loc) · 7.22 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
import * as dotenvenc from "@chainlink/env-enc";
dotenvenc.config();
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "./tasks";
import "@openzeppelin/hardhat-upgrades";
import "@nomicfoundation/hardhat-verify";
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const ETHEREUM_MAINNET_RPC_URL = process.env.ETHEREUM_MAINNET_RPC_URL;
const POLYGON_MAINNET_RPC_URL = process.env.POLYGON_MAINNET_RPC_URL;
const AVALANCHE_C_CHAIN_RPC_URL = process.env.AVALANCHE_C_CHAIN_RPC_URL;
const GNOSIS_MAINNET_RPC_URL = process.env.GNOSIS_MAINNET_RPC_URL;
const ETHEREUM_SEPOLIA_RPC_URL = process.env.ETHEREUM_SEPOLIA_RPC_URL;
const OPTIMISM_SEPOLIA_RPC_URL = process.env.OPTIMISM_SEPOLIA_RPC_URL;
const ARBITRUM_SEPOLIA_RPC_URL = process.env.ARBITRUM_SEPOLIA_RPC_URL;
const AVALANCHE_FUJI_RPC_URL = process.env.AVALANCHE_FUJI_RPC_URL;
const POLYGON_AMOY_RPC_URL = process.env.POLYGON_AMOY_RPC_URL;
const BNB_CHAIN_TESTNET_RPC_URL = process.env.BNB_CHAIN_TESTNET_RPC_URL;
const BASE_SEPOLIA_RPC_URL = process.env.BASE_SEPOLIA_RPC_URL;
const KROMA_SEPOLIA_RPC_URL = process.env.KROMA_SEPOLIA_RPC_URL;
const WEMIX_TESTNET_RPC_URL = process.env.WEMIX_TESTNET_RPC_URL;
const GNOSIS_CHIADO_RPC_URL = process.env.GNOSIS_CHIADO_RPC_URL;
const CELO_ALFAJORES_RPC_URL = process.env.CELO_ALFAJORES_RPC_URL;
const METIS_SEPOLIA_RPC_URL = process.env.METIS_SEPOLIA_RPC_URL;
const ZKSYNC_SEPOLIA_RPC_URL = process.env.ZKSYNC_SEPOLIA_RPC_URL;
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY
const config: HardhatUserConfig = {
solidity: "0.8.23",
networks: {
hardhat: {
chainId: 31337,
mining: {
auto: true,
interval: 1
}
},
localhost: {
url: 'http://localhost:8545',
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
},
mainnet: {
url:
ETHEREUM_MAINNET_RPC_URL !== undefined ? ETHEREUM_MAINNET_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 1,
},
polygon: {
url:
POLYGON_MAINNET_RPC_URL !== undefined ? POLYGON_MAINNET_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 137
},
avalanche: {
url:
AVALANCHE_C_CHAIN_RPC_URL !== undefined ? AVALANCHE_C_CHAIN_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 43114
},
gnosis: {
url:
GNOSIS_MAINNET_RPC_URL !== undefined ? GNOSIS_MAINNET_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 100
},
ethereumSepolia: {
url:
ETHEREUM_SEPOLIA_RPC_URL !== undefined ? ETHEREUM_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 11155111,
},
polygonAmoy: {
url: POLYGON_AMOY_RPC_URL !== undefined ? POLYGON_AMOY_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 80002,
},
optimismSepolia: {
url:
OPTIMISM_SEPOLIA_RPC_URL !== undefined ? OPTIMISM_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 11155420,
},
arbitrumSepolia: {
url:
ARBITRUM_SEPOLIA_RPC_URL !== undefined ? ARBITRUM_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 421614,
},
avalancheFuji: {
url: AVALANCHE_FUJI_RPC_URL !== undefined ? AVALANCHE_FUJI_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 43113,
},
bnbChainTestnet: {
url:
BNB_CHAIN_TESTNET_RPC_URL !== undefined
? BNB_CHAIN_TESTNET_RPC_URL
: "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 97,
},
baseSepolia: {
url: BASE_SEPOLIA_RPC_URL !== undefined ? BASE_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 84532,
},
kromaSepolia: {
url: KROMA_SEPOLIA_RPC_URL !== undefined ? KROMA_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 2358,
},
wemixTestnet: {
url: WEMIX_TESTNET_RPC_URL !== undefined ? WEMIX_TESTNET_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 1112,
},
gnosisChiado: {
url: GNOSIS_CHIADO_RPC_URL !== undefined ? GNOSIS_CHIADO_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 10200,
},
celoAlfajores: {
url: CELO_ALFAJORES_RPC_URL !== undefined ? CELO_ALFAJORES_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 44787,
},
metisSepolia: {
url: METIS_SEPOLIA_RPC_URL !== undefined ? METIS_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 59902,
},
zksyncSepolia: {
url: ZKSYNC_SEPOLIA_RPC_URL !== undefined ? ZKSYNC_SEPOLIA_RPC_URL : "",
accounts: PRIVATE_KEY !== undefined ? [PRIVATE_KEY] : [],
chainId: 300,
},
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY || "",
goerli: process.env.ETHERSCAN_API_KEY || "",
xdai: process.env.GNOSISSCAN_API_KEY || "",
sepolia: process.env.ETHERSCAN_API_KEY || "",
arbSepolia: process.env.ARBSCAN_API_KEY || "",
polygon: process.env.POLYGONSCAN_API_KEY || "",
polygonMumbai: process.env.POLYGONSCAN_API_KEY || "",
polygonAmoy: process.env.POLYGONSCAN_API_KEY || "",
baseSepolia: process.env.BASESCAN_API_KEY || "",
bartio: 'bartio',
liskSepolia: 'liskSepolia',
etherlinkTestnet: 'etherlinkTestnet',
avalanche: "snowtrace"
},
customChains: [
{
network: "avalanche",
chainId: 43114,
urls: {
apiURL: "https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan",
browserURL: "https://avalanche.routescan.io"
}
},
{
network: "arbSepolia",
chainId: 421614,
urls: {
apiURL: "https://api-sepolia.arbiscan.io/api",
browserURL: "https://sepolia.arbiscan.io/"
}
},
{
network: "polygonAmoy",
chainId: 80002,
urls: {
apiURL: "https://api-amoy.polygonscan.com/api",
browserURL: "https://amoy.polygonscan.com/"
},
},
{
network: "bartio",
chainId: 80084,
urls: {
apiURL: "https://api.routescan.io/v2/network/testnet/evm/80084/etherscan",
browserURL: "https://routescan.io"
}
}, {
network: "liskSepolia",
chainId: 4202,
urls: {
apiURL: "https://sepolia-blockscout.lisk.com/api",
browserURL: "https://sepolia-blockscout.lisk.com/",
}
}, {
network: "etherlinkTestnet",
chainId: 128123,
urls: {
apiURL: "https://testnet.explorer.etherlink.com/api",
browserURL: "https://testnet.explorer.etherlink.com/",
}
}
]
},
};
export default config;