Probe an Ethereum contract for ERC-165 interface support
An interface probe helps an integration choose the correct contract calls. A contract that answers true to every probe can otherwise fool a naïve detector.
Run the negative control
Using a read-only supportsInterface(bytes4) call with the ERC-165 gas budget of 30,000 for the probe, check the interface IDs below in order. The last ID describes the ERC-721 core interface.
0x01ffc9a7 → true
0xffffffff → false
0x80ac58cd → true or false
A revert, malformed return value or failed negative control means the detector cannot rely on ERC-165 here. If the controls pass, use the third answer to decide whether to try ERC-721 reads.
Verify the operation you need
A positive answer is a declaration by the contract. It does not establish ownership of any token, correctness of the implementation or support for optional metadata. Probe the metadata extension separately before relying on tokenURI. eips.ethereum.org ERC-165