Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 1.05 KB

Indexed Parameters.md

File metadata and controls

26 lines (20 loc) · 1.05 KB

Adding the attribute indexed for up to three parameters adds them to a special data structure known as “topics” instead of the data part of the log.

If you use arrays (including string and bytes) as indexed arguments, its Keccak256 hash is stored as a topic instead, this is because a topic can only hold a single word (32 bytes).

All parameters without the indexed attribute are ABI-encoded into the data part of the log. Topics allow you to search for events, for example when filtering a sequence of blocks for certain events.

You can also filter events by the address of the contract that emitted the event.


Slide Screenshot

028.jpg


Slide Deck

  • Event Parameters -> Indexed or Not
  • Indexed -> Topics
  • Not Indexed -> Data
  • Topics -> Search/Filter
    • Up to 3 Indexed
  • Indexed -> ERC20 Spec
  • Gas -> Fast Search

References

  • Youtube Reference