Skip to content

Commit

Permalink
fix: remove redundant check on the v value
Browse files Browse the repository at this point in the history
  • Loading branch information
ahramy committed Sep 20, 2024
1 parent be24c94 commit 3177c93
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions contracts/interchain-token/ERC20Permit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { ERC20 } from './ERC20.sol';
abstract contract ERC20Permit is IERC20, IERC20Permit, ERC20 {
error PermitExpired();
error InvalidS();
error InvalidV();
error InvalidSignature();

/**
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions test/ERC20Permit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3177c93

Please sign in to comment.