1234567891011121314151617181920212223242526272829303132333435363738 |
- // SPDX-License-Identifier: MIT
- // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/ERC721Royalty.sol)
- pragma solidity ^0.8.0;
- import "../ERC721.sol";
- import "../../common/ERC2981.sol";
- import "../../../utils/introspection/ERC165.sol";
- /**
- * @dev Extension of ERC721 with the ERC2981 NFT Royalty Standard, a standardized way to retrieve royalty payment
- * information.
- *
- * Royalty information can be specified globally for all token ids via {ERC2981-_setDefaultRoyalty}, and/or individually for
- * specific token ids via {ERC2981-_setTokenRoyalty}. The latter takes precedence over the first.
- *
- * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
- * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
- * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
- *
- * _Available since v4.5._
- */
- abstract contract ERC721Royalty is ERC2981, ERC721 {
- /**
- * @dev See {IERC165-supportsInterface}.
- */
- function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC2981) returns (bool) {
- return super.supportsInterface(interfaceId);
- }
- /**
- * @dev See {ERC721-_burn}. This override additionally clears the royalty information for the token.
- */
- function _burn(uint256 tokenId) internal virtual override {
- super._burn(tokenId);
- _resetTokenRoyalty(tokenId);
- }
- }
|