Unverified Commit aef0f63a by Jesse Busman Committed by GitHub

There's no need to throw when burning 0 tokens

Throwing when trying to burn 0 tokens is an unnecessary special case.
If another contract wants to burn() a variable amount, it should not be forced to deal with this special case of burning 0.
parent dd1fd000
...@@ -15,7 +15,6 @@ contract BurnableToken is StandardToken { ...@@ -15,7 +15,6 @@ contract BurnableToken is StandardToken {
* @param _value The amount of token to be burned. * @param _value The amount of token to be burned.
*/ */
function burn(uint256 _value) public { function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]); require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the // no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure // sender's balance is greater than the totalSupply, which *should* be an assertion failure
......
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