@gitmyabi/optimismportal 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -0
- package/contracts/OptimismPortal2_json.d.ts +1189 -0
- package/contracts/OptimismPortal2_json.js +1368 -0
- package/contracts/OptimismPortal2_json.ts +1580 -0
- package/contracts/Proxy_json.d.ts +376 -0
- package/contracts/Proxy_json.js +362 -0
- package/contracts/Proxy_json.ts +506 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1368 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OptimismPortal2_json = exports.OptimismPortal2_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* OptimismPortal2_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.OptimismPortal2_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "uint256",
|
|
15
|
+
"name": "_proofMaturityDelaySeconds",
|
|
16
|
+
"type": "uint256"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"inputs": [],
|
|
24
|
+
"name": "ContentLengthMismatch",
|
|
25
|
+
"type": "error"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"inputs": [],
|
|
29
|
+
"name": "EmptyItem",
|
|
30
|
+
"type": "error"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"inputs": [],
|
|
34
|
+
"name": "InvalidDataRemainder",
|
|
35
|
+
"type": "error"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"inputs": [],
|
|
39
|
+
"name": "InvalidHeader",
|
|
40
|
+
"type": "error"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"inputs": [],
|
|
44
|
+
"name": "OptimismPortal_AlreadyFinalized",
|
|
45
|
+
"type": "error"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"name": "OptimismPortal_BadTarget",
|
|
50
|
+
"type": "error"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [],
|
|
54
|
+
"name": "OptimismPortal_CallPaused",
|
|
55
|
+
"type": "error"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"inputs": [],
|
|
59
|
+
"name": "OptimismPortal_CalldataTooLarge",
|
|
60
|
+
"type": "error"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"inputs": [],
|
|
64
|
+
"name": "OptimismPortal_GasEstimation",
|
|
65
|
+
"type": "error"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"inputs": [],
|
|
69
|
+
"name": "OptimismPortal_GasLimitTooLow",
|
|
70
|
+
"type": "error"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"inputs": [],
|
|
74
|
+
"name": "OptimismPortal_ImproperDisputeGame",
|
|
75
|
+
"type": "error"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"inputs": [],
|
|
79
|
+
"name": "OptimismPortal_InvalidDisputeGame",
|
|
80
|
+
"type": "error"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"inputs": [],
|
|
84
|
+
"name": "OptimismPortal_InvalidLockboxState",
|
|
85
|
+
"type": "error"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"inputs": [],
|
|
89
|
+
"name": "OptimismPortal_InvalidMerkleProof",
|
|
90
|
+
"type": "error"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"inputs": [],
|
|
94
|
+
"name": "OptimismPortal_InvalidOutputRootProof",
|
|
95
|
+
"type": "error"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"inputs": [],
|
|
99
|
+
"name": "OptimismPortal_InvalidProofTimestamp",
|
|
100
|
+
"type": "error"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"inputs": [],
|
|
104
|
+
"name": "OptimismPortal_InvalidRootClaim",
|
|
105
|
+
"type": "error"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"inputs": [],
|
|
109
|
+
"name": "OptimismPortal_NoReentrancy",
|
|
110
|
+
"type": "error"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"inputs": [],
|
|
114
|
+
"name": "OptimismPortal_NotAllowedOnCGTMode",
|
|
115
|
+
"type": "error"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"inputs": [],
|
|
119
|
+
"name": "OptimismPortal_ProofNotOldEnough",
|
|
120
|
+
"type": "error"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"inputs": [],
|
|
124
|
+
"name": "OptimismPortal_Unproven",
|
|
125
|
+
"type": "error"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"inputs": [],
|
|
129
|
+
"name": "OutOfGas",
|
|
130
|
+
"type": "error"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"inputs": [],
|
|
134
|
+
"name": "ProxyAdminOwnedBase_NotProxyAdmin",
|
|
135
|
+
"type": "error"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"inputs": [],
|
|
139
|
+
"name": "ProxyAdminOwnedBase_NotProxyAdminOrProxyAdminOwner",
|
|
140
|
+
"type": "error"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"inputs": [],
|
|
144
|
+
"name": "ProxyAdminOwnedBase_NotProxyAdminOwner",
|
|
145
|
+
"type": "error"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"inputs": [],
|
|
149
|
+
"name": "ProxyAdminOwnedBase_NotResolvedDelegateProxy",
|
|
150
|
+
"type": "error"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"inputs": [],
|
|
154
|
+
"name": "ProxyAdminOwnedBase_NotSharedProxyAdminOwner",
|
|
155
|
+
"type": "error"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"inputs": [],
|
|
159
|
+
"name": "ProxyAdminOwnedBase_ProxyAdminNotFound",
|
|
160
|
+
"type": "error"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"inputs": [],
|
|
164
|
+
"name": "ReinitializableBase_ZeroInitVersion",
|
|
165
|
+
"type": "error"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"inputs": [],
|
|
169
|
+
"name": "UnexpectedList",
|
|
170
|
+
"type": "error"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"inputs": [],
|
|
174
|
+
"name": "UnexpectedString",
|
|
175
|
+
"type": "error"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"anonymous": false,
|
|
179
|
+
"inputs": [
|
|
180
|
+
{
|
|
181
|
+
"indexed": false,
|
|
182
|
+
"internalType": "uint8",
|
|
183
|
+
"name": "version",
|
|
184
|
+
"type": "uint8"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"name": "Initialized",
|
|
188
|
+
"type": "event"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"anonymous": false,
|
|
192
|
+
"inputs": [
|
|
193
|
+
{
|
|
194
|
+
"indexed": true,
|
|
195
|
+
"internalType": "address",
|
|
196
|
+
"name": "from",
|
|
197
|
+
"type": "address"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"indexed": true,
|
|
201
|
+
"internalType": "address",
|
|
202
|
+
"name": "to",
|
|
203
|
+
"type": "address"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"indexed": true,
|
|
207
|
+
"internalType": "uint256",
|
|
208
|
+
"name": "version",
|
|
209
|
+
"type": "uint256"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"indexed": false,
|
|
213
|
+
"internalType": "bytes",
|
|
214
|
+
"name": "opaqueData",
|
|
215
|
+
"type": "bytes"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"name": "TransactionDeposited",
|
|
219
|
+
"type": "event"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"anonymous": false,
|
|
223
|
+
"inputs": [
|
|
224
|
+
{
|
|
225
|
+
"indexed": true,
|
|
226
|
+
"internalType": "bytes32",
|
|
227
|
+
"name": "withdrawalHash",
|
|
228
|
+
"type": "bytes32"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"indexed": false,
|
|
232
|
+
"internalType": "bool",
|
|
233
|
+
"name": "success",
|
|
234
|
+
"type": "bool"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"name": "WithdrawalFinalized",
|
|
238
|
+
"type": "event"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"anonymous": false,
|
|
242
|
+
"inputs": [
|
|
243
|
+
{
|
|
244
|
+
"indexed": true,
|
|
245
|
+
"internalType": "bytes32",
|
|
246
|
+
"name": "withdrawalHash",
|
|
247
|
+
"type": "bytes32"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"indexed": true,
|
|
251
|
+
"internalType": "address",
|
|
252
|
+
"name": "from",
|
|
253
|
+
"type": "address"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"indexed": true,
|
|
257
|
+
"internalType": "address",
|
|
258
|
+
"name": "to",
|
|
259
|
+
"type": "address"
|
|
260
|
+
}
|
|
261
|
+
],
|
|
262
|
+
"name": "WithdrawalProven",
|
|
263
|
+
"type": "event"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"anonymous": false,
|
|
267
|
+
"inputs": [
|
|
268
|
+
{
|
|
269
|
+
"indexed": true,
|
|
270
|
+
"internalType": "bytes32",
|
|
271
|
+
"name": "withdrawalHash",
|
|
272
|
+
"type": "bytes32"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"indexed": true,
|
|
276
|
+
"internalType": "address",
|
|
277
|
+
"name": "proofSubmitter",
|
|
278
|
+
"type": "address"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"name": "WithdrawalProvenExtension1",
|
|
282
|
+
"type": "event"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"inputs": [],
|
|
286
|
+
"name": "anchorStateRegistry",
|
|
287
|
+
"outputs": [
|
|
288
|
+
{
|
|
289
|
+
"internalType": "contract IAnchorStateRegistry",
|
|
290
|
+
"name": "",
|
|
291
|
+
"type": "address"
|
|
292
|
+
}
|
|
293
|
+
],
|
|
294
|
+
"stateMutability": "view",
|
|
295
|
+
"type": "function"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"inputs": [
|
|
299
|
+
{
|
|
300
|
+
"internalType": "bytes32",
|
|
301
|
+
"name": "_withdrawalHash",
|
|
302
|
+
"type": "bytes32"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"internalType": "address",
|
|
306
|
+
"name": "_proofSubmitter",
|
|
307
|
+
"type": "address"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"name": "checkWithdrawal",
|
|
311
|
+
"outputs": [],
|
|
312
|
+
"stateMutability": "view",
|
|
313
|
+
"type": "function"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"inputs": [
|
|
317
|
+
{
|
|
318
|
+
"internalType": "address",
|
|
319
|
+
"name": "_to",
|
|
320
|
+
"type": "address"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"internalType": "uint256",
|
|
324
|
+
"name": "_value",
|
|
325
|
+
"type": "uint256"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"internalType": "uint64",
|
|
329
|
+
"name": "_gasLimit",
|
|
330
|
+
"type": "uint64"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"internalType": "bool",
|
|
334
|
+
"name": "_isCreation",
|
|
335
|
+
"type": "bool"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"internalType": "bytes",
|
|
339
|
+
"name": "_data",
|
|
340
|
+
"type": "bytes"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"name": "depositTransaction",
|
|
344
|
+
"outputs": [],
|
|
345
|
+
"stateMutability": "payable",
|
|
346
|
+
"type": "function"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"inputs": [
|
|
350
|
+
{
|
|
351
|
+
"internalType": "contract IDisputeGame",
|
|
352
|
+
"name": "_disputeGame",
|
|
353
|
+
"type": "address"
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"name": "disputeGameBlacklist",
|
|
357
|
+
"outputs": [
|
|
358
|
+
{
|
|
359
|
+
"internalType": "bool",
|
|
360
|
+
"name": "",
|
|
361
|
+
"type": "bool"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"stateMutability": "view",
|
|
365
|
+
"type": "function"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"inputs": [],
|
|
369
|
+
"name": "disputeGameFactory",
|
|
370
|
+
"outputs": [
|
|
371
|
+
{
|
|
372
|
+
"internalType": "contract IDisputeGameFactory",
|
|
373
|
+
"name": "",
|
|
374
|
+
"type": "address"
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"stateMutability": "view",
|
|
378
|
+
"type": "function"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"inputs": [],
|
|
382
|
+
"name": "disputeGameFinalityDelaySeconds",
|
|
383
|
+
"outputs": [
|
|
384
|
+
{
|
|
385
|
+
"internalType": "uint256",
|
|
386
|
+
"name": "",
|
|
387
|
+
"type": "uint256"
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"stateMutability": "view",
|
|
391
|
+
"type": "function"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"inputs": [],
|
|
395
|
+
"name": "donateETH",
|
|
396
|
+
"outputs": [],
|
|
397
|
+
"stateMutability": "payable",
|
|
398
|
+
"type": "function"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"inputs": [],
|
|
402
|
+
"name": "ethLockbox",
|
|
403
|
+
"outputs": [
|
|
404
|
+
{
|
|
405
|
+
"internalType": "contract IETHLockbox",
|
|
406
|
+
"name": "",
|
|
407
|
+
"type": "address"
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
"stateMutability": "view",
|
|
411
|
+
"type": "function"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"inputs": [
|
|
415
|
+
{
|
|
416
|
+
"components": [
|
|
417
|
+
{
|
|
418
|
+
"internalType": "uint256",
|
|
419
|
+
"name": "nonce",
|
|
420
|
+
"type": "uint256"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"internalType": "address",
|
|
424
|
+
"name": "sender",
|
|
425
|
+
"type": "address"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"internalType": "address",
|
|
429
|
+
"name": "target",
|
|
430
|
+
"type": "address"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"internalType": "uint256",
|
|
434
|
+
"name": "value",
|
|
435
|
+
"type": "uint256"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"internalType": "uint256",
|
|
439
|
+
"name": "gasLimit",
|
|
440
|
+
"type": "uint256"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"internalType": "bytes",
|
|
444
|
+
"name": "data",
|
|
445
|
+
"type": "bytes"
|
|
446
|
+
}
|
|
447
|
+
],
|
|
448
|
+
"internalType": "struct Types.WithdrawalTransaction",
|
|
449
|
+
"name": "_tx",
|
|
450
|
+
"type": "tuple"
|
|
451
|
+
}
|
|
452
|
+
],
|
|
453
|
+
"name": "finalizeWithdrawalTransaction",
|
|
454
|
+
"outputs": [],
|
|
455
|
+
"stateMutability": "nonpayable",
|
|
456
|
+
"type": "function"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"inputs": [
|
|
460
|
+
{
|
|
461
|
+
"components": [
|
|
462
|
+
{
|
|
463
|
+
"internalType": "uint256",
|
|
464
|
+
"name": "nonce",
|
|
465
|
+
"type": "uint256"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"internalType": "address",
|
|
469
|
+
"name": "sender",
|
|
470
|
+
"type": "address"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"internalType": "address",
|
|
474
|
+
"name": "target",
|
|
475
|
+
"type": "address"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"internalType": "uint256",
|
|
479
|
+
"name": "value",
|
|
480
|
+
"type": "uint256"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"internalType": "uint256",
|
|
484
|
+
"name": "gasLimit",
|
|
485
|
+
"type": "uint256"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"internalType": "bytes",
|
|
489
|
+
"name": "data",
|
|
490
|
+
"type": "bytes"
|
|
491
|
+
}
|
|
492
|
+
],
|
|
493
|
+
"internalType": "struct Types.WithdrawalTransaction",
|
|
494
|
+
"name": "_tx",
|
|
495
|
+
"type": "tuple"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"internalType": "address",
|
|
499
|
+
"name": "_proofSubmitter",
|
|
500
|
+
"type": "address"
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
"name": "finalizeWithdrawalTransactionExternalProof",
|
|
504
|
+
"outputs": [],
|
|
505
|
+
"stateMutability": "nonpayable",
|
|
506
|
+
"type": "function"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"inputs": [
|
|
510
|
+
{
|
|
511
|
+
"internalType": "bytes32",
|
|
512
|
+
"name": "",
|
|
513
|
+
"type": "bytes32"
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"name": "finalizedWithdrawals",
|
|
517
|
+
"outputs": [
|
|
518
|
+
{
|
|
519
|
+
"internalType": "bool",
|
|
520
|
+
"name": "",
|
|
521
|
+
"type": "bool"
|
|
522
|
+
}
|
|
523
|
+
],
|
|
524
|
+
"stateMutability": "view",
|
|
525
|
+
"type": "function"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"inputs": [],
|
|
529
|
+
"name": "guardian",
|
|
530
|
+
"outputs": [
|
|
531
|
+
{
|
|
532
|
+
"internalType": "address",
|
|
533
|
+
"name": "",
|
|
534
|
+
"type": "address"
|
|
535
|
+
}
|
|
536
|
+
],
|
|
537
|
+
"stateMutability": "view",
|
|
538
|
+
"type": "function"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"inputs": [],
|
|
542
|
+
"name": "initVersion",
|
|
543
|
+
"outputs": [
|
|
544
|
+
{
|
|
545
|
+
"internalType": "uint8",
|
|
546
|
+
"name": "",
|
|
547
|
+
"type": "uint8"
|
|
548
|
+
}
|
|
549
|
+
],
|
|
550
|
+
"stateMutability": "view",
|
|
551
|
+
"type": "function"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"inputs": [
|
|
555
|
+
{
|
|
556
|
+
"internalType": "contract ISystemConfig",
|
|
557
|
+
"name": "_systemConfig",
|
|
558
|
+
"type": "address"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"internalType": "contract IAnchorStateRegistry",
|
|
562
|
+
"name": "_anchorStateRegistry",
|
|
563
|
+
"type": "address"
|
|
564
|
+
}
|
|
565
|
+
],
|
|
566
|
+
"name": "initialize",
|
|
567
|
+
"outputs": [],
|
|
568
|
+
"stateMutability": "nonpayable",
|
|
569
|
+
"type": "function"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"inputs": [],
|
|
573
|
+
"name": "l2Sender",
|
|
574
|
+
"outputs": [
|
|
575
|
+
{
|
|
576
|
+
"internalType": "address",
|
|
577
|
+
"name": "",
|
|
578
|
+
"type": "address"
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
"stateMutability": "view",
|
|
582
|
+
"type": "function"
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
"inputs": [
|
|
586
|
+
{
|
|
587
|
+
"internalType": "uint64",
|
|
588
|
+
"name": "_byteCount",
|
|
589
|
+
"type": "uint64"
|
|
590
|
+
}
|
|
591
|
+
],
|
|
592
|
+
"name": "minimumGasLimit",
|
|
593
|
+
"outputs": [
|
|
594
|
+
{
|
|
595
|
+
"internalType": "uint64",
|
|
596
|
+
"name": "",
|
|
597
|
+
"type": "uint64"
|
|
598
|
+
}
|
|
599
|
+
],
|
|
600
|
+
"stateMutability": "pure",
|
|
601
|
+
"type": "function"
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"inputs": [
|
|
605
|
+
{
|
|
606
|
+
"internalType": "bytes32",
|
|
607
|
+
"name": "_withdrawalHash",
|
|
608
|
+
"type": "bytes32"
|
|
609
|
+
}
|
|
610
|
+
],
|
|
611
|
+
"name": "numProofSubmitters",
|
|
612
|
+
"outputs": [
|
|
613
|
+
{
|
|
614
|
+
"internalType": "uint256",
|
|
615
|
+
"name": "",
|
|
616
|
+
"type": "uint256"
|
|
617
|
+
}
|
|
618
|
+
],
|
|
619
|
+
"stateMutability": "view",
|
|
620
|
+
"type": "function"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"inputs": [],
|
|
624
|
+
"name": "params",
|
|
625
|
+
"outputs": [
|
|
626
|
+
{
|
|
627
|
+
"internalType": "uint128",
|
|
628
|
+
"name": "prevBaseFee",
|
|
629
|
+
"type": "uint128"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"internalType": "uint64",
|
|
633
|
+
"name": "prevBoughtGas",
|
|
634
|
+
"type": "uint64"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
"internalType": "uint64",
|
|
638
|
+
"name": "prevBlockNum",
|
|
639
|
+
"type": "uint64"
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"stateMutability": "view",
|
|
643
|
+
"type": "function"
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"inputs": [],
|
|
647
|
+
"name": "paused",
|
|
648
|
+
"outputs": [
|
|
649
|
+
{
|
|
650
|
+
"internalType": "bool",
|
|
651
|
+
"name": "",
|
|
652
|
+
"type": "bool"
|
|
653
|
+
}
|
|
654
|
+
],
|
|
655
|
+
"stateMutability": "view",
|
|
656
|
+
"type": "function"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
"inputs": [],
|
|
660
|
+
"name": "proofMaturityDelaySeconds",
|
|
661
|
+
"outputs": [
|
|
662
|
+
{
|
|
663
|
+
"internalType": "uint256",
|
|
664
|
+
"name": "",
|
|
665
|
+
"type": "uint256"
|
|
666
|
+
}
|
|
667
|
+
],
|
|
668
|
+
"stateMutability": "view",
|
|
669
|
+
"type": "function"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"inputs": [
|
|
673
|
+
{
|
|
674
|
+
"internalType": "bytes32",
|
|
675
|
+
"name": "",
|
|
676
|
+
"type": "bytes32"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
"internalType": "uint256",
|
|
680
|
+
"name": "",
|
|
681
|
+
"type": "uint256"
|
|
682
|
+
}
|
|
683
|
+
],
|
|
684
|
+
"name": "proofSubmitters",
|
|
685
|
+
"outputs": [
|
|
686
|
+
{
|
|
687
|
+
"internalType": "address",
|
|
688
|
+
"name": "",
|
|
689
|
+
"type": "address"
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
"stateMutability": "view",
|
|
693
|
+
"type": "function"
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
"inputs": [
|
|
697
|
+
{
|
|
698
|
+
"components": [
|
|
699
|
+
{
|
|
700
|
+
"internalType": "uint256",
|
|
701
|
+
"name": "nonce",
|
|
702
|
+
"type": "uint256"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"internalType": "address",
|
|
706
|
+
"name": "sender",
|
|
707
|
+
"type": "address"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"internalType": "address",
|
|
711
|
+
"name": "target",
|
|
712
|
+
"type": "address"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"internalType": "uint256",
|
|
716
|
+
"name": "value",
|
|
717
|
+
"type": "uint256"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"internalType": "uint256",
|
|
721
|
+
"name": "gasLimit",
|
|
722
|
+
"type": "uint256"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"internalType": "bytes",
|
|
726
|
+
"name": "data",
|
|
727
|
+
"type": "bytes"
|
|
728
|
+
}
|
|
729
|
+
],
|
|
730
|
+
"internalType": "struct Types.WithdrawalTransaction",
|
|
731
|
+
"name": "_tx",
|
|
732
|
+
"type": "tuple"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"internalType": "uint256",
|
|
736
|
+
"name": "_disputeGameIndex",
|
|
737
|
+
"type": "uint256"
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
"components": [
|
|
741
|
+
{
|
|
742
|
+
"internalType": "bytes32",
|
|
743
|
+
"name": "version",
|
|
744
|
+
"type": "bytes32"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"internalType": "bytes32",
|
|
748
|
+
"name": "stateRoot",
|
|
749
|
+
"type": "bytes32"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
"internalType": "bytes32",
|
|
753
|
+
"name": "messagePasserStorageRoot",
|
|
754
|
+
"type": "bytes32"
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"internalType": "bytes32",
|
|
758
|
+
"name": "latestBlockhash",
|
|
759
|
+
"type": "bytes32"
|
|
760
|
+
}
|
|
761
|
+
],
|
|
762
|
+
"internalType": "struct Types.OutputRootProof",
|
|
763
|
+
"name": "_outputRootProof",
|
|
764
|
+
"type": "tuple"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"internalType": "bytes[]",
|
|
768
|
+
"name": "_withdrawalProof",
|
|
769
|
+
"type": "bytes[]"
|
|
770
|
+
}
|
|
771
|
+
],
|
|
772
|
+
"name": "proveWithdrawalTransaction",
|
|
773
|
+
"outputs": [],
|
|
774
|
+
"stateMutability": "nonpayable",
|
|
775
|
+
"type": "function"
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
"inputs": [
|
|
779
|
+
{
|
|
780
|
+
"internalType": "bytes32",
|
|
781
|
+
"name": "",
|
|
782
|
+
"type": "bytes32"
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
"internalType": "address",
|
|
786
|
+
"name": "",
|
|
787
|
+
"type": "address"
|
|
788
|
+
}
|
|
789
|
+
],
|
|
790
|
+
"name": "provenWithdrawals",
|
|
791
|
+
"outputs": [
|
|
792
|
+
{
|
|
793
|
+
"internalType": "contract IDisputeGame",
|
|
794
|
+
"name": "disputeGameProxy",
|
|
795
|
+
"type": "address"
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"internalType": "uint64",
|
|
799
|
+
"name": "timestamp",
|
|
800
|
+
"type": "uint64"
|
|
801
|
+
}
|
|
802
|
+
],
|
|
803
|
+
"stateMutability": "view",
|
|
804
|
+
"type": "function"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"inputs": [],
|
|
808
|
+
"name": "proxyAdmin",
|
|
809
|
+
"outputs": [
|
|
810
|
+
{
|
|
811
|
+
"internalType": "contract IProxyAdmin",
|
|
812
|
+
"name": "",
|
|
813
|
+
"type": "address"
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
"stateMutability": "view",
|
|
817
|
+
"type": "function"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"inputs": [],
|
|
821
|
+
"name": "proxyAdminOwner",
|
|
822
|
+
"outputs": [
|
|
823
|
+
{
|
|
824
|
+
"internalType": "address",
|
|
825
|
+
"name": "",
|
|
826
|
+
"type": "address"
|
|
827
|
+
}
|
|
828
|
+
],
|
|
829
|
+
"stateMutability": "view",
|
|
830
|
+
"type": "function"
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
"inputs": [],
|
|
834
|
+
"name": "respectedGameType",
|
|
835
|
+
"outputs": [
|
|
836
|
+
{
|
|
837
|
+
"internalType": "GameType",
|
|
838
|
+
"name": "",
|
|
839
|
+
"type": "uint32"
|
|
840
|
+
}
|
|
841
|
+
],
|
|
842
|
+
"stateMutability": "view",
|
|
843
|
+
"type": "function"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"inputs": [],
|
|
847
|
+
"name": "respectedGameTypeUpdatedAt",
|
|
848
|
+
"outputs": [
|
|
849
|
+
{
|
|
850
|
+
"internalType": "uint64",
|
|
851
|
+
"name": "",
|
|
852
|
+
"type": "uint64"
|
|
853
|
+
}
|
|
854
|
+
],
|
|
855
|
+
"stateMutability": "view",
|
|
856
|
+
"type": "function"
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
"inputs": [],
|
|
860
|
+
"name": "superchainConfig",
|
|
861
|
+
"outputs": [
|
|
862
|
+
{
|
|
863
|
+
"internalType": "contract ISuperchainConfig",
|
|
864
|
+
"name": "",
|
|
865
|
+
"type": "address"
|
|
866
|
+
}
|
|
867
|
+
],
|
|
868
|
+
"stateMutability": "view",
|
|
869
|
+
"type": "function"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
"inputs": [],
|
|
873
|
+
"name": "systemConfig",
|
|
874
|
+
"outputs": [
|
|
875
|
+
{
|
|
876
|
+
"internalType": "contract ISystemConfig",
|
|
877
|
+
"name": "",
|
|
878
|
+
"type": "address"
|
|
879
|
+
}
|
|
880
|
+
],
|
|
881
|
+
"stateMutability": "view",
|
|
882
|
+
"type": "function"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
"inputs": [],
|
|
886
|
+
"name": "version",
|
|
887
|
+
"outputs": [
|
|
888
|
+
{
|
|
889
|
+
"internalType": "string",
|
|
890
|
+
"name": "",
|
|
891
|
+
"type": "string"
|
|
892
|
+
}
|
|
893
|
+
],
|
|
894
|
+
"stateMutability": "pure",
|
|
895
|
+
"type": "function"
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"stateMutability": "payable",
|
|
899
|
+
"type": "receive"
|
|
900
|
+
}
|
|
901
|
+
];
|
|
902
|
+
/**
|
|
903
|
+
* OptimismPortal2_json Contract Class
|
|
904
|
+
*
|
|
905
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
906
|
+
*
|
|
907
|
+
* @example
|
|
908
|
+
* ```typescript
|
|
909
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
910
|
+
* import { mainnet } from 'viem/chains';
|
|
911
|
+
* import { OptimismPortal2_json } from 'OptimismPortal2_json';
|
|
912
|
+
*
|
|
913
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
914
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
915
|
+
*
|
|
916
|
+
* const contract = new OptimismPortal2_json('0x...', { publicClient, walletClient });
|
|
917
|
+
*
|
|
918
|
+
* // Read functions
|
|
919
|
+
* const result = await contract.balanceOf('0x...');
|
|
920
|
+
*
|
|
921
|
+
* // Write functions
|
|
922
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
923
|
+
*
|
|
924
|
+
* // Simulate transactions (dry-run)
|
|
925
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
926
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
927
|
+
*
|
|
928
|
+
* // Watch events
|
|
929
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
930
|
+
* console.log('Transfer event:', event);
|
|
931
|
+
* });
|
|
932
|
+
* ```
|
|
933
|
+
*/
|
|
934
|
+
class OptimismPortal2_json {
|
|
935
|
+
constructor(address, clients) {
|
|
936
|
+
this.contractAddress = address;
|
|
937
|
+
this.publicClient = clients.publicClient;
|
|
938
|
+
this.contract = (0, viem_1.getContract)({
|
|
939
|
+
address,
|
|
940
|
+
abi: exports.OptimismPortal2_jsonAbi,
|
|
941
|
+
client: {
|
|
942
|
+
public: clients.publicClient,
|
|
943
|
+
wallet: clients.walletClient,
|
|
944
|
+
},
|
|
945
|
+
});
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Get the contract address
|
|
949
|
+
*/
|
|
950
|
+
get address() {
|
|
951
|
+
return this.contractAddress;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Get the underlying viem contract instance
|
|
955
|
+
*/
|
|
956
|
+
getContract() {
|
|
957
|
+
return this.contract;
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* anchorStateRegistry
|
|
961
|
+
* view
|
|
962
|
+
*/
|
|
963
|
+
async anchorStateRegistry() {
|
|
964
|
+
return this.contract.read.anchorStateRegistry();
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* checkWithdrawal
|
|
968
|
+
* view
|
|
969
|
+
*/
|
|
970
|
+
async checkWithdrawal(_withdrawalHash, _proofSubmitter) {
|
|
971
|
+
return this.contract.read.checkWithdrawal([_withdrawalHash, _proofSubmitter]);
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* disputeGameBlacklist
|
|
975
|
+
* view
|
|
976
|
+
*/
|
|
977
|
+
async disputeGameBlacklist(_disputeGame) {
|
|
978
|
+
return this.contract.read.disputeGameBlacklist([_disputeGame]);
|
|
979
|
+
}
|
|
980
|
+
/**
|
|
981
|
+
* disputeGameFactory
|
|
982
|
+
* view
|
|
983
|
+
*/
|
|
984
|
+
async disputeGameFactory() {
|
|
985
|
+
return this.contract.read.disputeGameFactory();
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* disputeGameFinalityDelaySeconds
|
|
989
|
+
* view
|
|
990
|
+
*/
|
|
991
|
+
async disputeGameFinalityDelaySeconds() {
|
|
992
|
+
return this.contract.read.disputeGameFinalityDelaySeconds();
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* ethLockbox
|
|
996
|
+
* view
|
|
997
|
+
*/
|
|
998
|
+
async ethLockbox() {
|
|
999
|
+
return this.contract.read.ethLockbox();
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* finalizedWithdrawals
|
|
1003
|
+
* view
|
|
1004
|
+
*/
|
|
1005
|
+
async finalizedWithdrawals(arg0) {
|
|
1006
|
+
return this.contract.read.finalizedWithdrawals([arg0]);
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* guardian
|
|
1010
|
+
* view
|
|
1011
|
+
*/
|
|
1012
|
+
async guardian() {
|
|
1013
|
+
return this.contract.read.guardian();
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* initVersion
|
|
1017
|
+
* view
|
|
1018
|
+
*/
|
|
1019
|
+
async initVersion() {
|
|
1020
|
+
return this.contract.read.initVersion();
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* l2Sender
|
|
1024
|
+
* view
|
|
1025
|
+
*/
|
|
1026
|
+
async l2Sender() {
|
|
1027
|
+
return this.contract.read.l2Sender();
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* minimumGasLimit
|
|
1031
|
+
* pure
|
|
1032
|
+
*/
|
|
1033
|
+
async minimumGasLimit(_byteCount) {
|
|
1034
|
+
return this.contract.read.minimumGasLimit([_byteCount]);
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* numProofSubmitters
|
|
1038
|
+
* view
|
|
1039
|
+
*/
|
|
1040
|
+
async numProofSubmitters(_withdrawalHash) {
|
|
1041
|
+
return this.contract.read.numProofSubmitters([_withdrawalHash]);
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* params
|
|
1045
|
+
* view
|
|
1046
|
+
*/
|
|
1047
|
+
async params() {
|
|
1048
|
+
return this.contract.read.params();
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* paused
|
|
1052
|
+
* view
|
|
1053
|
+
*/
|
|
1054
|
+
async paused() {
|
|
1055
|
+
return this.contract.read.paused();
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* proofMaturityDelaySeconds
|
|
1059
|
+
* view
|
|
1060
|
+
*/
|
|
1061
|
+
async proofMaturityDelaySeconds() {
|
|
1062
|
+
return this.contract.read.proofMaturityDelaySeconds();
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* proofSubmitters
|
|
1066
|
+
* view
|
|
1067
|
+
*/
|
|
1068
|
+
async proofSubmitters(arg0, arg1) {
|
|
1069
|
+
return this.contract.read.proofSubmitters([arg0, arg1]);
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* provenWithdrawals
|
|
1073
|
+
* view
|
|
1074
|
+
*/
|
|
1075
|
+
async provenWithdrawals(arg0, arg1) {
|
|
1076
|
+
return this.contract.read.provenWithdrawals([arg0, arg1]);
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* proxyAdmin
|
|
1080
|
+
* view
|
|
1081
|
+
*/
|
|
1082
|
+
async proxyAdmin() {
|
|
1083
|
+
return this.contract.read.proxyAdmin();
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* proxyAdminOwner
|
|
1087
|
+
* view
|
|
1088
|
+
*/
|
|
1089
|
+
async proxyAdminOwner() {
|
|
1090
|
+
return this.contract.read.proxyAdminOwner();
|
|
1091
|
+
}
|
|
1092
|
+
/**
|
|
1093
|
+
* respectedGameType
|
|
1094
|
+
* view
|
|
1095
|
+
*/
|
|
1096
|
+
async respectedGameType() {
|
|
1097
|
+
return this.contract.read.respectedGameType();
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* respectedGameTypeUpdatedAt
|
|
1101
|
+
* view
|
|
1102
|
+
*/
|
|
1103
|
+
async respectedGameTypeUpdatedAt() {
|
|
1104
|
+
return this.contract.read.respectedGameTypeUpdatedAt();
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* superchainConfig
|
|
1108
|
+
* view
|
|
1109
|
+
*/
|
|
1110
|
+
async superchainConfig() {
|
|
1111
|
+
return this.contract.read.superchainConfig();
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* systemConfig
|
|
1115
|
+
* view
|
|
1116
|
+
*/
|
|
1117
|
+
async systemConfig() {
|
|
1118
|
+
return this.contract.read.systemConfig();
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* version
|
|
1122
|
+
* pure
|
|
1123
|
+
*/
|
|
1124
|
+
async version() {
|
|
1125
|
+
return this.contract.read.version();
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* depositTransaction
|
|
1129
|
+
* payable
|
|
1130
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1131
|
+
*/
|
|
1132
|
+
async depositTransaction(_to, _value, _gasLimit, _isCreation, _data, options) {
|
|
1133
|
+
if (!this.contract.write) {
|
|
1134
|
+
throw new Error('Wallet client is required for write operations');
|
|
1135
|
+
}
|
|
1136
|
+
return this.contract.write.depositTransaction([_to, _value, _gasLimit, _isCreation, _data], options);
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* donateETH
|
|
1140
|
+
* payable
|
|
1141
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1142
|
+
*/
|
|
1143
|
+
async donateETH(options) {
|
|
1144
|
+
if (!this.contract.write) {
|
|
1145
|
+
throw new Error('Wallet client is required for write operations');
|
|
1146
|
+
}
|
|
1147
|
+
return this.contract.write.donateETH(options);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* finalizeWithdrawalTransaction
|
|
1151
|
+
* nonpayable
|
|
1152
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1153
|
+
*/
|
|
1154
|
+
async finalizeWithdrawalTransaction(_tx, options) {
|
|
1155
|
+
if (!this.contract.write) {
|
|
1156
|
+
throw new Error('Wallet client is required for write operations');
|
|
1157
|
+
}
|
|
1158
|
+
return this.contract.write.finalizeWithdrawalTransaction([_tx], options);
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* finalizeWithdrawalTransactionExternalProof
|
|
1162
|
+
* nonpayable
|
|
1163
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1164
|
+
*/
|
|
1165
|
+
async finalizeWithdrawalTransactionExternalProof(_tx, _proofSubmitter, options) {
|
|
1166
|
+
if (!this.contract.write) {
|
|
1167
|
+
throw new Error('Wallet client is required for write operations');
|
|
1168
|
+
}
|
|
1169
|
+
return this.contract.write.finalizeWithdrawalTransactionExternalProof([_tx, _proofSubmitter], options);
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* initialize
|
|
1173
|
+
* nonpayable
|
|
1174
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1175
|
+
*/
|
|
1176
|
+
async initialize(_systemConfig, _anchorStateRegistry, options) {
|
|
1177
|
+
if (!this.contract.write) {
|
|
1178
|
+
throw new Error('Wallet client is required for write operations');
|
|
1179
|
+
}
|
|
1180
|
+
return this.contract.write.initialize([_systemConfig, _anchorStateRegistry], options);
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* proveWithdrawalTransaction
|
|
1184
|
+
* nonpayable
|
|
1185
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1186
|
+
*/
|
|
1187
|
+
async proveWithdrawalTransaction(_tx, _disputeGameIndex, _outputRootProof, _withdrawalProof, options) {
|
|
1188
|
+
if (!this.contract.write) {
|
|
1189
|
+
throw new Error('Wallet client is required for write operations');
|
|
1190
|
+
}
|
|
1191
|
+
return this.contract.write.proveWithdrawalTransaction([_tx, _disputeGameIndex, _outputRootProof, _withdrawalProof], options);
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1195
|
+
*
|
|
1196
|
+
* @example
|
|
1197
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1198
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1199
|
+
* console.log('Would succeed:', result.result);
|
|
1200
|
+
*/
|
|
1201
|
+
get simulate() {
|
|
1202
|
+
const contract = this.contract;
|
|
1203
|
+
if (!contract.simulate) {
|
|
1204
|
+
throw new Error('Public client is required for simulation');
|
|
1205
|
+
}
|
|
1206
|
+
return {
|
|
1207
|
+
/**
|
|
1208
|
+
* Simulate depositTransaction
|
|
1209
|
+
* Returns gas estimate and result without sending transaction
|
|
1210
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1211
|
+
*/
|
|
1212
|
+
async depositTransaction(_to, _value, _gasLimit, _isCreation, _data, options) {
|
|
1213
|
+
return contract.simulate.depositTransaction([_to, _value, _gasLimit, _isCreation, _data], options);
|
|
1214
|
+
},
|
|
1215
|
+
/**
|
|
1216
|
+
* Simulate donateETH
|
|
1217
|
+
* Returns gas estimate and result without sending transaction
|
|
1218
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1219
|
+
*/
|
|
1220
|
+
async donateETH(options) {
|
|
1221
|
+
return contract.simulate.donateETH(options);
|
|
1222
|
+
},
|
|
1223
|
+
/**
|
|
1224
|
+
* Simulate finalizeWithdrawalTransaction
|
|
1225
|
+
* Returns gas estimate and result without sending transaction
|
|
1226
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1227
|
+
*/
|
|
1228
|
+
async finalizeWithdrawalTransaction(_tx, options) {
|
|
1229
|
+
return contract.simulate.finalizeWithdrawalTransaction([_tx], options);
|
|
1230
|
+
},
|
|
1231
|
+
/**
|
|
1232
|
+
* Simulate finalizeWithdrawalTransactionExternalProof
|
|
1233
|
+
* Returns gas estimate and result without sending transaction
|
|
1234
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1235
|
+
*/
|
|
1236
|
+
async finalizeWithdrawalTransactionExternalProof(_tx, _proofSubmitter, options) {
|
|
1237
|
+
return contract.simulate.finalizeWithdrawalTransactionExternalProof([_tx, _proofSubmitter], options);
|
|
1238
|
+
},
|
|
1239
|
+
/**
|
|
1240
|
+
* Simulate initialize
|
|
1241
|
+
* Returns gas estimate and result without sending transaction
|
|
1242
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1243
|
+
*/
|
|
1244
|
+
async initialize(_systemConfig, _anchorStateRegistry, options) {
|
|
1245
|
+
return contract.simulate.initialize([_systemConfig, _anchorStateRegistry], options);
|
|
1246
|
+
},
|
|
1247
|
+
/**
|
|
1248
|
+
* Simulate proveWithdrawalTransaction
|
|
1249
|
+
* Returns gas estimate and result without sending transaction
|
|
1250
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1251
|
+
*/
|
|
1252
|
+
async proveWithdrawalTransaction(_tx, _disputeGameIndex, _outputRootProof, _withdrawalProof, options) {
|
|
1253
|
+
return contract.simulate.proveWithdrawalTransaction([_tx, _disputeGameIndex, _outputRootProof, _withdrawalProof], options);
|
|
1254
|
+
}
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Watch contract events
|
|
1259
|
+
*
|
|
1260
|
+
* @example
|
|
1261
|
+
* // Watch all Transfer events
|
|
1262
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1263
|
+
* console.log('Transfer:', event);
|
|
1264
|
+
* });
|
|
1265
|
+
*
|
|
1266
|
+
* // Stop watching
|
|
1267
|
+
* unwatch();
|
|
1268
|
+
*/
|
|
1269
|
+
get watch() {
|
|
1270
|
+
return {
|
|
1271
|
+
/**
|
|
1272
|
+
* Watch Initialized events
|
|
1273
|
+
* @param callback Function to call when event is emitted
|
|
1274
|
+
* @param filter Optional filter for indexed parameters
|
|
1275
|
+
* @returns Unwatch function to stop listening
|
|
1276
|
+
*/
|
|
1277
|
+
Initialized: (callback) => {
|
|
1278
|
+
return this.publicClient.watchContractEvent({
|
|
1279
|
+
address: this.contractAddress,
|
|
1280
|
+
abi: exports.OptimismPortal2_jsonAbi,
|
|
1281
|
+
eventName: 'Initialized',
|
|
1282
|
+
onLogs: (logs) => {
|
|
1283
|
+
logs.forEach((log) => {
|
|
1284
|
+
callback(log.args);
|
|
1285
|
+
});
|
|
1286
|
+
},
|
|
1287
|
+
});
|
|
1288
|
+
},
|
|
1289
|
+
/**
|
|
1290
|
+
* Watch TransactionDeposited events
|
|
1291
|
+
* @param callback Function to call when event is emitted
|
|
1292
|
+
* @param filter Optional filter for indexed parameters
|
|
1293
|
+
* @returns Unwatch function to stop listening
|
|
1294
|
+
*/
|
|
1295
|
+
TransactionDeposited: (callback, filter) => {
|
|
1296
|
+
return this.publicClient.watchContractEvent({
|
|
1297
|
+
address: this.contractAddress,
|
|
1298
|
+
abi: exports.OptimismPortal2_jsonAbi,
|
|
1299
|
+
eventName: 'TransactionDeposited',
|
|
1300
|
+
args: filter,
|
|
1301
|
+
onLogs: (logs) => {
|
|
1302
|
+
logs.forEach((log) => {
|
|
1303
|
+
callback(log.args);
|
|
1304
|
+
});
|
|
1305
|
+
},
|
|
1306
|
+
});
|
|
1307
|
+
},
|
|
1308
|
+
/**
|
|
1309
|
+
* Watch WithdrawalFinalized events
|
|
1310
|
+
* @param callback Function to call when event is emitted
|
|
1311
|
+
* @param filter Optional filter for indexed parameters
|
|
1312
|
+
* @returns Unwatch function to stop listening
|
|
1313
|
+
*/
|
|
1314
|
+
WithdrawalFinalized: (callback, filter) => {
|
|
1315
|
+
return this.publicClient.watchContractEvent({
|
|
1316
|
+
address: this.contractAddress,
|
|
1317
|
+
abi: exports.OptimismPortal2_jsonAbi,
|
|
1318
|
+
eventName: 'WithdrawalFinalized',
|
|
1319
|
+
args: filter,
|
|
1320
|
+
onLogs: (logs) => {
|
|
1321
|
+
logs.forEach((log) => {
|
|
1322
|
+
callback(log.args);
|
|
1323
|
+
});
|
|
1324
|
+
},
|
|
1325
|
+
});
|
|
1326
|
+
},
|
|
1327
|
+
/**
|
|
1328
|
+
* Watch WithdrawalProven events
|
|
1329
|
+
* @param callback Function to call when event is emitted
|
|
1330
|
+
* @param filter Optional filter for indexed parameters
|
|
1331
|
+
* @returns Unwatch function to stop listening
|
|
1332
|
+
*/
|
|
1333
|
+
WithdrawalProven: (callback, filter) => {
|
|
1334
|
+
return this.publicClient.watchContractEvent({
|
|
1335
|
+
address: this.contractAddress,
|
|
1336
|
+
abi: exports.OptimismPortal2_jsonAbi,
|
|
1337
|
+
eventName: 'WithdrawalProven',
|
|
1338
|
+
args: filter,
|
|
1339
|
+
onLogs: (logs) => {
|
|
1340
|
+
logs.forEach((log) => {
|
|
1341
|
+
callback(log.args);
|
|
1342
|
+
});
|
|
1343
|
+
},
|
|
1344
|
+
});
|
|
1345
|
+
},
|
|
1346
|
+
/**
|
|
1347
|
+
* Watch WithdrawalProvenExtension1 events
|
|
1348
|
+
* @param callback Function to call when event is emitted
|
|
1349
|
+
* @param filter Optional filter for indexed parameters
|
|
1350
|
+
* @returns Unwatch function to stop listening
|
|
1351
|
+
*/
|
|
1352
|
+
WithdrawalProvenExtension1: (callback, filter) => {
|
|
1353
|
+
return this.publicClient.watchContractEvent({
|
|
1354
|
+
address: this.contractAddress,
|
|
1355
|
+
abi: exports.OptimismPortal2_jsonAbi,
|
|
1356
|
+
eventName: 'WithdrawalProvenExtension1',
|
|
1357
|
+
args: filter,
|
|
1358
|
+
onLogs: (logs) => {
|
|
1359
|
+
logs.forEach((log) => {
|
|
1360
|
+
callback(log.args);
|
|
1361
|
+
});
|
|
1362
|
+
},
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
exports.OptimismPortal2_json = OptimismPortal2_json;
|