Skip to main content

Since January 2026, we are unfortunately unable to actively maintain or develop ink! further.

We have written down the details in a Polkadot Forum post.

Version: v3
Attention!You are viewing outdated ink! 3 docs. Click here to view the latest docs.

#[ink(anonymous)]

Applicable to ink! events.

Tells the ink! codegen to treat the ink! event as anonymous which omits the event signature as topic upon emitting. Very similar to anonymous events in Solidity.

Anonymous events have similar semantics as in Solidity in that their event signature won't be included in their event topics serialization to reduce event emitting overhead. This is especially useful for user defined events.

The signature of the event is by default one of the topics of the event, except if you annotate the event with #[ink(anonymous)]. The attribute implies that it is not possible to filter for specific anonymous events by name.