Contract 603cf5fcd9a116855e530bab77877b0e6fbd48f767824908f8eed7b3491bee47

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 22.0.10#9a1b75b509a5053b676b09fdbd224fe8c5f2fcd5
rsver 1.94.0

Instances

  • CDEBJNSWCUSKYGCE6TVPW7IG6Q6TCEQWNNLCOM62FXQU2QMNZYAGN54A

Interface

fn is_locked(env: soroban_sdk::Env, loan_id: u64) -> bool

One-time setup. Only settlement engine may lock/release collateral.

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

Lock borrower's collateral into escrow when a loan is matched.

fn lock_collateral(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
    borrower: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
) -> Result<(), CollateralVaultError>

Transfer collateral to recipient on default (direct claim or liquidator). Returns the collateral token address and amount transferred.

fn claim_collateral(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
    recipient: soroban_sdk::Address,
) -> Result<(soroban_sdk::Address, i128), CollateralVaultError>

Release collateral back to borrower on successful repayment.

fn release_collateral(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
    recipient: soroban_sdk::Address,
) -> Result<(), CollateralVaultError>
fn get_collateral_token(
    env: soroban_sdk::Env,
    loan_id: u64,
) -> Result
fn get_collateral_amount(
    env: soroban_sdk::Env,
    loan_id: u64,
) -> Result

Imports

WebAssembly Text (WAT) ▶