Skip to content

Commit

Permalink
Merge pull request OpenZeppelin#341 from lsaether/master
Browse files Browse the repository at this point in the history
Added contracts/token/BurnableToken.sol
  • Loading branch information
frangio authored Aug 9, 2017
2 parents b938796 + 76fa433 commit 8cbe916
Show file tree
Hide file tree
Showing 4 changed files with 3,304 additions and 0 deletions.
27 changes: 27 additions & 0 deletions contracts/token/BurnableToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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, uint indexed value);
}
Loading

0 comments on commit 8cbe916

Please sign in to comment.