Skip to content

[FEAT] Implement Auto-Advancing Automated Payouts via Soroban Events #27

Description

@Queenode

🟡 Priority: High
Difficulty: Hard
Estimated Effort: 2-3 days
Relevant Files: contracts/src/lib.rs
Labels: enhancement, priority:high, integration

Requirements

  1. Event-Driven Automation

    • The backend currently polls or relies on cron jobs to trigger payouts. The smart contract can emit highly specific events to tell off-chain indexers exactly when an automated action is required.
  2. Rich Event Payloads

    • Enhance the contribute event to emit the current pool fullness status.
    • env.events().publish((symbol_short!("contrib"), member), (amount, current_cycle_contributions, is_pool_full));
    • If is_pool_full is true, this serves as a deterministic trigger for the backend to immediately construct and submit the payout() transaction, eliminating polling delays.
  3. Cycle Reset Events

  4. Data Minimization

    • Ensure sensitive data (like the total group size or exact total balance) is only emitted if strictly necessary, to maintain some privacy on the public ledger. Use short symbols (Symbol::short("P_FULL")) to save byte space.
  5. Testing

    • Unit test: Verify is_pool_full boolean is correctly calculated and emitted in the contribution event payload.
    • Unit test: Verify cycle_done event is emitted precisely on the final payout.
    • Target: >90% coverage on event emissions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions