-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
189 lines (171 loc) · 4.52 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
import { HardhatUserConfig } from "hardhat/config";
// PLUGINS
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "hardhat-deploy";
// ================================= TASKS =========================================
// ❗COMMENT IN to use || COMMENT OUT before git push to have CI work
import "./hardhat/tasks";
// Process Env Variables
import * as dotenv from "dotenv";
dotenv.config({ path: __dirname + "/.env" });
const ALCHEMY_ID = process.env.ALCHEMY_ID;
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY;
const RELAY_DEPLOYER_PK = process.env.RELAY_DEPLOYER_PK;
const RELAY_ERC2771_DEPLOYER_PK = process.env.RELAY_ERC2771_DEPLOYER_PK;
const DEV_RELAY_DEPLOYER_PK = process.env.DEV_RELAY_DEPLOYER_PK;
const DEV_RELAY_ERC2771_DEPLOYER_PK = process.env.DEV_RELAY_ERC2771_DEPLOYER_PK;
let accounts: string[] = [];
if (RELAY_DEPLOYER_PK && RELAY_ERC2771_DEPLOYER_PK) {
accounts = [RELAY_DEPLOYER_PK, RELAY_ERC2771_DEPLOYER_PK];
} else if (RELAY_DEPLOYER_PK) {
accounts = [RELAY_DEPLOYER_PK];
} else if (RELAY_ERC2771_DEPLOYER_PK) {
accounts = [RELAY_ERC2771_DEPLOYER_PK];
}
let devAccounts: string[] = [];
if (DEV_RELAY_DEPLOYER_PK && DEV_RELAY_ERC2771_DEPLOYER_PK) {
devAccounts = [DEV_RELAY_DEPLOYER_PK, DEV_RELAY_ERC2771_DEPLOYER_PK];
} else if (DEV_RELAY_DEPLOYER_PK) {
devAccounts = [DEV_RELAY_DEPLOYER_PK];
} else if (DEV_RELAY_ERC2771_DEPLOYER_PK) {
devAccounts = [DEV_RELAY_ERC2771_DEPLOYER_PK];
}
const config: HardhatUserConfig = {
defaultNetwork: "hardhat",
// hardhat-deploy
namedAccounts: {
deployer: {
default: 0,
},
relayDeployer: {
default: "0xd1Ac051Dc0E1366502eF3Fe4D754fbeC6986a177",
},
relayERC2771Deployer: {
default: "0xa4342E17DC5f5Ad441258F11cc2871D84a26FBfe",
},
devRelayDeployer: {
default: "0x1100555739378dEe764377bbc091ceae1a3574F1",
},
devRelayERC2771Deployer: {
default: "0x6Cc27Ae5440d8016A36350fbaDA0Ed209Ad89822",
},
},
networks: {
hardhat: {
forking: {
url: `https://api.avax-test.network/ext/bc/C/rpc`,
blockNumber: 16875970,
},
},
// Prod
arbitrum: {
accounts,
chainId: 42161,
url: `https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_ID}`,
},
avalanche: {
accounts,
url: "https://api.avax.network/ext/bc/C/rpc",
chainId: 43114,
},
bnb: {
accounts,
chainId: 56,
url: "https://bsc-dataseed1.ninicoin.io/",
},
ethereum: {
accounts,
chainId: 1,
url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_ID}`,
},
gnosis: {
accounts,
chainId: 100,
url: `https://rpc.gnosischain.com/`,
},
moonbeam: {
accounts,
url: "https://moonbeam.api.onfinality.io/public",
chainId: 1284,
},
moonriver: {
accounts,
url: "https://moonriver-rpc.dwellir.com",
chainId: 1285,
},
optimism: {
accounts,
url: `https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_ID}`,
chainId: 10,
},
polygon: {
accounts,
chainId: 137,
url: `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_ID}`,
},
// Staging
arbitrumGoerli: {
accounts,
chainId: 421613,
url: `https://arb-goerli.g.alchemy.com/v2/${ALCHEMY_ID}`,
},
baseGoerli: {
accounts,
chainId: 84531,
url: `${process.env.BASE_GOERLI_URL}`,
},
fuji: {
url: "https://api.avax-test.network/ext/bc/C/rpc",
chainId: 43113,
accounts,
},
goerli: {
accounts,
chainId: 5,
url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_ID}`,
},
mumbai: {
accounts,
chainId: 80001,
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_ID}`,
},
optimismGoerli: {
accounts,
url: `https://opt-goerli.g.alchemy.com/v2/${ALCHEMY_ID}`,
chainId: 420,
},
// Dev
baseGoerliDev: {
accounts: devAccounts,
chainId: 84531,
url: `${process.env.BASE_GOERLI_URL}`,
},
mumbaiDev: {
accounts: devAccounts,
chainId: 80001,
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_ID}`,
},
},
verify: {
etherscan: {
apiKey: ETHERSCAN_API_KEY ? ETHERSCAN_API_KEY : "",
},
},
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
optimizer: { enabled: true, runs: 999999 },
},
},
],
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
};
export default config;