ERC721Royalty.sol 1.2 KB

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