Skip to content

Commit db4f634

Browse files
authored
Merge branch 'main' into db/add-rpc-zks_getproof
2 parents 7919ac8 + 9a28e03 commit db4f634

File tree

8 files changed

+42
-12
lines changed

8 files changed

+42
-12
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.0.15"
2+
".": "0.0.16"
33
}

.github/workflows/ci-scheduled-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
version: v1.5.1
3737

3838
- name: Run ZKsync OS (L1-L2)
39-
uses: dutterbutter/zksync-server-action@1e0262a81dbbadbb535c6acc13cb23e9f2495812
39+
uses: matter-labs/zksync-server-action@6632ab9a6bd841c7849e8d62a4984734e018d89f # v0.1.1
4040
with:
4141
version: v0.18.1
4242
protocol_version: v30.2

.github/workflows/ci-test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ jobs:
6464
version: v1.5.1
6565

6666
- name: Run ZKsync OS (L1-L2)
67-
uses: dutterbutter/zksync-server-action@1e0262a81dbbadbb535c6acc13cb23e9f2495812
67+
uses: matter-labs/zksync-server-action@6632ab9a6bd841c7849e8d62a4984734e018d89f # v0.1.1
6868
with:
6969
version: v0.18.1
7070
protocol_version: v30.2
71-
71+
7272
- name: Compile test contracts
7373
working-directory: tests/contracts
7474
run: |
@@ -193,7 +193,7 @@ jobs:
193193
version: v1.5.1
194194

