Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/app/user/Stake/hooks/useAllowance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const useAllowance = (
})

const isAllowanceEnough = useMemo(
() => !!(allowanceBalance && allowanceBalance >= parseEther(amount)),
() => !!(allowanceBalance && allowanceBalance >= parseEther(amount || '0')),
[amount, allowanceBalance],
)

Expand All @@ -35,7 +35,7 @@ export const useAllowance = (
abi: RIFTokenAbi,
address: tokenToSendContract,
functionName: 'approve' as const,
args: [tokenToReceiveContract, parseEther(amount)] as const,
args: [tokenToReceiveContract, parseEther(amount || '0')] as const,
}),
[tokenToSendContract, tokenToReceiveContract, amount],
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/user/Stake/hooks/useStakeRIF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const useStakeRIF = (amount: string, tokenToReceiveContract: Address) =>
abi: StRIFTokenAbi,
address: tokenToReceiveContract,
functionName: 'depositAndDelegate' as const,
args: [address!, parseEther(amount)] as const,
args: [address!, parseEther(amount || '0')] as const,
}),
[tokenToReceiveContract, address, amount],
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/user/Stake/hooks/useUnstakeStRIF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const useUnstakeStRIF = (amount: string, tokenToSendContract: Address) =>
abi: StRIFTokenAbi,
address: tokenToSendContract,
functionName: 'withdrawTo' as const,
args: [address!, parseEther(amount)] as const,
args: [address!, parseEther(amount || '0')] as const,
})

return {
Expand Down
4 changes: 2 additions & 2 deletions src/app/vault/hooks/useVaultAllowance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const useVaultAllowance = (amount: string) => {
})

const isAllowanceEnough = useMemo(
() => !!(allowanceBalance && allowanceBalance >= parseEther(amount)),
() => !!(allowanceBalance && allowanceBalance >= parseEther(amount || '0')),
[amount, allowanceBalance],
)

Expand All @@ -35,7 +35,7 @@ export const useVaultAllowance = (amount: string) => {
abi: RIFTokenAbi,
address: tokenContracts.USDRIF,
functionName: 'approve' as const,
args: [vault.address, parseEther(amount)] as const,
args: [vault.address, parseEther(amount || '0')] as const,
}),
[amount],
)
Expand Down
Loading