From aad25205cdc54243ccfe82a1bd35c08904d2a152 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Tue, 29 Aug 2017 11:50:02 -0300 Subject: [PATCH] add comment making explicit that SafeMath.sub can throw --- contracts/token/BasicToken.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/token/BasicToken.sol b/contracts/token/BasicToken.sol index e584df274..d13156477 100644 --- a/contracts/token/BasicToken.sol +++ b/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);