In this track: Read logs and failures
advanced · 4 MIN READ

Indexed versus non-indexed arguments

The declaration decides which values become topics.

LET’S PICTURE IT

A record can put searchable labels on its cover and other information inside.

SEE IT FOR YOURSELF
From an emitted Transfer event to a receipt logStep 1 / 4
From an emitted Transfer event to a receipt logToken executionApply coded rulesUpdate relevant balancesEmit Transferfrom · to · valueA structured logA reverted execution portion does not keep its emitted logsTransfer(address,address,uint256)Topic 0: 0xddf252ad…b3efFull digest · 32 bytesEvent topic zero and a function selector use different lengthsTopic 1from addressIndexedTopic 2to addressIndexedDataraw valueNot indexedThis diagram is specifically the common ERC-20 Transfer layoutReceipt logTopics + dataBlock contextApplication viewDecoded fieldsImplementation still mattersThe local event tool does not query or authenticate a deployed token

A token implementation may update balances and emit its standard Transfer event. State and the emitted record are related but distinct.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Read indexed in the declaration

An indexed parameter is assigned a topic under event encoding rules. For a non-anonymous event, the signature already occupies topic zero, leaving at most three indexed fields.

Encode ordinary values appropriately

An indexed address fits in one topic and is left-padded to thirty-two bytes. Complex and dynamic indexed values use hashing rules instead of an ordinary recoverable topic value.

Decode the data tuple

Non-indexed fields are encoded together in the log data region. Their ABI offsets, when needed, use that data tuple as the base, without an event signature prefix.

Do not infer indexing from names

Two declarations can share a canonical event signature while indexing fields differently. Names like from and value do not replace the full declaration.

Inspect the example

event Transfer(address indexed from, address indexed to, uint256 value)

topic 0: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
topic 1: 0x0000000000000000000000000000000000000000000000000000000000000001
topic 2: 0x0000000000000000000000000000000000000000000000000000000000000002
data: 0x0000000000000000000000000000000000000000000000000000000000000064

Toy emitter; from address 1; to address 2; raw amount 100.
No token decimals or verified token identity are implied.

This declaration indexes from and to, while value remains in data.

TURN UNDERSTANDING INTO PRACTICEOpen the Event decoder →
QUICK CHECK · NO PRESSURE

Where does a non-indexed uint256 value appear?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.