Admin: upgrade this contract to a new wasm hash.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Read the currently configured image ID used for receipt verification.
fn image_id(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>
Read the configured reward token contract address.
fn token_id(env: soroban_sdk::Env) -> soroban_sdk::Address
Read the configured RISC Zero router contract address.
fn router_id(env: soroban_sdk::Env) -> soroban_sdk::Address
Admin: transfer admin role.
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Read a claimant's best score for a specific seed_id.
Returns 0 when no prior score exists.
fn best_score(
env: soroban_sdk::Env,
claimant: soroban_sdk::Address,
seed_id: u32,
) -> u32
Check whether a journal digest has already been claimed.
Arguments:
env: Soroban execution environment.journal_digest: SHA-256 digest of the raw journal bytes.fn is_claimed(env: soroban_sdk::Env, journal_digest: soroban_sdk::BytesN<32>) -> bool
Admin: pause or unpause score submissions.
fn set_paused(env: soroban_sdk::Env, paused: bool)
Return the current window's seed, materializing it on first call per window.
This method writes only one deterministic key:
SeedById(seed_id) -> seed.
fn current_seed(env: soroban_sdk::Env) -> CurrentSeed
Read the hard-coded rules digest for AST4 verifier policy.
fn rules_digest(env: soroban_sdk::Env) -> u32
Admin: update the image ID (for program upgrades).
fn set_image_id(env: soroban_sdk::Env, new_image_id: soroban_sdk::BytesN<32>)
Admin: update the token address.
fn set_token_id(env: soroban_sdk::Env, new_token_id: soroban_sdk::Address)
Verify a RISC Zero proof and mint KALIEN tokens.
seal: variable-length proof seal bytesjournal_raw: raw 49-byte journal bytes:seed_id, seed, frame_count, final_score)Returns the claimant's new best score for this seed_id.
Errors:
ContractPaused if submissions are disabled.InvalidJournalFormat for malformed journal data.SeedNotActive if the (seed_id, seed) pair is not active.JournalAlreadyClaimed on replay.ZeroScoreNotAllowed or ScoreNotImproved for policy violations.fn submit_score(
env: soroban_sdk::Env,
seal: soroban_sdk::Bytes,
journal_raw: soroban_sdk::Bytes,
) -> Result
Verify a RISC Zero proof without minting rewards or mutating claim state.
Returns the final_score carried by the verified journal.
fn verify_score(
env: soroban_sdk::Env,
seal: soroban_sdk::Bytes,
journal_raw: soroban_sdk::Bytes,
) -> Result
Initialize immutable and mutable configuration for the contract instance.
Arguments:
env: Soroban execution environment.admin: Address authorized for admin-only methods.router_id: RISC Zero router contract address used for proof verification.image_id: Expected RISC Zero image ID for valid receipts.token_id: Stellar asset contract used for reward minting.fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
router_id: soroban_sdk::Address,
image_id: soroban_sdk::BytesN<32>,
token_id: soroban_sdk::Address,
)
Admin: update the RISC Zero router address.
fn set_router_id(env: soroban_sdk::Env, new_router_id: soroban_sdk::Address)