From d74be215c2285239eb8d0974733adb0d9f6c97b4 Mon Sep 17 00:00:00 2001 From: Philippe Schommers Date: Mon, 2 Oct 2023 20:19:18 +0200 Subject: [PATCH] chore: negative bigint error --- src/components/Form/Form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Form/Form.tsx b/src/components/Form/Form.tsx index 564c1eb..7cf6fe7 100644 --- a/src/components/Form/Form.tsx +++ b/src/components/Form/Form.tsx @@ -122,7 +122,7 @@ const Form: React.FC = () => { abi: VaultAdapter, functionName: "depositXDAI", args: [receiver], - value: bigIntMin(amount, (tokenInput?.max ?? 0n) - GAS_PRICE_OFFSET), + value: bigIntMin(amount, tokenInput?.max ? tokenInput?.max - GAS_PRICE_OFFSET : 0n), enabled: action.action === Actions.DepositXDAI, }).config, );