Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove redundant check on the v value #279

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
ahramy marked this conversation as resolved.
Show resolved Hide resolved

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
2 changes: 1 addition & 1 deletion test/InterchainToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('InterchainToken', () => {
const contractBytecodeHash = keccak256(contractBytecode);

const expected = {
london: '0xa01cf28b0b6ce6dc3b466e995585d69486400d671fce0ea8d06beba583e6f3bb',
london: '0xb13b7218e227186d16ed3cac7cdcbd379dc9afd2061435f1b3f78a2c851a86a2',
}[getEVMVersion()];

expect(contractBytecodeHash).to.be.equal(expected);
Expand Down
Loading