Contract 78bee632a64720dc8a9c28aa2d34ec2bb4f1d28974888841a133ca1a5db0cf96

← Back to Index 📥 Download WASM

Meta

cliver 25.1.0#
rssdkver 23.5.2#347f71141ddf69ef1873527c94ac98e79215f125
rsver 1.87.0

Instances

  • CBBUVHCEML7UE46XXZXLTMGKFMKX7KOC2XAKI3TW6WBQBKWMSARMU3YM

Interface

One-time initialisation. Must be called immediately after deployment.

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

Register a new bond on-chain. Phase 1: proof hashes stored as-is (no on-chain ZK verification).

fn create_bond(
    env: soroban_sdk::Env,
    bond_id: soroban_sdk::String,
    bond_root: soroban_sdk::String,
    creator_proof_hash: soroban_sdk::String,
    counterparty_pubkey: soroban_sdk::String,
    pinata_link: soroban_sdk::String,
    expiry_at: u64,
    caller: soroban_sdk::Address,
) -> soroban_sdk::String

Counterparty co-signs: Pending → Live. No TTL change — the bond was already funded with ACTIVE_TTL at creation.

fn cosign_bond(
    env: soroban_sdk::Env,
    bond_id: soroban_sdk::String,
    counterparty_proof_hash: soroban_sdk::String,
    caller: soroban_sdk::Address,
)

Either party confirms settlement. Both must confirm to reach Settled. TTL is only reduced (to TERMINAL_TTL) when the bond fully settles.

fn settle_bond(
    env: soroban_sdk::Env,
    bond_id: soroban_sdk::String,
    is_creator: bool,
    caller: soroban_sdk::Address,
)

Anyone can call this after the expiry timestamp to expire a PENDING bond.

fn expire_bond(env: soroban_sdk::Env, bond_id: soroban_sdk::String)

Manually extend storage rent for active bonds. Only meaningful for Pending/Live bonds — Settled/Expired bonds won't need rent renewal beyond their short terminal window.

fn extend_bond_ttl(env: soroban_sdk::Env, bond_id: soroban_sdk::String)

Public read-only view — returns full bond state.

fn get_bond(env: soroban_sdk::Env, bond_id: soroban_sdk::String) -> BondData
fn bond_exists(env: soroban_sdk::Env, bond_id: soroban_sdk::String) -> bool

Imports

WebAssembly Text (WAT) ▶