Skip to content

[CT-14] Implement emergency pause mechanism for escrow contract #922

@mftee

Description

@mftee

Problem

If a critical vulnerability is discovered in the escrow contract after deployment, there is no way to stop new funds from being deposited while a patch is prepared. All in-flight escrow funding operations remain exposed to the vulnerability with no emergency stop.

Proposed Solution

Implement an admin-controlled pause mechanism in a new escrow contract inside contracts/package/escrow-pausable/ that halts new deposits while preserving the ability to release or refund existing funds.

Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.

Acceptance Criteria

  • pause() and unpause() functions are admin-only
  • When paused: fund_escrow() returns ContractPaused error
  • When paused: open_dispute() returns ContractPaused error
  • When paused: release_funds() and refund() continue to work (existing funds can always exit)
  • is_paused() is a publicly callable read-only function
  • A ContractPaused event is emitted with the admin address and timestamp when paused
  • Unit tests cover: fund fails when paused, release succeeds when paused, non-admin pause attempt (Unauthorized)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions