Преглед на файлове

Merge pull request #151 from AragonOne/clarity

Add clarifying comment to standard token transfer from function
Manuel Aráoz преди 8 години
родител
ревизия
5e50090da0
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      contracts/token/StandardToken.sol

+ 4 - 1
contracts/token/StandardToken.sol

@@ -26,7 +26,10 @@ contract StandardToken is ERC20, SafeMath {
 
   function transferFrom(address _from, address _to, uint _value) returns (bool success) {
     var _allowance = allowed[_from][msg.sender];
-    
+
+    // Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met
+    // if (_value > _allowance) throw;
+
     balances[_to] = safeAdd(balances[_to], _value);
     balances[_from] = safeSub(balances[_from], _value);
     allowed[_from][msg.sender] = safeSub(_allowance, _value);