Skip to content

Market.reveal_prediction() tier-3 #4

@GoSTEAN

Description

@GoSTEAN

Description: Reveal phase. Users present outcome, amount, salt; contract verifies the commitment and updates pools/odds.

Acceptance Criteria:

  • Auth required; user must have prior commit
  • Recompute hash(outcome + amount + salt) matches stored commit_hash
  • Update YES/NO pool, odds, total_volume
  • Move from pending commits to predictions map; clear pending entry
  • Emit PredictionRevealed(user, market_id, outcome, amount)
  • Unit + integration tests implemented and passing

Tests (minimum):

  • Happy path reveal updates pools and odds
  • Wrong salt/hash rejected
  • Reveal without commit rejected
  • YES and NO paths both verified
  • Event payload correct

Files: contracts/contracts/boxmeout/src/market.rs
Dependencies: commit_prediction implemented; USDC token

Metadata

Metadata

Assignees

Labels

HighHIGHStellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions