ERC20Burnable.sol 681 B

123456789101112131415161718192021222324252627
  1. pragma solidity ^0.5.0;
  2. import "../../GSN/Context.sol";
  3. import "./ERC20.sol";
  4. /**
  5. * @dev Extension of {ERC20} that allows token holders to destroy both their own
  6. * tokens and those that they have an allowance for, in a way that can be
  7. * recognized off-chain (via event analysis).
  8. */
  9. contract ERC20Burnable is Context, ERC20 {
  10. /**
  11. * @dev Destroys `amount` tokens from the caller.
  12. *
  13. * See {ERC20-_burn}.
  14. */
  15. function burn(uint256 amount) public {
  16. _burn(_msgSender(), amount);
  17. }
  18. /**
  19. * @dev See {ERC20-_burnFrom}.
  20. */
  21. function burnFrom(address account, uint256 amount) public {
  22. _burnFrom(account, amount);
  23. }
  24. }