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.

revert: "Unauthorized"

2. Emit Event

Emits an Ethereum event with parameters defined by expressions.

event:
  name: "TransferBlocked"
  parameters:
    - user: transaction.sender
    - reason: "Blacklist"

3. Update Tracker

Updates a tracker with a new value computed using an expression.

updateTracker:
  id: totalTransferred
  expression: totalTransferred + transaction.amount

4. Foreign Call

Calls a method on another smart contract with arguments evaluated from expressions.

foreignCall:
  contract: 0xABC...
  method: updateStatus
  args:
    - transaction.sender
    - "suspended"

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.