Logs are explicit EVM effects with memory data and up to four topics.
LET’S PICTURE IT
An instruction can append a labeled record containing selected workspace bytes.
SEE IT FOR YOURSELF
From an emitted Transfer event to a receipt logStep 1 / 4
A token implementation may update balances and emit its standard Transfer event. State and the emitted record are related but distinct.
A token implementation may update balances and emit its standard Transfer event. State and the emitted record are related but distinct.A non-anonymous Transfer event uses the full thirty-two-byte Keccak-256 signature digest as topic zero, not a four-byte function selector.In the common ERC-20 shape, from and to occupy topics one and two. The raw value is a thirty-two-byte data word. Other standards can index fields differently.An application can decode receipt logs under the correct ABI. A matching signature does not establish that an unknown emitter is an honest token.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Count topics from the opcode
LOG0 through LOG4 specify how many topics accompany the log. Topics are word-sized values, while the data payload comes from a selected memory range.
Connect to event compilation
Solidity event emission compiles into logging behavior. The signature topic convention belongs to the event ABI; the raw LOG opcode does not invent a canonical event name.
Keep the logging address
The log is associated with the current execution address context. Delegate execution can therefore emit a record associated with the proxy rather than the implementation address.
Apply static and rollback rules
Logging is disallowed in static context. Logs from a reverted execution scope do not survive as retained receipt records.
Trace the idea
LOG3 example for common Transfer:
topic 0 = signature digest
topic 1 = from
topic 2 = to
data memory range = encoded raw value
Stack examples list the bottom first and the top last. These small traces omit gas and surrounding dispatch unless stated.
QUICK CHECK · NO PRESSURE
Does LOG1 automatically calculate an event signature?