Contract d37035409b010c3ffb3274c780a0ddd1a25ae65301996115ffc73158e38fe2db

← Back to Index 📥 Download WASM

Meta

cliver 26.1.0#1228cff8022b804659750b94b315932b0e0f3f6a
rssdkver 26.0.1#f52b6aad85f18c5e312ff3f60e57cb613274e6bb
rsver 1.94.0

Instances

  • CBJSFSZOEOEBSBTUZPTFZNAMP37PU7GKVFRERYSBTMYY7KPG6QKMAAQE

Interface

fn root(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>

Get the admin authorized to upgrade this contract.

fn admin(env: soroban_sdk::Env) -> Result

Upgrade the contract's WASM code in place (admin-gated). Keeps the blocklist and sparse-tree root intact.

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

Add a leaf to the blocklist (admin-gated). In a full implementation, this would update a sparse Merkle tree. For the buildathon, we track blocked leaves in storage and update the root by hashing the new leaf into the existing root (simplified but functional).

fn block_leaf(
    env: soroban_sdk::Env,
    leaf: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
fn blocked_count(env: soroban_sdk::Env) -> u32

Check that a leaf is NOT blocklisted. Returns true if the leaf is NOT in the blocklist (i.e., the address is clean). In the full system, the ZK circuit verifies a sparse Merkle non-membership proof, and this on-chain check is a secondary validation.

fn is_not_blocked(env: soroban_sdk::Env, leaf: soroban_sdk::BytesN<32>) -> bool

Assert non-membership. Returns Ok(true) if leaf is not blocked.

fn assert_non_member(
    env: soroban_sdk::Env,
    leaf: soroban_sdk::BytesN<32>,
) -> Result

Imports

WebAssembly Text (WAT) ▶