Contract 85d4a95d66af0589f4645cc2f4a37dd90c483d52721ecc5167846029e7d2cd48

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.96.0

Interface

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

Admin-gated WASM upgrade — same contract instance + storage, new code. Lets us iterate/season without a new address or state migration (mainnet de-risk).

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

Allowlisted attester (or the QuestRegistry contract) credits the EARNED (cashable) track, writes the canonical attestation, emits att_set.

fn award_xp(
    env: soroban_sdk::Env,
    attester: soroban_sdk::Address,
    to: soroban_sdk::Address,
    schema_id: u32,
    amount: u64,
)

Social score — leaderboard / fun. NOT cashable.

fn get_score(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> u64

A half-card by id — for the claim preview and the expiry keeper.

fn get_vouch(env: soroban_sdk::Env, vouch_id: u64) -> Option

Earned score — the ONLY track Rewards may gate USDC payouts on.

fn get_earned(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> u64

from mints a half-card bound to claim_hash (= sha256 of a secret held in the share link). Escrows VOUCH_STAKE Social XP from from (refunded on a timely claim, else slashed). New wallets get STARTER_SOCIAL first so the first vouch is free. Per-day cap applies. Returns the vouch id.

fn mint_vouch(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    claim_hash: soroban_sdk::BytesN<32>,
    note: soroban_sdk::String,
) -> u64

claimer claims by presenting secret (sha256(secret) must equal claim_hash). The claimer earns SOCIAL XP (first-pair-only), the voucher's stake is refunded (if the claim is within VOUCH_TTL_SECS), and the voucher's 2nd-order bonus is released now if the claimer is already verified — otherwise it is queued until the claimer performs a verified (Earned) action. Vouches never touch Earned.

fn claim_vouch(
    env: soroban_sdk::Env,
    claimer: soroban_sdk::Address,
    vouch_id: u64,
    secret: soroban_sdk::Bytes,
)

Aggregate profile view — social + earned + verified in ONE call. Purely composes the existing getters; no new storage, no new write path. Cuts get_profile-style callers from 2-3 round-trips down to 1.

fn get_profile(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> Profile
fn is_attester(env: soroban_sdk::Env, who: soroban_sdk::Address) -> bool

True once addr has performed a verified (Earned) action — this is the gate that releases pending 2nd-order voucher bonuses.

fn is_verified(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool
fn add_attester(env: soroban_sdk::Env, attester: soroban_sdk::Address)

Slash an unclaimed half-card after its 7-day window (the staked Social XP was deducted at mint and is not refunded). Callable by anyone — a cheap keeper job. Idempotent; a still-claimable (late) claim earns no refund either way.

fn expire_vouch(env: soroban_sdk::Env, vouch_id: u64)
fn get_attestation(
    env: soroban_sdk::Env,
    addr: soroban_sdk::Address,
    schema_id: u32,
) -> Option
fn remove_attester(env: soroban_sdk::Env, attester: soroban_sdk::Address)

Imports

WebAssembly Text (WAT) ▶