Skip to content

Commit

Permalink
revert changes to preserve bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Dec 20, 2024
1 parent 16088d8 commit 82babdc
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions contracts/interchain-token/ERC20Permit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ abstract contract ERC20Permit is IERC20, IERC20Permit, ERC20 {
*/
bytes32 public nameHash;

// Prefix for the EIP712 structured data.
string private constant EIP191_PREFIX_FOR_EIP712_STRUCTURED_DATA = '\x19\x01';

// keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)')
Expand Down Expand Up @@ -72,15 +71,6 @@ abstract contract ERC20Permit is IERC20, IERC20Permit, ERC20 {
function permit(address issuer, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external {
if (block.timestamp > deadline) revert PermitExpired();

// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) revert InvalidS();

if (v != 27 && v != 28) revert InvalidV();
Expand Down

0 comments on commit 82babdc

Please sign in to comment.