Explorar o código

Merge pull request #416 from frangio/add-comment-basictoken-throw

Add comment making explicit that transfer throws without enough balance
Francisco Giordano %!s(int64=8) %!d(string=hai) anos
pai
achega
f073352632
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      contracts/token/BasicToken.sol

+ 1 - 0
contracts/token/BasicToken.sol

@@ -22,6 +22,7 @@ contract BasicToken is ERC20Basic {
   function transfer(address _to, uint256 _value) returns (bool) {
     require(_to != address(0));
 
+    // SafeMath.sub will throw if there is not enough balance.
     balances[msg.sender] = balances[msg.sender].sub(_value);
     balances[_to] = balances[_to].add(_value);
     Transfer(msg.sender, _to, _value);