195195
- name: Run ZKsync OS (L1-L2)
196-
uses: dutterbutter/zksync-server-action@1e0262a81dbbadbb535c6acc13cb23e9f2495812
196+
uses: matter-labs/zksync-server-action@6632ab9a6bd841c7849e8d62a4984734e018d89f # v0.1.1
197197
with:
198198
version: v0.18.1
199199
protocol_version: v30.2

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [0.0.16](https://github.com/matter-labs/zksync-js/compare/v0.0.15...v0.0.16) (2026-04-01)
4+
5+
6+
### Features
7+
8+
* add verifyBundle and getInteropRoot interop functions ([#85](https://github.com/matter-labs/zksync-js/issues/85)) ([f6d1628](https://github.com/matter-labs/zksync-js/commit/f6d1628f448f98b003dbb70eda93f5a2a93de876))
9+
10+
11+
### Bug Fixes
12+
13+
* address issue with ETH deposits on CBT chain ([#87](https://github.com/matter-labs/zksync-js/issues/87)) ([51a8ccb](https://github.com/matter-labs/zksync-js/commit/51a8ccb1c4ea50919eb6fba8bc60f2fd848c4a6e))
14+
315
## [0.0.15](https://github.com/matter-labs/zksync-js/compare/v0.0.14...v0.0.15) (2026-03-27)
416

517

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@matterlabs/zksync-js",
3-
"version": "0.0.15",
3+
"version": "0.0.16",
44
"main": "./dist/index.cjs",
55
"module": "./dist/index.js",
66
"devDependencies": {

src/adapters/__tests__/deposits/eth-nonbase.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ describeForAdapters('adapters/deposits/routeEthNonBase', (kind, factory) => {
174174
expect((tx.from as string).toLowerCase()).toBe(ctx.sender.toLowerCase());
175175
expect(BigInt(tx.value ?? 0n)).toBe(amount);
176176
expect(BigInt(info.mintValue)).toBe(mintValue);
177+
expect(BigInt(info.l2Value)).toBe(0n);
177178
expect(BigInt(info.secondBridgeValue)).toBe(amount);
178179
expect(bridgeArgs.token).toBe(ETH_ADDRESS.toLowerCase());
179180
expect(bridgeArgs.amount).toBe(amount);
@@ -188,6 +189,7 @@ describeForAdapters('adapters/deposits/routeEthNonBase', (kind, factory) => {
188189
expect((tx.account as string).toLowerCase()).toBe(ctx.sender.toLowerCase());
189190
expect(BigInt(tx.value ?? 0n)).toBe(amount);
190191
expect(BigInt(req.mintValue ?? 0n)).toBe(mintValue);
192+
expect(BigInt(req.l2Value ?? 0n)).toBe(0n);
191193
expect(BigInt(req.secondBridgeValue ?? 0n)).toBe(amount);
192194
}
193195
});
@@ -231,11 +233,19 @@ describeForAdapters('adapters/deposits/routeEthNonBase', (kind, factory) => {
231233

232234
const bridge = res.steps.at(-1)!;
233235
if (kind === 'ethers') {
236+
const tx = bridge.tx as any;
237+
expect(BigInt(tx.value ?? 0n)).toBe(amount);
234238
const info = decodeTwoBridgeOuter((bridge.tx as any).data);
235239
expect(BigInt(info.l2GasLimit)).toBe(expectedL2GasLimit);
240+
expect(BigInt(info.l2Value)).toBe(0n);
241+
expect(BigInt(info.secondBridgeValue)).toBe(amount);
236242
} else {
243+
const tx = bridge.tx as any;
244+
expect(BigInt(tx.value ?? 0n)).toBe(amount);
237245
const req = ((bridge.tx as any).args?.[0] ?? {}) as any;
238246
expect(BigInt(req.l2GasLimit ?? 0n)).toBe(expectedL2GasLimit);
247+
expect(BigInt(req.l2Value ?? 0n)).toBe(0n);
248+
expect(BigInt(req.secondBridgeValue ?? 0n)).toBe(amount);
239249
}
240250
});
241251

src/adapters/ethers/resources/deposits/routes/eth-nonbase.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,18 @@ export function routeEthNonBase(): DepositRouteStrategy {
223223
const requestStruct = {
224224
chainId: ctx.chainIdL2,
225225
mintValue,
226-
l2Value: p.amount,
226+
l2Value: 0n,
227227
l2GasLimit: l2GasParams.gasLimit,
228228
l2GasPerPubdataByteLimit: ctx.gasPerPubdata,
229229
refundRecipient: ctx.refundRecipient,
230230
secondBridgeAddress: ctx.l1AssetRouter,
231231
secondBridgeValue: p.amount,
232232
secondBridgeCalldata,
233233
} as const;
234+
// For ETH deposits on custom-base-token chains:
235+
// - outer Bridgehub msg.value must equal secondBridgeValue
236+
// - inner asset-router / NTV path requires l2Value to stay zero
237+
const bridgehubValue = p.amount;
234238

235239
const bridgehub = await ctx.contracts.bridgehub();
236240
const data = bridgehub.interface.encodeFunctionData('requestL2TransactionTwoBridges', [
@@ -240,7 +244,7 @@ export function routeEthNonBase(): DepositRouteStrategy {
240244
const l1TxCandidate: TransactionRequest = {
241245
to: ctx.bridgehub,
242246
data,
243-
value: p.amount, // base ≠ ETH ⇒ msg.value == secondBridgeValue
247+
value: bridgehubValue,
244248
from: ctx.sender,
245249
...ctx.gasOverrides,
246250
};

src/adapters/viem/resources/deposits/routes/eth-nonbase.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,18 @@ export function routeEthNonBase(): DepositRouteStrategy {
258258
const requestStruct = {
259259
chainId: ctx.chainIdL2,
260260
mintValue,
261-
l2Value: p.amount,
261+
l2Value: 0n,
262262
l2GasLimit: l2Gas.gasLimit,
263263
l2GasPerPubdataByteLimit: ctx.gasPerPubdata,
264264
refundRecipient: ctx.refundRecipient,
265265
secondBridgeAddress: ctx.l1AssetRouter,
266266
secondBridgeValue: p.amount,
267267
secondBridgeCalldata,
268268
} as const;
269+
// For ETH deposits on custom-base-token chains:
270+
// - outer Bridgehub msg.value must equal secondBridgeValue
271+
// - inner asset-router / NTV path requires l2Value to stay zero
272+
const bridgehubValue = p.amount;
269273

270274
let bridgeTx: ViemPlanWriteRequest;
271275
let calldata: `0x${string}`;
@@ -276,7 +280,7 @@ export function routeEthNonBase(): DepositRouteStrategy {
276280
abi: IBridgehubABI,
277281
functionName: 'requestL2TransactionTwoBridges',
278282
args: [requestStruct],
279-
value: p.amount, // base ≠ ETH ⇒ msg.value == secondBridgeValue
283+
value: bridgehubValue,
280284
account: ctx.client.account,
281285
} as const;
282286

@@ -295,7 +299,7 @@ export function routeEthNonBase(): DepositRouteStrategy {
295299
abi: IBridgehubABI,
296300
functionName: 'requestL2TransactionTwoBridges',
297301
args: [requestStruct],
298-
value: p.amount,
302+
value: bridgehubValue,
299303
account: ctx.client.account,
300304
}),
301305
{
@@ -317,7 +321,7 @@ export function routeEthNonBase(): DepositRouteStrategy {
317321
const l1TxCandidate: TransactionRequest = {
318322
to: ctx.bridgehub,
319323
data: calldata,
320-
value: p.amount,
324+
value: bridgehubValue,
321325
from: ctx.sender,
322326
...ctx.gasOverrides,
323327
};

0 commit comments

Comments
 (0)