diff --git a/.gas-report b/.gas-report index 937db0f..3c1571a 100644 --- a/.gas-report +++ b/.gas-report @@ -1,12 +1,12 @@ | contracts/MiniMeToken.sol:MiniMeToken contract | | | | | | |------------------------------------------------|-----------------|-------|--------|-------|---------| | Deployment Cost | Deployment Size | | | | | -| 2142502 | 12126 | | | | | +| 2131887 | 12073 | | | | | | Function Name | min | avg | median | max | # calls | | DOMAIN_SEPARATOR | 387 | 387 | 387 | 387 | 10 | | allowance | 0 | 190 | 0 | 763 | 16 | | approve | 0 | 15064 | 14767 | 31771 | 10 | -| approveAndCall | 0 | 30979 | 0 | 92937 | 3 | +| approveAndCall | 0 | 30975 | 0 | 92925 | 3 | | balanceOf | 0 | 622 | 0 | 2753 | 67 | | balanceOfAt | 0 | 830 | 0 | 3766 | 78 | | changeController | 0 | 596 | 0 | 3580 | 6 | diff --git a/.gas-snapshot b/.gas-snapshot index 1b1c68c..49f1b93 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,7 +1,7 @@ AllowanceTest:testAllowance() (gas: 42775) AllowanceTest:testAllowanceAlreadySet() (gas: 36905) AllowanceTest:testAllowanceReset() (gas: 46071) -AllowanceTest:testApproveAndCall() (gas: 97856) +AllowanceTest:testApproveAndCall() (gas: 97844) AllowanceTest:testApproveTransferDisabled() (gas: 7994) AllowanceTest:testDeployment() (gas: 26711) AllowanceTest:testNoAllowance() (gas: 9462) @@ -11,7 +11,7 @@ ClaimTokensTest:testClaimETH() (gas: 13659) ClaimTokensTest:testClaimSelf() (gas: 60361) ClaimTokensTest:testDeployment() (gas: 26595) CreateCloneTokenTest:testCloneFutureSnapshot() (gas: 101004) -CreateCloneTokenTest:testCreateCloneToken() (gas: 2181617) +CreateCloneTokenTest:testCreateCloneToken() (gas: 2170994) CreateCloneTokenTest:testDeployment() (gas: 26550) CreateCloneTokenTest:testGenerateTokens() (gas: 101358) DestroyTokensTest:testDeployment() (gas: 26595) diff --git a/contracts/MiniMeBase.sol b/contracts/MiniMeBase.sol index e729140..6852949 100644 --- a/contracts/MiniMeBase.sol +++ b/contracts/MiniMeBase.sol @@ -10,7 +10,6 @@ error InvalidDestination(); error ControllerRejected(); error Overflow(); error AllowanceAlreadySet(); -error OperationFailed(); error ControllerNotSet(); error ERC2612ExpiredSignature(uint256 deadline); error ERC2612InvalidSigner(address signer, address owner); @@ -282,7 +281,7 @@ abstract contract MiniMeBase is Controlled, IERC20, IERC20Permit, EIP712, Nonces /// @param _amount The amount of tokens to be approved for transfer /// @return success True if the function call was successful function approveAndCall(address _spender, uint256 _amount, bytes memory _extraData) public returns (bool success) { - if (!approve(_spender, _amount)) revert OperationFailed(); + approve(_spender, _amount); ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _amount, address(this), _extraData);