From 1349df896c7cd935d711028083b26ef4a6edfc38 Mon Sep 17 00:00:00 2001 From: t11s Date: Sat, 5 Feb 2022 15:35:10 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20PERMIT=5FTYPEHASH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tokens/ERC20.sol | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/tokens/ERC20.sol b/src/tokens/ERC20.sol index d7d26c95..63e86d28 100644 --- a/src/tokens/ERC20.sol +++ b/src/tokens/ERC20.sol @@ -38,9 +38,6 @@ abstract contract ERC20 { EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ - bytes32 internal constant PERMIT_TYPEHASH = - keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); - uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; @@ -134,7 +131,18 @@ abstract contract ERC20 { abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), - keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) + keccak256( + abi.encode( + keccak256( + "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" + ), + owner, + spender, + value, + nonces[owner]++, + deadline + ) + ) ) );