@matterlabs/zksync-js 0.0.16 → 0.0.17

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.
@@ -8404,8 +8404,8 @@ function buildFeeBreakdown(p) {
8404
8404
 
8405
8405
  // src/core/resources/deposits/priority.ts
8406
8406
  var PRIORITY_TX_ENCODING_STEP_BYTES = 544n;
8407
- var DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER = 6n;
8408
- var ERAVM_PRIORITY_L2_GAS_BUFFER = 30n;
8407
+ var DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER = 7n;
8408
+ var PRIORITY_L2_GAS_BUFFER = 40n;
8409
8409
  var maxBigInt2 = (a, b) => a > b ? a : b;
8410
8410
  var ceilDiv = (a, b) => (a + b - 1n) / b;
8411
8411
  function derivePriorityTxGasBreakdown(input) {
@@ -8433,10 +8433,7 @@ function derivePriorityBodyGasEstimateCap(input) {
8433
8433
  return input.minBodyGas * (input.multiplier ?? DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER);
8434
8434
  }
8435
8435
  function applyPriorityL2GasLimitBuffer(input) {
8436
- if (!isEraVmChain(input.chainIdL2)) {
8437
- return input.gasLimit;
8438
- }
8439
- return input.gasLimit * (100n + ERAVM_PRIORITY_L2_GAS_BUFFER) / 100n;
8436
+ return input.gasLimit * (100n + PRIORITY_L2_GAS_BUFFER) / 100n;
8440
8437
  }
8441
8438
  var EMPTY_BYTES = "0x";
8442
8439
  var ZERO_RESERVED_WORDS = [0n, 0n, 0n, 0n];
@@ -11091,13 +11088,23 @@ function routeIndirect() {
11091
11088
  // src/adapters/ethers/resources/interop/routes/direct.ts
11092
11089
  function routeDirect() {
11093
11090
  return {
11094
- // eslint-disable-next-line @typescript-eslint/require-await
11095
11091
  async preflight(params, ctx) {
11096
11092
  preflightDirect(params, {
11097
11093
  dstChainId: ctx.dstChainId,
11098
11094
  baseTokens: ctx.baseTokens,
11099
11095
  l2AssetRouter: ctx.l2AssetRouter,
11100
11096
  l2NativeTokenVault: ctx.l2NativeTokenVault});
11097
+ for (const action of params.actions) {
11098
+ const code = await ctx.dstProvider.getCode(action.to);
11099
+ if (!code || code === "0x") {
11100
+ throw createError("VALIDATION", {
11101
+ resource: "interop",
11102
+ operation: OP_INTEROP.routes.direct.preflight,
11103
+ message: `Destination address ${action.to} is not a contract on the destination chain. The receiver must be a contract that implements the IERC7786Recipient interface (receiveMessage).`,
11104
+ context: { to: action.to, action: action.type }
11105
+ });
11106
+ }
11107
+ }
11101
11108
  },
11102
11109
  async build(params, ctx) {
11103
11110
  const steps = [];
@@ -11347,7 +11354,7 @@ async function getBundleStatus(client, dstProvider, topics, bundleHash, opts) {
11347
11354
  }
11348
11355
  return { phase: "SENT" };
11349
11356
  }
11350
- async function executeBundle(client, dstProvider, info, opts) {
11357
+ async function executeBundle(client, dstProvider, info, opts, txOverrides) {
11351
11358
  const { topics } = getTopics();
11352
11359
  const { bundleHash, encodedData, proof } = info;
11353
11360
  const dstStatus = await getBundleStatus(client, dstProvider, topics, bundleHash, opts);
@@ -11365,7 +11372,11 @@ async function executeBundle(client, dstProvider, info, opts) {
11365
11372
  const { interopHandler } = await client.ensureAddresses();
11366
11373
  const handler = new ethers.Contract(interopHandler, IInteropHandler_default, signer);
11367
11374
  try {
11368
- const txResponse = await handler.executeBundle(encodedData, proof);
11375
+ const txResponse = await handler.executeBundle(
11376
+ encodedData,
11377
+ proof,
11378
+ txOverrides ?? {}
11379
+ );
11369
11380
  const hash = txResponse.hash;
11370
11381
  return {
11371
11382
  hash,
@@ -11813,8 +11824,8 @@ function createInteropFinalizationServices(client) {
11813
11824
  wait(dstProvider, gwProvider, input, opts) {
11814
11825
  return waitForFinalization(client, dstProvider, gwProvider, input, opts);
11815
11826
  },
11816
- async finalize(dstProvider, info, opts) {
11817
- const execResult = await executeBundle(client, dstProvider, info, opts);
11827
+ async finalize(dstProvider, info, opts, txOverrides) {
11828
+ const execResult = await executeBundle(client, dstProvider, info, opts, txOverrides);
11818
11829
  await execResult.wait();
11819
11830
  return {
11820
11831
  bundleHash: info.bundleHash,
@@ -12024,22 +12035,25 @@ function createInteropResource(client, config, tokens, contracts, attributes) {
12024
12035
  ctx: { where: "interop.wait" }
12025
12036
  });
12026
12037
  const tryWait = (dstChain, h, opts) => toResult2(OP_INTEROP.tryWait, () => wait(dstChain, h, opts));
12027
- const finalize = (dstChain, h, opts) => wrap7(
12038
+ const finalize = (dstChain, h, opts, txOverrides) => wrap7(
12028
12039
  OP_INTEROP.finalize,
12029
12040
  async () => {
12030
12041
  const dstProvider = resolveChainRef(dstChain);
12031
12042
  if (isInteropFinalizationInfo(h)) {
12032
- return svc.finalize(dstProvider, h, opts);
12043
+ return svc.finalize(dstProvider, h, opts, txOverrides);
12033
12044
  }
12034
12045
  const info = await svc.wait(dstProvider, getGwProvider(), h);
12035
- return svc.finalize(dstProvider, info, opts);
12046
+ return svc.finalize(dstProvider, info, opts, txOverrides);
12036
12047
  },
12037
12048
  {
12038
12049
  message: "Failed to finalize/execute interop bundle on destination.",
12039
12050
  ctx: { where: "interop.finalize" }
12040
12051
  }
12041
12052
  );
12042
- const tryFinalize = (dstChain, h, opts) => toResult2(OP_INTEROP.tryFinalize, () => finalize(dstChain, h, opts));
12053
+ const tryFinalize = (dstChain, h, opts, txOverrides) => toResult2(
12054
+ OP_INTEROP.tryFinalize,
12055
+ () => finalize(dstChain, h, opts, txOverrides)
12056
+ );
12043
12057
  const interopGetRoot = (dstChain, rootChainId, batchNumber) => wrap7(
12044
12058
  OP_INTEROP.svc.status.getRoot,
12045
12059
  () => getInteropRoot(resolveChainRef(dstChain), rootChainId, batchNumber),