Skip to main content

Event

Derive Macro Event 

Source
#[derive(Event)]
{
    // Attributes available to this derive:
    #[indexed]
    #[anonymous]
}
Expand description

Derives Solidity-compatible event emission for structs.

§Example

#[derive(Event)]
struct Transfer {
    #[indexed]
    from: Address,
    #[indexed]
    to: Address,
    value: U256,
}

Transfer { from, to, value }.emit(&mut sdk);