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:
-
Fork the repo and create a branch
git checkout -b feature/multi-outcome-markets
-
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
-
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
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:
place_betis one of event outcomesSuggested Execution:
Fork the repo and create a branch
Implement changes
src/lib.rs(create_event outcomes, place_bet, resolve, payouts)src/types.rs(outcomes as list, resolution)Test and commit
Example Commit Message:
Guidelines: