Problem
There is no emergency pause mechanism anywhere in the contract suite. The product vision specifies a kill-switch that can halt all protocol operations in case of an emergency (e.g., vulnerability discovered, oracle malfunction).
Contract impact: If a critical vulnerability is discovered, there is no way to pause the protocol. All contract operations would continue until a WASM upgrade is deployed and activated — a process that takes time during which funds can be lost.
Before Starting
Read: context/architecture-context.md
Root Cause
The pause mechanism was deferred in the contract design.
What To Build
- Add
paused: bool to parameters contract storage
- Add
set_paused(env, admin, paused: bool) — admin/multisig only
- All other contracts read pause status from parameters contract
- When paused, all mutating functions return a
Paused error
- Read-only functions (get_score, get_loan, etc.) still work when paused
Files To Touch
contracts/parameters-contract/src/lib.rs — add pause/unpause
contracts/parameters-contract/src/storage.rs — add paused key
contracts/creditline-contract/src/lib.rs — check pause before mutations
contracts/liquidity-pool-contract/src/lib.rs — check pause before mutations
contracts/reputation-contract/src/lib.rs — check pause before mutations
Acceptance Criteria
Mandatory Checks
Problem
There is no emergency pause mechanism anywhere in the contract suite. The product vision specifies a kill-switch that can halt all protocol operations in case of an emergency (e.g., vulnerability discovered, oracle malfunction).
Contract impact: If a critical vulnerability is discovered, there is no way to pause the protocol. All contract operations would continue until a WASM upgrade is deployed and activated — a process that takes time during which funds can be lost.
Before Starting
Read: context/architecture-context.md
Root Cause
The pause mechanism was deferred in the contract design.
What To Build
paused: boolto parameters contract storageset_paused(env, admin, paused: bool)— admin/multisig onlyPausederrorFiles To Touch
contracts/parameters-contract/src/lib.rs— add pause/unpausecontracts/parameters-contract/src/storage.rs— add paused keycontracts/creditline-contract/src/lib.rs— check pause before mutationscontracts/liquidity-pool-contract/src/lib.rs— check pause before mutationscontracts/reputation-contract/src/lib.rs— check pause before mutationsAcceptance Criteria
Mandatory Checks