Indexed Parameters
Filterable topics.
Filtering Logs
Once a contract emits many events, off-chain apps need a way to filter them efficiently, for example to find every Transfer to a specific address.
Solidity supports this with indexed event parameters, which become searchable topics.
The indexed Keyword
Mark a parameter indexed to store it as a log topic rather than in the data section. Topics can be filtered quickly by Ethereum nodes.
<code>event Transfer(
address indexed from,
address indexed to,
uint256 amount
);</code>All lessons in this course
- Declaring Events
- Indexed Parameters
- Listening for Events
- Events vs Storage