Events
Events are special values that can be emitted during the execution of a program.
An event type can be declared with the event
keyword.
The syntax of an event declaration is similar to that of a function declaration; events contain named parameters, each of which has an optional argument label. Types that can be in event definitions are restricted to booleans, strings, integer, and arrays or dictionaries of these types.
Events can only be declared within a contract body. Events cannot be declared globally or within resource or struct types.
Resource argument types are not allowed because when a resource is used as an argument, it is moved. A piece of code would not want to move a resource to emit an event, so it is not allowed as a parameter.
Last updated