Contract be3473474a1b648dfb8e55771253e7b63c9847067318873744638646e2d5e4bd

← Back to Index 📥 Download WASM

Meta

cliver 26.1.0#1228cff8022b804659750b94b315932b0e0f3f6a
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.96.0

Instances

  • CA37MRPVFGLRRENBW75CYZVBZPWZIS2FJQDMUFYU7MSLUNKFIDV2ZCQS

Interface

fn get_score(env: soroban_sdk::Env, player: soroban_sdk::Address) -> u32

Register the deployer as admin (call once after deploy).

fn init_admin(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Player: reset only your own score back to 0 / level 1.

fn reset_score(env: soroban_sdk::Env, player: soroban_sdk::Address)

Submit a score — caller must sign the transaction.

fn submit_score(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
    score: u32,
    level: u32,
)
fn get_leaderboard(env: soroban_sdk::Env) -> soroban_sdk::Vec

Admin-only: write a player's score directly, bypassing player auth. Exists solely to carry forward scores that were already proven via a real submit_score transaction on a prior contract deployment when migrating to a new instance — not for fabricating unproven scores.

fn admin_seed_score(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    player: soroban_sdk::Address,
    score: u32,
    level: u32,
)

Admin: wipe the entire leaderboard back to empty.

fn reset_leaderboard(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Admin-only: store the RewardContract address so submit_score can call it.

fn set_reward_contract(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    reward_contract_id: soroban_sdk::Address,
)

Register the WordScrambleContract address as the only authorized badge minter.

fn init(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Check whether a player holds a specific badge.

fn has_badge(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
    badge: soroban_sdk::Symbol,
) -> bool

Return all badges earned by a player.

fn get_badges(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
) -> soroban_sdk::Vec

Mint a badge for a player. Only callable by the registered WordScrambleContract (the address passed to init) — calling this directly as any other caller panics, since a contract Address's require_auth() only succeeds when that contract is the direct invoker of the current call, with no signature involved.

fn mint_badge(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
    badge: soroban_sdk::Symbol,
) -> bool

Imports

WebAssembly Text (WAT) ▶