Skip to main content

encode_event_topic

Function encode_event_topic 

Source
pub(crate) fn encode_event_topic(value: &DynSolValue) -> B256
Expand description

Encodes the topic of an indexed event parameter.

Value types are encoded as their 32-byte word. Reference types are hashed over the special in-place encoding defined for indexed event parameters, which differs from regular ABI encoding: string and bytes contribute their raw contents, and array or struct members are concatenated recursively without any offsets or length prefixes.

See https://docs.soliditylang.org/en/latest/abi-spec.html#encoding-of-indexed-event-parameters