Event Log
An immutable record of significant actions that occur within a smart contract.
Last Updated
2026-03-19
Related Concepts
What is Event Log?
An event log is a permanent, searchable record on the blockchain created when a smart contract emits an "event." Logs are much cheaper to store than regular contract state and serve as the primary way for external applications to track contract activity.
How does Event Log work?
- A smart contract executes a function that contains an emit statement.
- The EVM records the event's data into a special "log" section of the transaction receipt.
- This data includes "topics" (indexed parameters) and "data" (non-indexed parameters).
- Off-chain infrastructure, such as block explorers and indexers, scan these logs in real-time.
- Frontend applications use these logs to update their user interfaces without needing to query the contract's state directly.
Why does Event Log matter?
Event logs are essential for blockchain usability. They provide a cost-effective communication bridge between on-chain code and off-chain software.
Key features of Event Log
- Permanent and immutable on-chain record
- Highly gas-efficient compared to state storage
- Searchable via indexed "topics"
- Enables real-time application updates
- Provides a public audit trail of contract actions
Examples of Event Log
When you swap tokens on Uniswap, the protocol emits a Swap event log. This log contains details like the amount of tokens traded and the addresses involved.
Etherscan reads this log to display the "Transaction Action" you see on the block explorer.
