"type": "event"
.name
, inputs
, and indexed
fields.event
object or the whole ABI into an LLM and ask it to convert it into a correct Solidity declaration (more below with prompts).
Example input:
Supply
) and expand the event:
Name
of the event (e.g. Supply (index_topic_1 address reserve, address user, index_topic_2 address onBehalfOf, uint256 amount, index_topic_3 uint16 referralCode)
)Supply(address,address,address,uint256,uint16)
)indexed
indexed
markerstopic0
— a keccak256 hash of the event’s signature (name and argument types). If you want to index, decode, or filter on these logs, you need to provide the exact event signature.
In The Neighborhood, transformation code uses helper functions like utils.evmDecodeLogWithMetadata()
to decode logs. These functions rely on an array of event signatures written in their original Solidity declaration format — no shortened types, renamed parameters, or reordered arguments.
Why this matters:
event Borrow(address indexed reserve, address user, uint256 amount)
≠ event Borrow(address reserve, address user, uint256 amount)
— indexed
is part of the signature!uint256
≠ uint8
, and address[]
≠ address
— exact types must match the deployed contract.evmDecodeLog()
to decode logs into raw data.evmDecodeLogWithMetadata()
if you also want the matching event name returned.evmMethodSignatureToHex()
to convert a signature string to its topic0
hash for filtering or debugging.indexed
utils.evmMethodSignatureToHex()
to get topic0
and verify it matches the log’s first topic