Skip to main content

InterfaceId

Type Alias InterfaceId 

Source
pub type InterfaceId = [u8; 8];
Expand description

The identity of a contract interface at a major version.

#[contract] on a trait derives it from the interface’s effective name and major version — the same pair that namespaces the interface’s entrypoint IDs — and exposes it as Trait::INTERFACE_ID and <Iface>Entrypoints::INTERFACE_ID. Two contracts implementing the same interface crate therefore agree on the ID, and a major-version bump changes it. The leading eight bytes of the hash, kept as bytes: an interface ID is a name anyone may declare, so its width only keeps honestly distinct interfaces apart (as with ContractEntrypointID), and bytes cross the wire and the interface table with no decoding. This is Thruput’s analogue of an ERC-165 interface ID; thruput-erc165-if is the query surface for it.