My contract needs to check whether an external contract supports a standard interface, I want the function to be as cheap as possible, therefore my question is; does the checking contract need to detect support for ERC-165 AND the other given interface, or just the latter?
I mean, technically it is possible to implement a supportsInterface
function that only returns true for the given interface and not for ERC-165, which would make it non compliant to the standard, but do I really need to check for both?
My contract is an NFT marketplace, therefore NFTs should support eip165 by default; would it be unwise to check directly for support of the particular interface I am interested in? The NatSpec comments above the private _supportsERC165Interface
function read:
@dev Assumes that account contains a contract that supports ERC165, otherwise the behavior of this method is undefined.
What's the worse that could happen?
Thank you in advance. Kind regards.