Skip to content

Commit

Permalink
fix: Update PERMIT_TYPEHASH to be in accordance with ERC-2612 (SC-5…
Browse files Browse the repository at this point in the history
…345) (#37)

* fix: update typehash to be in accordance with erc-2612

* chore: update submodules
  • Loading branch information
vbidin authored Mar 23, 2022
1 parent 082ff0f commit d6256a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions contracts/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ contract ERC20 is IERC20 {
/*** ERC-2612 ***/
/****************/

// PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 amount,uint256 nonce,uint256 deadline)");
bytes32 public constant override PERMIT_TYPEHASH = bytes32(0xfc77c2b9d30fe91687fd39abb7d16fcdfe1472d065740051ab8b13e4bf4a617f);
// PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;

mapping(address => uint256) public override nonces;

Expand Down
4 changes: 2 additions & 2 deletions contracts/test/ERC20.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ contract ERC20PermitTest is TestUtils {
_user = new ERC20User();
}

function test_typehash() public {
assertEq(_token.PERMIT_TYPEHASH(), keccak256("Permit(address owner,address spender,uint256 amount,uint256 nonce,uint256 deadline)"));
function test_typehash() external {
assertEq(_token.PERMIT_TYPEHASH(), keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"));
}

// NOTE: Virtual so inheriting tests can override with different DOMAIN_SEPARATORs because of different addresses
Expand Down

0 comments on commit d6256a6

Please sign in to comment.