ERC721Burnable.sol 648 B

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