@matterlabs/zksync-js 0.0.12 → 0.0.13

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.
Files changed (38) hide show
  1. package/dist/adapters/ethers/client.cjs +722 -4
  2. package/dist/adapters/ethers/client.cjs.map +1 -1
  3. package/dist/adapters/ethers/client.js +5 -5
  4. package/dist/adapters/ethers/index.cjs +735 -14
  5. package/dist/adapters/ethers/index.cjs.map +1 -1
  6. package/dist/adapters/ethers/index.js +7 -7
  7. package/dist/adapters/ethers/sdk.cjs +733 -10
  8. package/dist/adapters/ethers/sdk.cjs.map +1 -1
  9. package/dist/adapters/ethers/sdk.js +5 -5
  10. package/dist/adapters/viem/client.cjs +2 -4
  11. package/dist/adapters/viem/client.cjs.map +1 -1
  12. package/dist/adapters/viem/client.js +5 -5
  13. package/dist/adapters/viem/index.cjs +2 -4
  14. package/dist/adapters/viem/index.cjs.map +1 -1
  15. package/dist/adapters/viem/index.js +7 -7
  16. package/dist/adapters/viem/sdk.js +5 -5
  17. package/dist/{chunk-BGUNJK2H.js → chunk-2RIARDXZ.js} +3 -3
  18. package/dist/{chunk-NBQVHW2N.js → chunk-4S4XDA4N.js} +3 -5
  19. package/dist/{chunk-GMNLOTNG.js → chunk-53MC5BR2.js} +1 -1
  20. package/dist/{chunk-I5VQBVQ2.js → chunk-5L6EYUJB.js} +1 -1
  21. package/dist/{chunk-TE2YQHVI.js → chunk-5R7L5NM5.js} +2 -2
  22. package/dist/{chunk-AUN5Y2A3.js → chunk-EDWBCPO3.js} +3 -3
  23. package/dist/{chunk-IUSH7YBZ.js → chunk-HI64OOAR.js} +1 -1
  24. package/dist/{chunk-6JM4PE62.js → chunk-JHO2UQ5F.js} +16 -13
  25. package/dist/{chunk-LWA7LC3N.js → chunk-R5WRFPK2.js} +3 -3
  26. package/dist/{chunk-6CLYCJMV.js → chunk-RI73VJSH.js} +715 -1
  27. package/dist/{chunk-4PFO3J7W.js → chunk-UDBRUBEK.js} +10 -2
  28. package/dist/core/abi.d.ts +2 -0
  29. package/dist/core/index.cjs +716 -4
  30. package/dist/core/index.cjs.map +1 -1
  31. package/dist/core/index.js +3 -3
  32. package/dist/core/internal/abis/IInteropErrors.d.ts +197 -0
  33. package/dist/core/internal/abis/IL1ContractErrors.d.ts +1021 -0
  34. package/dist/core/rpc/types.d.ts +0 -1
  35. package/dist/index.cjs +716 -4
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.js +3 -3
  38. package/package.json +1 -1
@@ -524,8 +524,8 @@ function ensureHex(value, field, context) {
524
524
  });
525
525
  }
526
526
  function ensureNumber(value, field, opts) {
527
- const operation = opts?.operation ?? "zksrpc.normalizeGenesis";
528
- const messagePrefix = opts?.messagePrefix ?? "Malformed genesis response";
527
+ const operation = opts?.operation;
528
+ const messagePrefix = opts?.messagePrefix;
529
529
  if (isNumber(value)) return value;
530
530
  if (isBigint(value)) return Number(value);
531
531
  if (typeof value === "string" && value.trim() !== "") {
@@ -663,7 +663,6 @@ function normalizeGenesis(raw) {
663
663
  context: { valueType: typeof contractsRaw }
664
664
  });
665
665
  }
666
- const executionVersion = ensureNumber(record["execution_version"], "execution_version");
667
666
  const genesisRoot = ensureHex(record["genesis_root"], "genesis_root", {});
