From 3177c93edfcdf44a83f29cad75fae74b9f72a930 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 19 Sep 2024 23:10:18 -0700 Subject: [PATCH] fix: remove redundant check on the v value --- contracts/interchain-token/ERC20Permit.sol | 3 --- test/ERC20Permit.js | 7 ------- 2 files changed, 10 deletions(-) diff --git a/contracts/interchain-token/ERC20Permit.sol b/contracts/interchain-token/ERC20Permit.sol index b692d723..6ac21c21 100644 --- a/contracts/interchain-token/ERC20Permit.sol +++ b/contracts/interchain-token/ERC20Permit.sol @@ -15,7 +15,6 @@ import { ERC20 } from './ERC20.sol'; abstract contract ERC20Permit is IERC20, IERC20Permit, ERC20 { error PermitExpired(); error InvalidS(); - error InvalidV(); error InvalidSignature(); /** @@ -73,8 +72,6 @@ abstract contract ERC20Permit is IERC20, IERC20Permit, ERC20 { if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) revert InvalidS(); - if (v != 27 && v != 28) revert InvalidV(); - bytes32 digest = keccak256( abi.encodePacked( EIP191_PREFIX_FOR_EIP712_STRUCTURED_DATA, diff --git a/test/ERC20Permit.js b/test/ERC20Permit.js index b8438224..08482968 100644 --- a/test/ERC20Permit.js +++ b/test/ERC20Permit.js @@ -170,13 +170,6 @@ describe('ERC20 Permit', () => { 'InvalidS', ); - await expectRevert( - (gasOptions) => - token.connect(owner).permit(user.address, owner.address, allowance, deadline, 0, signature.r, signature.s, gasOptions), - token, - 'InvalidV', - ); - await expectRevert( (gasOptions) => token