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

Event ordering in nested calls

Nested execution can interleave logs from different emitters.

LET’S PICTURE IT

A conversation can contain a reply before the original speaker finishes.

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.

Follow execution order

Suppose A emits a start log, calls B, and emits a finish log after B returns. If B emits during its call, that log occurs between A’s two records.

Retain emitter identity

The middle record belongs to B under a normal call. With delegatecall, execution context differs, so the storage and logging address require separate analysis.

Do not sort by event name

Alphabetical or contract-grouped display can obscure the actual sequence. Keep the original log ordering available when reconstructing an interaction.

Apply rollback before interpreting

A reverted nested scope removes its logs from the surviving sequence. Build the final narrative from retained records and use traces when the discarded attempts matter.

Inspect the example

A: emit Start
A → B: external call
B: emit Middle; return
A: emit Finish

Order: Start, Middle, Finish

Logs alone do not provide the entire call tree.

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

What is the surviving order when all three emissions succeed?

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.