Skip to Content
DevelopersDelayOverview

Delay Modifier

The Delay Modifier puts a waiting period between a decision and its execution. A transaction enters a queue. After a cooldown, anyone can execute it. Before that, the owner can cancel it.

Use the Delay Modifier when someone must be able to intervene:

  • The Safe owners review what an automated module wants to do, and veto bad transactions.
  • A DAO gives members a fast lane (for example through a Roles Modifier), and keeps a veto window for a guardian.
  • An account gives a service provider control, but with a time buffer that limits the damage of a compromised key.

How it works

  1. An enabled module calls execTransactionFromModule. The Delay Modifier stores the transaction hash in the queue and emits TransactionAdded.
  2. The cooldown (in seconds) runs. During this time, the owner can cancel queued transactions with setTxNonce.
  3. After the cooldown, anyone can call executeNextTx with the original transaction data. The Delay Modifier verifies the hash and forwards the call to the Safe.
  4. If an expiration is set, the transaction stays valid only for that window after the cooldown. Expired transactions never execute.

Two properties are important to plan around:

The queue is strictly first-in, first-out. executeNextTx always executes the oldest queued transaction. One stale transaction at the head blocks the whole queue until it expires or the owner skips it with setTxNonce.

The Delay Modifier delays only the module path that goes through it. Safe owners that sign directly, and modules enabled directly on the Safe, are not delayed.

Composition with Roles

Put the Delay Modifier between the Roles Modifier and the Safe to get “scoped permissions plus review period”:

  • The Safe enables the Delay Modifier.
  • The Delay Modifier enables the Roles Modifier.
  • The target of the Roles Modifier is the Delay Modifier.

See the concepts page for the full diagram. The reverse order works too: Delay in front of Roles delays the calls before the permission check.

Next steps

Last updated on