diff --git a/README.md b/README.md index 0661fa6..155c474 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ yarn test | Contract | Gas Cost | | ---------------- | --------- | | SolmateERC20 | 74172 | -| YulERC20 | 73782 | -| YulERC20External | **73770** | +| YulERC20 | 73774 | +| YulERC20External | **73762** | ### transfer diff --git a/contracts/ERC20.sol b/contracts/ERC20.sol index 14e0498..17dfdd1 100644 --- a/contracts/ERC20.sol +++ b/contracts/ERC20.sol @@ -305,12 +305,11 @@ abstract contract ERC20 { mstore(add(memptr, 0x40), r) mstore(add(memptr, 0x60), s) - if iszero(staticcall(not(0x00), 0x01, memptr, 0x80, memptr, 0x20)) { + if iszero(staticcall(_MAX, 0x01, memptr, 0x80, memptr, 0x20)) { revert(0x00, 0x00) } - let size := returndatasize() - returndatacopy(memptr, 0, size) + returndatacopy(memptr, 0x00, returndatasize()) let recovered := mload(memptr) // require(recovered != address(0) && recovered == owner, "Invalid Signature"); diff --git a/contracts/ERC20External.sol b/contracts/ERC20External.sol index 69cd202..289fd28 100644 --- a/contracts/ERC20External.sol +++ b/contracts/ERC20External.sol @@ -390,12 +390,11 @@ abstract contract ERC20External { mstore(add(memptr, 0x40), r) mstore(add(memptr, 0x60), s) - if iszero(staticcall(not(0x00), 0x01, memptr, 0x80, memptr, 0x20)) { + if iszero(staticcall(_MAX, 0x01, memptr, 0x80, memptr, 0x20)) { revert(0x00, 0x00) } - let size := returndatasize() - returndatacopy(memptr, 0, size) + returndatacopy(memptr, 0x00, returndatasize()) let recovered := mload(memptr) // require(recovered != address(0) && recovered == owner, "Invalid Signature"); diff --git a/package.json b/package.json index 5bc581c..4ececa6 100644 --- a/package.json +++ b/package.json @@ -74,5 +74,5 @@ "homepage": "https://github.com/kassandraoftroy/yulerc20", "description": "Yul ERC20", "license": "MIT", - "version": "0.5.1" + "version": "0.5.2" }