From 75fa6b0acdfa6f702d2e1b84603320e80e4ed09c Mon Sep 17 00:00:00 2001 From: Roman Petriv Date: Mon, 29 Jul 2024 15:05:09 +0300 Subject: [PATCH] fix: unblock ETH deposit on non-eth based chains (#185) --- composables/zksync/deposit/useFee.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composables/zksync/deposit/useFee.ts b/composables/zksync/deposit/useFee.ts index fb843580f..2f6940734 100644 --- a/composables/zksync/deposit/useFee.ts +++ b/composables/zksync/deposit/useFee.ts @@ -17,6 +17,7 @@ export type DepositFeeValues = { export default (tokens: Ref, balances: Ref) => { const { getPublicClient } = useOnboardStore(); const { getL1VoidSigner } = useZkSyncWalletStore(); + const { requestProvider } = useZkSyncProviderStore(); let params = { to: undefined as string | undefined, @@ -86,8 +87,11 @@ export default (tokens: Ref, balances: Ref) recommendedBalance.value = undefined; if (!feeToken.value) throw new Error("Fee tokens is not available"); + const provider = requestProvider(); + const isEthBasedChain = await provider.isEthBasedChain(); + try { - if (params.tokenAddress === feeToken.value?.address) { + if (isEthBasedChain && params.tokenAddress === feeToken.value?.address) { fee.value = await getEthTransactionFee(); } else { fee.value = getERC20TransactionFee();