Initialize the competition
fn init(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
end_time: u64,
token: soroban_sdk::Address,
)
Award prizes to top 10 players. Callable by anyone after end_time. Distribution: 1st=40%, 2nd=20%, 3rd=10%, 4th-10th=~4.3% each
fn payout(env: soroban_sdk::Env)
Upgrade the contract to a new WASM binary Can only be called by admin
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Get competition state
fn get_state(env: soroban_sdk::Env) -> GameConfig
Get current leader (backwards compatible - returns top of leaderboard)
fn get_leader(env: soroban_sdk::Env) -> (soroban_sdk::Address, u64)
Submit a verified score (called by backend oracle) Only updates if it's a new personal best
fn submit_score(env: soroban_sdk::Env, player: soroban_sdk::Address, score: u64)
Emergency function to recover all funds Can ONLY be called by the hardcoded panic admin address Returns all XLM to the panic admin
fn panic_withdraw(env: soroban_sdk::Env)
Get the full leaderboard (top 10)
fn get_leaderboard(env: soroban_sdk::Env) -> soroban_sdk::Vec
Start a new round (admin only)
fn start_new_round(env: soroban_sdk::Env, new_end_time: u64)
Get historical config for a specific completed round
fn get_round_config(env: soroban_sdk::Env, round_id: u32) -> Option
Get a player's personal best score
fn get_personal_best(env: soroban_sdk::Env, player: soroban_sdk::Address) -> u64
Get historical leaderboard for a specific completed round
fn get_round_history(
env: soroban_sdk::Env,
round_id: u32,
) -> soroban_sdk::Vec