// SPDX-License-Identifier: MIT // Klaytn Contract Library v1.0.0 (KIP/token/KIP17/extensions/KIP17Royalty.sol) // Based on OpenZeppelin Contracts v4.5.0 (token/ERC721/extensions/ERC721Royalty.sol) // https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.5.0 pragma solidity ^0.8.0; import "../KIP17.sol"; import "../../../../token/common/ERC2981.sol"; /** * @dev Extension of KIP17 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 {_setDefaultRoyalty}, and/or individually for * specific token ids via {_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. */ abstract contract KIP17Royalty is KIP17, ERC2981 { /** * @dev See {IKIP13-supportsInterface} and {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(KIP17, ERC2981) returns (bool) { return KIP17.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId); } /** * @dev See {KIP7-_burn}. This override additionally clears the royalty information for the token. */ function _burn(uint256 tokenId) internal virtual override { super._burn(tokenId); _resetTokenRoyalty(tokenId); } }