Skip to content

feat: implement multi-outcome markets with 3 or more outcomes #247

@greatest0fallt1me

Description

@greatest0fallt1me

Description:

Extend event/market support to allow 3 or more outcomes (e.g., Team A / Team B / Draw) with correct pool and payout logic.

Requirements and Context:

  • Must be secure, tested, and documented
  • Should allow admin to create events with 2 to N outcomes
  • Should validate outcome selection in place_bet is one of event outcomes
  • Should compute pool and payouts for multi-outcome resolution (single winning outcome)
  • Should handle ties or multi-winner cases per spec (e.g., split pool)
  • Should emit events and update storage consistently
  • Must not break existing binary (yes/no) markets

Suggested Execution:

  1. Fork the repo and create a branch

    git checkout -b feature/multi-outcome-markets
  2. Implement changes

    • Write contract: src/lib.rs (create_event outcomes, place_bet, resolve, payouts)
    • Update types: src/types.rs (outcomes as list, resolution)
    • Update storage, validation, events
    • Add documentation and NatSpec-style comments
  3. Test and commit

    • Run tests; cover 2, 3, and N outcomes; edge cases (tie, invalid outcome)
    • Include test output and security notes

Example Commit Message:

feat: implement multi-outcome markets with 3 or more outcomes

Guidelines:

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions