Skip to main content

decode_event_params

Function decode_event_params 

Source
pub fn decode_event_params(log: &Log, event_abi: &str) -> Vec<DecodedParam>
Expand description

Decode event parameters from a log entry using its JSON ABI definition.

The ABI string is JSON like: {“name”:“Transfer”,“inputs”:[{“type”:“address”,“indexed”:true},{“type”:“uint256”,“indexed”:false}]}

Uses alloy’s EventExt::decode_log (same library as graph-node’s WASM runtime) to decode indexed params from topics and non-indexed params from data.

Supports anonymous events via "anonymous":true.

Returns params in declaration order.