Skip to content

Commit 9dc3a95

Browse files
committed
Update ZkSync_SpokePool.ts
1 parent d98a953 commit 9dc3a95

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/evm/hardhat/chain-specific-spokepools/ZkSync_SpokePool.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { constructSingleRelayerRefundTree } from "../MerkleLib.utils";
2020
import { smock } from "@defi-wonderland/smock";
2121

2222
const L2_ASSET_ROUTER = "0x0000000000000000000000000000000000010003";
23+
const L1_NATIVE_TOKEN_VAULT_ADDR = "0x0000000000000000000000000000000000010004";
2324
// TODO: Grab the following from relayer/CONTRACT_ADDRESSES dictionary?
2425
const USDC_BRIDGE = "0x350ACF3d84A6E668E53d4AA682989DCA15Ea27E2";
2526

@@ -185,7 +186,7 @@ describe("ZkSync Spoke Pool", function () {
185186
// This should have sent tokens back to L1.
186187
expect(l2AssetRouter.withdraw).to.have.been.calledOnce;
187188
const expectedAssetId = keccak256(
188-
defaultAbiCoder.encode(["uint256", "address", "address"], [1, L2_ASSET_ROUTER, l2Dai])
189+
defaultAbiCoder.encode(["uint256", "address", "address"], [1, L1_NATIVE_TOKEN_VAULT_ADDR, l2Dai])
189190
);
190191
const expectedData = defaultAbiCoder.encode(
191192
["uint256", "address", "address"],
@@ -212,6 +213,14 @@ describe("ZkSync Spoke Pool", function () {
212213

213214
// This should have sent tokens back to L1. Check the correct methods on the gateway are correctly called.
214215
expect(l2AssetRouter.withdraw).to.have.been.calledOnce;
216+
const expectedAssetId = keccak256(
217+
defaultAbiCoder.encode(["uint256", "address", "address"], [1, L1_NATIVE_TOKEN_VAULT_ADDR, usdc.address])
218+
);
219+
const expectedData = defaultAbiCoder.encode(
220+
["uint256", "address", "address"],
221+
[amountToReturn, hubPool.address, usdc.address]
222+
);
223+
expect(l2AssetRouter.withdraw).to.have.been.calledWith(expectedAssetId, expectedData);
215224
});
216225
it("Bridge tokens to hub pool correctly calls the custom USDC L2 Bridge for Circle Bridged USDC", async function () {
217226
const { leaves, tree } = await constructSingleRelayerRefundTree(

0 commit comments

Comments
 (0)