Effects
The actions triggered by rules—like reverting, emitting events, updating trackers, or calling contracts.
Effects are the actions triggered by rules when their condition expressions evaluate to true
or false
. Each effect directly impacts the behavior of the transaction or the state of the system.
You can include one or more effects in either branch of a rule.
Types of Effects
1. Revert
Cancels the transaction and optionally displays a custom message.
2. Emit Event
Emits an Ethereum event with parameters defined by expressions.
3. Update Tracker
Updates a tracker with a new value computed using an expression.
4. Foreign Call
Calls a method on another smart contract with arguments evaluated from expressions.
Effects are executed in the order defined. Reverts stop execution immediately.
Design Tip
Group related effects together and order them carefully, especially if you rely on tracker updates or foreign interactions that must happen before other logic.