Moving business logic preconditions to the beginning of the function.
This commit is contained in:
@ -21,6 +21,7 @@ contract BasicToken is ERC20Basic {
|
||||
*/
|
||||
function transfer(address _to, uint256 _value) public returns (bool) {
|
||||
require(_to != address(0));
|
||||
require(_value <= balances[msg.sender]);
|
||||
|
||||
// SafeMath.sub will throw if there is not enough balance.
|
||||
balances[msg.sender] = balances[msg.sender].sub(_value);
|
||||
|
||||
Reference in New Issue
Block a user