From 8b1f1ab67b7cdbd131c5ba7bce3da39f79241cb3 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 23 Nov 2016 17:37:44 -0800 Subject: [PATCH] Remove redundant checks in StandardToken --- contracts/token/StandardToken.sol | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/contracts/token/StandardToken.sol b/contracts/token/StandardToken.sol index f2a2138bd..2f3e301d6 100644 --- a/contracts/token/StandardToken.sol +++ b/contracts/token/StandardToken.sol @@ -16,9 +16,6 @@ contract StandardToken is ERC20, SafeMath { mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { - if (balances[msg.sender] < _value) { - throw; - } balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); Transfer(msg.sender, _to, _value); @@ -27,11 +24,7 @@ contract StandardToken is ERC20, SafeMath { function transferFrom(address _from, address _to, uint _value) returns (bool success) { var _allowance = allowed[_from][msg.sender]; - if (balances[_from] < _value || - _allowance < _value) { - throw; - } - + balances[_to] = safeAdd(balances[_to], _value); balances[_from] = safeSub(balances[_from], _value); allowed[_from][msg.sender] = safeSub(_allowance, _value);