Description
The vault has a pause circuit-breaker but RevenuePool does not. If a compromised admin key or buggy backend triggers erroneous distributions, there is no on-chain way to freeze outflows. Add pause/unpause/is_paused gating distribute and batch_distribute, mirroring the vault's pattern.
Requirements and Context
- Add
Paused storage key and admin-gated pause/unpause with pause_set events.
- Block
distribute and batch_distribute while paused; allow admin rotation while paused.
- Add
is_paused() view defaulting to false.
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b feature/revenue-pool-pause
- Implement changes
contracts/revenue_pool/src/lib.rs — pause state + gating + events
SECURITY.md — document the new circuit-breaker
- Test and commit
cargo test -p callora-revenue-pool
- Test distribute-while-paused reverts; unpause restores
- Include test output and notes in the PR
Example commit message
feat: add pause circuit-breaker to revenue pool
Acceptance Criteria
Guidelines
.rs under contracts/revenue_pool/src/, cargo test, /// docs, minimum 95% line coverage, no unwrap() in prod paths
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
The vault has a pause circuit-breaker but
RevenuePooldoes not. If a compromised admin key or buggy backend triggers erroneous distributions, there is no on-chain way to freeze outflows. Addpause/unpause/is_pausedgatingdistributeandbatch_distribute, mirroring the vault's pattern.Requirements and Context
Pausedstorage key and admin-gatedpause/unpausewithpause_setevents.distributeandbatch_distributewhile paused; allow admin rotation while paused.is_paused()view defaulting tofalse.Suggested Execution
contracts/revenue_pool/src/lib.rs— pause state + gating + eventsSECURITY.md— document the new circuit-breakercargo test -p callora-revenue-poolExample commit message
Acceptance Criteria
pause/unpause/is_pausedimplemented and admin-gatedGuidelines
.rsundercontracts/revenue_pool/src/,cargo test,///docs, minimum 95% line coverage, nounwrap()in prod paths