ERC721Burnable.sol 880 B

1234567891011121314151617181920212223242526
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Burnable.sol)
  3. pragma solidity ^0.8.20;
  4. import {ERC721} from "../ERC721.sol";
  5. import {Context} from "../../../utils/Context.sol";
  6. /**
  7. * @title ERC-721 Burnable Token
  8. * @dev ERC-721 Token that can be burned (destroyed).
  9. */
  10. abstract contract ERC721Burnable is Context, ERC721 {
  11. /**
  12. * @dev Burns `tokenId`. See {ERC721-_burn}.
  13. *
  14. * Requirements:
  15. *
  16. * - The caller must own `tokenId` or be an approved operator.
  17. */
  18. function burn(uint256 tokenId) public virtual {
  19. // Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
  20. // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
  21. _update(address(0), tokenId, _msgSender());
  22. }
  23. }