-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
127 lines (122 loc) · 3.46 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
import * as dotenv from "dotenv";
import { HardhatUserConfig, task } from "hardhat/config";
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "hardhat-spdx-license-identifier";
import "solidity-coverage";
import "hardhat-deploy";
import "hardhat-dependency-compiler";
import "./tasks";
dotenv.config();
const networkConfig = (
url: string | null | undefined,
verifyUrl?: string,
verifyKey?: string
) => ({
url: url || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
verify: {
etherscan: {
apiUrl: verifyUrl ?? "",
apiKey: verifyKey ?? "",
},
},
});
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.21",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: "paris",
},
},
],
},
namedAccounts: {
deployer: {
default: 0,
},
},
networks: {
hardhat: {
forking: process.env.FORKING_RPC_URL
? {
url: process.env.FORKING_RPC_URL,
blockNumber: 14791509,
}
: undefined,
},
opGoerli: networkConfig(
"https://goerli.optimism.io",
undefined,
process.env.OPTISCAN_API_KEY
),
baseGoerli: networkConfig(
"https://goerli.base.org",
"https://api-goerli.basescan.org",
process.env.BASESCAN_API_KEY!
),
zoraGoerli: networkConfig(
"https://zora-testnet.rpc.thirdweb.com",
process.env.ZORASCAN_API_KEY
),
modeSepolia: networkConfig(
"https://mode-testnet.rpc.thirdweb.com",
process.env.MODESCAN_API_KEY
),
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
currency: "USD",
},
spdxLicenseIdentifier: {
overwrite: true,
runOnCompile: true,
},
etherscan: {
customChains: [
{
network: "opGoerli",
chainId: 420,
urls: {
apiURL: "https://goerli-explorer.optimism.io/api",
browserURL: "https://goerli-explorer.optimism.io/",
},
},
{
network: "baseGoerli",
chainId: 84531,
urls: {
apiURL: "https://api-goerli.basescan.org/api",
browserURL: "https://goerli.basescan.org/",
},
},
{
network: "zoraGoerli",
chainId: 999,
urls: {
apiURL: "https://testnet.explorer.zora.energy/api",
browserURL: "https://testnet.explorer.zora.energy/",
},
},
{
network: "modeSepolia",
chainId: 919,
urls: {
apiURL: "https://sepolia.explorer.mode.network/api",
browserURL: "https://sepolia.explorer.mode.network/",
},
},
],
},
};
export default config;