StandardBurnableToken.sol 862 B

123456789101112131415161718192021222324
  1. pragma solidity ^0.4.18;
  2. import "./BurnableToken.sol";
  3. import "./StandardToken.sol";
  4. /**
  5. * @title Standard Burnable Token
  6. * @dev Adds burnFrom method to ERC20 implementations
  7. */
  8. contract StandardBurnableToken is BurnableToken, StandardToken {
  9. /**
  10. * @dev Burns a specific amount of tokens from the target address and decrements allowance
  11. * @param _from address The address which you want to send tokens from
  12. * @param _value uint256 The amount of token to be burned
  13. */
  14. function burnFrom(address _from, uint256 _value) public {
  15. require(_value <= allowed[_from][msg.sender]);
  16. // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
  17. // this function needs to emit an event with the updated approval.
  18. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
  19. _burn(_from, _value);
  20. }
  21. }