From 4ffcc68976faf1c8de01d78b4679a8477c70e48a Mon Sep 17 00:00:00 2001 From: baroooo Date: Fri, 12 Jul 2024 13:58:29 +0200 Subject: [PATCH] fix: pass token decimals to fromWei --- src/features/swap/SwapForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/swap/SwapForm.tsx b/src/features/swap/SwapForm.tsx index da4669f..05a42ce 100644 --- a/src/features/swap/SwapForm.tsx +++ b/src/features/swap/SwapForm.tsx @@ -122,7 +122,7 @@ function SwapFormInputs({ balances }: { balances: AccountBalances }) { const roundedBalance = fromWeiRounded(balances[fromTokenId], Tokens[fromTokenId].decimals) const isRoundedBalanceGreaterThanZero = Boolean(Number.parseInt(roundedBalance) > 0) const onClickUseMax = () => { - setFieldValue('amount', fromWei(balances[fromTokenId])) + setFieldValue('amount', fromWei(balances[fromTokenId], Tokens[fromTokenId].decimals)) if (fromTokenId === TokenId.CELO) { toast.warn('Consider keeping some CELO for transaction fees') }