-
Notifications
You must be signed in to change notification settings - Fork 48
Revenue pool: batch_distribute — sum validation + atomic transfers #122
Copy link
Copy link
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programrevenue-poolsecuritysmart-contractssoroban
Description
Description
Precompute total required USDC, validate every amount is positive, ensure on-ledger balance covers total, then perform transfers; emit per-leg events.
Requirements and context
- Must fail without partial external transfers if later legs would fail.
- Document vector size policy (see related cap issue).
Suggested execution
- Fork the repo and create a branch:
git checkout -b feature/revenue-pool-batch-distribute - Implement changes in the Callora-Contracts Soroban workspace (
contracts/*/src/). - Run
cargo fmt,cargo clippy --all-targets --all-features -- -D warnings, andcargo testfrom the workspace root. - For WASM release builds:
cargo build --target wasm32-unknown-unknown --release -p callora-revenue-pool(adjust-pif the crate name differs).
Deliverables
lib.rs+test.rs.- Edge tests: duplicates, many recipients, insufficient aggregate balance.
Test and commit
- Run tests and
./scripts/coverage.sh(orcargo tarpaulinpertarpaulin.toml). - Cover edge cases; include summarized test output and brief security notes in the PR description.
Example commit message
feat(revenue-pool): batch_distribute validation and tests
Guidelines
- Minimum 95% line coverage for touched crates (workspace policy).
- Clear documentation (Rust
///on public items where applicable; repo markdown as needed). - Timeframe: 96 hours from assignment unless agreed otherwise.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programrevenue-poolsecuritysmart-contractssoroban