Skip to content

feat: implement batch claim winnings for multiple events in one transaction #337

@greatest0fallt1me

Description

@greatest0fallt1me

Description:

Allow a user to claim winnings for multiple resolved events in a single transaction to save gas and improve UX.

Requirements and Context:

  • Must be secure, tested, and documented
  • Should add claim_winnings_batch(user, event_ids: Vec<Symbol>) (or equivalent)
  • Should validate each event is resolved and user is winner; claim all or none (atomic)
  • Should emit events per claim or batch
  • Must enforce same rules as single claim_winnings (no double claim)
  • Should be gas-efficient

Suggested Execution:

  1. Fork the repo and create a branch

    git checkout -b feature/batch-claim-winnings
  2. Implement changes

    • Write contract: src/lib.rs (add claim_winnings_batch)
    • Update storage and events; add documentation and NatSpec-style comments
  3. Test and commit

    • Run tests; cover full success, partial failure (atomic revert), double claim
    • Include test output and security notes

Example Commit Message:

feat: implement batch claim winnings for multiple events in one transaction

Guidelines:

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 48 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions