Overview
ERC-165 enables contracts to declare which interfaces they support. Interface IDs are computed by XORing function selectors, creating a unique 4-byte identifier for each interface.getInterfaceId
getInterfaceId(selectors: SelectorLike[]): InterfaceIdType
Calculates ERC-165 interface ID by XORing function selectors.
Parameters:
selectors: SelectorLike[]- Array of function selectors (4 bytes each)
InterfaceIdType - 4-byte interface ID
Example:
Standard Interface IDs
ERC165_INTERFACE_ID
supportsInterface(bytes4) function itself.
ERC20_INTERFACE_ID
balanceOf(address)transfer(address,uint256)approve(address,uint256)transferFrom(address,address,uint256)allowance(address,address)totalSupply()
ERC721_INTERFACE_ID
ERC1155_INTERFACE_ID
Usage Patterns
Check Interface Support
Custom Interface
Specification
Defined in: src/primitives/Abi/interface/ See also:- ERC-165 Specification
- Selector - Function selector utilities

