eth_log_decode
Turn a receipt log's topics and data into named event arguments.
Instructions
Turn a receipt log's topics and data into named event arguments.
signature is human-readable, e.g. "Transfer(address indexed from, address
indexed to, uint256 value)"; indexed is what splits the arguments between
topics and data. Returns {signature (canonical), anonymous, topic0,
topic0_matches, args}; topic0 and topic0_matches are omitted for an
anonymous event, which carries no topic0 to check. args lists EVERY
argument in declaration order — indexed and not, interleaved — as
{name (null when undeclared), type, value, indexed}, plus components on
tuple args. Only a value type (uintN/intN/bool/address/bytesN) survives in a
topic: every array, every struct, and bytes/string are keccak-hashed into it,
so those come back with value null plus {hashed: true, hash} — enough to
match against keccak of a candidate, never the value itself. A topics[0] that
is not this signature's topic0 is soft (topic0_matches false, plus
log_topic0 and reason), but a topic COUNT that contradicts the signature
raises: ERC-20 and ERC-721 Transfer share a topic0 and differ only there.
Example: eth_log_decode("Transfer(address indexed from, address indexed to, uint256 value)", [topic0, from_word, to_word], "0x..0de0b6b3a7640000") -> args=[{name="from", ...}, {name="to", ...}, {name="value", ...}].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | 0x-prefixed log data: the standard ABI encoding of the NON-indexed arguments. Omit (or pass '0x') when every argument is indexed. | |
| topics | Yes | The log's topics as 32-byte hex words (0x prefix optional): topic0 (the event's keccak signature hash) first, then one word per indexed argument. An anonymous event has no topic0. A stringified JSON array is accepted. | |
| anonymous | No | True when the event is declared `anonymous` in Solidity — its log carries no topic0, so indexed arguments start at topics[0] and up to 4 are allowed. | |
| signature | Yes | A human-readable Solidity event signature, e.g. 'Transfer(address indexed from, address indexed to, uint256 value)'. The `indexed` modifier is what splits the arguments between `topics` and `data`; parameter names are optional and are reported back, and aliases (uint->uint256) are normalized away. |