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