Skip to content

feat(freeze,revenue_pool): connect freeze flag to revenue pool distributions (#1218) - #1386

Closed
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1218-connect-freeze-to-revenue-pool
Closed

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1218-connect-freeze-to-revenue-pool

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1218

Summary

Connects CalloraFreeze to RevenuePool distributions via an optional configured cross-contract circuit-breaker check:

  1. Adds set_freeze_contract(env, caller, Option<Address>) and get_freeze_contract(env) on RevenuePool.
  2. Consults is_frozen on the configured CalloraFreeze contract inside RevenuePool::require_not_paused and RevenuePool::is_paused, blocking distribute and batch_distribute with RevenuePoolError::Paused while frozen.
  3. Preserves existing standalone behaviour when no freeze contract is configured (None).
  4. Documents the integration model in contracts/freeze/README.md and adds end-to-end cross-contract integration tests in contracts/freeze/tests/malformed_freeze.rs.

Acceptance Criteria Mapping

  • Freezing blocks revenue pool distribute when wired: Verified in freeze_contract_blocks_revenue_pool_distribute_when_wired.
  • Unconfigured freeze address keeps current behaviour: Verified before wiring (pool.get_freeze_contract() == None).
  • Integration test covers the cross-contract flow: Added freeze_contract_blocks_revenue_pool_distribute_when_wired in contracts/freeze/tests/malformed_freeze.rs.
  • Freeze crate README states the integration model: Added the Revenue Pool Integration Model section in contracts/freeze/README.md.

Validation

  • cargo test -p callora-freeze && cargo test -p callora-revenue-pool

Payout Wallet (Base Mainnet USDC / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connect freeze flag to revenue pool distributions

2 participants