Skip to content

Revenue pool: add pausable circuit-breaker for distribute and batch_distribute #349

@greatest0fallt1me

Description

@greatest0fallt1me

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

  1. Fork the repo and create a branch
    git checkout -b feature/revenue-pool-pause
  2. Implement changes
    • contracts/revenue_pool/src/lib.rs — pause state + gating + events
    • SECURITY.md — document the new circuit-breaker
  3. 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

  • pause/unpause/is_paused implemented and admin-gated
  • Distributions blocked while paused
  • Pause events emitted
  • Tests cover paused/unpaused transitions

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or improvementsecuritySecurity hardeningsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions