Overview
EventLog represents Ethereum event logs emitted by smart contracts. Events are indexed by topic0 (event signature hash) and up to 3 additional indexed parameters. The EventLog primitive provides type-safe construction, filtering, sorting, and RPC conversion.Type Definition
Constructor Methods
create
Create an EventLog from parameters with branded types.from
Alias forcreate. Creates an EventLog from parameters.
fromRpc
Convert RPC log format (hex strings) to EventLog.Conversion Methods
toRpc
Convert EventLog to RPC format (hex strings).clone / copy
Create a deep copy of an EventLog.Accessor Methods
getTopic0 / getSignature
Get the event signature hash (topic0).getIndexedTopics / getIndexed
Get indexed parameters (topic1-topic3).isRemoved / wasRemoved
Check if log was removed due to chain reorganization.Filtering Methods
matchesAddress
Check if log matches an address filter.matchesTopics
Check if log matches a topic filter. Usenull as wildcard.
matchesFilter
Check if log matches a complete filter object.filterLogs
Filter an array of logs by criteria.Sorting
sortLogs
Sort logs by block number and log index.Filter Type
Usage Patterns
Decoding Transfer Events
Filtering by Multiple Addresses
Handling Reorgs
Related
- Address - Contract address type
- Hash - Hash type for topics
- BlockStream - Block streaming with reorg support
- LogFilter - Log filter primitive
- EVM LOG Instructions - LOG0-LOG4 opcodes

