Skip to content

[CTR] Implement Emergency Protocol Pause and Global Freeze Mechanism#23

Description

@Rampop01

Issue #54

[CTR] Implement Emergency Protocol Pause and Global Freeze Mechanism

馃敶 Priority: Critical
Difficulty: Hard
Estimated Effort: 2 days
Relevant Files: contracts/admin/src/pause.rs, contracts/shared/src/guards.rs
Labels: admin, security, priority:critical

Requirements

  1. Pause Guard

    • Store a global is_paused: bool flag in the Admin contract's instance storage.
    • Expose pause_protocol() and resume_protocol() callable only by the Admin multisig.
    • Create a require_not_paused(env) guard function in contracts/shared/src/guards.rs that reads the flag and panics with Error::ProtocolPaused if true.
    • Integrate require_not_paused(env) as the first check in ALL state-mutating functions across Escrow, Swap, and Reputation contracts.
  2. Testing Requirements

    • Unit test: Call pause_protocol(), then attempt to call fund_escrow() and assert it panics with Error::ProtocolPaused.
    • Unit test: Call resume_protocol() and assert fund_escrow() proceeds normally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions