Contract a9f0a93a8648c9b8758f35831c9fc19b41af3530980f9ed6c1da252035e5d37f

← Back to Index 📥 Download WASM

Meta

cliver 23.3.0#08473ac20016c369067ce0dbca91d9595e72d6d4
rssdkver 22.0.9#3890521426d71bb4d892b21f5a283a1e836cfa38
rsver 1.91.1

Instances

  • CB5STITMI4N3QQ6ZHMMWFJKPLBZXRJNQJP5UJG7W4IYVHQMSTSXVJPWJ
  • CBZFZRDFPC5VT7VVUPEUJWW2ABFBFMEI65X7T3MUF655DERH34J3BNWU

Interface

Upgrade the contract to a new WASM hash. Only callable by admin.

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

Initialize the contract with an admin address.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), TierVerifierError>

Store a tier attestation (placeholder for ZK verification).

In the next upgrade, this will perform actual Groth16 verification using Protocol 25 BN254 host functions.

For now, it stores the attestation with a proof hash for later verification.

fn attest_tier(
    env: soroban_sdk::Env,
    farmer: soroban_sdk::Address,
    tier: u32,
    commitment: soroban_sdk::BytesN<32>,
    proof_hash: soroban_sdk::BytesN<32>,
) -> Result

Lookup a farmer's tier attestation.

fn get_attestation(
    env: soroban_sdk::Env,
    farmer: soroban_sdk::Address,
) -> Option

Imports

WebAssembly Text (WAT) ▶