From e582f8517b40c3f8ea160bff76cdf69fd79b2152 Mon Sep 17 00:00:00 2001 From: BrickheadJohnny Date: Fri, 29 Nov 2024 19:26:41 +0100 Subject: [PATCH] fix(ClaimTokenModal): check balance with native currency decimals --- src/rewards/Token/ClaimTokenModal/ClaimTokenModal.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rewards/Token/ClaimTokenModal/ClaimTokenModal.tsx b/src/rewards/Token/ClaimTokenModal/ClaimTokenModal.tsx index be63d231d1..0f5ce0b8be 100644 --- a/src/rewards/Token/ClaimTokenModal/ClaimTokenModal.tsx +++ b/src/rewards/Token/ClaimTokenModal/ClaimTokenModal.tsx @@ -32,7 +32,7 @@ import { } from "utils/rolePlatformHelpers" import { formatUnits } from "viem" import { useAccount } from "wagmi" -import { Chains } from "wagmiConfig/chains" +import { CHAIN_CONFIG, Chains } from "wagmiConfig/chains" import TokenClaimFeeTable from "../TokenClaimFeeTable" import { useTokenRewardContext } from "../TokenRewardContext" import useCollectToken from "../hooks/useCollectToken" @@ -102,9 +102,9 @@ const ClaimTokenModal = ({ isOpen, onClose }: Props) => { ) const formattedFee = - fee.isLoading || token.isLoading || !fee?.amount || !token?.data?.decimals + fee.isLoading || !fee?.amount ? null - : formatUnits(fee.amount, token.data.decimals) + : formatUnits(fee.amount, CHAIN_CONFIG[chain!].nativeCurrency.decimals) const { isBalanceSufficient } = useIsBalanceSufficient({ address: NULL_ADDRESS,