Skip to main content
An event can contain topics, alongside the data it is publishing. The topics data can be any value or type you want.
Whisk ChangesWith the release of Whisk, Protocol 23, the syntax for publishing smart contract events has changed. In order to provide the most up-to-date information, this guide has been updated to include the new patterns. Find more detailed information in the Rust SDK documentation.
The strategy here is to first create some structs that will define how our events are shaped. Then, within the contract’s function, we can create and publish those structs.
A more realistic example can be found in the way the token interface works. For example, the interface requires an event to be published every time the transfer function is invoked, with the following information: