diff --git a/contracts/eip20/EIP20.sol b/contracts/eip20/EIP20.sol index d5e510e6..ccc09ec1 100644 --- a/contracts/eip20/EIP20.sol +++ b/contracts/eip20/EIP20.sol @@ -45,15 +45,13 @@ contract EIP20 is EIP20Interface { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { - uint256 allowance = allowed[_from][msg.sender]; - require(balances[_from] >= _value && allowance >= _value); - balances[_to] += _value; - balances[_from] -= _value; - if (allowance < MAX_UINT256) { - allowed[_from][msg.sender] -= _value; - } - emit Transfer(_from, _to, _value); //solhint-disable-line indent, no-unused-vars - return true; + uint256 allowance = allowed[_from][msg.sender]; + require(balances[_from] >= _value && allowance >= _value && allowance < MAX_UINT256); + allowed[_from][msg.sender] -= _value; + balances[_from] -= _value; + balances[_to] += _value; + emit Transfer(_from, _to, _value); //solhint-disable-line indent, no-unused-vars + return true; } function balanceOf(address _owner) public view returns (uint256 balance) {