-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
204 lines (197 loc) · 5.77 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
import "hardhat-diamond-abi"; // needs to be loaded before typechain
import "@nomiclabs/hardhat-ethers";
import "@nomicfoundation/hardhat-chai-matchers";
import "@nomicfoundation/hardhat-foundry";
import "@nomicfoundation/hardhat-toolbox";
import "@nomiclabs/hardhat-etherscan";
import "hardhat-gas-reporter";
import "solidity-coverage";
import "hardhat-contract-sizer";
import "hardhat-abi-exporter";
import "@typechain/hardhat";
import type { JsonFragment } from "@ethersproject/abi";
import * as dotenv from "dotenv";
import * as ethers from "ethers";
import * as fs from "fs";
import type { HardhatUserConfig } from "hardhat/config";
import { task } from "hardhat/config";
const abiSet = new Set();
dotenv.config();
task("accounts", "Prints the list of accounts", async (_, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
const config: HardhatUserConfig = {
paths: {
sources: "./src",
},
solidity: {
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
contractSizer: {
alphaSort: true,
runOnCompile: true,
disambiguatePaths: false,
strict: true,
only: [],
except: [],
},
diamondAbi: {
name: "SwitchboardPushReceiver",
strict: false,
exclude: [
"IDiamondCut",
"IDiamondLoupe",
"IERC173",
"IERC165",
"LibDiamond",
],
filter: (
abiElement: unknown,
index: number,
abi: unknown[],
fullyQualifiedName: string
) => {
const signature = ethers.utils.Fragment.fromObject(
abiElement as JsonFragment
).format();
const includes = abiSet.has(signature);
if (!includes) {
abiSet.add(signature);
}
return !includes;
},
},
abiExporter: {
path: "./abis",
runOnCompile: true,
clear: true,
flat: false,
only: [],
spacing: 2,
pretty: true,
},
networks: {
hardhat: {
initialBaseFeePerGas: 0,
chainId: 31337,
hardfork: "shanghai",
allowUnlimitedContractSize: true,
forking: {
url: process.env.ETH_MAINNET_URL || "",
// The Hardhat network will by default fork from the latest mainnet block
// To pin the block number, specify it below
// You will need access to a node with archival data for this to work!
// blockNumber: 14743877,
// If you want to do some forking, set `enabled` to true
enabled: false,
},
// zksync: true, // Enables zkSync in the Hardhat local network
},
localhost: {
url: "http://127.0.0.1:8545",
// gas: 30000000,
},
kovan: {
chainId: 42,
url: process.env.ETH_KOVAN_TESTNET_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
ropsten: {
chainId: 3,
url: process.env.ETH_ROPSTEN_TESTNET_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
goerli: {
chainId: 5,
url: process.env.ETH_GOERLI_TESTNET_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
arbitrumTestnet: {
chainId: 421613,
url:
process.env.ARBITRUM_TESTNET_URL ||
"https://goerli-rollup.arbitrum.io/rpc",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
arbitrumMainnet: {
chainId: 42161,
url: process.env.ARBITRUM_MAINNET_URL || "https://arb1.arbitrum.io/rpc",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
sepolia: {
chainId: 11155111,
url: process.env.ETH_SEPOLIA_TESTNET_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
ethMain: {
chainId: 1,
url: process.env.ETH_MAINNET_URL || "",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
coredaoMain: {
chainId: 1116,
url: process.env.COREDAO_MAINNET_URL || "https://rpc.coredao.org",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
coredaoTestnet: {
chainId: 1115,
url: process.env.COREDAO_TESTNET_URL || "https://rpc.test.btcs.network",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
optimismTestnet: {
chainId: 420,
url: process.env.OPTIMISM_TESTNET_URL || "https://goerli.optimism.io",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
baseTestnet: {
chainId: 84531,
url:
process.env.BASE_TESTNET_URL ||
"https://base-goerli.g.alchemy.com/v2/ClyZ4o3fVUGNs9BapqOvCoPLMEoOLfaQ",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
optimismMain: {
chainId: 10,
url: process.env.OPTIMISM_MAINNET_URL || "https://mainnet.optimism.io",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
auroraTestnet: {
chainId: 1313161555,
url:
process.env.AURORA_TESTNET_URL ||
"https://aurora-testnet.infura.io/v3/04755baf707e4b8288caba12502ad047",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
auroraMainnet: {
chainId: 1313161554,
url:
process.env.AURORA_MAINNET_URL ||
"https://aurora-mainnet.infura.io/v3/04755baf707e4b8288caba12502ad047",
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
},
},
};
export default config;