Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unblock ETH deposit on non-eth based chains #185

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading