Crypto glossary
Event logs
Event logs are records a smart contract emits during a transaction, such as a token Transfer, that apps, explorers and indexers read to track on-chain activity.
When a contract wants to signal that something happened, it emits an event. The EVM stores it as a log in the transaction receipt, with up to four indexed topics, the first being a hash of the event's signature, plus extra data. An ERC-20 transfer, for example, emits Transfer with the sender, the receiver and the amount, and an approval emits Approval. Logs cost much less gas than writing to contract storage.
Events are how most of the crypto stack learns what happened on-chain. Wallets update balances and activity feeds from them, explorers list token transfers using them, analytics dashboards and indexers build their databases from them, and trading bots watch them to react to swaps or liquidations. Block headers include a bloom filter that helps nodes search logs quickly.
Contracts cannot read logs, so they are a one-way signal to the outside world. Events can also be misleading: a malicious contract can emit a fake Transfer that never moved real tokens, a trick used in address-poisoning scams and fake airdrops. Logs from a reverted transaction are discarded.
Example
A portfolio tracker detects a new token in a user's history because it reads a Transfer event in which the user's address appears as the receiver.
