Overview
Add a circuit-breaker pattern so the admin can halt all state-changing operations during an incident without upgrading the contract. Read-only functions remain available while paused.
Acceptance Criteria
pause() and unpause() functions callable only by the admin
- While paused, the following functions revert with
ContractPaused: create_invoice, pay_invoice, release_funds, claim_refund, raise_dispute, resolve_dispute
- Read-only functions (
get_invoice, get_leaderboard, get_stats) remain usable while paused
is_paused() view function returns the current pause state
- Emits
ContractPaused { admin, ledger } and ContractUnpaused { admin, ledger } events
- Pause state stored in instance storage (survives ledger boundary)
- Integration tests: pause → verify write blocked → unpause → verify write resumes
Overview
Add a circuit-breaker pattern so the admin can halt all state-changing operations during an incident without upgrading the contract. Read-only functions remain available while paused.
Acceptance Criteria
pause()andunpause()functions callable only by the adminContractPaused:create_invoice,pay_invoice,release_funds,claim_refund,raise_dispute,resolve_disputeget_invoice,get_leaderboard,get_stats) remain usable while pausedis_paused()view function returns the current pause stateContractPaused { admin, ledger }andContractUnpaused { admin, ledger }events