Synq
Skip to content
[ synq / docs ]Synq home

SynqArcVaultPolicy

The per-vault guard and module that adds a timelock, a scoped operator and a guardian pause to a Safe.

SynqArcVaultPolicy (contracts/src/arc/SynqArcVaultPolicy.sol) is installed on one Safe v1.4.1 vault as both its transaction guard and an enabled module. The Safe's owners keep custody. This contract adds four controls.

  1. Governance timelock. Every Safe self-call (owners, threshold, modules, guard, fallback handler), every DELEGATECALL, and every operator-scope expansion must first be queued by an owner-quorum transaction, wait delay, and then be executed by an owner-quorum transaction, once, inside GRACE_PERIOD.
  2. Scoped operator. One operator address may pay allowlisted recipients in the vault token only, up to a per-payment and a rolling 24-hour cap.
  3. Guardian pause. The guardian can freeze outflows for at most MAX_PAUSE, then must wait PAUSE_COOLDOWN. It cannot move funds, change owners or block timelocked governance recovery.
  4. Atomic transactions. Safe gas refunds (gasPrice) and non-zero safeTxGas are rejected, so a failed inner call reverts the whole Safe transaction and cannot burn a queued operation.

Roles#

RoleHeld byPower
FactorySynqArcVaultFactoryCalls bind once to attach the Safe
Safe (owner quorum)The vaultQueue, cancel, set guardian, operator, recipients and caps; all governed calls
GuardianAddress chosen at creation (may be zero)pause, unpause
OperatorAddress chosen at creation (may be zero)pay within caps

Constants#

NameValue
MIN_DELAY / MAX_DELAY1 hour / 30 days
GRACE_PERIOD14 days to execute a queued operation after its ETA
MAX_PAUSE7 days
PAUSE_COOLDOWN2 days after a pause ends before the next
WINDOW1 day (operator spending window)

How the guard decides#

checkTransaction runs before every owner-signed Safe transaction.

  1. gasPrice and safeTxGas must be zero (RefundsDisabled).
  2. If the transaction is governed (isGoverned): any DELEGATECALL, any call to the Safe itself, or any call to the policy except the instant, scope-reducing selectors (queue, cancel, revokeOperator, removeRecipient). It must have been queued: NotQueued, NotReady before the ETA, Expired after ETA plus grace. A valid operation is consumed (single use). Delegatecalls and Safe value transfers are frozen while paused. A setGuard to a replacement must point to a guard bound to the same Safe (InvalidReplacement), or every later transaction would revert.
  3. Otherwise, when paused, only zero-value calls to the policy itself pass (OutflowsPaused for the rest).

External functions#

FunctionCallerTimingEffect
bind(safe)FactoryOnceAttaches the Safe. Rejects a Safe equal to the operator, guardian or a recipient
checkTransaction(...), checkAfterExecution(...)SafePer transactionGuard hooks. The post hook is a no-op because execution is atomic
queue(to, value, data, operation)SafeInstant (quorum)Records eta = now + delay; refuses a live duplicate (AlreadyQueued)
cancel(id)SafeInstantRemoves a queued operation
setGuardian(address)SafeTimelockedReplaces the guardian; the operator may not be the guardian
setOperator(address)SafeTimelockedSets the operator; not an owner, the Safe, guardian, a recipient
revokeOperator()SafeInstantRemoves the operator (scope reduction)
addRecipient(address)SafeTimelockedAllowlist addition
removeRecipient(address)SafeInstantAllowlist removal
setCaps(perPayment, window)SafeTimelockedSets operator caps
pause()GuardianInstantFreezes outflows until now plus MAX_PAUSE; cannot extend a running pause; PauseCooldown if too soon
unpause()Guardian, or Safe through the timelockLifts the freeze; the cooldown runs from now
pay(recipient, amount, ref)OperatorInstant, not while pausedTransfers from the Safe via execTransactionFromModule. Checks recipient allowlist, amount greater than zero, per-payment cap, rolling-window cap, then verifies the Safe and recipient balance deltas equal amount (PaymentFailed otherwise)
paused(), operationId(...), isGoverned(...), supportsInterface(...)AnyoneViewStatus and helpers. Supports the Safe v1.4.1 Guard interface and ERC-165

Public state: factory, token, delay, safe, guardian, pausedUntil, operator, perPaymentCap, windowCap, windowSpent, windowStart, isRecipient, eta.

Events#

Bound, OperationQueued, OperationCancelled, OperationExecuted, GuardianChanged, Paused, Unpaused, OperatorChanged, RecipientSet, CapsChanged, OperatorPaid(ref, operator, recipient, token, amount).

Errors#

NotFactory, AlreadyBound, NotSafe, NotGuardian, NotOperator, InvalidDelay, InvalidAddress, AlreadyQueued, NotQueued, NotReady, Expired, RefundsDisabled, OutflowsPaused, RecipientNotAllowed, CapExceeded, ZeroAmount, PaymentFailed, Reentrancy, PauseCooldown, InvalidReplacement.

Invariants#

  • The operator can pay only allowlisted recipients, only in token, never more than the per-payment cap, and never more than the window cap per rolling day. It cannot change governance.
  • Scope can shrink instantly (revoke the operator, remove a recipient, cancel a queue entry) but can grow only after the delay.
  • A pause cannot be extended by the guardian, and recovery operations remain available to the quorum during a pause. A stolen quorum cannot lift a pause sooner than the lesser of MAX_PAUSE and delay.
  • A queued operation executes at most once and only in its window.

How Synq uses it#

Synq's execution worker is the vault operator. For an approved payout (for example a contractor payment from a settled invoice) it submits pay(recipient, amount, ref) with ref tying the payment to the invoice or mandate id, through an outbox that guarantees one broadcast per grant (workers/execution/src/vault-outbox.ts). The Kernel grant authorizes the call; the policy enforces the same limits again on chain. Owners add recipients through the timelock, and the guardian role is the emergency brake. See Architecture and the Kernel and grants.

Edit this page on GitHub