Skip to content

Commit

Permalink
fix: pass token decimals to fromWei (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
baroooo authored Jul 12, 2024
1 parent 27ecf9e commit 199a32a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/swap/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down

0 comments on commit 199a32a

Please sign in to comment.