ERC721Royalty.sol 1.2 KB

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: MIT
  2. // OpenZeppelin Contracts (last updated v5.1.0-rc.1) (token/ERC721/extensions/ERC721Royalty.sol)
  3. pragma solidity ^0.8.20;
  4. import {ERC721} from "../ERC721.sol";
  5. import {ERC2981} from "../../common/ERC2981.sol";
  6. /**
  7. * @dev Extension of ERC-721 with the ERC-2981 NFT Royalty Standard, a standardized way to retrieve royalty payment
  8. * information.
  9. *
  10. * Royalty information can be specified globally for all token ids via {ERC2981-_setDefaultRoyalty}, and/or individually
  11. * for specific token ids via {ERC2981-_setTokenRoyalty}. The latter takes precedence over the first.
  12. *
  13. * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
  14. * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the ERC. Marketplaces are expected to
  15. * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
  16. */
  17. abstract contract ERC721Royalty is ERC2981, ERC721 {
  18. /**
  19. * @dev See {IERC165-supportsInterface}.
  20. */
  21. function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) {
  22. return super.supportsInterface(interfaceId);
  23. }
  24. }