Commit 1d162e95 by Francisco Giordano Committed by GitHub

Merge pull request #377 from yaronvel/master

fix for issue 375: transferFrom allows sending to self more than self balance
parents 060843d9 9333fec5
...@@ -29,8 +29,8 @@ contract StandardToken is ERC20, BasicToken { ...@@ -29,8 +29,8 @@ contract StandardToken is ERC20, BasicToken {
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance); // require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value); balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value); Transfer(_from, _to, _value);
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment