@matterlabs/zksync-js 0.0.7 → 0.0.9
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/dist/adapters/ethers/client.cjs +1705 -259
- package/dist/adapters/ethers/client.cjs.map +1 -1
- package/dist/adapters/ethers/client.d.ts +11 -0
- package/dist/adapters/ethers/client.js +6 -6
- package/dist/adapters/ethers/index.cjs +5254 -2335
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.d.ts +4 -0
- package/dist/adapters/ethers/index.js +9 -9
- package/dist/adapters/ethers/resources/contracts/types.d.ts +15 -0
- package/dist/adapters/ethers/resources/deposits/context.d.ts +3 -3
- package/dist/adapters/ethers/resources/deposits/services/gas.d.ts +2 -2
- package/dist/adapters/ethers/resources/deposits/services/verification.d.ts +1 -1
- package/dist/adapters/ethers/resources/interop/address.d.ts +18 -0
- package/dist/adapters/ethers/resources/interop/attributes/resource.d.ts +9 -0
- package/dist/adapters/ethers/resources/interop/context.d.ts +36 -0
- package/dist/adapters/ethers/resources/interop/index.d.ts +63 -0
- package/dist/adapters/ethers/resources/interop/resolvers.d.ts +9 -0
- package/dist/adapters/ethers/resources/interop/routes/direct.d.ts +2 -0
- package/dist/adapters/ethers/resources/interop/routes/indirect.d.ts +2 -0
- package/dist/adapters/ethers/resources/interop/routes/types.d.ts +13 -0
- package/dist/adapters/ethers/resources/interop/services/erc20.d.ts +15 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/bundle.d.ts +15 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/data-fetchers.d.ts +17 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/decoders.d.ts +12 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/index.d.ts +13 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/polling.d.ts +7 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/status.d.ts +5 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/topics.d.ts +6 -0
- package/dist/adapters/ethers/resources/interop/services/starter-data.d.ts +6 -0
- package/dist/adapters/ethers/resources/interop/types.d.ts +16 -0
- package/dist/adapters/ethers/resources/withdrawals/context.d.ts +2 -2
- package/dist/adapters/ethers/sdk.cjs +3384 -931
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.d.ts +10 -8
- package/dist/adapters/ethers/sdk.js +7 -7
- package/dist/adapters/viem/client.cjs +760 -64
- package/dist/adapters/viem/client.cjs.map +1 -1
- package/dist/adapters/viem/client.js +6 -4
- package/dist/adapters/viem/index.cjs +404 -276
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.d.ts +1 -0
- package/dist/adapters/viem/index.js +9 -8
- package/dist/adapters/viem/resources/deposits/context.d.ts +3 -3
- package/dist/adapters/viem/resources/deposits/services/gas.d.ts +2 -2
- package/dist/adapters/viem/resources/deposits/services/verification.d.ts +1 -1
- package/dist/adapters/viem/resources/withdrawals/context.d.ts +2 -2
- package/dist/adapters/viem/sdk.cjs +84 -92
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +6 -6
- package/dist/{chunk-KRIRXY74.js → chunk-5AG6B7UX.js} +38 -63
- package/dist/{chunk-NNFWIAVG.js → chunk-AIFHAPJC.js} +9 -3
- package/dist/{chunk-NCR42O6O.js → chunk-C3AGOEHR.js} +11 -1
- package/dist/{chunk-GIXLOHLK.js → chunk-FBKBF7YM.js} +1534 -12
- package/dist/{chunk-VRL6Y4YJ.js → chunk-IYEDEUXG.js} +1 -1
- package/dist/chunk-JNWHQJU3.js +209 -0
- package/dist/{chunk-7VP6742W.js → chunk-KLNFDFLA.js} +43 -32
- package/dist/{chunk-GNERKUWO.js → chunk-QDJOEVGJ.js} +2 -2
- package/dist/{chunk-EWLA4NUE.js → chunk-RRKVUW3G.js} +1377 -78
- package/dist/{chunk-KAMEGD6I.js → chunk-SRPKTXIF.js} +1 -1
- package/dist/{chunk-WY36Z6YB.js → chunk-UIXU35ZU.js} +57 -19
- package/dist/{chunk-P5PIWVEO.js → chunk-ZVHFVUDE.js} +14 -26
- package/dist/core/abi.d.ts +5 -0
- package/dist/core/constants.cjs +10 -0
- package/dist/core/constants.cjs.map +1 -1
- package/dist/core/constants.d.ts +10 -0
- package/dist/core/constants.js +1 -1
- package/dist/core/index.cjs +1676 -186
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.js +5 -5
- package/dist/core/internal/abis/IERC7786Attributes.d.ts +42 -0
- package/dist/core/internal/abis/IInteropCenter.d.ts +211 -0
- package/dist/core/internal/abis/IInteropHandler.d.ts +166 -0
- package/dist/core/internal/abis/InteropCenter.d.ts +578 -0
- package/dist/core/internal/abis/InteropRootStorage.d.ts +20 -0
- package/dist/core/internal/abis/L2MessageVerification.d.ts +277 -0
- package/dist/core/resources/interop/attributes/bundle.d.ts +6 -0
- package/dist/core/resources/interop/attributes/call.d.ts +6 -0
- package/dist/core/resources/interop/attributes/index.d.ts +4 -0
- package/dist/core/resources/interop/attributes/resource.d.ts +12 -0
- package/dist/core/resources/interop/attributes/types.d.ts +4 -0
- package/dist/core/resources/interop/events.d.ts +7 -0
- package/dist/core/resources/interop/finalization.d.ts +60 -0
- package/dist/core/resources/interop/plan.d.ts +39 -0
- package/dist/core/resources/interop/route.d.ts +15 -0
- package/dist/core/rpc/types.d.ts +9 -0
- package/dist/core/types/errors.d.ts +56 -5
- package/dist/core/types/fees.d.ts +9 -0
- package/dist/core/types/flows/base.d.ts +1 -1
- package/dist/core/types/flows/interop.d.ts +207 -0
- package/dist/core/types/flows/withdrawals.d.ts +0 -8
- package/dist/core/types/primitives.d.ts +1 -0
- package/dist/core/types/transactions.d.ts +10 -0
- package/dist/core/utils/addr.d.ts +2 -2
- package/dist/core/utils/events.d.ts +12 -0
- package/dist/core/utils/hash.d.ts +5 -0
- package/dist/core/utils/index.d.ts +5 -0
- package/dist/core/utils/number.d.ts +2 -0
- package/dist/index.cjs +1686 -186
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -5
- package/package.json +6 -2
- package/dist/chunk-NGXRO2ZX.js +0 -142
- package/dist/core/resources/withdrawals/events.d.ts +0 -9
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,7 @@ var __export = (target, all) => {
|
|
|
13
13
|
var constants_exports = {};
|
|
14
14
|
__export(constants_exports, {
|
|
15
15
|
BUFFER: () => BUFFER,
|
|
16
|
+
BUNDLE_IDENTIFIER: () => BUNDLE_IDENTIFIER,
|
|
16
17
|
DEFAULT_ABI_BYTES: () => DEFAULT_ABI_BYTES,
|
|
17
18
|
DEFAULT_PUBDATA_BYTES: () => DEFAULT_PUBDATA_BYTES,
|
|
18
19
|
ETH_ADDRESS: () => ETH_ADDRESS,
|
|
@@ -23,6 +24,10 @@ __export(constants_exports, {
|
|
|
23
24
|
L1_SOPH_TOKEN_ADDRESS: () => L1_SOPH_TOKEN_ADDRESS,
|
|
24
25
|
L2_ASSET_ROUTER_ADDRESS: () => L2_ASSET_ROUTER_ADDRESS,
|
|
25
26
|
L2_BASE_TOKEN_ADDRESS: () => L2_BASE_TOKEN_ADDRESS,
|
|
27
|
+
L2_INTEROP_CENTER_ADDRESS: () => L2_INTEROP_CENTER_ADDRESS,
|
|
28
|
+
L2_INTEROP_HANDLER_ADDRESS: () => L2_INTEROP_HANDLER_ADDRESS,
|
|
29
|
+
L2_INTEROP_ROOT_STORAGE_ADDRESS: () => L2_INTEROP_ROOT_STORAGE_ADDRESS,
|
|
30
|
+
L2_MESSAGE_VERIFICATION_ADDRESS: () => L2_MESSAGE_VERIFICATION_ADDRESS,
|
|
26
31
|
L2_NATIVE_TOKEN_VAULT_ADDRESS: () => L2_NATIVE_TOKEN_VAULT_ADDRESS,
|
|
27
32
|
SAFE_L1_BRIDGE_GAS: () => SAFE_L1_BRIDGE_GAS,
|
|
28
33
|
TOPIC_CANONICAL_ASSIGNED: () => TOPIC_CANONICAL_ASSIGNED,
|
|
@@ -41,7 +46,12 @@ var L2_ASSET_ROUTER_ADDRESS = "0x0000000000000000000000000000000000010003";
|
|
|
41
46
|
var L2_NATIVE_TOKEN_VAULT_ADDRESS = "0x0000000000000000000000000000000000010004";
|
|
42
47
|
var L1_MESSENGER_ADDRESS = "0x0000000000000000000000000000000000008008";
|
|
43
48
|
var L2_BASE_TOKEN_ADDRESS = "0x000000000000000000000000000000000000800A";
|
|
49
|
+
var L2_INTEROP_CENTER_ADDRESS = "0x000000000000000000000000000000000001000d";
|
|
50
|
+
var L2_INTEROP_HANDLER_ADDRESS = "0x000000000000000000000000000000000001000e";
|
|
51
|
+
var L2_INTEROP_ROOT_STORAGE_ADDRESS = "0x0000000000000000000000000000000000010008";
|
|
52
|
+
var L2_MESSAGE_VERIFICATION_ADDRESS = "0x0000000000000000000000000000000000010009";
|
|
44
53
|
var L1_SOPH_TOKEN_ADDRESS = "0xa9544a49d4aEa4c8E074431c89C79fA9592049d8";
|
|
54
|
+
var BUNDLE_IDENTIFIER = "0x01";
|
|
45
55
|
var TOPIC_L1_MESSAGE_SENT = "0x2632cc0d58b0cb1017b99cc0b6cc66ad86440cc0dd923bfdaa294f95ba1b0201";
|
|
46
56
|
var TOPIC_L1_MESSAGE_SENT_NEW = k256hex("L1MessageSent(uint256,bytes32,bytes)");
|
|
47
57
|
var TOPIC_L1_MESSAGE_SENT_LEG = k256hex("L1MessageSent(address,bytes32,bytes)");
|
|
@@ -62,10 +72,15 @@ __export(abi_exports, {
|
|
|
62
72
|
IBaseTokenABI: () => IBaseToken_default,
|
|
63
73
|
IBridgehubABI: () => IBridgehub_default,
|
|
64
74
|
IERC20ABI: () => IERC20_default,
|
|
75
|
+
IERC7786AttributesABI: () => IERC7786Attributes_default,
|
|
76
|
+
IInteropHandlerABI: () => IInteropHandler_default,
|
|
65
77
|
IL1AssetRouterABI: () => IL1AssetRouter_default,
|
|
66
78
|
IL1NullifierABI: () => IL1Nullifier_default,
|
|
67
79
|
IL2AssetRouterABI: () => IL2AssetRouter_default,
|
|
80
|
+
InteropCenterABI: () => InteropCenter_default,
|
|
81
|
+
InteropRootStorageABI: () => InteropRootStorage_default,
|
|
68
82
|
L1NativeTokenVaultABI: () => L1NativeTokenVault_default,
|
|
83
|
+
L2MessageVerificationABI: () => L2MessageVerification_default,
|
|
69
84
|
L2NativeTokenVaultABI: () => L2NativeTokenVault_default,
|
|
70
85
|
MailboxABI: () => Mailbox_default
|
|
71
86
|
});
|
|
@@ -4182,6 +4197,63 @@ var IERC20ABI = [
|
|
|
4182
4197
|
];
|
|
4183
4198
|
var IERC20_default = IERC20ABI;
|
|
4184
4199
|
|
|
4200
|
+
// src/core/internal/abis/IERC7786Attributes.ts
|
|
4201
|
+
var IERC7786AttributesABI = [
|
|
4202
|
+
{
|
|
4203
|
+
inputs: [
|
|
4204
|
+
{
|
|
4205
|
+
internalType: "bytes",
|
|
4206
|
+
name: "_executionAddress",
|
|
4207
|
+
type: "bytes"
|
|
4208
|
+
}
|
|
4209
|
+
],
|
|
4210
|
+
name: "executionAddress",
|
|
4211
|
+
outputs: [],
|
|
4212
|
+
stateMutability: "pure",
|
|
4213
|
+
type: "function"
|
|
4214
|
+
},
|
|
4215
|
+
{
|
|
4216
|
+
inputs: [
|
|
4217
|
+
{
|
|
4218
|
+
internalType: "uint256",
|
|
4219
|
+
name: "_indirectCallMessageValue",
|
|
4220
|
+
type: "uint256"
|
|
4221
|
+
}
|
|
4222
|
+
],
|
|
4223
|
+
name: "indirectCall",
|
|
4224
|
+
outputs: [],
|
|
4225
|
+
stateMutability: "pure",
|
|
4226
|
+
type: "function"
|
|
4227
|
+
},
|
|
4228
|
+
{
|
|
4229
|
+
inputs: [
|
|
4230
|
+
{
|
|
4231
|
+
internalType: "uint256",
|
|
4232
|
+
name: "_interopCallValue",
|
|
4233
|
+
type: "uint256"
|
|
4234
|
+
}
|
|
4235
|
+
],
|
|
4236
|
+
name: "interopCallValue",
|
|
4237
|
+
outputs: [],
|
|
4238
|
+
stateMutability: "pure",
|
|
4239
|
+
type: "function"
|
|
4240
|
+
},
|
|
4241
|
+
{
|
|
4242
|
+
inputs: [
|
|
4243
|
+
{
|
|
4244
|
+
internalType: "bytes",
|
|
4245
|
+
name: "_unbundlerAddress",
|
|
4246
|
+
type: "bytes"
|
|
4247
|
+
}
|
|
4248
|
+
],
|
|
4249
|
+
name: "unbundlerAddress",
|
|
4250
|
+
outputs: [],
|
|
4251
|
+
stateMutability: "pure",
|
|
4252
|
+
type: "function"
|
|
4253
|
+
}
|
|
4254
|
+
];
|
|
4255
|
+
var IERC7786Attributes_default = IERC7786AttributesABI;
|
|
4256
|
+
|
|
4185
4257
|
// src/core/internal/abis/Mailbox.ts
|
|
4186
4258
|
var MailboxABI = [
|
|
4187
4259
|
{
|
|
@@ -4410,153 +4482,1510 @@ var MailboxABI = [
|
|
|
4410
4482
|
{ name: "_factoryDeps", type: "bytes[]", internalType: "bytes[]" },
|
|
4411
4483
|
{ name: "_refundRecipient", type: "address", internalType: "address" }
|
|
4412
4484
|
],
|
|
4413
|
-
outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
|
|
4414
|
-
stateMutability: "payable"
|
|
4415
|
-
},
|
|
4416
|
-
{
|
|
4417
|
-
type: "function",
|
|
4418
|
-
name: "requestL2TransactionToGatewayMailbox",
|
|
4419
|
-
inputs: [
|
|
4420
|
-
{ name: "_chainId", type: "uint256", internalType: "uint256" },
|
|
4421
|
-
{ name: "_canonicalTxHash", type: "bytes32", internalType: "bytes32" },
|
|
4422
|
-
{ name: "_expirationTimestamp", type: "uint64", internalType: "uint64" }
|
|
4485
|
+
outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
|
|
4486
|
+
stateMutability: "payable"
|
|
4487
|
+
},
|
|
4488
|
+
{
|
|
4489
|
+
type: "function",
|
|
4490
|
+
name: "requestL2TransactionToGatewayMailbox",
|
|
4491
|
+
inputs: [
|
|
4492
|
+
{ name: "_chainId", type: "uint256", internalType: "uint256" },
|
|
4493
|
+
{ name: "_canonicalTxHash", type: "bytes32", internalType: "bytes32" },
|
|
4494
|
+
{ name: "_expirationTimestamp", type: "uint64", internalType: "uint64" }
|
|
4495
|
+
],
|
|
4496
|
+
outputs: [{ name: "canonicalTxHash", type: "bytes32", internalType: "bytes32" }],
|
|
4497
|
+
stateMutability: "nonpayable"
|
|
4498
|
+
},
|
|
4499
|
+
{
|
|
4500
|
+
type: "event",
|
|
4501
|
+
name: "NewPriorityRequest",
|
|
4502
|
+
inputs: [
|
|
4503
|
+
{ name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
|
|
4504
|
+
{ name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
|
|
4505
|
+
{
|
|
4506
|
+
name: "expirationTimestamp",
|
|
4507
|
+
type: "uint64",
|
|
4508
|
+
indexed: false,
|
|
4509
|
+
internalType: "uint64"
|
|
4510
|
+
},
|
|
4511
|
+
{
|
|
4512
|
+
name: "transaction",
|
|
4513
|
+
type: "tuple",
|
|
4514
|
+
indexed: false,
|
|
4515
|
+
internalType: "struct L2CanonicalTransaction",
|
|
4516
|
+
components: [
|
|
4517
|
+
{ name: "txType", type: "uint256", internalType: "uint256" },
|
|
4518
|
+
{ name: "from", type: "uint256", internalType: "uint256" },
|
|
4519
|
+
{ name: "to", type: "uint256", internalType: "uint256" },
|
|
4520
|
+
{ name: "gasLimit", type: "uint256", internalType: "uint256" },
|
|
4521
|
+
{ name: "gasPerPubdataByteLimit", type: "uint256", internalType: "uint256" },
|
|
4522
|
+
{ name: "maxFeePerGas", type: "uint256", internalType: "uint256" },
|
|
4523
|
+
{ name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256" },
|
|
4524
|
+
{ name: "paymaster", type: "uint256", internalType: "uint256" },
|
|
4525
|
+
{ name: "nonce", type: "uint256", internalType: "uint256" },
|
|
4526
|
+
{ name: "value", type: "uint256", internalType: "uint256" },
|
|
4527
|
+
{ name: "reserved", type: "uint256[4]", internalType: "uint256[4]" },
|
|
4528
|
+
{ name: "data", type: "bytes", internalType: "bytes" },
|
|
4529
|
+
{ name: "signature", type: "bytes", internalType: "bytes" },
|
|
4530
|
+
{ name: "factoryDeps", type: "uint256[]", internalType: "uint256[]" },
|
|
4531
|
+
{ name: "paymasterInput", type: "bytes", internalType: "bytes" },
|
|
4532
|
+
{ name: "reservedDynamic", type: "bytes", internalType: "bytes" }
|
|
4533
|
+
]
|
|
4534
|
+
},
|
|
4535
|
+
{ name: "factoryDeps", type: "bytes[]", indexed: false, internalType: "bytes[]" }
|
|
4536
|
+
],
|
|
4537
|
+
anonymous: false
|
|
4538
|
+
},
|
|
4539
|
+
{
|
|
4540
|
+
type: "event",
|
|
4541
|
+
name: "NewPriorityRequestId",
|
|
4542
|
+
inputs: [
|
|
4543
|
+
{ name: "txId", type: "uint256", indexed: true, internalType: "uint256" },
|
|
4544
|
+
{ name: "txHash", type: "bytes32", indexed: true, internalType: "bytes32" }
|
|
4545
|
+
],
|
|
4546
|
+
anonymous: false
|
|
4547
|
+
},
|
|
4548
|
+
{
|
|
4549
|
+
type: "event",
|
|
4550
|
+
name: "NewRelayedPriorityTransaction",
|
|
4551
|
+
inputs: [
|
|
4552
|
+
{ name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
|
|
4553
|
+
{ name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
|
|
4554
|
+
{
|
|
4555
|
+
name: "expirationTimestamp",
|
|
4556
|
+
type: "uint64",
|
|
4557
|
+
indexed: false,
|
|
4558
|
+
internalType: "uint64"
|
|
4559
|
+
}
|
|
4560
|
+
],
|
|
4561
|
+
anonymous: false
|
|
4562
|
+
},
|
|
4563
|
+
{ type: "error", name: "BaseTokenGasPriceDenominatorNotSet", inputs: [] },
|
|
4564
|
+
{
|
|
4565
|
+
type: "error",
|
|
4566
|
+
name: "BatchNotExecuted",
|
|
4567
|
+
inputs: [{ name: "batchNumber", type: "uint256", internalType: "uint256" }]
|
|
4568
|
+
},
|
|
4569
|
+
{ type: "error", name: "GasPerPubdataMismatch", inputs: [] },
|
|
4570
|
+
{ type: "error", name: "HashedLogIsDefault", inputs: [] },
|
|
4571
|
+
{ type: "error", name: "InvalidChainId", inputs: [] },
|
|
4572
|
+
{ type: "error", name: "InvalidProofLengthForFinalNode", inputs: [] },
|
|
4573
|
+
{
|
|
4574
|
+
type: "error",
|
|
4575
|
+
name: "LengthIsNotDivisibleBy32",
|
|
4576
|
+
inputs: [{ name: "length", type: "uint256", internalType: "uint256" }]
|
|
4577
|
+
},
|
|
4578
|
+
{ type: "error", name: "LocalRootIsZero", inputs: [] },
|
|
4579
|
+
{ type: "error", name: "LocalRootMustBeZero", inputs: [] },
|
|
4580
|
+
{
|
|
4581
|
+
type: "error",
|
|
4582
|
+
name: "MalformedBytecode",
|
|
4583
|
+
inputs: [{ name: "", type: "uint8", internalType: "enum BytecodeError" }]
|
|
4584
|
+
},
|
|
4585
|
+
{ type: "error", name: "MerkleIndexOutOfBounds", inputs: [] },
|
|
4586
|
+
{ type: "error", name: "MerklePathEmpty", inputs: [] },
|
|
4587
|
+
{ type: "error", name: "MerklePathOutOfBounds", inputs: [] },
|
|
4588
|
+
{
|
|
4589
|
+
type: "error",
|
|
4590
|
+
name: "MsgValueTooLow",
|
|
4591
|
+
inputs: [
|
|
4592
|
+
{ name: "required", type: "uint256", internalType: "uint256" },
|
|
4593
|
+
{ name: "provided", type: "uint256", internalType: "uint256" }
|
|
4594
|
+
]
|
|
4595
|
+
},
|
|
4596
|
+
{ type: "error", name: "NotHyperchain", inputs: [] },
|
|
4597
|
+
{ type: "error", name: "NotInitializedReentrancyGuard", inputs: [] },
|
|
4598
|
+
{
|
|
4599
|
+
type: "error",
|
|
4600
|
+
name: "NotL1",
|
|
4601
|
+
inputs: [{ name: "blockChainId", type: "uint256", internalType: "uint256" }]
|
|
4602
|
+
},
|
|
4603
|
+
{ type: "error", name: "NotSettlementLayer", inputs: [] },
|
|
4604
|
+
{ type: "error", name: "OnlyEraSupported", inputs: [] },
|
|
4605
|
+
{
|
|
4606
|
+
type: "error",
|
|
4607
|
+
name: "PubdataGreaterThanLimit",
|
|
4608
|
+
inputs: [
|
|
4609
|
+
{ name: "limit", type: "uint256", internalType: "uint256" },
|
|
4610
|
+
{ name: "length", type: "uint256", internalType: "uint256" }
|
|
4611
|
+
]
|
|
4612
|
+
},
|
|
4613
|
+
{ type: "error", name: "Reentrancy", inputs: [] },
|
|
4614
|
+
{ type: "error", name: "TooManyFactoryDeps", inputs: [] },
|
|
4615
|
+
{ type: "error", name: "TooMuchGas", inputs: [] },
|
|
4616
|
+
{ type: "error", name: "TransactionNotAllowed", inputs: [] },
|
|
4617
|
+
{ type: "error", name: "TxnBodyGasLimitNotEnoughGas", inputs: [] },
|
|
4618
|
+
{
|
|
4619
|
+
type: "error",
|
|
4620
|
+
name: "Unauthorized",
|
|
4621
|
+
inputs: [{ name: "caller", type: "address", internalType: "address" }]
|
|
4622
|
+
},
|
|
4623
|
+
{
|
|
4624
|
+
type: "error",
|
|
4625
|
+
name: "UnsupportedProofMetadataVersion",
|
|
4626
|
+
inputs: [{ name: "metadataVersion", type: "uint256", internalType: "uint256" }]
|
|
4627
|
+
},
|
|
4628
|
+
{ type: "error", name: "ValidateTxnNotEnoughGas", inputs: [] },
|
|
4629
|
+
{ type: "error", name: "ZeroGasPriceL1TxZKSyncOS", inputs: [] }
|
|
4630
|
+
];
|
|
4631
|
+
var Mailbox_default = MailboxABI;
|
|
4632
|
+
|
|
4633
|
+
// src/core/internal/abis/InteropCenter.ts
|
|
4634
|
+
var InteropCenterABI = [
|
|
4635
|
+
{
|
|
4636
|
+
inputs: [
|
|
4637
|
+
{
|
|
4638
|
+
internalType: "bytes4",
|
|
4639
|
+
name: "selector",
|
|
4640
|
+
type: "bytes4"
|
|
4641
|
+
}
|
|
4642
|
+
],
|
|
4643
|
+
name: "AttributeAlreadySet",
|
|
4644
|
+
type: "error"
|
|
4645
|
+
},
|
|
4646
|
+
{
|
|
4647
|
+
inputs: [
|
|
4648
|
+
{
|
|
4649
|
+
internalType: "bytes4",
|
|
4650
|
+
name: "selector",
|
|
4651
|
+
type: "bytes4"
|
|
4652
|
+
},
|
|
4653
|
+
{
|
|
4654
|
+
internalType: "uint256",
|
|
4655
|
+
name: "restriction",
|
|
4656
|
+
type: "uint256"
|
|
4657
|
+
}
|
|
4658
|
+
],
|
|
4659
|
+
name: "AttributeViolatesRestriction",
|
|
4660
|
+
type: "error"
|
|
4661
|
+
},
|
|
4662
|
+
{
|
|
4663
|
+
inputs: [
|
|
4664
|
+
{
|
|
4665
|
+
internalType: "uint256",
|
|
4666
|
+
name: "expected",
|
|
4667
|
+
type: "uint256"
|
|
4668
|
+
},
|
|
4669
|
+
{
|
|
4670
|
+
internalType: "uint256",
|
|
4671
|
+
name: "actual",
|
|
4672
|
+
type: "uint256"
|
|
4673
|
+
}
|
|
4674
|
+
],
|
|
4675
|
+
name: "IndirectCallValueMismatch",
|
|
4676
|
+
type: "error"
|
|
4677
|
+
},
|
|
4678
|
+
{
|
|
4679
|
+
inputs: [
|
|
4680
|
+
{
|
|
4681
|
+
internalType: "bytes",
|
|
4682
|
+
name: "interoperableAddress",
|
|
4683
|
+
type: "bytes"
|
|
4684
|
+
}
|
|
4685
|
+
],
|
|
4686
|
+
name: "InteroperableAddressChainReferenceNotEmpty",
|
|
4687
|
+
type: "error"
|
|
4688
|
+
},
|
|
4689
|
+
{
|
|
4690
|
+
inputs: [
|
|
4691
|
+
{
|
|
4692
|
+
internalType: "bytes",
|
|
4693
|
+
name: "interoperableAddress",
|
|
4694
|
+
type: "bytes"
|
|
4695
|
+
}
|
|
4696
|
+
],
|
|
4697
|
+
name: "InteroperableAddressNotEmpty",
|
|
4698
|
+
type: "error"
|
|
4699
|
+
},
|
|
4700
|
+
{
|
|
4701
|
+
inputs: [
|
|
4702
|
+
{
|
|
4703
|
+
internalType: "bytes",
|
|
4704
|
+
name: "",
|
|
4705
|
+
type: "bytes"
|
|
4706
|
+
}
|
|
4707
|
+
],
|
|
4708
|
+
name: "InteroperableAddressParsingError",
|
|
4709
|
+
type: "error"
|
|
4710
|
+
},
|
|
4711
|
+
{
|
|
4712
|
+
inputs: [
|
|
4713
|
+
{
|
|
4714
|
+
internalType: "uint256",
|
|
4715
|
+
name: "expectedMsgValue",
|
|
4716
|
+
type: "uint256"
|
|
4717
|
+
},
|
|
4718
|
+
{
|
|
4719
|
+
internalType: "uint256",
|
|
4720
|
+
name: "providedMsgValue",
|
|
4721
|
+
type: "uint256"
|
|
4722
|
+
}
|
|
4723
|
+
],
|
|
4724
|
+
name: "MsgValueMismatch",
|
|
4725
|
+
type: "error"
|
|
4726
|
+
},
|
|
4727
|
+
{
|
|
4728
|
+
inputs: [],
|
|
4729
|
+
name: "NotInGatewayMode",
|
|
4730
|
+
type: "error"
|
|
4731
|
+
},
|
|
4732
|
+
{
|
|
4733
|
+
inputs: [
|
|
4734
|
+
{
|
|
4735
|
+
internalType: "uint256",
|
|
4736
|
+
name: "sourceChainId",
|
|
4737
|
+
type: "uint256"
|
|
4738
|
+
},
|
|
4739
|
+
{
|
|
4740
|
+
internalType: "uint256",
|
|
4741
|
+
name: "destinationChainId",
|
|
4742
|
+
type: "uint256"
|
|
4743
|
+
}
|
|
4744
|
+
],
|
|
4745
|
+
name: "NotL2ToL2",
|
|
4746
|
+
type: "error"
|
|
4747
|
+
},
|
|
4748
|
+
{
|
|
4749
|
+
inputs: [],
|
|
4750
|
+
name: "SlotOccupied",
|
|
4751
|
+
type: "error"
|
|
4752
|
+
},
|
|
4753
|
+
{
|
|
4754
|
+
inputs: [
|
|
4755
|
+
{
|
|
4756
|
+
internalType: "address",
|
|
4757
|
+
name: "caller",
|
|
4758
|
+
type: "address"
|
|
4759
|
+
}
|
|
4760
|
+
],
|
|
4761
|
+
name: "Unauthorized",
|
|
4762
|
+
type: "error"
|
|
4763
|
+
},
|
|
4764
|
+
{
|
|
4765
|
+
inputs: [
|
|
4766
|
+
{
|
|
4767
|
+
internalType: "bytes4",
|
|
4768
|
+
name: "selector",
|
|
4769
|
+
type: "bytes4"
|
|
4770
|
+
}
|
|
4771
|
+
],
|
|
4772
|
+
name: "UnsupportedAttribute",
|
|
4773
|
+
type: "error"
|
|
4774
|
+
},
|
|
4775
|
+
{
|
|
4776
|
+
anonymous: false,
|
|
4777
|
+
inputs: [
|
|
4778
|
+
{
|
|
4779
|
+
indexed: false,
|
|
4780
|
+
internalType: "uint8",
|
|
4781
|
+
name: "version",
|
|
4782
|
+
type: "uint8"
|
|
4783
|
+
}
|
|
4784
|
+
],
|
|
4785
|
+
name: "Initialized",
|
|
4786
|
+
type: "event"
|
|
4787
|
+
},
|
|
4788
|
+
{
|
|
4789
|
+
anonymous: false,
|
|
4790
|
+
inputs: [
|
|
4791
|
+
{
|
|
4792
|
+
indexed: false,
|
|
4793
|
+
internalType: "bytes32",
|
|
4794
|
+
name: "l2l1MsgHash",
|
|
4795
|
+
type: "bytes32"
|
|
4796
|
+
},
|
|
4797
|
+
{
|
|
4798
|
+
indexed: false,
|
|
4799
|
+
internalType: "bytes32",
|
|
4800
|
+
name: "interopBundleHash",
|
|
4801
|
+
type: "bytes32"
|
|
4802
|
+
},
|
|
4803
|
+
{
|
|
4804
|
+
components: [
|
|
4805
|
+
{
|
|
4806
|
+
internalType: "bytes1",
|
|
4807
|
+
name: "version",
|
|
4808
|
+
type: "bytes1"
|
|
4809
|
+
},
|
|
4810
|
+
{
|
|
4811
|
+
internalType: "uint256",
|
|
4812
|
+
name: "sourceChainId",
|
|
4813
|
+
type: "uint256"
|
|
4814
|
+
},
|
|
4815
|
+
{
|
|
4816
|
+
internalType: "uint256",
|
|
4817
|
+
name: "destinationChainId",
|
|
4818
|
+
type: "uint256"
|
|
4819
|
+
},
|
|
4820
|
+
{
|
|
4821
|
+
internalType: "bytes32",
|
|
4822
|
+
name: "interopBundleSalt",
|
|
4823
|
+
type: "bytes32"
|
|
4824
|
+
},
|
|
4825
|
+
{
|
|
4826
|
+
components: [
|
|
4827
|
+
{
|
|
4828
|
+
internalType: "bytes1",
|
|
4829
|
+
name: "version",
|
|
4830
|
+
type: "bytes1"
|
|
4831
|
+
},
|
|
4832
|
+
{
|
|
4833
|
+
internalType: "bool",
|
|
4834
|
+
name: "shadowAccount",
|
|
4835
|
+
type: "bool"
|
|
4836
|
+
},
|
|
4837
|
+
{
|
|
4838
|
+
internalType: "address",
|
|
4839
|
+
name: "to",
|
|
4840
|
+
type: "address"
|
|
4841
|
+
},
|
|
4842
|
+
{
|
|
4843
|
+
internalType: "address",
|
|
4844
|
+
name: "from",
|
|
4845
|
+
type: "address"
|
|
4846
|
+
},
|
|
4847
|
+
{
|
|
4848
|
+
internalType: "uint256",
|
|
4849
|
+
name: "value",
|
|
4850
|
+
type: "uint256"
|
|
4851
|
+
},
|
|
4852
|
+
{
|
|
4853
|
+
internalType: "bytes",
|
|
4854
|
+
name: "data",
|
|
4855
|
+
type: "bytes"
|
|
4856
|
+
}
|
|
4857
|
+
],
|
|
4858
|
+
internalType: "struct InteropCall[]",
|
|
4859
|
+
name: "calls",
|
|
4860
|
+
type: "tuple[]"
|
|
4861
|
+
},
|
|
4862
|
+
{
|
|
4863
|
+
components: [
|
|
4864
|
+
{
|
|
4865
|
+
internalType: "bytes",
|
|
4866
|
+
name: "executionAddress",
|
|
4867
|
+
type: "bytes"
|
|
4868
|
+
},
|
|
4869
|
+
{
|
|
4870
|
+
internalType: "bytes",
|
|
4871
|
+
name: "unbundlerAddress",
|
|
4872
|
+
type: "bytes"
|
|
4873
|
+
}
|
|
4874
|
+
],
|
|
4875
|
+
internalType: "struct BundleAttributes",
|
|
4876
|
+
name: "bundleAttributes",
|
|
4877
|
+
type: "tuple"
|
|
4878
|
+
}
|
|
4879
|
+
],
|
|
4880
|
+
indexed: false,
|
|
4881
|
+
internalType: "struct InteropBundle",
|
|
4882
|
+
name: "interopBundle",
|
|
4883
|
+
type: "tuple"
|
|
4884
|
+
}
|
|
4885
|
+
],
|
|
4886
|
+
name: "InteropBundleSent",
|
|
4887
|
+
type: "event"
|
|
4888
|
+
},
|
|
4889
|
+
{
|
|
4890
|
+
anonymous: false,
|
|
4891
|
+
inputs: [
|
|
4892
|
+
{
|
|
4893
|
+
indexed: true,
|
|
4894
|
+
internalType: "bytes32",
|
|
4895
|
+
name: "sendId",
|
|
4896
|
+
type: "bytes32"
|
|
4897
|
+
},
|
|
4898
|
+
{
|
|
4899
|
+
indexed: false,
|
|
4900
|
+
internalType: "bytes",
|
|
4901
|
+
name: "sender",
|
|
4902
|
+
type: "bytes"
|
|
4903
|
+
},
|
|
4904
|
+
{
|
|
4905
|
+
indexed: false,
|
|
4906
|
+
internalType: "bytes",
|
|
4907
|
+
name: "recipient",
|
|
4908
|
+
type: "bytes"
|
|
4909
|
+
},
|
|
4910
|
+
{
|
|
4911
|
+
indexed: false,
|
|
4912
|
+
internalType: "bytes",
|
|
4913
|
+
name: "payload",
|
|
4914
|
+
type: "bytes"
|
|
4915
|
+
},
|
|
4916
|
+
{
|
|
4917
|
+
indexed: false,
|
|
4918
|
+
internalType: "uint256",
|
|
4919
|
+
name: "value",
|
|
4920
|
+
type: "uint256"
|
|
4921
|
+
},
|
|
4922
|
+
{
|
|
4923
|
+
indexed: false,
|
|
4924
|
+
internalType: "bytes[]",
|
|
4925
|
+
name: "attributes",
|
|
4926
|
+
type: "bytes[]"
|
|
4927
|
+
}
|
|
4928
|
+
],
|
|
4929
|
+
name: "MessageSent",
|
|
4930
|
+
type: "event"
|
|
4931
|
+
},
|
|
4932
|
+
{
|
|
4933
|
+
anonymous: false,
|
|
4934
|
+
inputs: [
|
|
4935
|
+
{
|
|
4936
|
+
indexed: true,
|
|
4937
|
+
internalType: "address",
|
|
4938
|
+
name: "oldAssetRouter",
|
|
4939
|
+
type: "address"
|
|
4940
|
+
},
|
|
4941
|
+
{
|
|
4942
|
+
indexed: true,
|
|
4943
|
+
internalType: "address",
|
|
4944
|
+
name: "newAssetRouter",
|
|
4945
|
+
type: "address"
|
|
4946
|
+
}
|
|
4947
|
+
],
|
|
4948
|
+
name: "NewAssetRouter",
|
|
4949
|
+
type: "event"
|
|
4950
|
+
},
|
|
4951
|
+
{
|
|
4952
|
+
anonymous: false,
|
|
4953
|
+
inputs: [
|
|
4954
|
+
{
|
|
4955
|
+
indexed: true,
|
|
4956
|
+
internalType: "address",
|
|
4957
|
+
name: "oldAssetTracker",
|
|
4958
|
+
type: "address"
|
|
4959
|
+
},
|
|
4960
|
+
{
|
|
4961
|
+
indexed: true,
|
|
4962
|
+
internalType: "address",
|
|
4963
|
+
name: "newAssetTracker",
|
|
4964
|
+
type: "address"
|
|
4965
|
+
}
|
|
4966
|
+
],
|
|
4967
|
+
name: "NewAssetTracker",
|
|
4968
|
+
type: "event"
|
|
4969
|
+
},
|
|
4970
|
+
{
|
|
4971
|
+
anonymous: false,
|
|
4972
|
+
inputs: [
|
|
4973
|
+
{
|
|
4974
|
+
indexed: true,
|
|
4975
|
+
internalType: "address",
|
|
4976
|
+
name: "previousOwner",
|
|
4977
|
+
type: "address"
|
|
4978
|
+
},
|
|
4979
|
+
{
|
|
4980
|
+
indexed: true,
|
|
4981
|
+
internalType: "address",
|
|
4982
|
+
name: "newOwner",
|
|
4983
|
+
type: "address"
|
|
4984
|
+
}
|
|
4985
|
+
],
|
|
4986
|
+
name: "OwnershipTransferStarted",
|
|
4987
|
+
type: "event"
|
|
4988
|
+
},
|
|
4989
|
+
{
|
|
4990
|
+
anonymous: false,
|
|
4991
|
+
inputs: [
|
|
4992
|
+
{
|
|
4993
|
+
indexed: true,
|
|
4994
|
+
internalType: "address",
|
|
4995
|
+
name: "previousOwner",
|
|
4996
|
+
type: "address"
|
|
4997
|
+
},
|
|
4998
|
+
{
|
|
4999
|
+
indexed: true,
|
|
5000
|
+
internalType: "address",
|
|
5001
|
+
name: "newOwner",
|
|
5002
|
+
type: "address"
|
|
5003
|
+
}
|
|
5004
|
+
],
|
|
5005
|
+
name: "OwnershipTransferred",
|
|
5006
|
+
type: "event"
|
|
5007
|
+
},
|
|
5008
|
+
{
|
|
5009
|
+
anonymous: false,
|
|
5010
|
+
inputs: [
|
|
5011
|
+
{
|
|
5012
|
+
indexed: false,
|
|
5013
|
+
internalType: "address",
|
|
5014
|
+
name: "account",
|
|
5015
|
+
type: "address"
|
|
5016
|
+
}
|
|
5017
|
+
],
|
|
5018
|
+
name: "Paused",
|
|
5019
|
+
type: "event"
|
|
5020
|
+
},
|
|
5021
|
+
{
|
|
5022
|
+
anonymous: false,
|
|
5023
|
+
inputs: [
|
|
5024
|
+
{
|
|
5025
|
+
indexed: false,
|
|
5026
|
+
internalType: "address",
|
|
5027
|
+
name: "account",
|
|
5028
|
+
type: "address"
|
|
5029
|
+
}
|
|
5030
|
+
],
|
|
5031
|
+
name: "Unpaused",
|
|
5032
|
+
type: "event"
|
|
5033
|
+
},
|
|
5034
|
+
{
|
|
5035
|
+
inputs: [],
|
|
5036
|
+
name: "L1_CHAIN_ID",
|
|
5037
|
+
outputs: [
|
|
5038
|
+
{
|
|
5039
|
+
internalType: "uint256",
|
|
5040
|
+
name: "",
|
|
5041
|
+
type: "uint256"
|
|
5042
|
+
}
|
|
5043
|
+
],
|
|
5044
|
+
stateMutability: "view",
|
|
5045
|
+
type: "function"
|
|
5046
|
+
},
|
|
5047
|
+
{
|
|
5048
|
+
inputs: [],
|
|
5049
|
+
name: "acceptOwnership",
|
|
5050
|
+
outputs: [],
|
|
5051
|
+
stateMutability: "nonpayable",
|
|
5052
|
+
type: "function"
|
|
5053
|
+
},
|
|
5054
|
+
{
|
|
5055
|
+
inputs: [
|
|
5056
|
+
{
|
|
5057
|
+
internalType: "uint256",
|
|
5058
|
+
name: "_chainId",
|
|
5059
|
+
type: "uint256"
|
|
5060
|
+
},
|
|
5061
|
+
{
|
|
5062
|
+
internalType: "bytes32",
|
|
5063
|
+
name: "_canonicalTxHash",
|
|
5064
|
+
type: "bytes32"
|
|
5065
|
+
},
|
|
5066
|
+
{
|
|
5067
|
+
internalType: "uint64",
|
|
5068
|
+
name: "_expirationTimestamp",
|
|
5069
|
+
type: "uint64"
|
|
5070
|
+
},
|
|
5071
|
+
{
|
|
5072
|
+
components: [
|
|
5073
|
+
{
|
|
5074
|
+
internalType: "bytes1",
|
|
5075
|
+
name: "version",
|
|
5076
|
+
type: "bytes1"
|
|
5077
|
+
},
|
|
5078
|
+
{
|
|
5079
|
+
internalType: "address",
|
|
5080
|
+
name: "originToken",
|
|
5081
|
+
type: "address"
|
|
5082
|
+
},
|
|
5083
|
+
{
|
|
5084
|
+
internalType: "bytes32",
|
|
5085
|
+
name: "baseTokenAssetId",
|
|
5086
|
+
type: "bytes32"
|
|
5087
|
+
},
|
|
5088
|
+
{
|
|
5089
|
+
internalType: "uint256",
|
|
5090
|
+
name: "baseTokenAmount",
|
|
5091
|
+
type: "uint256"
|
|
5092
|
+
},
|
|
5093
|
+
{
|
|
5094
|
+
internalType: "bytes32",
|
|
5095
|
+
name: "assetId",
|
|
5096
|
+
type: "bytes32"
|
|
5097
|
+
},
|
|
5098
|
+
{
|
|
5099
|
+
internalType: "uint256",
|
|
5100
|
+
name: "amount",
|
|
5101
|
+
type: "uint256"
|
|
5102
|
+
},
|
|
5103
|
+
{
|
|
5104
|
+
internalType: "uint256",
|
|
5105
|
+
name: "tokenOriginChainId",
|
|
5106
|
+
type: "uint256"
|
|
5107
|
+
}
|
|
5108
|
+
],
|
|
5109
|
+
internalType: "struct BalanceChange",
|
|
5110
|
+
name: "_balanceChange",
|
|
5111
|
+
type: "tuple"
|
|
5112
|
+
}
|
|
5113
|
+
],
|
|
5114
|
+
name: "forwardTransactionOnGatewayWithBalanceChange",
|
|
5115
|
+
outputs: [],
|
|
5116
|
+
stateMutability: "nonpayable",
|
|
5117
|
+
type: "function"
|
|
5118
|
+
},
|
|
5119
|
+
{
|
|
5120
|
+
inputs: [
|
|
5121
|
+
{
|
|
5122
|
+
internalType: "uint256",
|
|
5123
|
+
name: "_l1ChainId",
|
|
5124
|
+
type: "uint256"
|
|
5125
|
+
},
|
|
5126
|
+
{
|
|
5127
|
+
internalType: "address",
|
|
5128
|
+
name: "_owner",
|
|
5129
|
+
type: "address"
|
|
5130
|
+
}
|
|
5131
|
+
],
|
|
5132
|
+
name: "initL2",
|
|
5133
|
+
outputs: [],
|
|
5134
|
+
stateMutability: "nonpayable",
|
|
5135
|
+
type: "function"
|
|
5136
|
+
},
|
|
5137
|
+
{
|
|
5138
|
+
inputs: [
|
|
5139
|
+
{
|
|
5140
|
+
internalType: "address",
|
|
5141
|
+
name: "sender",
|
|
5142
|
+
type: "address"
|
|
5143
|
+
}
|
|
5144
|
+
],
|
|
5145
|
+
name: "interopBundleNonce",
|
|
5146
|
+
outputs: [
|
|
5147
|
+
{
|
|
5148
|
+
internalType: "uint256",
|
|
5149
|
+
name: "numberOfBundlesSent",
|
|
5150
|
+
type: "uint256"
|
|
5151
|
+
}
|
|
5152
|
+
],
|
|
5153
|
+
stateMutability: "view",
|
|
5154
|
+
type: "function"
|
|
5155
|
+
},
|
|
5156
|
+
{
|
|
5157
|
+
inputs: [],
|
|
5158
|
+
name: "owner",
|
|
5159
|
+
outputs: [
|
|
5160
|
+
{
|
|
5161
|
+
internalType: "address",
|
|
5162
|
+
name: "",
|
|
5163
|
+
type: "address"
|
|
5164
|
+
}
|
|
5165
|
+
],
|
|
5166
|
+
stateMutability: "view",
|
|
5167
|
+
type: "function"
|
|
5168
|
+
},
|
|
5169
|
+
{
|
|
5170
|
+
inputs: [
|
|
5171
|
+
{
|
|
5172
|
+
internalType: "bytes[]",
|
|
5173
|
+
name: "_attributes",
|
|
5174
|
+
type: "bytes[]"
|
|
5175
|
+
},
|
|
5176
|
+
{
|
|
5177
|
+
internalType: "enum IInteropCenter.AttributeParsingRestrictions",
|
|
5178
|
+
name: "_restriction",
|
|
5179
|
+
type: "uint8"
|
|
5180
|
+
}
|
|
5181
|
+
],
|
|
5182
|
+
name: "parseAttributes",
|
|
5183
|
+
outputs: [
|
|
5184
|
+
{
|
|
5185
|
+
components: [
|
|
5186
|
+
{
|
|
5187
|
+
internalType: "uint256",
|
|
5188
|
+
name: "interopCallValue",
|
|
5189
|
+
type: "uint256"
|
|
5190
|
+
},
|
|
5191
|
+
{
|
|
5192
|
+
internalType: "bool",
|
|
5193
|
+
name: "indirectCall",
|
|
5194
|
+
type: "bool"
|
|
5195
|
+
},
|
|
5196
|
+
{
|
|
5197
|
+
internalType: "uint256",
|
|
5198
|
+
name: "indirectCallMessageValue",
|
|
5199
|
+
type: "uint256"
|
|
5200
|
+
}
|
|
5201
|
+
],
|
|
5202
|
+
internalType: "struct CallAttributes",
|
|
5203
|
+
name: "callAttributes",
|
|
5204
|
+
type: "tuple"
|
|
5205
|
+
},
|
|
5206
|
+
{
|
|
5207
|
+
components: [
|
|
5208
|
+
{
|
|
5209
|
+
internalType: "bytes",
|
|
5210
|
+
name: "executionAddress",
|
|
5211
|
+
type: "bytes"
|
|
5212
|
+
},
|
|
5213
|
+
{
|
|
5214
|
+
internalType: "bytes",
|
|
5215
|
+
name: "unbundlerAddress",
|
|
5216
|
+
type: "bytes"
|
|
5217
|
+
}
|
|
5218
|
+
],
|
|
5219
|
+
internalType: "struct BundleAttributes",
|
|
5220
|
+
name: "bundleAttributes",
|
|
5221
|
+
type: "tuple"
|
|
5222
|
+
}
|
|
5223
|
+
],
|
|
5224
|
+
stateMutability: "pure",
|
|
5225
|
+
type: "function"
|
|
5226
|
+
},
|
|
5227
|
+
{
|
|
5228
|
+
inputs: [],
|
|
5229
|
+
name: "pause",
|
|
5230
|
+
outputs: [],
|
|
5231
|
+
stateMutability: "nonpayable",
|
|
5232
|
+
type: "function"
|
|
5233
|
+
},
|
|
5234
|
+
{
|
|
5235
|
+
inputs: [],
|
|
5236
|
+
name: "paused",
|
|
5237
|
+
outputs: [
|
|
5238
|
+
{
|
|
5239
|
+
internalType: "bool",
|
|
5240
|
+
name: "",
|
|
5241
|
+
type: "bool"
|
|
5242
|
+
}
|
|
5243
|
+
],
|
|
5244
|
+
stateMutability: "view",
|
|
5245
|
+
type: "function"
|
|
5246
|
+
},
|
|
5247
|
+
{
|
|
5248
|
+
inputs: [],
|
|
5249
|
+
name: "pendingOwner",
|
|
5250
|
+
outputs: [
|
|
5251
|
+
{
|
|
5252
|
+
internalType: "address",
|
|
5253
|
+
name: "",
|
|
5254
|
+
type: "address"
|
|
5255
|
+
}
|
|
5256
|
+
],
|
|
5257
|
+
stateMutability: "view",
|
|
5258
|
+
type: "function"
|
|
5259
|
+
},
|
|
5260
|
+
{
|
|
5261
|
+
inputs: [],
|
|
5262
|
+
name: "renounceOwnership",
|
|
5263
|
+
outputs: [],
|
|
5264
|
+
stateMutability: "nonpayable",
|
|
5265
|
+
type: "function"
|
|
5266
|
+
},
|
|
5267
|
+
{
|
|
5268
|
+
inputs: [
|
|
5269
|
+
{
|
|
5270
|
+
internalType: "bytes",
|
|
5271
|
+
name: "_destinationChainId",
|
|
5272
|
+
type: "bytes"
|
|
5273
|
+
},
|
|
5274
|
+
{
|
|
5275
|
+
components: [
|
|
5276
|
+
{
|
|
5277
|
+
internalType: "bytes",
|
|
5278
|
+
name: "to",
|
|
5279
|
+
type: "bytes"
|
|
5280
|
+
},
|
|
5281
|
+
{
|
|
5282
|
+
internalType: "bytes",
|
|
5283
|
+
name: "data",
|
|
5284
|
+
type: "bytes"
|
|
5285
|
+
},
|
|
5286
|
+
{
|
|
5287
|
+
internalType: "bytes[]",
|
|
5288
|
+
name: "callAttributes",
|
|
5289
|
+
type: "bytes[]"
|
|
5290
|
+
}
|
|
5291
|
+
],
|
|
5292
|
+
internalType: "struct InteropCallStarter[]",
|
|
5293
|
+
name: "_callStarters",
|
|
5294
|
+
type: "tuple[]"
|
|
5295
|
+
},
|
|
5296
|
+
{
|
|
5297
|
+
internalType: "bytes[]",
|
|
5298
|
+
name: "_bundleAttributes",
|
|
5299
|
+
type: "bytes[]"
|
|
5300
|
+
}
|
|
5301
|
+
],
|
|
5302
|
+
name: "sendBundle",
|
|
5303
|
+
outputs: [
|
|
5304
|
+
{
|
|
5305
|
+
internalType: "bytes32",
|
|
5306
|
+
name: "bundleHash",
|
|
5307
|
+
type: "bytes32"
|
|
5308
|
+
}
|
|
5309
|
+
],
|
|
5310
|
+
stateMutability: "payable",
|
|
5311
|
+
type: "function"
|
|
5312
|
+
},
|
|
5313
|
+
{
|
|
5314
|
+
inputs: [
|
|
5315
|
+
{
|
|
5316
|
+
internalType: "bytes",
|
|
5317
|
+
name: "recipient",
|
|
5318
|
+
type: "bytes"
|
|
5319
|
+
},
|
|
5320
|
+
{
|
|
5321
|
+
internalType: "bytes",
|
|
5322
|
+
name: "payload",
|
|
5323
|
+
type: "bytes"
|
|
5324
|
+
},
|
|
5325
|
+
{
|
|
5326
|
+
internalType: "bytes[]",
|
|
5327
|
+
name: "attributes",
|
|
5328
|
+
type: "bytes[]"
|
|
5329
|
+
}
|
|
5330
|
+
],
|
|
5331
|
+
name: "sendMessage",
|
|
5332
|
+
outputs: [
|
|
5333
|
+
{
|
|
5334
|
+
internalType: "bytes32",
|
|
5335
|
+
name: "sendId",
|
|
5336
|
+
type: "bytes32"
|
|
5337
|
+
}
|
|
5338
|
+
],
|
|
5339
|
+
stateMutability: "payable",
|
|
5340
|
+
type: "function"
|
|
5341
|
+
},
|
|
5342
|
+
{
|
|
5343
|
+
inputs: [
|
|
5344
|
+
{
|
|
5345
|
+
internalType: "bytes4",
|
|
5346
|
+
name: "_attributeSelector",
|
|
5347
|
+
type: "bytes4"
|
|
5348
|
+
}
|
|
5349
|
+
],
|
|
5350
|
+
name: "supportsAttribute",
|
|
5351
|
+
outputs: [
|
|
5352
|
+
{
|
|
5353
|
+
internalType: "bool",
|
|
5354
|
+
name: "",
|
|
5355
|
+
type: "bool"
|
|
5356
|
+
}
|
|
5357
|
+
],
|
|
5358
|
+
stateMutability: "pure",
|
|
5359
|
+
type: "function"
|
|
5360
|
+
},
|
|
5361
|
+
{
|
|
5362
|
+
inputs: [
|
|
5363
|
+
{
|
|
5364
|
+
internalType: "address",
|
|
5365
|
+
name: "newOwner",
|
|
5366
|
+
type: "address"
|
|
5367
|
+
}
|
|
5368
|
+
],
|
|
5369
|
+
name: "transferOwnership",
|
|
5370
|
+
outputs: [],
|
|
5371
|
+
stateMutability: "nonpayable",
|
|
5372
|
+
type: "function"
|
|
5373
|
+
},
|
|
5374
|
+
{
|
|
5375
|
+
inputs: [],
|
|
5376
|
+
name: "unpause",
|
|
5377
|
+
outputs: [],
|
|
5378
|
+
stateMutability: "nonpayable",
|
|
5379
|
+
type: "function"
|
|
5380
|
+
}
|
|
5381
|
+
];
|
|
5382
|
+
var InteropCenter_default = InteropCenterABI;
|
|
5383
|
+
|
|
5384
|
+
// src/core/internal/abis/IInteropHandler.ts
|
|
5385
|
+
var IInteropHandlerABI = [
|
|
5386
|
+
{
|
|
5387
|
+
anonymous: false,
|
|
5388
|
+
inputs: [
|
|
5389
|
+
{
|
|
5390
|
+
indexed: true,
|
|
5391
|
+
internalType: "bytes32",
|
|
5392
|
+
name: "bundleHash",
|
|
5393
|
+
type: "bytes32"
|
|
5394
|
+
}
|
|
5395
|
+
],
|
|
5396
|
+
name: "BundleExecuted",
|
|
5397
|
+
type: "event"
|
|
5398
|
+
},
|
|
5399
|
+
{
|
|
5400
|
+
anonymous: false,
|
|
5401
|
+
inputs: [
|
|
5402
|
+
{
|
|
5403
|
+
indexed: true,
|
|
5404
|
+
internalType: "bytes32",
|
|
5405
|
+
name: "bundleHash",
|
|
5406
|
+
type: "bytes32"
|
|
5407
|
+
}
|
|
5408
|
+
],
|
|
5409
|
+
name: "BundleUnbundled",
|
|
5410
|
+
type: "event"
|
|
5411
|
+
},
|
|
5412
|
+
{
|
|
5413
|
+
anonymous: false,
|
|
5414
|
+
inputs: [
|
|
5415
|
+
{
|
|
5416
|
+
indexed: true,
|
|
5417
|
+
internalType: "bytes32",
|
|
5418
|
+
name: "bundleHash",
|
|
5419
|
+
type: "bytes32"
|
|
5420
|
+
}
|
|
5421
|
+
],
|
|
5422
|
+
name: "BundleVerified",
|
|
5423
|
+
type: "event"
|
|
5424
|
+
},
|
|
5425
|
+
{
|
|
5426
|
+
anonymous: false,
|
|
5427
|
+
inputs: [
|
|
5428
|
+
{
|
|
5429
|
+
indexed: true,
|
|
5430
|
+
internalType: "bytes32",
|
|
5431
|
+
name: "bundleHash",
|
|
5432
|
+
type: "bytes32"
|
|
5433
|
+
},
|
|
5434
|
+
{
|
|
5435
|
+
indexed: true,
|
|
5436
|
+
internalType: "uint256",
|
|
5437
|
+
name: "callIndex",
|
|
5438
|
+
type: "uint256"
|
|
5439
|
+
},
|
|
5440
|
+
{
|
|
5441
|
+
indexed: false,
|
|
5442
|
+
internalType: "enum CallStatus",
|
|
5443
|
+
name: "status",
|
|
5444
|
+
type: "uint8"
|
|
5445
|
+
}
|
|
5446
|
+
],
|
|
5447
|
+
name: "CallProcessed",
|
|
5448
|
+
type: "event"
|
|
5449
|
+
},
|
|
5450
|
+
{
|
|
5451
|
+
inputs: [
|
|
5452
|
+
{
|
|
5453
|
+
internalType: "bytes",
|
|
5454
|
+
name: "_bundle",
|
|
5455
|
+
type: "bytes"
|
|
5456
|
+
},
|
|
5457
|
+
{
|
|
5458
|
+
components: [
|
|
5459
|
+
{
|
|
5460
|
+
internalType: "uint256",
|
|
5461
|
+
name: "chainId",
|
|
5462
|
+
type: "uint256"
|
|
5463
|
+
},
|
|
5464
|
+
{
|
|
5465
|
+
internalType: "uint256",
|
|
5466
|
+
name: "l1BatchNumber",
|
|
5467
|
+
type: "uint256"
|
|
5468
|
+
},
|
|
5469
|
+
{
|
|
5470
|
+
internalType: "uint256",
|
|
5471
|
+
name: "l2MessageIndex",
|
|
5472
|
+
type: "uint256"
|
|
5473
|
+
},
|
|
5474
|
+
{
|
|
5475
|
+
components: [
|
|
5476
|
+
{
|
|
5477
|
+
internalType: "uint16",
|
|
5478
|
+
name: "txNumberInBatch",
|
|
5479
|
+
type: "uint16"
|
|
5480
|
+
},
|
|
5481
|
+
{
|
|
5482
|
+
internalType: "address",
|
|
5483
|
+
name: "sender",
|
|
5484
|
+
type: "address"
|
|
5485
|
+
},
|
|
5486
|
+
{
|
|
5487
|
+
internalType: "bytes",
|
|
5488
|
+
name: "data",
|
|
5489
|
+
type: "bytes"
|
|
5490
|
+
}
|
|
5491
|
+
],
|
|
5492
|
+
internalType: "struct L2Message",
|
|
5493
|
+
name: "message",
|
|
5494
|
+
type: "tuple"
|
|
5495
|
+
},
|
|
5496
|
+
{
|
|
5497
|
+
internalType: "bytes32[]",
|
|
5498
|
+
name: "proof",
|
|
5499
|
+
type: "bytes32[]"
|
|
5500
|
+
}
|
|
5501
|
+
],
|
|
5502
|
+
internalType: "struct MessageInclusionProof",
|
|
5503
|
+
name: "_proof",
|
|
5504
|
+
type: "tuple"
|
|
5505
|
+
}
|
|
5506
|
+
],
|
|
5507
|
+
name: "executeBundle",
|
|
5508
|
+
outputs: [],
|
|
5509
|
+
stateMutability: "nonpayable",
|
|
5510
|
+
type: "function"
|
|
5511
|
+
},
|
|
5512
|
+
{
|
|
5513
|
+
inputs: [
|
|
5514
|
+
{
|
|
5515
|
+
internalType: "uint256",
|
|
5516
|
+
name: "_sourceChainId",
|
|
5517
|
+
type: "uint256"
|
|
5518
|
+
},
|
|
5519
|
+
{
|
|
5520
|
+
internalType: "bytes",
|
|
5521
|
+
name: "_bundle",
|
|
5522
|
+
type: "bytes"
|
|
5523
|
+
},
|
|
5524
|
+
{
|
|
5525
|
+
internalType: "enum CallStatus[]",
|
|
5526
|
+
name: "_callStatus",
|
|
5527
|
+
type: "uint8[]"
|
|
5528
|
+
}
|
|
5529
|
+
],
|
|
5530
|
+
name: "unbundleBundle",
|
|
5531
|
+
outputs: [],
|
|
5532
|
+
stateMutability: "nonpayable",
|
|
5533
|
+
type: "function"
|
|
5534
|
+
},
|
|
5535
|
+
{
|
|
5536
|
+
inputs: [
|
|
5537
|
+
{
|
|
5538
|
+
internalType: "bytes",
|
|
5539
|
+
name: "_bundle",
|
|
5540
|
+
type: "bytes"
|
|
5541
|
+
},
|
|
5542
|
+
{
|
|
5543
|
+
components: [
|
|
5544
|
+
{
|
|
5545
|
+
internalType: "uint256",
|
|
5546
|
+
name: "chainId",
|
|
5547
|
+
type: "uint256"
|
|
5548
|
+
},
|
|
5549
|
+
{
|
|
5550
|
+
internalType: "uint256",
|
|
5551
|
+
name: "l1BatchNumber",
|
|
5552
|
+
type: "uint256"
|
|
5553
|
+
},
|
|
5554
|
+
{
|
|
5555
|
+
internalType: "uint256",
|
|
5556
|
+
name: "l2MessageIndex",
|
|
5557
|
+
type: "uint256"
|
|
5558
|
+
},
|
|
5559
|
+
{
|
|
5560
|
+
components: [
|
|
5561
|
+
{
|
|
5562
|
+
internalType: "uint16",
|
|
5563
|
+
name: "txNumberInBatch",
|
|
5564
|
+
type: "uint16"
|
|
5565
|
+
},
|
|
5566
|
+
{
|
|
5567
|
+
internalType: "address",
|
|
5568
|
+
name: "sender",
|
|
5569
|
+
type: "address"
|
|
5570
|
+
},
|
|
5571
|
+
{
|
|
5572
|
+
internalType: "bytes",
|
|
5573
|
+
name: "data",
|
|
5574
|
+
type: "bytes"
|
|
5575
|
+
}
|
|
5576
|
+
],
|
|
5577
|
+
internalType: "struct L2Message",
|
|
5578
|
+
name: "message",
|
|
5579
|
+
type: "tuple"
|
|
5580
|
+
},
|
|
5581
|
+
{
|
|
5582
|
+
internalType: "bytes32[]",
|
|
5583
|
+
name: "proof",
|
|
5584
|
+
type: "bytes32[]"
|
|
5585
|
+
}
|
|
5586
|
+
],
|
|
5587
|
+
internalType: "struct MessageInclusionProof",
|
|
5588
|
+
name: "_proof",
|
|
5589
|
+
type: "tuple"
|
|
5590
|
+
}
|
|
5591
|
+
],
|
|
5592
|
+
name: "verifyBundle",
|
|
5593
|
+
outputs: [],
|
|
5594
|
+
stateMutability: "nonpayable",
|
|
5595
|
+
type: "function"
|
|
5596
|
+
}
|
|
5597
|
+
];
|
|
5598
|
+
var IInteropHandler_default = IInteropHandlerABI;
|
|
5599
|
+
|
|
5600
|
+
// src/core/internal/abis/InteropRootStorage.ts
|
|
5601
|
+
var InteropRootStorageABI = [
|
|
5602
|
+
{
|
|
5603
|
+
inputs: [
|
|
5604
|
+
{
|
|
5605
|
+
internalType: "uint256",
|
|
5606
|
+
name: "chainId",
|
|
5607
|
+
type: "uint256"
|
|
5608
|
+
},
|
|
5609
|
+
{
|
|
5610
|
+
internalType: "uint256",
|
|
5611
|
+
name: "batchNumber",
|
|
5612
|
+
type: "uint256"
|
|
5613
|
+
}
|
|
5614
|
+
],
|
|
5615
|
+
name: "interopRoots",
|
|
5616
|
+
outputs: [
|
|
5617
|
+
{
|
|
5618
|
+
internalType: "bytes32",
|
|
5619
|
+
name: "",
|
|
5620
|
+
type: "bytes32"
|
|
5621
|
+
}
|
|
5622
|
+
],
|
|
5623
|
+
stateMutability: "view",
|
|
5624
|
+
type: "function"
|
|
5625
|
+
}
|
|
5626
|
+
];
|
|
5627
|
+
var InteropRootStorage_default = InteropRootStorageABI;
|
|
5628
|
+
|
|
5629
|
+
// src/core/internal/abis/L2MessageVerification.ts
|
|
5630
|
+
var L2MessageVerificationABI = [
|
|
5631
|
+
{
|
|
5632
|
+
inputs: [],
|
|
5633
|
+
name: "DepthMoreThanOneForRecursiveMerkleProof",
|
|
5634
|
+
type: "error"
|
|
5635
|
+
},
|
|
5636
|
+
{
|
|
5637
|
+
inputs: [],
|
|
5638
|
+
name: "HashedLogIsDefault",
|
|
5639
|
+
type: "error"
|
|
5640
|
+
},
|
|
5641
|
+
{
|
|
5642
|
+
inputs: [],
|
|
5643
|
+
name: "InvalidProofLengthForFinalNode",
|
|
5644
|
+
type: "error"
|
|
5645
|
+
},
|
|
5646
|
+
{
|
|
5647
|
+
inputs: [],
|
|
5648
|
+
name: "MerkleIndexOutOfBounds",
|
|
5649
|
+
type: "error"
|
|
5650
|
+
},
|
|
5651
|
+
{
|
|
5652
|
+
inputs: [],
|
|
5653
|
+
name: "MerklePathEmpty",
|
|
5654
|
+
type: "error"
|
|
5655
|
+
},
|
|
5656
|
+
{
|
|
5657
|
+
inputs: [],
|
|
5658
|
+
name: "MerklePathOutOfBounds",
|
|
5659
|
+
type: "error"
|
|
5660
|
+
},
|
|
5661
|
+
{
|
|
5662
|
+
inputs: [
|
|
5663
|
+
{
|
|
5664
|
+
internalType: "uint256",
|
|
5665
|
+
name: "metadataVersion",
|
|
5666
|
+
type: "uint256"
|
|
5667
|
+
}
|
|
5668
|
+
],
|
|
5669
|
+
name: "UnsupportedProofMetadataVersion",
|
|
5670
|
+
type: "error"
|
|
5671
|
+
},
|
|
5672
|
+
{
|
|
5673
|
+
inputs: [
|
|
5674
|
+
{
|
|
5675
|
+
components: [
|
|
5676
|
+
{
|
|
5677
|
+
internalType: "uint256",
|
|
5678
|
+
name: "chainId",
|
|
5679
|
+
type: "uint256"
|
|
5680
|
+
},
|
|
5681
|
+
{
|
|
5682
|
+
internalType: "uint256",
|
|
5683
|
+
name: "l2BatchNumber",
|
|
5684
|
+
type: "uint256"
|
|
5685
|
+
},
|
|
5686
|
+
{
|
|
5687
|
+
internalType: "uint256",
|
|
5688
|
+
name: "l2MessageIndex",
|
|
5689
|
+
type: "uint256"
|
|
5690
|
+
},
|
|
5691
|
+
{
|
|
5692
|
+
internalType: "address",
|
|
5693
|
+
name: "l2Sender",
|
|
5694
|
+
type: "address"
|
|
5695
|
+
},
|
|
5696
|
+
{
|
|
5697
|
+
internalType: "uint16",
|
|
5698
|
+
name: "l2TxNumberInBatch",
|
|
5699
|
+
type: "uint16"
|
|
5700
|
+
},
|
|
5701
|
+
{
|
|
5702
|
+
internalType: "bytes",
|
|
5703
|
+
name: "message",
|
|
5704
|
+
type: "bytes"
|
|
5705
|
+
},
|
|
5706
|
+
{
|
|
5707
|
+
internalType: "bytes32[]",
|
|
5708
|
+
name: "merkleProof",
|
|
5709
|
+
type: "bytes32[]"
|
|
5710
|
+
}
|
|
5711
|
+
],
|
|
5712
|
+
internalType: "struct FinalizeL1DepositParams",
|
|
5713
|
+
name: "_finalizeWithdrawalParams",
|
|
5714
|
+
type: "tuple"
|
|
5715
|
+
}
|
|
5716
|
+
],
|
|
5717
|
+
name: "proveL1DepositParamsInclusion",
|
|
5718
|
+
outputs: [
|
|
5719
|
+
{
|
|
5720
|
+
internalType: "bool",
|
|
5721
|
+
name: "success",
|
|
5722
|
+
type: "bool"
|
|
5723
|
+
}
|
|
5724
|
+
],
|
|
5725
|
+
stateMutability: "view",
|
|
5726
|
+
type: "function"
|
|
5727
|
+
},
|
|
5728
|
+
{
|
|
5729
|
+
inputs: [
|
|
5730
|
+
{
|
|
5731
|
+
internalType: "uint256",
|
|
5732
|
+
name: "_chainId",
|
|
5733
|
+
type: "uint256"
|
|
5734
|
+
},
|
|
5735
|
+
{
|
|
5736
|
+
internalType: "bytes32",
|
|
5737
|
+
name: "_l2TxHash",
|
|
5738
|
+
type: "bytes32"
|
|
5739
|
+
},
|
|
5740
|
+
{
|
|
5741
|
+
internalType: "uint256",
|
|
5742
|
+
name: "_l2BatchNumber",
|
|
5743
|
+
type: "uint256"
|
|
5744
|
+
},
|
|
5745
|
+
{
|
|
5746
|
+
internalType: "uint256",
|
|
5747
|
+
name: "_l2MessageIndex",
|
|
5748
|
+
type: "uint256"
|
|
5749
|
+
},
|
|
5750
|
+
{
|
|
5751
|
+
internalType: "uint16",
|
|
5752
|
+
name: "_l2TxNumberInBatch",
|
|
5753
|
+
type: "uint16"
|
|
5754
|
+
},
|
|
5755
|
+
{
|
|
5756
|
+
internalType: "bytes32[]",
|
|
5757
|
+
name: "_merkleProof",
|
|
5758
|
+
type: "bytes32[]"
|
|
5759
|
+
},
|
|
5760
|
+
{
|
|
5761
|
+
internalType: "enum TxStatus",
|
|
5762
|
+
name: "_status",
|
|
5763
|
+
type: "uint8"
|
|
5764
|
+
}
|
|
5765
|
+
],
|
|
5766
|
+
name: "proveL1ToL2TransactionStatusShared",
|
|
5767
|
+
outputs: [
|
|
5768
|
+
{
|
|
5769
|
+
internalType: "bool",
|
|
5770
|
+
name: "",
|
|
5771
|
+
type: "bool"
|
|
5772
|
+
}
|
|
5773
|
+
],
|
|
5774
|
+
stateMutability: "view",
|
|
5775
|
+
type: "function"
|
|
5776
|
+
},
|
|
5777
|
+
{
|
|
5778
|
+
inputs: [
|
|
5779
|
+
{
|
|
5780
|
+
internalType: "uint256",
|
|
5781
|
+
name: "_chainId",
|
|
5782
|
+
type: "uint256"
|
|
5783
|
+
},
|
|
5784
|
+
{
|
|
5785
|
+
internalType: "uint256",
|
|
5786
|
+
name: "_blockOrBatchNumber",
|
|
5787
|
+
type: "uint256"
|
|
5788
|
+
},
|
|
5789
|
+
{
|
|
5790
|
+
internalType: "uint256",
|
|
5791
|
+
name: "_leafProofMask",
|
|
5792
|
+
type: "uint256"
|
|
5793
|
+
},
|
|
5794
|
+
{
|
|
5795
|
+
internalType: "bytes32",
|
|
5796
|
+
name: "_leaf",
|
|
5797
|
+
type: "bytes32"
|
|
5798
|
+
},
|
|
5799
|
+
{
|
|
5800
|
+
internalType: "bytes32[]",
|
|
5801
|
+
name: "_proof",
|
|
5802
|
+
type: "bytes32[]"
|
|
5803
|
+
}
|
|
5804
|
+
],
|
|
5805
|
+
name: "proveL2LeafInclusionShared",
|
|
5806
|
+
outputs: [
|
|
5807
|
+
{
|
|
5808
|
+
internalType: "bool",
|
|
5809
|
+
name: "",
|
|
5810
|
+
type: "bool"
|
|
5811
|
+
}
|
|
5812
|
+
],
|
|
5813
|
+
stateMutability: "view",
|
|
5814
|
+
type: "function"
|
|
5815
|
+
},
|
|
5816
|
+
{
|
|
5817
|
+
inputs: [
|
|
5818
|
+
{
|
|
5819
|
+
internalType: "uint256",
|
|
5820
|
+
name: "_chainId",
|
|
5821
|
+
type: "uint256"
|
|
5822
|
+
},
|
|
5823
|
+
{
|
|
5824
|
+
internalType: "uint256",
|
|
5825
|
+
name: "_blockOrBatchNumber",
|
|
5826
|
+
type: "uint256"
|
|
5827
|
+
},
|
|
5828
|
+
{
|
|
5829
|
+
internalType: "uint256",
|
|
5830
|
+
name: "_leafProofMask",
|
|
5831
|
+
type: "uint256"
|
|
5832
|
+
},
|
|
5833
|
+
{
|
|
5834
|
+
internalType: "bytes32",
|
|
5835
|
+
name: "_leaf",
|
|
5836
|
+
type: "bytes32"
|
|
5837
|
+
},
|
|
5838
|
+
{
|
|
5839
|
+
internalType: "bytes32[]",
|
|
5840
|
+
name: "_proof",
|
|
5841
|
+
type: "bytes32[]"
|
|
5842
|
+
},
|
|
5843
|
+
{
|
|
5844
|
+
internalType: "uint256",
|
|
5845
|
+
name: "_depth",
|
|
5846
|
+
type: "uint256"
|
|
5847
|
+
}
|
|
5848
|
+
],
|
|
5849
|
+
name: "proveL2LeafInclusionSharedRecursive",
|
|
5850
|
+
outputs: [
|
|
5851
|
+
{
|
|
5852
|
+
internalType: "bool",
|
|
5853
|
+
name: "",
|
|
5854
|
+
type: "bool"
|
|
5855
|
+
}
|
|
5856
|
+
],
|
|
5857
|
+
stateMutability: "view",
|
|
5858
|
+
type: "function"
|
|
5859
|
+
},
|
|
5860
|
+
{
|
|
5861
|
+
inputs: [
|
|
5862
|
+
{
|
|
5863
|
+
internalType: "uint256",
|
|
5864
|
+
name: "_chainId",
|
|
5865
|
+
type: "uint256"
|
|
5866
|
+
},
|
|
5867
|
+
{
|
|
5868
|
+
internalType: "uint256",
|
|
5869
|
+
name: "_blockOrBatchNumber",
|
|
5870
|
+
type: "uint256"
|
|
5871
|
+
},
|
|
5872
|
+
{
|
|
5873
|
+
internalType: "uint256",
|
|
5874
|
+
name: "_index",
|
|
5875
|
+
type: "uint256"
|
|
5876
|
+
},
|
|
5877
|
+
{
|
|
5878
|
+
components: [
|
|
5879
|
+
{
|
|
5880
|
+
internalType: "uint8",
|
|
5881
|
+
name: "l2ShardId",
|
|
5882
|
+
type: "uint8"
|
|
5883
|
+
},
|
|
5884
|
+
{
|
|
5885
|
+
internalType: "bool",
|
|
5886
|
+
name: "isService",
|
|
5887
|
+
type: "bool"
|
|
5888
|
+
},
|
|
5889
|
+
{
|
|
5890
|
+
internalType: "uint16",
|
|
5891
|
+
name: "txNumberInBatch",
|
|
5892
|
+
type: "uint16"
|
|
5893
|
+
},
|
|
5894
|
+
{
|
|
5895
|
+
internalType: "address",
|
|
5896
|
+
name: "sender",
|
|
5897
|
+
type: "address"
|
|
5898
|
+
},
|
|
5899
|
+
{
|
|
5900
|
+
internalType: "bytes32",
|
|
5901
|
+
name: "key",
|
|
5902
|
+
type: "bytes32"
|
|
5903
|
+
},
|
|
5904
|
+
{
|
|
5905
|
+
internalType: "bytes32",
|
|
5906
|
+
name: "value",
|
|
5907
|
+
type: "bytes32"
|
|
5908
|
+
}
|
|
5909
|
+
],
|
|
5910
|
+
internalType: "struct L2Log",
|
|
5911
|
+
name: "_log",
|
|
5912
|
+
type: "tuple"
|
|
5913
|
+
},
|
|
5914
|
+
{
|
|
5915
|
+
internalType: "bytes32[]",
|
|
5916
|
+
name: "_proof",
|
|
5917
|
+
type: "bytes32[]"
|
|
5918
|
+
}
|
|
5919
|
+
],
|
|
5920
|
+
name: "proveL2LogInclusionShared",
|
|
5921
|
+
outputs: [
|
|
5922
|
+
{
|
|
5923
|
+
internalType: "bool",
|
|
5924
|
+
name: "",
|
|
5925
|
+
type: "bool"
|
|
5926
|
+
}
|
|
4423
5927
|
],
|
|
4424
|
-
|
|
4425
|
-
|
|
5928
|
+
stateMutability: "view",
|
|
5929
|
+
type: "function"
|
|
4426
5930
|
},
|
|
4427
5931
|
{
|
|
4428
|
-
type: "event",
|
|
4429
|
-
name: "NewPriorityRequest",
|
|
4430
5932
|
inputs: [
|
|
4431
|
-
{ name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
|
|
4432
|
-
{ name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
|
|
4433
5933
|
{
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
5934
|
+
internalType: "uint256",
|
|
5935
|
+
name: "_chainId",
|
|
5936
|
+
type: "uint256"
|
|
5937
|
+
},
|
|
5938
|
+
{
|
|
5939
|
+
internalType: "uint256",
|
|
5940
|
+
name: "_blockOrBatchNumber",
|
|
5941
|
+
type: "uint256"
|
|
5942
|
+
},
|
|
5943
|
+
{
|
|
5944
|
+
internalType: "uint256",
|
|
5945
|
+
name: "_index",
|
|
5946
|
+
type: "uint256"
|
|
4438
5947
|
},
|
|
4439
5948
|
{
|
|
4440
|
-
name: "transaction",
|
|
4441
|
-
type: "tuple",
|
|
4442
|
-
indexed: false,
|
|
4443
|
-
internalType: "struct L2CanonicalTransaction",
|
|
4444
5949
|
components: [
|
|
4445
|
-
{
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
{
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
{
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
5950
|
+
{
|
|
5951
|
+
internalType: "uint16",
|
|
5952
|
+
name: "txNumberInBatch",
|
|
5953
|
+
type: "uint16"
|
|
5954
|
+
},
|
|
5955
|
+
{
|
|
5956
|
+
internalType: "address",
|
|
5957
|
+
name: "sender",
|
|
5958
|
+
type: "address"
|
|
5959
|
+
},
|
|
5960
|
+
{
|
|
5961
|
+
internalType: "bytes",
|
|
5962
|
+
name: "data",
|
|
5963
|
+
type: "bytes"
|
|
5964
|
+
}
|
|
5965
|
+
],
|
|
5966
|
+
internalType: "struct L2Message",
|
|
5967
|
+
name: "_message",
|
|
5968
|
+
type: "tuple"
|
|
4462
5969
|
},
|
|
4463
|
-
{
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
type: "event",
|
|
4469
|
-
name: "NewPriorityRequestId",
|
|
4470
|
-
inputs: [
|
|
4471
|
-
{ name: "txId", type: "uint256", indexed: true, internalType: "uint256" },
|
|
4472
|
-
{ name: "txHash", type: "bytes32", indexed: true, internalType: "bytes32" }
|
|
5970
|
+
{
|
|
5971
|
+
internalType: "bytes32[]",
|
|
5972
|
+
name: "_proof",
|
|
5973
|
+
type: "bytes32[]"
|
|
5974
|
+
}
|
|
4473
5975
|
],
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
{
|
|
4477
|
-
type: "event",
|
|
4478
|
-
name: "NewRelayedPriorityTransaction",
|
|
4479
|
-
inputs: [
|
|
4480
|
-
{ name: "txId", type: "uint256", indexed: false, internalType: "uint256" },
|
|
4481
|
-
{ name: "txHash", type: "bytes32", indexed: false, internalType: "bytes32" },
|
|
5976
|
+
name: "proveL2MessageInclusionShared",
|
|
5977
|
+
outputs: [
|
|
4482
5978
|
{
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
internalType: "uint64"
|
|
5979
|
+
internalType: "bool",
|
|
5980
|
+
name: "",
|
|
5981
|
+
type: "bool"
|
|
4487
5982
|
}
|
|
4488
5983
|
],
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
{
|
|
4493
|
-
type: "error",
|
|
4494
|
-
name: "BatchNotExecuted",
|
|
4495
|
-
inputs: [{ name: "batchNumber", type: "uint256", internalType: "uint256" }]
|
|
4496
|
-
},
|
|
4497
|
-
{ type: "error", name: "GasPerPubdataMismatch", inputs: [] },
|
|
4498
|
-
{ type: "error", name: "HashedLogIsDefault", inputs: [] },
|
|
4499
|
-
{ type: "error", name: "InvalidChainId", inputs: [] },
|
|
4500
|
-
{ type: "error", name: "InvalidProofLengthForFinalNode", inputs: [] },
|
|
4501
|
-
{
|
|
4502
|
-
type: "error",
|
|
4503
|
-
name: "LengthIsNotDivisibleBy32",
|
|
4504
|
-
inputs: [{ name: "length", type: "uint256", internalType: "uint256" }]
|
|
4505
|
-
},
|
|
4506
|
-
{ type: "error", name: "LocalRootIsZero", inputs: [] },
|
|
4507
|
-
{ type: "error", name: "LocalRootMustBeZero", inputs: [] },
|
|
4508
|
-
{
|
|
4509
|
-
type: "error",
|
|
4510
|
-
name: "MalformedBytecode",
|
|
4511
|
-
inputs: [{ name: "", type: "uint8", internalType: "enum BytecodeError" }]
|
|
4512
|
-
},
|
|
4513
|
-
{ type: "error", name: "MerkleIndexOutOfBounds", inputs: [] },
|
|
4514
|
-
{ type: "error", name: "MerklePathEmpty", inputs: [] },
|
|
4515
|
-
{ type: "error", name: "MerklePathOutOfBounds", inputs: [] },
|
|
4516
|
-
{
|
|
4517
|
-
type: "error",
|
|
4518
|
-
name: "MsgValueTooLow",
|
|
4519
|
-
inputs: [
|
|
4520
|
-
{ name: "required", type: "uint256", internalType: "uint256" },
|
|
4521
|
-
{ name: "provided", type: "uint256", internalType: "uint256" }
|
|
4522
|
-
]
|
|
4523
|
-
},
|
|
4524
|
-
{ type: "error", name: "NotHyperchain", inputs: [] },
|
|
4525
|
-
{ type: "error", name: "NotInitializedReentrancyGuard", inputs: [] },
|
|
4526
|
-
{
|
|
4527
|
-
type: "error",
|
|
4528
|
-
name: "NotL1",
|
|
4529
|
-
inputs: [{ name: "blockChainId", type: "uint256", internalType: "uint256" }]
|
|
4530
|
-
},
|
|
4531
|
-
{ type: "error", name: "NotSettlementLayer", inputs: [] },
|
|
4532
|
-
{ type: "error", name: "OnlyEraSupported", inputs: [] },
|
|
4533
|
-
{
|
|
4534
|
-
type: "error",
|
|
4535
|
-
name: "PubdataGreaterThanLimit",
|
|
4536
|
-
inputs: [
|
|
4537
|
-
{ name: "limit", type: "uint256", internalType: "uint256" },
|
|
4538
|
-
{ name: "length", type: "uint256", internalType: "uint256" }
|
|
4539
|
-
]
|
|
4540
|
-
},
|
|
4541
|
-
{ type: "error", name: "Reentrancy", inputs: [] },
|
|
4542
|
-
{ type: "error", name: "TooManyFactoryDeps", inputs: [] },
|
|
4543
|
-
{ type: "error", name: "TooMuchGas", inputs: [] },
|
|
4544
|
-
{ type: "error", name: "TransactionNotAllowed", inputs: [] },
|
|
4545
|
-
{ type: "error", name: "TxnBodyGasLimitNotEnoughGas", inputs: [] },
|
|
4546
|
-
{
|
|
4547
|
-
type: "error",
|
|
4548
|
-
name: "Unauthorized",
|
|
4549
|
-
inputs: [{ name: "caller", type: "address", internalType: "address" }]
|
|
4550
|
-
},
|
|
4551
|
-
{
|
|
4552
|
-
type: "error",
|
|
4553
|
-
name: "UnsupportedProofMetadataVersion",
|
|
4554
|
-
inputs: [{ name: "metadataVersion", type: "uint256", internalType: "uint256" }]
|
|
4555
|
-
},
|
|
4556
|
-
{ type: "error", name: "ValidateTxnNotEnoughGas", inputs: [] },
|
|
4557
|
-
{ type: "error", name: "ZeroGasPriceL1TxZKSyncOS", inputs: [] }
|
|
5984
|
+
stateMutability: "view",
|
|
5985
|
+
type: "function"
|
|
5986
|
+
}
|
|
4558
5987
|
];
|
|
4559
|
-
var
|
|
5988
|
+
var L2MessageVerification_default = L2MessageVerificationABI;
|
|
4560
5989
|
|
|
4561
5990
|
// src/core/errors/factory.ts
|
|
4562
5991
|
var factory_exports = {};
|
|
@@ -4565,6 +5994,45 @@ __export(factory_exports, {
|
|
|
4565
5994
|
shapeCause: () => shapeCause
|
|
4566
5995
|
});
|
|
4567
5996
|
|
|
5997
|
+
// src/core/utils/hash.ts
|
|
5998
|
+
var RegExpHex = /^0x[0-9a-fA-F]*$/;
|
|
5999
|
+
var isHash = (x, length) => {
|
|
6000
|
+
if (!x || typeof x !== "string") return false;
|
|
6001
|
+
return (length === void 0 || x.length === length) && RegExpHex.test(x);
|
|
6002
|
+
};
|
|
6003
|
+
var isHashArray = (x, length) => {
|
|
6004
|
+
if (!Array.isArray(x)) return false;
|
|
6005
|
+
return x.every((item) => isHash(item, length));
|
|
6006
|
+
};
|
|
6007
|
+
var isHash66 = (x) => isHash(x, 66);
|
|
6008
|
+
var isHash66Array = (x) => isHashArray(x, 66);
|
|
6009
|
+
|
|
6010
|
+
// src/core/utils/number.ts
|
|
6011
|
+
var isNumber = (x) => typeof x === "number" && Number.isFinite(x);
|
|
6012
|
+
var isBigint = (x) => typeof x === "bigint";
|
|
6013
|
+
|
|
6014
|
+
// src/core/utils/addr.ts
|
|
6015
|
+
function isAddress(x) {
|
|
6016
|
+
return isHash(x, 42);
|
|
6017
|
+
}
|
|
6018
|
+
function isAddressEq(a, b) {
|
|
6019
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
6020
|
+
}
|
|
6021
|
+
function isETH(token) {
|
|
6022
|
+
return isAddressEq(token, FORMAL_ETH_ADDRESS) || isAddressEq(token, L2_BASE_TOKEN_ADDRESS) || isAddressEq(token, ETH_ADDRESS);
|
|
6023
|
+
}
|
|
6024
|
+
function normalizeAddrEq(a, b) {
|
|
6025
|
+
if (!a || !b) return false;
|
|
6026
|
+
const normalize = (s) => {
|
|
6027
|
+
const hasPrefix = s.slice(0, 2).toLowerCase() === "0x";
|
|
6028
|
+
const body = hasPrefix ? s.slice(2) : s;
|
|
6029
|
+
return `0x${body.toLowerCase()}`;
|
|
6030
|
+
};
|
|
6031
|
+
return normalize(a) === normalize(b);
|
|
6032
|
+
}
|
|
6033
|
+
var hexEq = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
6034
|
+
var normalizeL1Token = (token) => isAddressEq(token, FORMAL_ETH_ADDRESS) ? ETH_ADDRESS : token;
|
|
6035
|
+
|
|
4568
6036
|
// src/core/errors/formatter.ts
|
|
4569
6037
|
function elideMiddle(s, max = 96) {
|
|
4570
6038
|
if (s.length <= max) return s;
|
|
@@ -4575,7 +6043,7 @@ function shortJSON(v, max = 240) {
|
|
|
4575
6043
|
try {
|
|
4576
6044
|
const s = JSON.stringify(
|
|
4577
6045
|
v,
|
|
4578
|
-
(_k, val) =>
|
|
6046
|
+
(_k, val) => isBigint(val) ? `${val.toString()}n` : val
|
|
4579
6047
|
);
|
|
4580
6048
|
return s.length > max ? elideMiddle(s, max) : s;
|
|
4581
6049
|
} catch {
|
|
@@ -4595,7 +6063,7 @@ function formatContextLine(ctx) {
|
|
|
4595
6063
|
if (txHash !== void 0)
|
|
4596
6064
|
parts.push(`txHash=${typeof txHash === "string" ? txHash : shortJSON(txHash, 96)}`);
|
|
4597
6065
|
if (nonce !== void 0) {
|
|
4598
|
-
const nonceStr = typeof nonce === "string" ||
|
|
6066
|
+
const nonceStr = typeof nonce === "string" || isNumber(nonce) || isBigint(nonce) ? String(nonce) : shortJSON(nonce, 48);
|
|
4599
6067
|
parts.push(`nonce=${nonceStr}`);
|
|
4600
6068
|
}
|
|
4601
6069
|
return parts.length ? ` ${kv("Context", parts.join(" \u2022 "))}` : void 0;
|
|
@@ -4625,17 +6093,17 @@ function formatCause(c) {
|
|
|
4625
6093
|
const head = [];
|
|
4626
6094
|
if (obj.name !== void 0) {
|
|
4627
6095
|
const nameVal = obj.name;
|
|
4628
|
-
const nameStr = typeof nameVal === "string" ||
|
|
6096
|
+
const nameStr = typeof nameVal === "string" || isNumber(nameVal) || isBigint(nameVal) || typeof nameVal === "boolean" ? String(nameVal) : shortJSON(nameVal, 120);
|
|
4629
6097
|
head.push(`name=${nameStr}`);
|
|
4630
6098
|
}
|
|
4631
6099
|
if (obj.code !== void 0) {
|
|
4632
6100
|
const codeVal = obj.code;
|
|
4633
|
-
const codeStr = typeof codeVal === "string" ||
|
|
6101
|
+
const codeStr = typeof codeVal === "string" || isNumber(codeVal) || isBigint(codeVal) || typeof codeVal === "boolean" ? String(codeVal) : shortJSON(codeVal, 120);
|
|
4634
6102
|
head.push(`code=${codeStr}`);
|
|
4635
6103
|
}
|
|
4636
6104
|
if (head.length) out.push(` ${kv("Cause", head.join(" "))}`);
|
|
4637
6105
|
if (obj.message) {
|
|
4638
|
-
const messageStr = typeof obj.message === "string" ||
|
|
6106
|
+
const messageStr = typeof obj.message === "string" || isNumber(obj.message) || isBigint(obj.message) || typeof obj.message === "boolean" ? String(obj.message) : shortJSON(obj.message, 600);
|
|
4639
6107
|
out.push(` message=${elideMiddle(messageStr, 600)}`);
|
|
4640
6108
|
}
|
|
4641
6109
|
if (obj.data) {
|
|
@@ -4698,12 +6166,13 @@ if (kInspect) {
|
|
|
4698
6166
|
enumerable: false
|
|
4699
6167
|
});
|
|
4700
6168
|
}
|
|
4701
|
-
function isZKsyncError(e) {
|
|
6169
|
+
function isZKsyncError(e, opts) {
|
|
4702
6170
|
if (!e || typeof e !== "object") return false;
|
|
4703
6171
|
const maybe = e;
|
|
4704
6172
|
if (!("envelope" in maybe)) return false;
|
|
4705
6173
|
const envelope = maybe.envelope;
|
|
4706
|
-
|
|
6174
|
+
if (typeof envelope?.type !== "string" || typeof envelope?.message !== "string") return false;
|
|
6175
|
+
return true;
|
|
4707
6176
|
}
|
|
4708
6177
|
|
|
4709
6178
|
// src/core/errors/factory.ts
|
|
@@ -4711,20 +6180,20 @@ function createError(type, input) {
|
|
|
4711
6180
|
return new ZKsyncError({ ...input, type });
|
|
4712
6181
|
}
|
|
4713
6182
|
function shapeCause(err) {
|
|
4714
|
-
const
|
|
6183
|
+
const isRecord2 = (x) => x !== null && typeof x === "object";
|
|
4715
6184
|
let data = void 0;
|
|
4716
|
-
if (
|
|
6185
|
+
if (isRecord2(err)) {
|
|
4717
6186
|
const r2 = err;
|
|
4718
6187
|
const d = r2.data;
|
|
4719
|
-
if (
|
|
6188
|
+
if (isRecord2(d) && "data" in d) {
|
|
4720
6189
|
data = d.data;
|
|
4721
|
-
} else if ("error" in r2 &&
|
|
6190
|
+
} else if ("error" in r2 && isRecord2(r2.error) && "data" in r2.error) {
|
|
4722
6191
|
data = r2.error.data;
|
|
4723
6192
|
} else if ("data" in r2) {
|
|
4724
6193
|
data = r2.data;
|
|
4725
6194
|
}
|
|
4726
6195
|
}
|
|
4727
|
-
const r =
|
|
6196
|
+
const r = isRecord2(err) ? err : void 0;
|
|
4728
6197
|
const name = r && typeof r.name === "string" ? r.name : void 0;
|
|
4729
6198
|
const message = r && typeof r.message === "string" ? r.message : r && typeof r.shortMessage === "string" ? r.shortMessage : void 0;
|
|
4730
6199
|
const code = r && "code" in r ? r.code : void 0;
|
|
@@ -4787,7 +6256,7 @@ function normalizeProof(p) {
|
|
|
4787
6256
|
context: { keys: Object.keys(raw ?? {}) }
|
|
4788
6257
|
});
|
|
4789
6258
|
}
|
|
4790
|
-
const toBig = (x) =>
|
|
6259
|
+
const toBig = (x) => isBigint(x) ? x : isNumber(x) ? BigInt(x) : typeof x === "string" ? BigInt(x) : (() => {
|
|
4791
6260
|
throw createError("RPC", {
|
|
4792
6261
|
resource: "zksrpc",
|
|
4793
6262
|
operation: "zksrpc.normalizeProof",
|
|
@@ -4798,7 +6267,8 @@ function normalizeProof(p) {
|
|
|
4798
6267
|
return {
|
|
4799
6268
|
id: toBig(idRaw),
|
|
4800
6269
|
batchNumber: toBig(bnRaw),
|
|
4801
|
-
proof: toHexArray(raw?.proof)
|
|
6270
|
+
proof: toHexArray(raw?.proof),
|
|
6271
|
+
root: raw.root
|
|
4802
6272
|
};
|
|
4803
6273
|
} catch (e) {
|
|
4804
6274
|
if (isZKsyncError(e)) throw e;
|
|
@@ -4823,8 +6293,8 @@ function ensureHex(value, field, context) {
|
|
|
4823
6293
|
function ensureNumber(value, field, opts) {
|
|
4824
6294
|
const operation = opts?.operation ?? "zksrpc.normalizeGenesis";
|
|
4825
6295
|
const messagePrefix = opts?.messagePrefix ?? "Malformed genesis response";
|
|
4826
|
-
if (
|
|
4827
|
-
if (
|
|
6296
|
+
if (isNumber(value)) return value;
|
|
6297
|
+
if (isBigint(value)) return Number(value);
|
|
4828
6298
|
if (typeof value === "string" && value.trim() !== "") {
|
|
4829
6299
|
const parsed = Number(value);
|
|
4830
6300
|
if (Number.isFinite(parsed)) return parsed;
|
|
@@ -4839,8 +6309,8 @@ function ensureNumber(value, field, opts) {
|
|
|
4839
6309
|
function ensureBigInt(value, field, opts) {
|
|
4840
6310
|
const operation = opts?.operation ?? "zksrpc.normalizeBlockMetadata";
|
|
4841
6311
|
const messagePrefix = opts?.messagePrefix ?? "Malformed block metadata response";
|
|
4842
|
-
if (
|
|
4843
|
-
if (
|
|
6312
|
+
if (isBigint(value)) return value;
|
|
6313
|
+
if (isNumber(value)) {
|
|
4844
6314
|
if (!Number.isInteger(value)) {
|
|
4845
6315
|
throw createError("RPC", {
|
|
4846
6316
|
resource: "zksrpc",
|
|
@@ -4864,6 +6334,9 @@ function ensureBigInt(value, field, opts) {
|
|
|
4864
6334
|
context: { field, valueType: typeof value }
|
|
4865
6335
|
});
|
|
4866
6336
|
}
|
|
6337
|
+
function isRecord(x) {
|
|
6338
|
+
return !!x && typeof x === "object" && !Array.isArray(x);
|
|
6339
|
+
}
|
|
4867
6340
|
function normalizeContractTuple(tuple, index) {
|
|
4868
6341
|
if (!Array.isArray(tuple) || tuple.length < 2) {
|
|
4869
6342
|
throw createError("RPC", {
|
|
@@ -4879,7 +6352,7 @@ function normalizeContractTuple(tuple, index) {
|
|
|
4879
6352
|
bytecode: ensureHex(bytecodeRaw, "initial_contracts.bytecode", { index })
|
|
4880
6353
|
};
|
|
4881
6354
|
}
|
|
4882
|
-
function
|
|
6355
|
+
function normalizeRawStorageTuple(tuple, index) {
|
|
4883
6356
|
if (!Array.isArray(tuple) || tuple.length < 2) {
|
|
4884
6357
|
throw createError("RPC", {
|
|
4885
6358
|
resource: "zksrpc",
|
|
@@ -4890,10 +6363,53 @@ function normalizeStorageTuple(tuple, index) {
|
|
|
4890
6363
|
}
|
|
4891
6364
|
const [keyRaw, valueRaw] = tuple;
|
|
4892
6365
|
return {
|
|
6366
|
+
format: "raw",
|
|
4893
6367
|
key: ensureHex(keyRaw, "additional_storage.key", { index }),
|
|
4894
6368
|
value: ensureHex(valueRaw, "additional_storage.value", { index })
|
|
4895
6369
|
};
|
|
4896
6370
|
}
|
|
6371
|
+
function normalizeAdditionalStorage(value, record) {
|
|
6372
|
+
const effective = value ?? record["additional_storage_raw"];
|
|
6373
|
+
if (Array.isArray(effective)) {
|
|
6374
|
+
return effective.map((entry, index) => {
|
|
6375
|
+
const kv2 = normalizeRawStorageTuple(entry, index);
|
|
6376
|
+
return { format: "raw", key: kv2.key, value: kv2.value };
|
|
6377
|
+
});
|
|
6378
|
+
}
|
|
6379
|
+
if (isRecord(effective)) {
|
|
6380
|
+
const out = [];
|
|
6381
|
+
for (const [addrRaw, slotsRaw] of Object.entries(effective)) {
|
|
6382
|
+
const address = ensureHex(addrRaw, "additional_storage.address", {});
|
|
6383
|
+
if (!isRecord(slotsRaw)) {
|
|
6384
|
+
throw createError("RPC", {
|
|
6385
|
+
resource: "zksrpc",
|
|
6386
|
+
operation: "zksrpc.normalizeGenesis",
|
|
6387
|
+
message: "Malformed genesis response: additional_storage[address] must be an object map.",
|
|
6388
|
+
context: { address, valueType: typeof slotsRaw }
|
|
6389
|
+
});
|
|
6390
|
+
}
|
|
6391
|
+
for (const [slotRaw, valRaw] of Object.entries(slotsRaw)) {
|
|
6392
|
+
out.push({
|
|
6393
|
+
format: "pretty",
|
|
6394
|
+
address,
|
|
6395
|
+
key: ensureHex(slotRaw, "additional_storage.key", { address }),
|
|
6396
|
+
value: ensureHex(valRaw, "additional_storage.value", { address, key: slotRaw })
|
|
6397
|
+
});
|
|
6398
|
+
}
|
|
6399
|
+
}
|
|
6400
|
+
return out;
|
|
6401
|
+
}
|
|
6402
|
+
throw createError("RPC", {
|
|
6403
|
+
resource: "zksrpc",
|
|
6404
|
+
operation: "zksrpc.normalizeGenesis",
|
|
6405
|
+
message: "Malformed genesis response: additional_storage must be an array (raw) or an object map (pretty).",
|
|
6406
|
+
context: {
|
|
6407
|
+
valueType: typeof effective,
|
|
6408
|
+
hasAdditionalStorage: "additional_storage" in record,
|
|
6409
|
+
hasAdditionalStorageRaw: "additional_storage_raw" in record
|
|
6410
|
+
}
|
|
6411
|
+
});
|
|
6412
|
+
}
|
|
4897
6413
|
function normalizeGenesis(raw) {
|
|
4898
6414
|
try {
|
|
4899
6415
|
if (!raw || typeof raw !== "object") {
|
|
@@ -4914,21 +6430,12 @@ function normalizeGenesis(raw) {
|
|
|
4914
6430
|
context: { valueType: typeof contractsRaw }
|
|
4915
6431
|
});
|
|
4916
6432
|
}
|
|
4917
|
-
const storageRaw = record["additional_storage"];
|
|
4918
|
-
if (!Array.isArray(storageRaw)) {
|
|
4919
|
-
throw createError("RPC", {
|
|
4920
|
-
resource: "zksrpc",
|
|
4921
|
-
operation: "zksrpc.normalizeGenesis",
|
|
4922
|
-
message: "Malformed genesis response: additional_storage must be an array.",
|
|
4923
|
-
context: { valueType: typeof storageRaw }
|
|
4924
|
-
});
|
|
4925
|
-
}
|
|
4926
6433
|
const executionVersion = ensureNumber(record["execution_version"], "execution_version");
|
|
4927
6434
|
const genesisRoot = ensureHex(record["genesis_root"], "genesis_root", {});
|
|
4928
6435
|
const initialContracts = contractsRaw.map(
|
|
4929
6436
|
(entry, index) => normalizeContractTuple(entry, index)
|
|
4930
6437
|
);
|
|
4931
|
-
const additionalStorage =
|
|
6438
|
+
const additionalStorage = normalizeAdditionalStorage(record["additional_storage"], record);
|
|
4932
6439
|
return {
|
|
4933
6440
|
initialContracts,
|
|
4934
6441
|
additionalStorage,
|
|
@@ -5111,26 +6618,6 @@ function makeTransportFromViem(client) {
|
|
|
5111
6618
|
return (m, p = []) => client.request({ method: m, params: p });
|
|
5112
6619
|
}
|
|
5113
6620
|
|
|
5114
|
-
// src/core/utils/addr.ts
|
|
5115
|
-
var isHash66 = (x) => !!x && x.startsWith("0x") && x.length === 66;
|
|
5116
|
-
function isAddressEq(a, b) {
|
|
5117
|
-
return a.toLowerCase() === b.toLowerCase();
|
|
5118
|
-
}
|
|
5119
|
-
function isETH(token) {
|
|
5120
|
-
return isAddressEq(token, FORMAL_ETH_ADDRESS) || isAddressEq(token, L2_BASE_TOKEN_ADDRESS) || isAddressEq(token, ETH_ADDRESS);
|
|
5121
|
-
}
|
|
5122
|
-
function normalizeAddrEq(a, b) {
|
|
5123
|
-
if (!a || !b) return false;
|
|
5124
|
-
const normalize = (s) => {
|
|
5125
|
-
const hasPrefix = s.slice(0, 2).toLowerCase() === "0x";
|
|
5126
|
-
const body = hasPrefix ? s.slice(2) : s;
|
|
5127
|
-
return `0x${body.toLowerCase()}`;
|
|
5128
|
-
};
|
|
5129
|
-
return normalize(a) === normalize(b);
|
|
5130
|
-
}
|
|
5131
|
-
var hexEq = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
5132
|
-
var normalizeL1Token = (token) => isAddressEq(token, FORMAL_ETH_ADDRESS) ? ETH_ADDRESS : token;
|
|
5133
|
-
|
|
5134
6621
|
// src/core/resources/deposits/route.ts
|
|
5135
6622
|
async function pickDepositRoute(client, chainIdL2, token) {
|
|
5136
6623
|
if (isETH(token)) {
|
|
@@ -5154,11 +6641,14 @@ function pickWithdrawRoute(args) {
|
|
|
5154
6641
|
return "erc20-nonbase";
|
|
5155
6642
|
}
|
|
5156
6643
|
|
|
5157
|
-
// src/core/
|
|
6644
|
+
// src/core/utils/events.ts
|
|
6645
|
+
function extractPreferAddress(opts) {
|
|
6646
|
+
const preferAddr = typeof opts?.prefer === "object" ? opts.prefer.address : opts?.prefer === "assetRouter" ? L2_ASSET_ROUTER_ADDRESS : L1_MESSENGER_ADDRESS;
|
|
6647
|
+
return (preferAddr || L1_MESSENGER_ADDRESS).toLowerCase();
|
|
6648
|
+
}
|
|
5158
6649
|
function findL1MessageSentLog(receipt, opts) {
|
|
5159
6650
|
const index = opts?.index ?? 0;
|
|
5160
|
-
const preferAddr =
|
|
5161
|
-
const prefer = (preferAddr ?? L1_MESSENGER_ADDRESS).toLowerCase();
|
|
6651
|
+
const preferAddr = extractPreferAddress(opts);
|
|
5162
6652
|
const matches = receipt.logs.filter((lg) => {
|
|
5163
6653
|
const t0 = (lg.topics?.[0] ?? "").toLowerCase();
|
|
5164
6654
|
return t0 === TOPIC_L1_MESSAGE_SENT_NEW || t0 === TOPIC_L1_MESSAGE_SENT_LEG;
|
|
@@ -5166,13 +6656,18 @@ function findL1MessageSentLog(receipt, opts) {
|
|
|
5166
6656
|
if (!matches.length) {
|
|
5167
6657
|
throw new Error("No L1MessageSent event found in L2 receipt logs.");
|
|
5168
6658
|
}
|
|
5169
|
-
const preferred = matches.find((lg) => (lg.address ?? "").toLowerCase() ===
|
|
6659
|
+
const preferred = matches.find((lg) => (lg.address ?? "").toLowerCase() === preferAddr);
|
|
5170
6660
|
const chosen = preferred ?? matches[index] ?? matches[0];
|
|
5171
6661
|
if (!chosen) {
|
|
5172
6662
|
throw new Error("No suitable L1MessageSent event found.");
|
|
5173
6663
|
}
|
|
5174
6664
|
return chosen;
|
|
5175
6665
|
}
|
|
6666
|
+
function isL1MessageSentLog(log, opts) {
|
|
6667
|
+
const topic = log.topics[0].toLowerCase();
|
|
6668
|
+
const preferAddr = extractPreferAddress(opts);
|
|
6669
|
+
return log.address.toLowerCase() === preferAddr && (topic === TOPIC_L1_MESSAGE_SENT_LEG.toLowerCase() || topic === TOPIC_L1_MESSAGE_SENT_NEW.toLowerCase());
|
|
6670
|
+
}
|
|
5176
6671
|
|
|
5177
6672
|
// src/core/resources/withdrawals/logs.ts
|
|
5178
6673
|
function messengerLogIndex(raw, opts) {
|
|
@@ -5192,9 +6687,14 @@ exports.errors = factory_exports;
|
|
|
5192
6687
|
exports.findL1MessageSentLog = findL1MessageSentLog;
|
|
5193
6688
|
exports.formatEnvelopePretty = formatEnvelopePretty;
|
|
5194
6689
|
exports.hexEq = hexEq;
|
|
6690
|
+
exports.isAddress = isAddress;
|
|
5195
6691
|
exports.isAddressEq = isAddressEq;
|
|
5196
6692
|
exports.isETH = isETH;
|
|
6693
|
+
exports.isHash = isHash;
|
|
5197
6694
|
exports.isHash66 = isHash66;
|
|
6695
|
+
exports.isHash66Array = isHash66Array;
|
|
6696
|
+
exports.isHashArray = isHashArray;
|
|
6697
|
+
exports.isL1MessageSentLog = isL1MessageSentLog;
|
|
5198
6698
|
exports.makeTransportFromEthers = makeTransportFromEthers;
|
|
5199
6699
|
exports.makeTransportFromViem = makeTransportFromViem;
|
|
5200
6700
|
exports.messengerLogIndex = messengerLogIndex;
|