From f1bcee3c089bdcf77f500b5f628af8caf8536c54 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Wed, 23 Mar 2022 09:56:07 -0400 Subject: [PATCH] fix: retain permit validity for lesser amounts (#3580) --- src/hooks/useERC20Permit.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useERC20Permit.ts b/src/hooks/useERC20Permit.ts index 71c0c750aa..0a4224d158 100644 --- a/src/hooks/useERC20Permit.ts +++ b/src/hooks/useERC20Permit.ts @@ -174,7 +174,8 @@ export function useERC20Permit( signatureData.tokenAddress === tokenAddress && signatureData.nonce === nonceNumber && signatureData.spender === spender && - ('allowed' in signatureData || JSBI.equal(JSBI.BigInt(signatureData.amount), currencyAmount.quotient)) + ('allowed' in signatureData || + JSBI.greaterThanOrEqual(JSBI.BigInt(signatureData.amount), currencyAmount.quotient)) return { state: isSignatureDataValid ? UseERC20PermitState.SIGNED : UseERC20PermitState.NOT_SIGNED,