From 3177c93edfcdf44a83f29cad75fae74b9f72a930 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 19 Sep 2024 23:10:18 -0700 Subject: [PATCH 1/2] 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 From 130fcd04867afe0a56d0ce18a0ab14cb9d4f9231 Mon Sep 17 00:00:00 2001 From: ahramy Date: Thu, 19 Sep 2024 23:27:47 -0700 Subject: [PATCH 2/2] updated test --- test/InterchainToken.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/InterchainToken.js b/test/InterchainToken.js index a7ff687a..8eca01cc 100644 --- a/test/InterchainToken.js +++ b/test/InterchainToken.js @@ -147,7 +147,7 @@ describe('InterchainToken', () => { const contractBytecodeHash = keccak256(contractBytecode); const expected = { - london: '0xa01cf28b0b6ce6dc3b466e995585d69486400d671fce0ea8d06beba583e6f3bb', + london: '0xb13b7218e227186d16ed3cac7cdcbd379dc9afd2061435f1b3f78a2c851a86a2', }[getEVMVersion()]; expect(contractBytecodeHash).to.be.equal(expected);