Contract ffa48577dcaa0dadcd5f48318d8b22faed970acb80ff097d6e49065dfc8b299a

← Back to Index 📥 Download WASM

Meta

cliver 25.1.0#a048a57a75762458b487052e0021ea704a926bee
rssdkver 25.1.0#86c50a1ea4f87b40add3064ff9df95c7553565c5
rsver 1.93.0

Instances

  • CDDAYXNY6MMA47Q54VSHG2WV445ZUOJ354NOLSFRC7ZUDTD6OTS4A7PE

Interface

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

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)

Read the configured RISC Zero verifier contract address.

fn verifier_id(env: soroban_sdk::Env) -> soroban_sdk::Address

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 bytes
  • journal_raw: raw 49-byte journal bytes:
  • 4 x u32 LE fields (seed_id, seed, frame_count, final_score)
  • claimant payload (kind + 32-byte id)

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.
  • verifier_id: RISC Zero Groth16 verifier contract address.
  • 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,
    verifier_id: soroban_sdk::Address,
    image_id: soroban_sdk::BytesN<32>,
    token_id: soroban_sdk::Address,
)

Admin: update the RISC Zero verifier address.

fn set_verifier_id(env: soroban_sdk::Env, new_verifier_id: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