mirror of openzeppelin-contracts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
pragma solidity ^0.4.13;
|
|
|
|
|
|
|
|
import './StandardToken.sol';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @title Burnable Token
|
|
|
|
* @dev Token that can be irreversibly burned (destroyed).
|
|
|
|
*/
|
|
|
|
contract BurnableToken is StandardToken {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Burns a specific amount of tokens.
|
|
|
|
* @param _value The amount of token to be burned.
|
|
|
|
*/
|
|
|
|
function burn(uint _value)
|
|
|
|
public
|
|
|
|
{
|
|
|
|
require(_value > 0);
|
|
|
|
|
|
|
|
address burner = msg.sender;
|
|
|
|
balances[burner] = balances[burner].sub(_value);
|
|
|
|
totalSupply = totalSupply.sub(_value);
|
|
|
|
Burn(burner, _value);
|
|
|
|
}
|
|
|
|
|
|
|
|
event Burn(address indexed burner, uint256 value);
|
|
|
|
}
|