parse_abi_event

Returns a JSON ABI event fragment parsed from Solidity event syntax; use it with log filters and decoders.

Example

Local

1
SELECT parse_abi_event('Transfer(address indexed from, address indexed to, uint256 value)') AS event_abi;
2
-- event_abi.name = Transfer
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

parse_abi_event(VARCHAR) #

Accepts Solidity-style event syntax, including indexed parameters and the optional anonymous marker.

Inputs

Name Type Use
src VARCHAR

Solidity-style event declaration or JSON event ABI object.

required positional

Returns

Name Type
event JSON

JSON ABI event fragment. Returns event name, anonymous marker, parameter names, canonical types, and indexed flags. Anonymous event topics omit topic0.

Guidance

Event topic layout

Non-anonymous logs store the event signature hash in topic0.

Their indexed parameters begin at topic1. Anonymous events omit the signature hash, so their first indexed parameter begins at the first topic.

Non-indexed parameters are ABI-encoded in the data field. Indexed string, bytes, array, and tuple values are represented by their BYTES32 topic hash and cannot be recovered from the log alone.

  • Use this helper when a function expects event_abi JSON but you prefer Solidity event syntax.
  • The Transfer example follows the captured USDC log at Ethereum block 20,000,000, transaction 0x5cbf...3dde, log index 97.
  • Parameter names are preserved when present. Downstream decoders assign documented fallback names to unnamed parameters.

Related functions

Category and tags

Tag
ABI