fix: retain permit validity for lesser amounts (#3580)

This commit is contained in:
Zach Pomerantz 2022-03-23 09:56:07 -04:00 committed by GitHub
parent 7a215ccdb4
commit f1bcee3c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -174,7 +174,8 @@ export function useERC20Permit(
signatureData.tokenAddress === tokenAddress && signatureData.tokenAddress === tokenAddress &&
signatureData.nonce === nonceNumber && signatureData.nonce === nonceNumber &&
signatureData.spender === spender && 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 { return {
state: isSignatureDataValid ? UseERC20PermitState.SIGNED : UseERC20PermitState.NOT_SIGNED, state: isSignatureDataValid ? UseERC20PermitState.SIGNED : UseERC20PermitState.NOT_SIGNED,