668
667
  const initialContracts = contractsRaw.map(
669
668
  (entry, index) => normalizeContractTuple(entry, index)
@@ -672,7 +671,6 @@ function normalizeGenesis(raw) {
672
671
  return {
673
672
  initialContracts,
674
673
  additionalStorage,
675
- executionVersion,
676
674
  genesisRoot
677
675
  };
678
676
  } catch (e) {
@@ -6764,6 +6762,718 @@ var L2MessageVerificationABI = [
6764
6762
  ];
6765
6763
  var L2MessageVerification_default = L2MessageVerificationABI;
6766
6764
 
6765
+ // src/core/internal/abis/IInteropErrors.ts
6766
+ var IInteropErrorsABI = [
6767
+ {
6768
+ type: "error",
6769
+ name: "AttributeAlreadySet",
6770
+ inputs: [
6771
+ {
6772
+ name: "selector",
6773
+ type: "bytes4"
6774
+ }
6775
+ ]
6776
+ },
6777
+ {
6778
+ type: "error",
6779
+ name: "AttributeViolatesRestriction",
6780
+ inputs: [
6781
+ {
6782
+ name: "selector",
6783
+ type: "bytes4"
6784
+ },
6785
+ {
6786
+ name: "restriction",
6787
+ type: "uint256"
6788
+ }
6789
+ ]
6790
+ },
6791
+ {
6792
+ type: "error",
6793
+ name: "BundleAlreadyProcessed",
6794
+ inputs: [
6795
+ {
6796
+ name: "bundleHash",
6797
+ type: "bytes32"
6798
+ }
6799
+ ]
6800
+ },
6801
+ {
6802
+ type: "error",
6803
+ name: "CallAlreadyExecuted",
6804
+ inputs: [
6805
+ {
6806
+ name: "bundleHash",
6807
+ type: "bytes32"
6808
+ },
6809
+ {
6810
+ name: "callIndex",
6811
+ type: "uint256"
6812
+ }
6813
+ ]
6814
+ },
6815
+ {
6816
+ type: "error",
6817
+ name: "CallNotExecutable",
6818
+ inputs: [
6819
+ {
6820
+ name: "bundleHash",
6821
+ type: "bytes32"
6822
+ },
6823
+ {
6824
+ name: "callIndex",
6825
+ type: "uint256"
6826
+ }
6827
+ ]
6828
+ },
6829
+ {
6830
+ type: "error",
6831
+ name: "CanNotUnbundle",
6832
+ inputs: [
6833
+ {
6834
+ name: "bundleHash",
6835
+ type: "bytes32"
6836
+ }
6837
+ ]
6838
+ },
6839
+ {
6840
+ type: "error",
6841
+ name: "DestinationChainNotRegistered",
6842
+ inputs: [
6843
+ {
6844
+ name: "destinationChainId",
6845
+ type: "uint256"
6846
+ }
6847
+ ]
6848
+ },
6849
+ {
6850
+ type: "error",
6851
+ name: "ExecutingNotAllowed",
6852
+ inputs: [
6853
+ {
6854
+ name: "bundleHash",
6855
+ type: "bytes32"
6856
+ },
6857
+ {
6858
+ name: "callerAddress",
6859
+ type: "bytes"
6860
+ },
6861
+ {
6862
+ name: "executionAddress",
6863
+ type: "bytes"
6864
+ }
6865
+ ]
6866
+ },
6867
+ {
6868
+ type: "error",
6869
+ name: "FeeWithdrawalFailed",
6870
+ inputs: []
6871
+ },
6872
+ {
6873
+ type: "error",
6874
+ name: "IndirectCallValueMismatch",
6875
+ inputs: [
6876
+ {
6877
+ name: "expected",
6878
+ type: "uint256"
6879
+ },
6880
+ {
6881
+ name: "actual",
6882
+ type: "uint256"
6883
+ }
6884
+ ]
6885
+ },
6886
+ {
6887
+ type: "error",
6888
+ name: "InteroperableAddressChainReferenceNotEmpty",
6889
+ inputs: [
6890
+ {
6891
+ name: "interoperableAddress",
6892
+ type: "bytes"
6893
+ }
6894
+ ]
6895
+ },
6896
+ {
6897
+ type: "error",
6898
+ name: "InteroperableAddressNotEmpty",
6899
+ inputs: [
6900
+ {
6901
+ name: "interoperableAddress",
6902
+ type: "bytes"
6903
+ }
6904
+ ]
6905
+ },
6906
+ {
6907
+ type: "error",
6908
+ name: "InvalidInteropBundleVersion",
6909
+ inputs: []
6910
+ },
6911
+ {
6912
+ type: "error",
6913
+ name: "InvalidInteropCallVersion",
6914
+ inputs: []
6915
+ },
6916
+ {
6917
+ type: "error",
6918
+ name: "InteropRootAlreadyExists",
6919
+ inputs: []
6920
+ },
6921
+ {
6922
+ type: "error",
6923
+ name: "MessageNotIncluded",
6924
+ inputs: []
6925
+ },
6926
+ {
6927
+ type: "error",
6928
+ name: "SidesLengthNotOne",
6929
+ inputs: []
6930
+ },
6931
+ {
6932
+ type: "error",
6933
+ name: "UnauthorizedMessageSender",
6934
+ inputs: [
6935
+ {
6936
+ name: "expected",
6937
+ type: "address"
6938
+ },
6939
+ {
6940
+ name: "actual",
6941
+ type: "address"
6942
+ }
6943
+ ]
6944
+ },
6945
+ {
6946
+ type: "error",
6947
+ name: "UnbundlingNotAllowed",
6948
+ inputs: [
6949
+ {
6950
+ name: "bundleHash",
6951
+ type: "bytes32"
6952
+ },
6953
+ {
6954
+ name: "callerAddress",
6955
+ type: "bytes"
6956
+ },
6957
+ {
6958
+ name: "unbundlerAddress",
6959
+ type: "bytes"
6960
+ }
6961
+ ]
6962
+ },
6963
+ {
6964
+ type: "error",
6965
+ name: "WrongCallStatusLength",
6966
+ inputs: [
6967
+ {
6968
+ name: "bundleCallsLength",
6969
+ type: "uint256"
6970
+ },
6971
+ {
6972
+ name: "providedCallStatusLength",
6973
+ type: "uint256"
6974
+ }
6975
+ ]
6976
+ },
6977
+ {
6978
+ type: "error",
6979
+ name: "WrongDestinationChainId",
6980
+ inputs: [
6981
+ {
6982
+ name: "bundleHash",
6983
+ type: "bytes32"
6984
+ },
6985
+ {
6986
+ name: "expected",
6987
+ type: "uint256"
6988
+ },
6989
+ {
6990
+ name: "actual",
6991
+ type: "uint256"
6992
+ }
6993
+ ]
6994
+ },
6995
+ {
6996
+ type: "error",
6997
+ name: "WrongDestinationBaseTokenAssetId",
6998
+ inputs: [
6999
+ {
7000
+ name: "bundleHash",
7001
+ type: "bytes32"
7002
+ },
7003
+ {
7004
+ name: "expected",
7005
+ type: "bytes32"
7006
+ },
7007
+ {
7008
+ name: "actual",
7009
+ type: "bytes32"
7010
+ }
7011
+ ]
7012
+ },
7013
+ {
7014
+ type: "error",
7015
+ name: "WrongSourceChainId",
7016
+ inputs: [
7017
+ {
7018
+ name: "bundleHash",
7019
+ type: "bytes32"
7020
+ },
7021
+ {
7022
+ name: "expected",
7023
+ type: "uint256"
7024
+ },
7025
+ {
7026
+ name: "actual",
7027
+ type: "uint256"
7028
+ }
7029
+ ]
7030
+ },
7031
+ {
7032
+ type: "error",
7033
+ name: "ZKTokenNotAvailable",
7034
+ inputs: []
7035
+ }
7036
+ ];
7037
+ var IInteropErrors_default = IInteropErrorsABI;
7038
+
7039
+ // src/core/internal/abis/IL1ContractErrors.ts
7040
+ var IL1ContractErrorsABI = [
7041
+ {
7042
+ type: "error",
7043
+ name: "AccessToFallbackDenied",
7044
+ inputs: [
7045
+ { name: "target", type: "address" },
7046
+ { name: "invoker", type: "address" }
7047
+ ]
7048
+ },
7049
+ {
7050
+ type: "error",
7051
+ name: "AccessToFunctionDenied",
7052
+ inputs: [
7053
+ { name: "target", type: "address" },
7054
+ { name: "selector", type: "bytes4" },
7055
+ { name: "invoker", type: "address" }
7056
+ ]
7057
+ },
7058
+ { type: "error", name: "AddressAlreadySet", inputs: [{ name: "addr", type: "address" }] },
7059
+ { type: "error", name: "AddressHasNoCode", inputs: [{ name: "", type: "address" }] },
7060
+ {
7061
+ type: "error",
7062
+ name: "AddressMismatch",
7063
+ inputs: [
7064
+ { name: "expected", type: "address" },
7065
+ { name: "supplied", type: "address" }
7066
+ ]
7067
+ },
7068
+ { type: "error", name: "AlreadyPermanentRollup", inputs: [] },
7069
+ { type: "error", name: "AlreadyWhitelisted", inputs: [{ name: "", type: "address" }] },
7070
+ { type: "error", name: "AmountMustBeGreaterThanZero", inputs: [] },
7071
+ {
7072
+ type: "error",
7073
+ name: "AssetHandlerDoesNotExist",
7074
+ inputs: [{ name: "assetId", type: "bytes32" }]
7075
+ },
7076
+ {
7077
+ type: "error",
7078
+ name: "AssetHandlerNotRegistered",
7079
+ inputs: [{ name: "assetId", type: "bytes32" }]
7080
+ },
7081
+ { type: "error", name: "AssetIdAlreadyRegistered", inputs: [] },
7082
+ {
7083
+ type: "error",
7084
+ name: "AssetIdMismatch",
7085
+ inputs: [
7086
+ { name: "expected", type: "bytes32" },
7087
+ { name: "supplied", type: "bytes32" }
7088
+ ]
7089
+ },
7090
+ { type: "error", name: "AssetIdNotSupported", inputs: [{ name: "assetId", type: "bytes32" }] },
7091
+ { type: "error", name: "AssetRouterAllowanceNotZero", inputs: [] },
7092
+ { type: "error", name: "BaseTokenGasPriceDenominatorNotSet", inputs: [] },
7093
+ {
7094
+ type: "error",
7095
+ name: "BatchHashMismatch",
7096
+ inputs: [
7097
+ { name: "expected", type: "bytes32" },
7098
+ { name: "actual", type: "bytes32" }
7099
+ ]
7100
+ },
7101
+ { type: "error", name: "BatchNotExecuted", inputs: [{ name: "batchNumber", type: "uint256" }] },
7102
+ {
7103
+ type: "error",
7104
+ name: "BatchNumberMismatch",
7105
+ inputs: [
7106
+ { name: "expectedBatchNumber", type: "uint256" },
7107
+ { name: "providedBatchNumber", type: "uint256" }
7108
+ ]
7109
+ },
7110
+ { type: "error", name: "BridgeHubAlreadyRegistered", inputs: [] },
7111
+ { type: "error", name: "BridgeMintNotImplemented", inputs: [] },
7112
+ { type: "error", name: "BurningNativeWETHNotSupported", inputs: [] },
7113
+ {
7114
+ type: "error",
7115
+ name: "BytecodeAlreadyPublished",
7116
+ inputs: [{ name: "bytecodeHash", type: "bytes32" }]
7117
+ },
7118
+ { type: "error", name: "CallerNotTimerAdmin", inputs: [] },
7119
+ { type: "error", name: "CallNotAllowed", inputs: [{ name: "call", type: "bytes" }] },
7120
+ { type: "error", name: "CanOnlyProcessOneBatch", inputs: [] },
7121
+ { type: "error", name: "CantExecuteUnprovenBatches", inputs: [] },
7122
+ { type: "error", name: "CantRevertExecutedBatch", inputs: [] },
7123
+ { type: "error", name: "ChainAlreadyLive", inputs: [] },
7124
+ { type: "error", name: "ChainIdAlreadyExists", inputs: [] },
7125
+ { type: "error", name: "ChainIdCantBeCurrentChain", inputs: [] },
7126
+ { type: "error", name: "ChainIdMismatch", inputs: [] },
7127
+ { type: "error", name: "ChainIdNotRegistered", inputs: [{ name: "chainId", type: "uint256" }] },
7128
+ { type: "error", name: "ChainIdTooBig", inputs: [] },
7129
+ { type: "error", name: "CTMAlreadyRegistered", inputs: [] },
7130
+ { type: "error", name: "CTMNotRegistered", inputs: [] },
7131
+ { type: "error", name: "DeadlineNotYetPassed", inputs: [] },
7132
+ { type: "error", name: "DefaultAdminTransferNotAllowed", inputs: [] },
7133
+ { type: "error", name: "DelegateCallFailed", inputs: [{ name: "returnData", type: "bytes" }] },
7134
+ { type: "error", name: "DenominatorIsZero", inputs: [] },
7135
+ { type: "error", name: "DeployFailed", inputs: [] },
7136
+ { type: "error", name: "DeployingBridgedTokenForNativeToken", inputs: [] },
7137
+ { type: "error", name: "DepositDoesNotExist", inputs: [] },
7138
+ { type: "error", name: "DepositExists", inputs: [] },
7139
+ { type: "error", name: "DiamondAlreadyFrozen", inputs: [] },
7140
+ { type: "error", name: "DiamondNotFrozen", inputs: [] },
7141
+ { type: "error", name: "EmptyAddress", inputs: [] },
7142
+ { type: "error", name: "EmptyAssetId", inputs: [] },
7143
+ { type: "error", name: "EmptyBytes32", inputs: [] },
7144
+ { type: "error", name: "EmptyData", inputs: [] },
7145
+ { type: "error", name: "EmptyDeposit", inputs: [] },
7146
+ { type: "error", name: "EmptyPrecommitData", inputs: [{ name: "batchNumber", type: "uint256" }] },
7147
+ { type: "error", name: "EmptyProofLength", inputs: [] },
7148
+ { type: "error", name: "ETHDepositNotSupported", inputs: [] },
7149
+ {
7150
+ type: "error",
7151
+ name: "FacetExists",
7152
+ inputs: [
7153
+ { name: "selector", type: "bytes4" },
7154
+ { name: "", type: "address" }
7155
+ ]
7156
+ },
7157
+ { type: "error", name: "GasPerPubdataMismatch", inputs: [] },
7158
+ { type: "error", name: "GenesisBatchCommitmentZero", inputs: [] },
7159
+ { type: "error", name: "GenesisBatchHashZero", inputs: [] },
7160
+ { type: "error", name: "GenesisIndexStorageZero", inputs: [] },
7161
+ { type: "error", name: "GenesisUpgradeZero", inputs: [] },
7162
+ { type: "error", name: "HashedLogIsDefault", inputs: [] },
7163
+ {
7164
+ type: "error",
7165
+ name: "HashMismatch",
7166
+ inputs: [
7167
+ { name: "expected", type: "bytes32" },
7168
+ { name: "actual", type: "bytes32" }
7169
+ ]
7170
+ },
7171
+ {
7172
+ type: "error",
7173
+ name: "IncorrectBatchBounds",
7174
+ inputs: [
7175
+ { name: "processFromExpected", type: "uint256" },
7176
+ { name: "processToExpected", type: "uint256" },
7177
+ { name: "processFromProvided", type: "uint256" },
7178
+ { name: "processToProvided", type: "uint256" }
7179
+ ]
7180
+ },
7181
+ {
7182
+ type: "error",
7183
+ name: "IncorrectBridgeHubAddress",
7184
+ inputs: [{ name: "bridgehub", type: "address" }]
7185
+ },
7186
+ {
7187
+ type: "error",
7188
+ name: "IncorrectTokenAddressFromNTV",
7189
+ inputs: [
7190
+ { name: "assetId", type: "bytes32" },
7191
+ { name: "tokenAddress", type: "address" }
7192
+ ]
7193
+ },
7194
+ { type: "error", name: "InsufficientChainBalance", inputs: [] },
7195
+ {
7196
+ type: "error",
7197
+ name: "InvalidBatchNumber",
7198
+ inputs: [
7199
+ { name: "provided", type: "uint256" },
7200
+ { name: "expected", type: "uint256" }
7201
+ ]
7202
+ },
7203
+ { type: "error", name: "InvalidCaller", inputs: [{ name: "", type: "address" }] },
7204
+ { type: "error", name: "InvalidDAForPermanentRollup", inputs: [] },
7205
+ { type: "error", name: "InvalidDelay", inputs: [] },
7206
+ {
7207
+ type: "error",
7208
+ name: "InvalidLogSender",
7209
+ inputs: [
7210
+ { name: "sender", type: "address" },
7211
+ { name: "logKey", type: "uint256" }
7212
+ ]
7213
+ },
7214
+ {
7215
+ type: "error",
7216
+ name: "InvalidMessageRoot",
7217
+ inputs: [
7218
+ { name: "expectedMessageRoot", type: "bytes32" },
7219
+ { name: "providedMessageRoot", type: "bytes32" }
7220
+ ]
7221
+ },
7222
+ { type: "error", name: "InvalidNTVBurnData", inputs: [] },
7223
+ {
7224
+ type: "error",
7225
+ name: "InvalidNumberOfBlobs",
7226
+ inputs: [
7227
+ { name: "expected", type: "uint256" },
7228
+ { name: "numCommitments", type: "uint256" },
7229
+ { name: "numHashes", type: "uint256" }
7230
+ ]
7231
+ },
7232
+ {
7233
+ type: "error",
7234
+ name: "InvalidPackedPrecommitmentLength",
7235
+ inputs: [{ name: "length", type: "uint256" }]
7236
+ },
7237
+ { type: "error", name: "InvalidProof", inputs: [] },
7238
+ { type: "error", name: "InvalidProofLengthForFinalNode", inputs: [] },
7239
+ { type: "error", name: "InvalidProtocolVersion", inputs: [] },
7240
+ { type: "error", name: "InvalidPubdataPricingMode", inputs: [] },
7241
+ { type: "error", name: "InvalidSelector", inputs: [{ name: "func", type: "bytes4" }] },
7242
+ { type: "error", name: "InvalidSystemLogsLength", inputs: [] },
7243
+ { type: "error", name: "InvalidUpgradeTxn", inputs: [{ name: "", type: "uint8" }] },
7244
+ { type: "error", name: "L2TimestampTooBig", inputs: [] },
7245
+ {
7246
+ type: "error",
7247
+ name: "L2WithdrawalMessageWrongLength",
7248
+ inputs: [{ name: "messageLen", type: "uint256" }]
7249
+ },
7250
+ { type: "error", name: "LegacyBridgeNotSet", inputs: [] },
7251
+ { type: "error", name: "LegacyBridgeUsesNonNativeToken", inputs: [] },
7252
+ { type: "error", name: "LegacyEncodingUsedForNonL1Token", inputs: [] },
7253
+ { type: "error", name: "LegacyMethodForNonL1Token", inputs: [] },
7254
+ {
7255
+ type: "error",
7256
+ name: "LengthIsNotDivisibleBy32",
7257
+ inputs: [{ name: "length", type: "uint256" }]
7258
+ },
7259
+ { type: "error", name: "LogAlreadyProcessed", inputs: [{ name: "", type: "uint8" }] },
7260
+ { type: "error", name: "MalformedBytecode", inputs: [{ name: "", type: "uint8" }] },
7261
+ { type: "error", name: "MerkleIndexOrHeightMismatch", inputs: [] },
7262
+ { type: "error", name: "MerkleIndexOutOfBounds", inputs: [] },
7263
+ { type: "error", name: "MerkleNothingToProve", inputs: [] },
7264
+ { type: "error", name: "MerklePathEmpty", inputs: [] },
7265
+ {
7266
+ type: "error",
7267
+ name: "MerklePathLengthMismatch",
7268
+ inputs: [
7269
+ { name: "pathLength", type: "uint256" },
7270
+ { name: "expectedLength", type: "uint256" }
7271
+ ]
7272
+ },
7273
+ { type: "error", name: "MerklePathOutOfBounds", inputs: [] },
7274
+ {
7275
+ type: "error",
7276
+ name: "MerkleWrongIndex",
7277
+ inputs: [
7278
+ { name: "index", type: "uint256" },
7279
+ { name: "maxNodeNumber", type: "uint256" }
7280
+ ]
7281
+ },
7282
+ {
7283
+ type: "error",
7284
+ name: "MerkleWrongLength",
7285
+ inputs: [
7286
+ { name: "newLeavesLength", type: "uint256" },
7287
+ { name: "leafNumber", type: "uint256" }
7288
+ ]
7289
+ },
7290
+ { type: "error", name: "MigrationPaused", inputs: [] },
7291
+ { type: "error", name: "MigrationsNotPaused", inputs: [] },
7292
+ {
7293
+ type: "error",
7294
+ name: "MissingSystemLogs",
7295
+ inputs: [
7296
+ { name: "expected", type: "uint256" },
7297
+ { name: "actual", type: "uint256" }
7298
+ ]
7299
+ },
7300
+ {
7301
+ type: "error",
7302
+ name: "MsgValueMismatch",
7303
+ inputs: [
7304
+ { name: "expectedMsgValue", type: "uint256" },
7305
+ { name: "providedMsgValue", type: "uint256" }
7306
+ ]
7307
+ },
7308
+ {
7309
+ type: "error",
7310
+ name: "MsgValueTooLow",
7311
+ inputs: [
7312
+ { name: "required", type: "uint256" },
7313
+ { name: "provided", type: "uint256" }
7314
+ ]
7315
+ },
7316
+ { type: "error", name: "NewDeadlineExceedsMaxDeadline", inputs: [] },
7317
+ { type: "error", name: "NewDeadlineNotGreaterThanCurrent", inputs: [] },
7318
+ { type: "error", name: "NoCallsProvided", inputs: [] },
7319
+ { type: "error", name: "NoCTMForAssetId", inputs: [{ name: "assetId", type: "bytes32" }] },
7320
+ { type: "error", name: "NoFunctionsForDiamondCut", inputs: [] },
7321
+ { type: "error", name: "NoFundsTransferred", inputs: [] },
7322
+ { type: "error", name: "NoLegacySharedBridge", inputs: [] },
7323
+ { type: "error", name: "NonEmptyCalldata", inputs: [] },
7324
+ { type: "error", name: "NonEmptyMsgValue", inputs: [] },
7325
+ { type: "error", name: "NonIncreasingTimestamp", inputs: [] },
7326
+ { type: "error", name: "NonSequentialBatch", inputs: [] },
7327
+ { type: "error", name: "NonSequentialVersion", inputs: [] },
7328
+ { type: "error", name: "NotAllowed", inputs: [{ name: "addr", type: "address" }] },
7329
+ { type: "error", name: "NotARestriction", inputs: [{ name: "addr", type: "address" }] },
7330
+ { type: "error", name: "NotAZKChain", inputs: [{ name: "addr", type: "address" }] },
7331
+ { type: "error", name: "NotInitializedReentrancyGuard", inputs: [] },
7332
+ { type: "error", name: "NotWhitelisted", inputs: [{ name: "", type: "address" }] },
7333
+ { type: "error", name: "OnlyEraSupported", inputs: [] },
7334
+ { type: "error", name: "OnlySelfAllowed", inputs: [] },
7335
+ { type: "error", name: "OperationExists", inputs: [] },
7336
+ { type: "error", name: "OperationMustBePending", inputs: [] },
7337
+ { type: "error", name: "OperationMustBeReady", inputs: [] },
7338
+ { type: "error", name: "OriginChainIdNotFound", inputs: [] },
7339
+ {
7340
+ type: "error",
7341
+ name: "PrecommitmentMismatch",
7342
+ inputs: [
7343
+ { name: "batchNumber", type: "uint256" },
7344
+ { name: "expected", type: "bytes32" },
7345
+ { name: "found", type: "bytes32" }
7346
+ ]
7347
+ },
7348
+ { type: "error", name: "PreviousOperationNotExecuted", inputs: [] },
7349
+ { type: "error", name: "PriorityOperationsRollingHashMismatch", inputs: [] },
7350
+ { type: "error", name: "PriorityTxPubdataExceedsMaxPubDataPerBatch", inputs: [] },
7351
+ {
7352
+ type: "error",
7353
+ name: "ProtocolIdMismatch",
7354
+ inputs: [
7355
+ { name: "expectedProtocolVersion", type: "uint256" },
7356
+ { name: "providedProtocolId", type: "uint256" }
7357
+ ]
7358
+ },
7359
+ { type: "error", name: "ProtocolIdNotGreater", inputs: [] },
7360
+ {
7361
+ type: "error",
7362
+ name: "PubdataGreaterThanLimit",
7363
+ inputs: [
7364
+ { name: "limit", type: "uint256" },
7365
+ { name: "length", type: "uint256" }
7366
+ ]
7367
+ },
7368
+ { type: "error", name: "QueueIsEmpty", inputs: [] },
7369
+ { type: "error", name: "Reentrancy", inputs: [] },
7370
+ {
7371
+ type: "error",
7372
+ name: "RemoveFunctionFacetAddressNotZero",
7373
+ inputs: [{ name: "facet", type: "address" }]
7374
+ },
7375
+ { type: "error", name: "RemoveFunctionFacetAddressZero", inputs: [] },
7376
+ { type: "error", name: "RemovingPermanentRestriction", inputs: [] },
7377
+ { type: "error", name: "ReplaceFunctionFacetAddressZero", inputs: [] },
7378
+ {
7379
+ type: "error",
7380
+ name: "RestrictionWasAlreadyPresent",
7381
+ inputs: [{ name: "restriction", type: "address" }]
7382
+ },
7383
+ {
7384
+ type: "error",
7385
+ name: "RestrictionWasNotPresent",
7386
+ inputs: [{ name: "restriction", type: "address" }]
7387
+ },
7388
+ { type: "error", name: "RevertedBatchNotAfterNewLastBatch", inputs: [] },
7389
+ {
7390
+ type: "error",
7391
+ name: "RoleAccessDenied",
7392
+ inputs: [
7393
+ { name: "chainAddress", type: "address" },
7394
+ { name: "role", type: "bytes32" },
7395
+ { name: "account", type: "address" }
7396
+ ]
7397
+ },
7398
+ { type: "error", name: "SelectorsMustAllHaveSameFreezability", inputs: [] },
7399
+ { type: "error", name: "SettlementLayersMustSettleOnL1", inputs: [] },
7400
+ { type: "error", name: "SharedBridgeNotSet", inputs: [] },
7401
+ { type: "error", name: "SharedBridgeValueNotSet", inputs: [{ name: "", type: "uint8" }] },
7402
+ { type: "error", name: "SlotOccupied", inputs: [] },
7403
+ { type: "error", name: "SystemLogsSizeTooBig", inputs: [] },
7404
+ {
7405
+ type: "error",
7406
+ name: "TimeNotReached",
7407
+ inputs: [
7408
+ { name: "expectedTimestamp", type: "uint256" },
7409
+ { name: "actualTimestamp", type: "uint256" }
7410
+ ]
7411
+ },
7412
+ { type: "error", name: "TimerAlreadyStarted", inputs: [] },
7413
+ { type: "error", name: "TimestampError", inputs: [] },
7414
+ { type: "error", name: "TokenIsLegacy", inputs: [] },
7415
+ { type: "error", name: "TokenNotLegacy", inputs: [] },
7416
+ { type: "error", name: "TokenNotSupported", inputs: [{ name: "token", type: "address" }] },
7417
+ { type: "error", name: "TokensWithFeesNotSupported", inputs: [] },
7418
+ { type: "error", name: "TooHighDeploymentNonce", inputs: [] },
7419
+ { type: "error", name: "TooManyFactoryDeps", inputs: [] },
7420
+ { type: "error", name: "TooMuchGas", inputs: [] },
7421
+ { type: "error", name: "TransactionNotAllowed", inputs: [] },
7422
+ { type: "error", name: "TxHashMismatch", inputs: [] },
7423
+ { type: "error", name: "TxnBodyGasLimitNotEnoughGas", inputs: [] },
7424
+ {
7425
+ type: "error",
7426
+ name: "UnallowedImplementation",
7427
+ inputs: [{ name: "implementationHash", type: "bytes32" }]
7428
+ },
7429
+ { type: "error", name: "Unauthorized", inputs: [{ name: "caller", type: "address" }] },
7430
+ { type: "error", name: "UndefinedDiamondCutAction", inputs: [] },
7431
+ { type: "error", name: "UnexpectedSystemLog", inputs: [{ name: "logKey", type: "uint256" }] },
7432
+ { type: "error", name: "UnknownVerifierType", inputs: [] },
7433
+ {
7434
+ type: "error",
7435
+ name: "UnsupportedCommitBatchEncoding",
7436
+ inputs: [{ name: "version", type: "uint8" }]
7437
+ },
7438
+ { type: "error", name: "UnsupportedEncodingVersion", inputs: [] },
7439
+ {
7440
+ type: "error",
7441
+ name: "UnsupportedExecuteBatchEncoding",
7442
+ inputs: [{ name: "version", type: "uint8" }]
7443
+ },
7444
+ {
7445
+ type: "error",
7446
+ name: "UnsupportedProofBatchEncoding",
7447
+ inputs: [{ name: "version", type: "uint8" }]
7448
+ },
7449
+ { type: "error", name: "UpgradeBatchNumberIsNotZero", inputs: [] },
7450
+ { type: "error", name: "ValidateTxnNotEnoughGas", inputs: [] },
7451
+ {
7452
+ type: "error",
7453
+ name: "ValueMismatch",
7454
+ inputs: [
7455
+ { name: "expected", type: "uint256" },
7456
+ { name: "actual", type: "uint256" }
7457
+ ]
7458
+ },
7459
+ { type: "error", name: "VerifiedBatchesExceedsCommittedBatches", inputs: [] },
7460
+ { type: "error", name: "WithdrawalAlreadyFinalized", inputs: [] },
7461
+ { type: "error", name: "WithdrawFailed", inputs: [] },
7462
+ { type: "error", name: "WrappedBaseTokenAlreadyRegistered", inputs: [] },
7463
+ {
7464
+ type: "error",
7465
+ name: "WrongMagicValue",
7466
+ inputs: [
7467
+ { name: "expectedMagicValue", type: "uint256" },
7468
+ { name: "providedMagicValue", type: "uint256" }
7469
+ ]
7470
+ },
7471
+ { type: "error", name: "ZeroAddress", inputs: [] },
7472
+ { type: "error", name: "ZeroChainId", inputs: [] },
7473
+ { type: "error", name: "ZKChainLimitReached", inputs: [] }
7474
+ ];
7475
+ var IL1ContractErrors_default = IL1ContractErrorsABI;
7476
+
6767
7477
  // src/core/types/primitives.ts
6768
7478
  var ZERO_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000";
6769
7479
 
@@ -6873,6 +7583,14 @@ var IFACE_PANIC = new ethers.Interface(["error Panic(uint256)"]);
6873
7583
  ERROR_IFACES.push({ name: "Mailbox", iface: new ethers.Interface(Mailbox_default) });
6874
7584
  } catch {
6875
7585
  }
7586
+ try {
7587
+ ERROR_IFACES.push({ name: "IL1ContractErrors", iface: new ethers.Interface(IL1ContractErrors_default) });
7588
+ } catch {
7589
+ }
7590
+ try {
7591
+ ERROR_IFACES.push({ name: "IInteropErrors", iface: new ethers.Interface(IInteropErrors_default) });
7592
+ } catch {
7593
+ }
6876
7594
  })();
