This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
162 lines (144 loc) · 3.99 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
import { HardhatUserConfig } from "hardhat/config";
// PLUGINS
import "@gelatonetwork/web3-functions-sdk/hardhat-plugin";
import "@typechain/hardhat";
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "@nomicfoundation/hardhat-foundry";
import "hardhat-deploy";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync-verify";
// ================================= TASKS =========================================
// Process Env Variables
import * as dotenv from "dotenv";
dotenv.config({ path: __dirname + "/.env" });
// Libraries
import assert from "assert";
// Process Env Variables
const ALCHEMY_ID = process.env.ALCHEMY_ID;
assert.ok(ALCHEMY_ID, "no Alchemy ID in process.env");
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const ETHERSCAN_KEY = process.env.ETHERSCAN_KEY;
const BASE_RPC = process.env.BASE_RPC;
assert.ok(BASE_RPC, "no Base RPC url in process.env");
const OPTIMISM_RPC = process.env.OPTIMISM_RPC;
assert.ok(OPTIMISM_RPC, "no Optimism RPC url in process.env");
const BLOCK_NUMBER = Number(process.env.KEEPER_TEST_BLOCK);
assert.ok(BLOCK_NUMBER, "no Block Number set in process.env");
// ================================= CONFIG =========================================
const config: HardhatUserConfig = {
w3f: {
rootDir: "./web3-functions",
debug: false,
networks: ["mumbai", "goerli", "baseGoerli"], //(multiChainProvider) injects provider for these networks
},
namedAccounts: {
deployer: {
default: 0,
},
},
defaultNetwork: "hardhat",
paths: {
sources: "./lib/relay-private/src/",
},
mocha: {
timeout: 100000000,
},
networks: {
hardhat: {
forking: {
url: OPTIMISM_RPC,
blockNumber: BLOCK_NUMBER,
},
},
// Prod
avalanche: {
url: "https://api.avax.network/ext/bc/C/rpc",
chainId: 43114,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
arbitrum: {
chainId: 42161,
url: "https://arb1.arbitrum.io/rpc",
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
base: {
chainId: 8453,
url: BASE_RPC,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
baseGoerli: {
chainId: 84531,
url: "https://goerli.base.org",
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
bsc: {
chainId: 56,
url: "https://bsc-dataseed.binance.org/",
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
ethereum: {
chainId: 1,
url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_ID}`,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
fantom: {
chainId: 250,
url: `https://rpcapi.fantom.network/`,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
optimism: {
chainId: 10,
url: "https://mainnet.optimism.io",
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
polygon: {
chainId: 137,
url: "https://rpc-mainnet.maticvigil.com",
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
zksync: {
zksync: true,
url: "https://mainnet.era.zksync.io",
chainId: 324,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
verifyURL:
"https://zksync2-mainnet-explorer.zksync.io/contract_verification",
},
// Staging
arbgoerli: {
chainId: 421613,
url: `https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_ID}`,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
goerli: {
chainId: 5,
url: `https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_ID}`,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
mumbai: {
chainId: 80001,
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_ID}`,
accounts: PRIVATE_KEY ? [PRIVATE_KEY] : [],
},
},
verify: {
etherscan: {
apiKey: ETHERSCAN_KEY ? ETHERSCAN_KEY : "",
},
},
solidity: {
version: "0.8.19",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
};
export default config;