Skip to content

[NF-07] Add Guardian-gated Emergency Pause / Circuit Breaker to VaultRouter - #134

Merged
wumibals merged 3 commits into
LadderMine:mainfrom
Leothosine:feat/nf-07-emergency-pause-circuit-breaker
Jul 21, 2026
Merged

[NF-07] Add Guardian-gated Emergency Pause / Circuit Breaker to VaultRouter#134
wumibals merged 3 commits into
LadderMine:mainfrom
Leothosine:feat/nf-07-emergency-pause-circuit-breaker

Conversation

@Leothosine

Copy link
Copy Markdown
Contributor

Summary

Adds a Guardian-gated circuit breaker to VaultRouter so all mutating operations can be halted instantly during an active incident, without waiting for the 72-hour governance timelock.

Changes

contracts/vault_router/src/error.rs

  • Added ProtocolPaused = 4 and Unauthorized = 5 error variants

contracts/vault_router/src/lib.rs

  • Added DataKey::Guardian and DataKey::Paused (bool, default false) storage keys
  • initialize now accepts a guardian address and sets Paused = false
  • New pause() - Guardian-only; sets Paused = true and emits a paused event
  • New unpause() - Guardian-only; sets Paused = false and emits an unpaused event
  • New is_paused() - read-only view, not gated
  • Added require_not_paused() internal helper called at top of deposit, withdraw, and early_exit
  • position() and other read-only functions deliberately not gated (users can still see funds while paused)
  • Full test suite updated: setup() passes guardian, 7 new tests covering all acceptance criteria (deposit/withdraw/early_exit rejected while paused, deposit succeeds after unpause, position readable while paused, non-guardian pause rejected)

closes #82

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

@Leothosine is attempting to deploy a commit to the wumibals' projects Team on Vercel.

A member of the Team first needs to authorize it.

…y-pause-circuit-breaker

# Conflicts:
#	contracts/vault_router/src/error.rs
#	contracts/vault_router/src/lib.rs
@wumibals
wumibals merged commit bd2f733 into LadderMine:main Jul 21, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NF-07] [CONTRACT] Emergency Pause / Circuit Breaker

2 participants