6877
7595
  function registerErrorAbi(name, abi2) {
6878
7596
  const existing = ERROR_IFACES.findIndex((x) => x.name === name);
@@ -10841,17 +11559,20 @@ function createInteropResource(client, tokens, contracts, attributes) {
10841
11559
  }
10842
11560
  } catch (e) {
10843
11561
  if (isZKsyncError(e)) throw e;
10844
- throw createError("EXECUTION", {
10845
- resource: "interop",
10846
- operation: "interop.create.sendTransaction",
10847
- message: "Failed to send or confirm an interop transaction step.",
10848
- context: {
10849
- step: step.key,
10850
- txHash: hash,
10851
- nonce: Number(step.tx.nonce ?? -1)
11562
+ throw toZKsyncError(
11563
+ "EXECUTION",
11564
+ {
11565
+ resource: "interop",
11566
+ operation: "interop.create.sendTransaction",
11567
+ message: "Failed to send or confirm an interop transaction step.",
11568
+ context: {
11569
+ step: step.key,
11570
+ txHash: hash,
11571
+ nonce: Number(step.tx.nonce ?? -1)
11572
+ }
10852
11573
  },
10853
- cause: e
10854
- });
11574
+ e
11575
+ );
10855
11576
  }
10856
11577
  }
10857
11578
  const last = Object.values(stepHashes).pop();