Contract 713a288d91e84897d48a42bfc56aa67874c2b91a18470136bb7064808e660d88

← Back to Index 📥 Download WASM

Meta

binver 1.0.0
cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.93.0

Instances

  • CBO6NT4FQTGPXVBF4JZTPAAS6SE6K4XV7VNE7MOLFR7XDUUXZ6NOZOA2
  • CCGUYOEQYSF7IDGEMPQ2BDFXQ2BYLIG3TV5ZPZJKTCCAPQN47CZ5BOPV

Interface

Player commits their Nether Seal hash after completing the game.

The seal_hash is SHA-256(PIKO-NETHER|score:X|wisdom:Y|time:Z|ts:T) computed client-side. The contract stores it in Temporary storage with a ~24h TTL — if not revealed in time, the commitment expires.

fn commit(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
    seal_hash: soroban_sdk::BytesN<32>,
)

Player reveals their game results. Contract verifies hash match.

Uses env.crypto().sha256() (host-optimized) to recompute the hash from revealed values and compare against the stored commitment.

fn reveal(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
    score: u32,
    wisdom: u32,
    elapsed: u32,
    salt: u64,
) -> NetherSeal

Upgrade the contract WASM (admin only).

fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)

Contract version for tracking upgrades.

fn version(env: soroban_sdk::Env) -> u32

Get a specific verified seal by player and index.

fn get_seal(
    env: soroban_sdk::Env,
    player: soroban_sdk::Address,
    index: u64,
) -> NetherSeal

Initialize the contract. Must be called once after deployment.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    nft_contract: soroban_sdk::Address,
)

Get the total number of verified seals across all players.

fn total_seals(env: soroban_sdk::Env) -> u64

Get the number of seals a specific player has earned.

fn player_seals(env: soroban_sdk::Env, player: soroban_sdk::Address) -> u64

Check if a player has an active (unrevealed) commitment.

fn has_commitment(env: soroban_sdk::Env, player: soroban_sdk::Address) -> bool

Transfer admin to a new address (admin only).

fn transfer_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)

Update the NFT contract address (admin only).

fn set_nft_contract(env: soroban_sdk::Env, nft_contract: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