Contract 6f9ffff186d9a15c293a08355dd576d9ad3198aa8f0f2c8bbbeaf3e522882c30

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.95.0

Instances

  • CDMHMQNPO7GHJH6YRDCDT2L24SSUVKBOWNOY6F3QRWZRWLSH7G2DDG6K

Interface

Admin calls this once payer payment is detected in the lockbox. Distributes USDC from the contract's own balance: collected >= advance_amount → repay advance to funder, reserve to msme collected < advance_amount → send all to funder, log shortfall (leakage path)

fn settle(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    invoice_id: soroban_sdk::String,
    collected_amount: i128,
) -> Result

One-time setup. admin is the Axial server key (custodial signer).

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    usdc: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
fn get_lockbox(
    env: soroban_sdk::Env,
    invoice_id: soroban_sdk::String,
) -> Result

Admin reports leakage: invoice is past due and lockbox shows insufficient payment. Transitions status to Leaked and emits event (off-chain reconciliation takes over).

fn report_leakage(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    invoice_id: soroban_sdk::String,
) -> Result

Called by admin immediately after axial_swap::execute_advance. Records the lockbox terms for this invoice. The settlement contract's own address is the payment destination — share it with the NoA.

fn register_invoice(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    invoice_id: soroban_sdk::String,
    funder: soroban_sdk::Address,
    msme: soroban_sdk::Address,
    face_amount: i128,
    advance_amount: i128,
) -> Result

Imports

WebAssembly Text (WAT) ▶