fn get_game(env: soroban_sdk::Env, game_id: u64) -> Result
fn get_round(
env: soroban_sdk::Env,
game_id: u64,
round_index: u32,
) -> Result
fn get_stats(env: soroban_sdk::Env, player: soroban_sdk::Address) -> Stats
fn get_config(env: soroban_sdk::Env) -> Config
Start a new game. Burns the wager from the player's balance. No seeds or guesses — returns game_id only.
fn start_game(
env: soroban_sdk::Env,
player: soroban_sdk::Address,
tier: Tier,
wager: i128,
) -> Result
Settle a completed game with a ZK proof. Public inputs are constructed from on-chain data to prevent tampering.
fn settle_game(
env: soroban_sdk::Env,
game_id: u64,
proof: soroban_sdk::Bytes,
won: bool,
num_rounds: u32,
) -> Result<(), PhantomError>
Commit a guess hash for the next round.
Resolution must happen in a later ledger via resolve_round.
fn commit_guess(
env: soroban_sdk::Env,
game_id: u64,
guess_hash: soroban_sdk::BytesN<32>,
) -> Result
Claim signup bonus (1,000 PHANTOM). One-time per player. Called by the admin on behalf of the player.
fn signup_bonus(
env: soroban_sdk::Env,
player: soroban_sdk::Address,
) -> Result<(), PhantomError>
Resolve a previously committed round in a later ledger.
fn resolve_round(env: soroban_sdk::Env, game_id: u64) -> Result
Admin-only: update configuration fields after deployment.
fn update_config(env: soroban_sdk::Env, config: Config) -> Result<(), PhantomError>
Set contract configuration atomically at deployment time.
fn __constructor(env: soroban_sdk::Env, config: Config)
Resolve an abandoned game after timeout. Unplayed games refund wager minus fee. In-progress games forfeit as a loss.
fn refund_abandoned(env: soroban_sdk::Env, game_id: u64) -> Result<(), PhantomError>
fn get_pending_round(
env: soroban_sdk::Env,
game_id: u64,
) -> Result