-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
252 lines (250 loc) · 8.65 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
import { HardhatUserConfig } from "hardhat/config";
import "@typechain/hardhat";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
import "hardhat-diamond-abi";
import "solidity-coverage";
import "hardhat-gas-reporter";
import "solidity-docgen";
import { DEPLOYER_FACTORY_COMMON, accounts, abiFilter } from "./src/utils";
import { ISSUER_FACETS } from "./tasks/issuer";
import { MARKETPLACE_FACETS } from "./tasks/marketplace";
import { FAST_FACETS } from "./tasks/fast";
import { PAYMASTER_FACETS } from "./tasks/paymaster";
// Import all of our tasks here!
import "./tasks/accounts";
import "./tasks/issuer";
import "./tasks/marketplace";
import "./tasks/paymaster";
import "./tasks/fast";
import "./tasks/upgrades";
const config: HardhatUserConfig = {
solidity: {
version: "0.8.10",
settings: {
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
optimizer: {
enabled: true,
runs: 1000000,
},
},
},
diamondAbi: [
{
name: "Issuer",
filter: abiFilter([
// Event types.
["Facet$", "EthDrained(address,uint256)"],
["Facet$", "EthReceived(address,uint256)"],
["Facet$", "FastRegistered(address)"],
["Facet$", "FastUnregistered(address)"],
["Facet$", "FastGroupChanged(address,string,string)"],
["Facet$", "GovernorshipAdded(address,address)"],
["Facet$", "GovernorshipRemoved(address,address)"],
// Error types.
["Facet$", "RequiresIssuerMembership(address)"],
["Facet$", "RequiresFastContractCaller()"],
]),
include: [
"IERC165",
"IERC173",
"IDiamondCut",
"IDiamondLoupe",
"IIssuerEvents",
...ISSUER_FACETS,
],
},
{
name: "Marketplace",
filter: abiFilter([
// Event types.
["Facet$", "MemberActivated(address)"],
["Facet$", "MemberDeactivated(address)"],
["Facet$", "FastDeploymentRequested(uint256)"],
// Error types.
["Facet$", "InsufficientFunds(uint256)"],
["Facet$", "OutOfBounds()"],
["Facet$", "Overfunded(uint256)"],
["Facet$", "RequiresFastContractCaller()"],
["Facet$", "RequiresIssuerMembership(address)"],
["Facet$", "RequiresMarketplaceMembership(address)"],
]),
include: [
"IERC165",
"IERC173",
"IDiamondCut",
"IDiamondLoupe",
"IMarketplaceEvents",
...MARKETPLACE_FACETS,
],
},
{
name: "Fast",
filter: abiFilter([
// Event types.
["Facet$", "EthDrained(address,uint256)"],
["Facet$", "EthReceived(address,uint256)"],
["Facet$", "Minted(uint256,string,address)"],
["Facet$", "Burnt(uint256,string,address)"],
["Facet$", "FastTransfer(address,address,address,uint256,string)"],
["Facet$", "Disapproval(address,address,uint256)"],
[
"Facet$",
"DetailsChanged(bool,uint32,uint256,uint256,uint256,uint256)",
],
["Facet$", "DistributionDeployed(address)"],
["Facet$", "DistributionRemoved(address)"],
["Facet$", "CrowdfundDeployed(address)"],
["Facet$", "CrowdfundRemoved(address)"],
["Facet$", "CrowdfundDefaultBasisPointFeeSet(uint32)"],
// Error types.
["Facet$", "InternalMethod()"],
["Facet$", "RequiresIssuerMembership(address)"],
["Facet$", "RequiresMarketplaceMembership(address)"],
["Facet$", "RequiresFastMembership(address)"],
["Facet$", "RequiresFastGovernorship(address)"],
["Facet$", "UnsupportedOperation()"],
["Facet$", "InvalidCrowdfundBasisPointFee(uint32)"],
]),
include: [
"IERC165",
"IERC173",
"IDiamondCut",
"IDiamondLoupe",
"IFastEvents",
...FAST_FACETS,
],
},
{
name: "Paymaster",
filter: abiFilter([
// Event types.
// ...
// Error types.
// ...
]),
include: [
"IERC173",
"IDiamondCut",
"IDiamondLoupe",
...PAYMASTER_FACETS,
],
},
],
networks: {
// Built-in for tests etc.
hardhat: { saveDeployments: false },
localhost: { saveDeployments: false },
// Typically a Geth local dev net.
dev: {
live: true,
saveDeployments: true,
url: "http://localhost:8546",
chainId: 18021980,
accounts: accounts("dev"),
},
// Polygon stuff.
mumbai: {
live: true,
saveDeployments: true,
url: "https://rpc-mumbai.polygon.technology",
chainId: 80001,
accounts: accounts("mumbai"),
},
amoy: {
live: true,
saveDeployments: true,
url: "https://rpc-amoy.polygon.technology",
chainId: 80002,
accounts: accounts("amoy"),
},
polygon: {
live: true,
saveDeployments: true,
url: "https://polygon-rpc.com/",
chainId: 137,
accounts: accounts("polygon"),
},
},
namedAccounts: {
// The one in charge of all ops. It will also be the owner of the deployed proxies and contracts.
deployer: {
default: 0,
},
// The account who will be the first member of the ISSUER contract.
issuerMember: {
default: 1,
},
// Used to hold genesis Eth in our live environments.
storage: {
default: 2,
},
// Used exclusively in dev environments when deploying test FAST contracts.
fastGovernor: {
default: 3,
},
automaton: { default: 4 },
user1: { default: 5 },
user2: { default: 6 },
user3: { default: 7 },
user4: { default: 8 },
user5: { default: 9 },
user6: { default: 10 },
user7: { default: 11 },
user8: { default: 12 },
user9: { default: 13 },
},
// Our deterministic deployment parameters were generated using https://github.com/safe-global/safe-singleton-factory.
// These shouldn't need to change - they are self-contained, and allow to deploy everything needed
// for determinist deployments on our three environments.
deterministicDeployment: {
// Hardhat / Localhost.
31337: {
...DEPLOYER_FACTORY_COMMON,
signedTx:
"0xf8a78085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf382f4f5a03381292b6ba77ee1f88e5418750ba737f5e94d8df24b67c4eab84b6a96801c70a03409d040cfc82946e15e361c5142cc7b811c8ee3d9b94460ba3ef45d0e293dde",
},
// Local Geth POA chain.
18021980: {
...DEPLOYER_FACTORY_COMMON,
signedTx:
"0xf8a98085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3840225fcdba01590b43af70aef60a9342a33eaf1536b07df9ba36e96f0e5102485b4f23f7720a01e6266145487736a1809cf67cbc0a86d9eee3438cc97e0bd523694f3f3e9e1cb",
},
// Polygon Testnet - Mumbai.
80001: {
...DEPLOYER_FACTORY_COMMON,
signedTx:
"0xf8a88085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf383027125a05f9ad6b5fd17d50ec5b92745a600a89fe389f8d4bae2f06189efe0543374acb2a0570b22388a260bc0d2ace93767114ab9a4f7776177778b2293c1233118c725b5",
},
// Polygon Testnet - Amoy.
80002: {
deployer: "0xE1CB04A0fA36DdD16a06ea828007E35e1a3cBC37",
factory: "0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7",
funding: "10000000000000000",
signedTx:
"0xf8a88085746a52880f830174a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf383027128a0983a0a2de9444f60b6405a227cce730f6d1025f02ff2d37c638e976389f8a073a07846164338796cbf55c45d80f7b328ff55f495d0264574a7cb876673808161bc",
},
// Polygon Mainnet.
137: {
...DEPLOYER_FACTORY_COMMON,
signedTx:
"0xf8a78085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3820135a005875581598a4bb6ff0dffadc18a9ef60b5829b031d5f744834da3ac508e744ca05f114c384908df349ba3200e308ee8862872dd42ce7252118174b5844fbcc661",
},
},
typechain: {
externalArtifacts: [
"artifacts/hardhat-diamond-abi/HardhatDiamondABI.sol/*.json",
],
outDir: "typechain",
target: "ethers-v5",
},
docgen: { pages: "items" },
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
},
};
export default config;