Skip to content

Commit

Permalink
erc20 deposit and withdraw fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi committed Jun 5, 2024
1 parent 8471411 commit 5909553
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions composables/zksync/deposit/useTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default (getL1Signer: () => Promise<L1Signer | undefined>) => {
token: transaction.tokenAddress,
amount: transaction.amount,
l2GasLimit: fee.l2GasLimit,
approveERC20: true,
overrides,
});

Expand Down
2 changes: 1 addition & 1 deletion composables/zksync/useTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default (getSigner: () => Promise<Signer | undefined>, getProvider: () =>
const getRequiredBridgeAddress = async () => {
if (transaction.tokenAddress === ETH_TOKEN.address) return undefined;
const bridgeAddresses = await retrieveBridgeAddresses();
return bridgeAddresses.erc20L2;
return bridgeAddresses.sharedL2;
};
const bridgeAddress = transaction.type === "withdrawal" ? await getRequiredBridgeAddress() : undefined;

Expand Down
5 changes: 2 additions & 3 deletions composables/zksync/useWithdrawalFinalization.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useMemoize } from "@vueuse/core";
import { BigNumber, type BigNumberish } from "ethers";
import { Wallet } from "zksync-ethers";
import ZkSyncL1BridgeAbi from "zksync-ethers/abi/IL1Bridge.json";
import IL1SharedBridge from "zksync-ethers/abi/IL1SharedBridge.json";

import type { Hash } from "@/types";
Expand Down Expand Up @@ -80,8 +79,8 @@ export default (transactionInfo: ComputedRef<TransactionInfo>) => {
};
} else {
return {
address: (await retrieveBridgeAddresses()).erc20L1 as Hash,
abi: ZkSyncL1BridgeAbi,
address: (await retrieveBridgeAddresses()).sharedL1 as Hash,
abi: IL1SharedBridge,
account: onboardStore.account.address!,
functionName: "finalizeWithdrawal",
args: Object.values(finalizeWithdrawalParams.value!),
Expand Down

0 comments on commit 5909553

Please sign in to comment.