contract ERC721WithRoyalties is
    ERC2981PerTokenRoyalties,
    IRaribleSecondarySales
{
    /*
     * bytes4(keccak256('getFeeBps(uint256)')) == 0x0ebd4c7f
     * bytes4(keccak256('getFeeRecipients(uint256)')) == 0xb9c4d9fb
     *
     * => 0x0ebd4c7f ^ 0xb9c4d9fb == 0xb7799584
     */
    bytes4 private constant _RARIBLE_FEES_ID = 0xb7799584;

    /// @inheritdoc	ERC165
    function supportsInterface(bytes4 interfaceId)
        public
        view
        virtual
        override
        returns (bool)
    {
        return
            ERC2981PerTokenRoyalties.supportsInterface(interfaceId) ||
            interfaceId == _RARIBLE_FEES_ID;
    }

    /// @inheritdoc	IRaribleSecondarySales
    function getFeeRecipients(uint256 tokenId)
        public
        view
        override
        returns (address payable[] memory recipients)
    {
        // using ERC2981 implementation to get the recipient & amount
        (address recipient, uint256 amount) = _getTokenRoyalty(tokenId);
        if (amount != 0) {
            recipients = new address payable[](1);
            recipients[0] = payable(recipient);
        }
    }

    /// @inheritdoc	IRaribleSecondarySales
    function getFeeBps(uint256 tokenId)
        public
        view
        override
        returns (uint256[] memory fees)
    {
        // using ERC2981 implementation to get the amount
        (, uint256 amount) = _getTokenRoyalty(tokenId);
        if (amount != 0) {
            fees = new uint256[](1);
            fees[0] = amount;
        }
    }
}
/// @dev This is a contract used for royalties on various platforms
/// @author Simon Fremaux (@dievardump)
function getFeeBps(uint256 tokenId)
    public
    view
    override
    returns (uint256[] memory fees)
{
    // using ERC2981 implementation to get the amount
    (, uint256 amount) = _getTokenRoyalty(tokenId);
    if (amount != 0) {
        fees = new uint256[](1);
        fees[0] = amount;
    }
}

/// @inheritdoc	IRaribleSecondarySales