Summary
The settlement function iterates over all investor positions to distribute returns. An unbounded investor count could exhaust the Soroban transaction budget. A maximum investor count per invoice enforced in the invest function would cap the settlement cost within safe limits.
Scope
- Add set_max_investors(count: u32) admin function to configure the cap (default 500)
- Track the investor count per invoice in a persistent counter keyed by invoice_id
- In invest, panic with MaxInvestorsReached if adding a new investor would exceed the cap
- Increment the counter only for first-time investors on a given invoice
- Emit a max_investors_updated event when the cap is changed
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram
Summary
The settlement function iterates over all investor positions to distribute returns. An unbounded investor count could exhaust the Soroban transaction budget. A maximum investor count per invoice enforced in the invest function would cap the settlement cost within safe limits.
Scope
Acceptance Criteria
ETA: 24 hours
Coordinate on Telegram