Skip to content

@governor:timelockOperationState

State of a TimelockController operation: Unset, Waiting, Ready or Done.

On-chain (@governor:timelockOperationState!): Returns the numeric OperationState (0 Unset, 1 Waiting, 2 Ready, 3 Done), not the name.

⚗️ Experimental — available at next.evmcrispr.com.

Returns: string

@governor:timelockOperationState(timelock operationId)
NameTypeDescription
timelockaddressTimelockController address
operationIdbytes32Operation id (bound by governor:timelock-schedule)
load governor
set $timelock 0xc0dbDcA66a0636236fAbe1B3C16B1bD4C84bB1E1
set $opId 0x83f6db63dbcae7ea6a625e442c00b74a4707ce6c4a91667c8b5cf01b6f3159a1
print @governor:timelockOperationState($timelock $opId)
  • Returns Unset, Waiting, Ready or Done, derived from the operation timestamp (works on all TimelockController versions).

A nested core cond over the timelock's own state views, evaluated at assertion time: cond(isOperationDone, 3, cond(isOperationReady, 2, cond(isOperationPending, 1, 0))). The result is OZ's NUMERIC OperationState enum value — the string mapping stays off-chain:

ValueOperationStateView that selects it
3DoneisOperationDone(id)
2ReadyisOperationReady(id)
1WaitingisOperationPending(id) (pending but not ready)
0Unsetnone of the above
load governor
set $timelock 0xc0dbDcA66a0636236fAbe1B3C16B1bD4C84bB1E1
set $opId 0x83f6db63dbcae7ea6a625e442c00b74a4707ce6c4a91667c8b5cf01b6f3159a1
# The operation must be Ready (2) when the batch executes
assert @governor:timelockOperationState!($timelock $opId) == 2 "not ready"
  • The conds are lazy: only the winning branch resolves, so at most three views execute (Done short-circuits after one).
  • The timelock address and operation id resolve at composition time.