Skip to main content
Version: v4
Attention!You are viewing outdated ink! 4 docs. Click here to view the latest docs.

Text/topic Title Picture

Applied on fields of ink! event types to indicate that they are topics.

Tells the ink! codegen to provide a topic hash for the given field. Every ink! event can only have a limited number of such topic field. The semantics are similar to indexed event arguments in Solidity.

Example

#[ink(event)]
pub struct Transferred {
#[ink(topic)]
from: Option<AccountId>,

#[ink(topic)]
to: Option<AccountId>,

amount: Balance
}