Skip to content

Commit 892e2bf

Browse files
authored
fix: update method to finalizeDeposit instead of legacy (#250)
1 parent 79bdb7d commit 892e2bf

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

composables/zksync/useWithdrawalFinalization.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default (transactionInfo: ComputedRef<TransactionInfo>) => {
2323
const retrieveBridgeAddresses = useMemoize(() => providerStore.requestProvider().getDefaultBridgeAddresses());
2424
const retrieveL1NullifierAddress = useMemoize(async () => {
2525
const providerL1 = walletStore.getL1VoidSigner();
26-
return IL1AssetRouterFactory.connect((await retrieveBridgeAddresses()).sharedL1, providerL1).L1_NULLIFIER();
26+
return await IL1AssetRouterFactory.connect((await retrieveBridgeAddresses()).sharedL1, providerL1).L1_NULLIFIER();
2727
});
2828

2929
const gasLimit = ref<bigint | undefined>();
@@ -55,21 +55,22 @@ export default (transactionInfo: ComputedRef<TransactionInfo>) => {
5555
const chainId = BigInt(await provider.getNetwork().then((n) => n.chainId));
5656
const p = finalizeWithdrawalParams.value!;
5757

58-
const args = [
59-
chainId,
60-
p.l1BatchNumber ?? 0,
61-
BigInt(p.l2MessageIndex),
62-
Number(p.l2TxNumberInBlock),
63-
p.message,
64-
p.proof,
65-
];
58+
const finalizeDepositParams = {
59+
chainId: BigInt(chainId),
60+
l2BatchNumber: BigInt(p.l1BatchNumber ?? 0n),
61+
l2MessageIndex: BigInt(p.l2MessageIndex),
62+
l2Sender: p.sender as `0x${string}`,
63+
l2TxNumberInBatch: Number(p.l2TxNumberInBlock),
64+
message: p.message,
65+
merkleProof: p.proof,
66+
};
6667

6768
return {
6869
address: (await retrieveL1NullifierAddress()) as Hash,
6970
abi: IL1Nullifier,
7071
account: onboardStore.account.address!,
71-
functionName: "finalizeWithdrawal",
72-
args,
72+
functionName: "finalizeDeposit",
73+
args: [finalizeDepositParams],
7374
} as const;
7475
};
7576

0 commit comments

Comments
 (0)