Skip to content

feat: implement batch bet placement in a single transaction #267

@greatest0fallt1me

Description

@greatest0fallt1me

Description:

Allow users to place multiple bets (different events or outcomes) in a single transaction to save gas and improve UX.

Requirements and Context:

  • Must be secure, tested, and documented
  • Should add place_bets(bets: Vec<(event_id, outcome, amount)>) (or equivalent)
  • Should validate each bet and either apply all or none (atomic)
  • Should emit events per bet or batch event
  • Must enforce same rules as single place_bet (limits, deadline, balance)
  • Should be gas-efficient (avoid redundant storage reads where possible)

Suggested Execution:

  1. Fork the repo and create a branch

    git checkout -b feature/batch-bet-placement
  2. Implement changes

    • Write contract: src/lib.rs (add place_bets)
    • Update validation and storage
    • Add documentation and NatSpec-style comments
  3. Test and commit

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

Example Commit Message:

feat: implement batch bet placement in a single transaction

Guidelines:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions