Quickstart: add a Delay Modifier
Goal — In about 15 minutes, you put a review period between a role and your Safe. Queued transactions wait for one day. During that day, the Safe owners can cancel them.
You need:
- The constellation project from the Roles quickstart, with the
Safe
treasuryand the roles nodeopsRoles. - A Safe on a supported chain.
Step 1: add the Delay to your constellation
In constellation/index.ts, define the Delay Modifier and route the Roles Modifier
through it:
export const treasuryDelay = eth.delay['Treasury Delay']({
nonce: 0n,
owner: treasury,
avatar: treasury,
target: treasury,
cooldown: 86_400n, // 1 day, in seconds
expiration: 604_800n, // 7 days, in seconds
})
export const opsRoles = eth.roles['Ops Roles']({
nonce: 0n,
owner: treasury,
avatar: treasury,
target: treasuryDelay, // checked transactions go into the queue
roles: { ops },
})One day is a floor, not a recommendation. Pick a cooldown in which your owners
really notice and cancel a bad transaction, on a weekend too. The expiration
must be 0 (never expires) or at least 60 seconds; see the
guide for the trade-offs.
Step 2: review and apply
bun pushThe browser opens the Zodiac App with the change set: the Delay deployment, the
enableModule calls, and the new target of the Roles Modifier. Review it, then sign with
the Safe.
The path is now: member → Roles Modifier (permission check) → Delay Modifier (queue) → Safe.
Step 3: test the queue
- As a role member, execute a small allowed transaction. It does not run — it lands in
the queue. The Delay Modifier emits
TransactionAdded. - Call
executeNextTxwith the sameto,value,data, andoperation. It reverts: “Transaction is still in cooldown”. Good. - After the cooldown, call
executeNextTxagain. The Safe executes the transaction. Anyone can make this call — it needs no permission.
Step 4: prepare the cancel path
Cancellation is the point of the Delay Modifier, so rehearse it once:
- Queue another test transaction.
- As the Safe, call
setTxNonce(queueNonce)on the Delay Modifier. The queue is empty; the transaction never executes.
Set up an alert on the TransactionAdded event, so the owners see every queued
transaction in time. See watch the queue.
Where to go next
- Operations, monitoring, and recovery: Delay guide
- The full API: Delay reference
- The wiring in depth: Concepts