0PricingLogin
Web3 & DApp Development Fundamentals · Lesson

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

  1. Declaring Events
  2. Indexed Parameters
  3. Listening for Events
  4. Events vs Storage
← Back to Web3 & DApp Development Fundamentals