Contract 221603953da369b4d77c619f1794a76ae9bba636b04f038eea209983cba76e10

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.89.0

Instances

  • CAZG6ZKEL6CLE55FVB43BRWORNYWJ5TKZDKFH7F5IBKMX6YYCQ56U43H

Interface

One-time bootstrap. The admin address must sign the init tx, which closes the front-running window between deploy and first call.

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

Add a new authorized writer. Caller must be in the auth set and sign.

fn add_authorized(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
)

Remove an authorized writer. Caller must be in the auth set and sign. Refuses to empty the auth set so the contract never becomes orphaned.

fn remove_authorized(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    target: soroban_sdk::Address,
)

Public read of the current authorized writer set.

fn get_authorized(env: soroban_sdk::Env) -> soroban_sdk::Vec

Record the SHA-256 hash for one stage of a gem. Append-only: re-setting an existing stage panics with StageAlreadySet. To correct a mistake, deploy a new gem record under a new gemID.

fn set_gem_hash(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    id: soroban_sdk::String,
    stage: soroban_sdk::String,
    hash: soroban_sdk::BytesN<32>,
)

Record several stage hashes in one transaction. Each entry is subject to the same append-only and whitelist rules as set_gem_hash. If any entry violates a rule, the whole call reverts.

fn set_gem_hashes(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    id: soroban_sdk::String,
    hashes_to_set: soroban_sdk::Map>,
)

Extend the storage TTL of a gem's on-chain record WITHOUT modifying it.

Persistent entries are archived once their TTL runs out, after which the anchored hashes can't be read without a costly restore. Because the contract is append-only, an existing stage can never be re-written to piggy-back a TTL bump — so this dedicated keeper entrypoint is the only way to keep a gem's provenance alive indefinitely.

Permissionless by design: extending TTL only prolongs storage (the caller pays the fee) and can't alter or reveal anything, so anyone who cares about a gem's longevity may keep it alive. No-op if the gem has no record on-chain, so keepers can call it blindly over a batch of IDs.

fn bump_gem_ttl(env: soroban_sdk::Env, id: soroban_sdk::String)

Read the recorded hash for one (gem, stage) pair. None if not set.

fn get_gem_stage_hash(
    env: soroban_sdk::Env,
    id: soroban_sdk::String,
    stage: soroban_sdk::String,
) -> Option>

Read every stage hash recorded for a gem. None if the gem has no record on-chain at all.

fn get_gem(
    env: soroban_sdk::Env,
    id: soroban_sdk::String,
) -> Option>>

Convenience read: which stages exist for a gem.

fn list_gem_stages(
    env: soroban_sdk::Env,
    id: soroban_sdk::String,
) -> soroban_sdk::Vec

Imports

WebAssembly Text (WAT) ▶