ERC721Burnable.sol 615 B

1234567891011121314151617181920
  1. pragma solidity ^0.6.0;
  2. import "../../GSN/Context.sol";
  3. import "./ERC721.sol";
  4. /**
  5. * @title ERC721 Burnable Token
  6. * @dev ERC721 Token that can be irreversibly burned (destroyed).
  7. */
  8. abstract contract ERC721Burnable is Context, ERC721 {
  9. /**
  10. * @dev Burns a specific ERC721 token.
  11. * @param tokenId uint256 id of the ERC721 token to be burned.
  12. */
  13. function burn(uint256 tokenId) public virtual {
  14. //solhint-disable-next-line max-line-length
  15. require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved");
  16. _burn(tokenId);
  17. }
  18. }