ERCs
ERC-165 — Standard Interface Detection
A contract declares which interfaces it supports via supportsInterface(bytes4) — returning true for interface IDs it implements. The interface ID is the XOR of the function selectors.
import { supports_interface } from "@ethernauta/erc/165";
const ok = await supports_interface({ interface_id: "0x80ac58cd" })(
contract({ chain_id: eip155_1.chain_id, contract: nft_address }),
);
// true → contract implements ERC-721 Surface
| Method | Shape | Purpose |
|---|---|---|
supports_interface({ interface_id }) | Callable<boolean> | Per-interface detection. |
Common interface IDs
| ID | Standard |
|---|---|
0x80ac58cd | ERC-721 |
0x5b5e139f | ERC-721 Metadata |
0x780e9d63 | ERC-721 Enumerable |
0xd9b67a26 | ERC-1155 |
0x0e89341c | ERC-1155 Metadata URI |
0x2a55205a | ERC-2981 (royalties) |
See also
- ERC-721, ERC-1155 — typical 165-aware contracts.
- @ethernauta/erc/registry — selector → method lookup.