-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
116 lines (110 loc) · 3.08 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
//import * as dotenv from "dotenv";
//dotenv.config();
import { HardhatUserConfig, vars } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "hardhat-switch-network";
// If not set, it uses ours Alchemy's default API key.
// You can get your own at https://dashboard.alchemyapi.io
const alchemyProviderApiKey = vars.get("ALCHEMY_API_KEY")
// If not set, it uses the hardhat account 0 private key.
const deployerPrivateKey = vars.get("DEPLOYER_PRIVATE_KEY")
// If not set, it uses ours Etherscan default API key.
const etherscanApiKey = vars.get("ETHERSCAN_KEY");
const scrollscanApiKey = vars.get("SCROLLSCAN_KEY")
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.7.6"
},
{
version: "0.8.23",
settings: {
evmVersion: "shanghai",
optimizer: {
enabled: true,
// https://docs.soliditylang.org/en/latest/using-the-compiler.html#optimizer-options
runs: 200,
},
},
}
],
},
defaultNetwork: "localhost",
networks: {
// View the networks that are pre-configured.
// If the network you are looking for is not here you can add new network settings
hardhat: {
forking: {
url: `https://eth-mainnet.alchemyapi.io/v2/${alchemyProviderApiKey}`,
enabled: process.env.MAINNET_FORKING_ENABLED === "true",
},
},
mainnet: {
url: `https://eth-mainnet.alchemyapi.io/v2/${alchemyProviderApiKey}`,
accounts: [deployerPrivateKey],
},
sepolia: {
url: `https://eth-sepolia.g.alchemy.com/v2/${alchemyProviderApiKey}`,
accounts: [deployerPrivateKey],
},
l1sload: {
url: `https://l1sload-rpc.scroll.io`,
accounts: [deployerPrivateKey],
chainId: 2227728,
},
scrollSepolia: {
url: "https://sepolia-rpc.scroll.io",
accounts: [deployerPrivateKey],
chainId: 534351
},
scroll: {
url: "https://rpc.scroll.io",
accounts: [deployerPrivateKey],
},
},
// configuration for harhdat-verify plugin
etherscan: {
apiKey: {
l1sload: "abc",
sepolia: etherscanApiKey,
scrollSepolia: scrollscanApiKey,
},
customChains: [
{
network: "l1sload",
chainId: 2227728,
urls: {
apiURL: "https://l1sload-blockscout.scroll.io/api",
browserURL: "https://l1sload-blockscout.scroll.io",
}
},
{
network: "sepolia",
chainId: 11155111,
urls: {
apiURL: "https://api-sepolia.etherscan.io/api",
browserURL: "https://sepolia.etherscan.io/",
}
},
{
network: 'scrollSepolia',
chainId: 534351,
urls: {
apiURL: 'https://api-sepolia.scrollscan.com/api',
browserURL: 'https://sepolia.scrollscan.com/',
},
}
]
},
// configuration for etherscan-verify from hardhat-deploy plugin
// verify: {
// etherscan: {
// apiKey: `${etherscanApiKey}`,
// },
// },
// sourcify: {
// enabled: false,
// },
};
export default config;