What are the practical use cases of anonymous events in Solidity? In which situations they might be helpful?
-
What do you mean by anonymous events? Events in solidity have a name.– Ismael ♦May 12 at 3:06
-
1Anonymous events don't have a signature topic hash, the events cannot be filtered by the event signature: docs.ethers.io/v5/concepts/events/#events-solidity– DenizMay 12 at 12:16
1 Answer
At the low level all events are quite similar: an optional topics array with a maximum of 4 entries and a data array of arbitrary length. Topics are 32 bytes in length and they are indexed in the block bloom filter.
Solidity events use one of the topics for the event identifier. So the only advantage of anonymous events is that they may have 4 topics.