Update the contract WASM hash (upgrade contract)
new_wasm_hash - The hash of the new WASM binaryNotAdmin - If caller is not the adminfn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Get game information.
game_id - The ID of the gameGame - The game state (includes winning number after game ends)fn get_game(env: soroban_sdk::Env, game_id: u32) -> Result
Get the current admin address
Address - The admin addressfn get_admin(env: soroban_sdk::Env) -> Result
Set a new admin address
new_admin - The new admin addressNotAdmin - If caller is not the current adminfn set_admin(
env: soroban_sdk::Env,
new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Make a guess for the current game. Players can guess a number between 1 and 10.
game_id - The ID of the gameplayer - Address of the player making the guessguess - The guessed number (1-10)fn make_guess(
env: soroban_sdk::Env,
game_id: u32,
player: soroban_sdk::Address,
guess: u32,
) -> Result<(), soroban_sdk::Error>
Start a new game between two players with FP wagers. This creates a session in Blendizzard and locks FP before starting the game.
CRITICAL: This method requires authorization from THIS contract (not players).
Blendizzard will call game_id.require_auth() which checks this contract's address.
session_id - Unique session identifier (u32)player1 - Address of first playerplayer2 - Address of second playerplayer1_wager - FP amount player1 is wageringplayer2_wager - FP amount player2 is wageringu32 - The game IDfn start_game(
env: soroban_sdk::Env,
session_id: u32,
player1: soroban_sdk::Address,
player2: soroban_sdk::Address,
player1_wager: i128,
player2_wager: i128,
) -> Result
Initialize the contract with Blendizzard address and admin
admin - Admin address (can upgrade contract)blendizzard - Address of the Blendizzard contractfn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
blendizzard: soroban_sdk::Address,
)
Reveal the winner of the game and submit outcome to Blendizzard. Can only be called after both players have made their guesses. This ends the Blendizzard session, unlocks FP, and updates faction standings.
game_id - The ID of the gameAddress - Address of the winning playerfn reveal_winner(
env: soroban_sdk::Env,
game_id: u32,
) -> Result
Get the current Blendizzard contract address
Address - The Blendizzard contract addressfn get_blendizzard(
env: soroban_sdk::Env,
) -> Result
Set a new Blendizzard contract address
new_blendizzard - The new Blendizzard contract addressNotAdmin - If caller is not the adminfn set_blendizzard(
env: soroban_sdk::Env,
new_blendizzard: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>