Skip to content

Commit

Permalink
fix: unblock ETH deposit on non-eth based chains (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters authored Jul 29, 2024
1 parent 3c61403 commit 75fa6b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion composables/zksync/deposit/useFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type DepositFeeValues = {
export default (tokens: Ref<Token[]>, balances: Ref<TokenAmount[] | undefined>) => {
const { getPublicClient } = useOnboardStore();
const { getL1VoidSigner } = useZkSyncWalletStore();
const { requestProvider } = useZkSyncProviderStore();

let params = {
to: undefined as string | undefined,
Expand Down Expand Up @@ -86,8 +87,11 @@ export default (tokens: Ref<Token[]>, balances: Ref<TokenAmount[] | undefined>)
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();
Expand Down

0 comments on commit 75fa6b0

Please sign in to comment.