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)