-
Notifications
You must be signed in to change notification settings - Fork 24
/
hardhat.config.ts
205 lines (197 loc) · 6.69 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
import { HardhatUserConfig, task } from "hardhat/config";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";
import "@openzeppelin/hardhat-upgrades";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-verify";
import "@nomicfoundation/hardhat-ignition-ethers";
import "@nomicfoundation/hardhat-ledger";
import dotenv from "dotenv";
dotenv.config();
const DEFAULT_MNEMONIC = "test test test test test test test test test test test junk";
const DEFAULT_ACCOUNTS: any = {
mnemonic: DEFAULT_MNEMONIC,
path: "m/44'/60'/0'/0",
initialIndex: 0,
count: 20,
};
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(await account.getAddress());
}
});
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.27",
},
],
},
networks: {
"privado-main": {
chainId: 21000,
url: `${process.env.PRIVADO_MAIN_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"privado-test": {
chainId: 21001,
url: `${process.env.PRIVADO_TEST_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"polygon-mainnet": {
chainId: 137,
url: `${process.env.POLYGON_MAINNET_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"polygon-amoy": {
chainId: 80002,
url: `${process.env.POLYGON_AMOY_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"ethereum-mainnet": {
chainId: 1,
url: `${process.env.ETHEREUM_MAINNET_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"ethereum-sepolia": {
chainId: 11155111,
url: `${process.env.ETHEREUM_SEPOLIA_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"zkevm-mainnet": {
chainId: 1101,
url: `${process.env.ZKEVM_MAINNET_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"zkevm-cardona": {
chainId: 2442,
url: `${process.env.ZKEVM_CARDONA_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"linea-mainnet": {
chainId: 59144,
url: `${process.env.LINEA_MAINNET_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
"linea-sepolia": {
chainId: 59141,
url: `${process.env.LINEA_SEPOLIA_RPC_URL}`,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
ledgerAccounts: [`${process.env.LEDGER_ACCOUNT}`],
},
// hardhat: {
// chainId: 80002,
// forking: {
// url: `${process.env.POLYGON_AMOY_RPC_URL}`,
// },
// chains: {
// 80002: {
// hardforkHistory: {
// london: 10000000,
// },
// },
// },
// accounts: [
// {
// privateKey: process.env.PRIVATE_KEY as string,
// balance: "1000000000000000000000000",
// },
// ],
// },
localhost: {
url: "http://127.0.0.1:8545",
timeout: 100000000,
// accounts: process.env.PRIVATE_KEY ? [`0x${process.env.PRIVATE_KEY}`] : DEFAULT_ACCOUNTS,
},
},
gasReporter: {
currency: "USD",
coinmarketcap: process.env.COINMARKETCAP_KEY,
enabled: !!process.env.REPORT_GAS,
token: "MATIC",
gasPriceApi: "https://api.polygonscan.com/api?module=proxy&action=eth_gasPrice", // MATIC
// gasPriceAPI: "https://api.etherscan.io/api?module=proxy&action=eth_gasPrice", // ETH
},
ignition: {
strategyConfig: {
create2: {
salt: "0x000000000000000000000000000000000000000000f4179bc3e4988a1a06f8d1", // 20 bytes: zero address; 1 byte: 00 - no cross chain protection, 11 bytes - random salt.
},
},
requiredConfirmations: 5,
},
etherscan: {
apiKey: {
"polygon-amoy": process.env.POLYGON_EXPLORER_API_KEY || "",
polygon: process.env.POLYGON_EXPLORER_API_KEY || "",
sepolia: process.env.ETHEREUM_EXPLORER_API_KEY || "",
mainnet: process.env.ETHEREUM_EXPLORER_API_KEY || "",
"linea-mainnet": process.env.LINEA_EXPLORER_API_KEY || "",
"linea-sepolia": process.env.LINEA_EXPLORER_API_KEY || "",
"zkevm-cardona": process.env.ZKEVM_EXPLORER_API_KEY || "",
"zkevm-mainnet": process.env.ZKEVM_EXPLORER_API_KEY || "",
},
customChains: [
{
network: "polygon-amoy",
chainId: 80002,
urls: {
apiURL: "https://api-amoy.polygonscan.com/api",
browserURL: "https://docs.polygonscan.com",
},
},
{
network: "linea-sepolia",
chainId: 59141,
urls: {
apiURL: "https://api-sepolia.lineascan.build/api",
browserURL: "https://docs.lineascan.build/sepolia-lineascan",
},
},
{
network: "linea-mainnet",
chainId: 59144,
urls: {
apiURL: "https://api.lineascan.build/api",
browserURL: "https://docs.lineascan.build",
},
},
{
network: "zkevm-cardona",
chainId: 2442,
urls: {
apiURL: "https://api-cardona-zkevm.polygonscan.com/api",
browserURL: "https://docs.polygonscan.com/cardona-polygon-zkevm",
},
},
{
network: "zkevm-mainnet",
chainId: 1101,
urls: {
apiURL: "https://api-zkevm.polygonscan.com/api",
browserURL: "https://docs.polygonscan.com/polygon-zkevm",
},
},
],
},
};
export default config;