eth_getLogs - Optimism RPC Method
Query event logs on Optimism. Essential for indexing cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients on the heart of the Superchain powering 60%+ of Ethereum L2 transactions with $6B+ TVL.
Returns an array of all logs matching a given filter object on Optimism.
Why Optimism? Build on the heart of the Superchain powering 60%+ of Ethereum L2 transactions with $6B+ TVL with OP Stack modularity, Superchain interoperability, 17M+ daily transactions across 33 chains, and 20% of tokens for public goods.
Use Cases
The eth_getLogs method is essential for:
- Event indexing - Track contract events for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients
- Token transfers - Monitor ERC20/ERC721 transfers
- DeFi analytics - Track swaps, liquidity events, and more
- Notification systems - Alert on specific on-chain events
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32005 | Query returned more than 10000 results | Reduce block range |
| -32602 | Invalid params | Invalid filter parameters |
Related Methods
eth_newFilter- Create a filter for logseth_getFilterChanges- Poll filter for new logs
eth_call
Execute smart contract calls without creating transactions on Optimism. Essential for reading contract state for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients.
eth_newFilter
Create an event log filter on Optimism. Essential for event monitoring, contract activity tracking, and DeFi event streaming for cross-chain DeFi, Superchain-interoperable dApps, and public goods funding recipients.