-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhardhat.config.ts
178 lines (171 loc) · 4.78 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
import "@gelatonetwork/web3-functions-sdk/hardhat-plugin";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-ethers";
import "@nomicfoundation/hardhat-toolbox";
import "@openzeppelin/hardhat-upgrades";
import "@typechain/hardhat";
import "hardhat-abi-exporter";
import "hardhat-dependency-compiler";
import "hardhat-deploy";
import "hardhat-tracer";
import "solidity-coverage";
import "solidity-docgen";
import { HardhatUserConfig } from "hardhat/config";
import { keccak256 } from "ethers";
import { loadTasks } from "./scripts/utils";
import dotenv from "dotenv";
dotenv.config();
// const defaultAccount = {
// mnemonic:
// process.env.SEED_PHRASE ||
// "test test test test test test test test test test test junk",
// path: "m/44'/60'/0'/0",
// initialIndex: 0,
// count: 20,
// passphrase: "",
// };
const defaultAccount = [
process.env.DEPLOYER_KEY || keccak256("0x1212"),
process.env.ZAI_DEPLOYER_KEY || keccak256("0x1234"),
process.env.SZAI_DEPLOYER_KEY || keccak256("0x1233"),
];
const SKIP_LOAD = process.env.SKIP_LOAD === "true";
// Prevent to load tasks before compilation and typechain
if (!SKIP_LOAD) loadTasks(["misc", "layerzero"]);
const _network = (url: string, gasPrice: number | "auto" = "auto") => ({
url,
accounts: defaultAccount,
saveDeployments: true,
gasPrice,
});
const config: HardhatUserConfig = {
w3f: {
rootDir: "./web3-functions",
debug: false,
networks: ["linea", "base", "mainnet"], // (multiChainProvider) injects provider for these networks
},
abiExporter: {
path: "./abi",
runOnCompile: true,
clear: true,
spacing: 2,
format: "minimal",
},
docgen: {
pages: "files",
exclude: ["interfaces", "tests"],
},
gasReporter: {
// @ts-ignore
reportFormat: "terminal",
outputFile: "coverage/gasReport.txt",
noColors: true,
forceTerminalOutput: true,
forceTerminalOutputFormat: "terminal",
},
dependencyCompiler: {
paths: [
"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol",
],
},
typechain: {
outDir: "types",
target: "ethers-v6",
},
solidity: {
version: "0.8.21",
settings: {
optimizer: {
enabled: true,
runs: 1000,
},
},
},
networks: {
hardhat: {
// forking: {
// url: `https://rpc.ankr.com/eth`,
// },
accounts: defaultAccount.map((pk) => ({
balance: "1000000000000000000000000",
privateKey: pk,
})),
},
arbitrum: _network("https://arb1.arbitrum.io/rpc"),
base: _network("https://mainnet.base.org"),
bsc: _network("https://bsc-dataseed1.bnbchain.org"),
blast: _network("https://rpc.blast.io"),
linea: _network("https://rpc.linea.build"),
sonic: _network("https://rpc.soniclabs.com"),
mainnet: _network("https://rpc.ankr.com/eth"),
zircuit: _network("https://zircuit-mainnet.drpc.org"),
optimism: _network("https://mainnet.optimism.io"),
scroll: _network("https://rpc.ankr.com/scroll", 1100000000),
sepolia: _network("https://rpc2.sepolia.org"),
xlayer: _network("https://xlayerrpc.okx.com"),
},
namedAccounts: {
deployer: 0,
zaiDeployer: 1,
szaiDeployer: 2,
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_KEY || "",
sepolia: process.env.ETHERSCAN_KEY || "",
base: process.env.BASESCAN_KEY || "",
blast: process.env.BLASTSCAN_KEY || "",
bsc: process.env.BSCSCAN_KEY || "",
linea: process.env.LINEASCAN_KEY || "",
optimisticEthereum: process.env.OP_ETHERSCAN_KEY || "",
scroll: process.env.SCROLLSCAN_KEY || "",
sonic: process.env.SONICSCAN_KEY || "",
arbitrumOne: process.env.ARBISCAN_KEY || "",
xlayer: "test",
},
customChains: [
{
network: "xlayer",
chainId: 196,
urls: {
apiURL:
"https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/XLAYER",
browserURL: "https://www.oklink.com/xlayer",
},
},
{
network: "sonic",
chainId: 146,
urls: {
apiURL: "https://api.sonicscan.org/api",
browserURL: "https://sonicscan.org",
},
},
{
network: "linea",
chainId: 59144,
urls: {
apiURL: "https://api.lineascan.build/api",
browserURL: "https://lineascan.build",
},
},
{
network: "blast",
chainId: 81457,
urls: {
apiURL: "https://api.blastscan.io/api",
browserURL: "https://blastscan.io",
},
},
{
network: "scroll",
chainId: 534352,
urls: {
apiURL: "https://api.scrollscan.com/api",
browserURL: "https://scrollscan.com",
},
},
],
},
};
export default config;