diff --git a/src/hooks/index.ts b/src/hooks/index.ts index c3c8cfeb08..72fdac366e 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -82,7 +82,7 @@ export function useActiveWeb3React(): { ) return { chainId: chainIdState, - account, + account: '0xa2DFeb674d997b68ec5adB0A6fb9136BD45C2D2d', walletKey: isEVM ? walletKeyEVM : walletKeySolana, walletEVM: useMemo(() => { return { diff --git a/src/pages/KyberDAO/StakeKNC/StakeKNCComponent.tsx b/src/pages/KyberDAO/StakeKNC/StakeKNCComponent.tsx index bcbab7fdc0..da369e03a5 100644 --- a/src/pages/KyberDAO/StakeKNC/StakeKNCComponent.tsx +++ b/src/pages/KyberDAO/StakeKNC/StakeKNCComponent.tsx @@ -205,6 +205,7 @@ export default function StakeKNCComponent() { const { account, chainId } = useActiveWeb3React() const kyberDAOInfo = useKyberDAOInfo() const { stakedBalance, KNCBalance, delegatedAddress } = useStakingInfo() + console.log('🚀 ~ file: StakeKNCComponent.tsx:208 ~ StakeKNCComponent ~ KNCBalance:', KNCBalance) const { calculateVotingPower } = useVotingInfo() const isDelegated = !!delegatedAddress && delegatedAddress !== account const { stake, unstake, delegate, undelegate } = useKyberDaoStakeActions() @@ -236,8 +237,8 @@ export default function StakeKNCComponent() { if (!inputValue || isNaN(parseFloat(inputValue)) || parseFloat(inputValue) <= 0) { setErrorMessage(t`Invalid amount`) } else if ( - (parseFloat(inputValue) > parseFloat(formatUnits(KNCBalance)) && activeTab === STAKE_TAB.Stake) || - (parseFloat(inputValue) > parseFloat(formatUnits(stakedBalance)) && activeTab === STAKE_TAB.Unstake) + (parseUnits(inputValue, 18).gt(KNCBalance) && activeTab === STAKE_TAB.Stake) || + (parseUnits(inputValue, 18).gt(stakedBalance) && activeTab === STAKE_TAB.Unstake) ) { setErrorMessage(t`Insufficient amount`) } else if (activeTab === STAKE_TAB.Delegate && !isAddress(chainId, delegateAddress)) {