Contract 1872e71c6ba523dcd60ec9afa29000b38211c846dfda3be9c4f6199fde54f9c4

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.94.0

Instances

  • CAOZ6YRJ7FYN5XBXUV7KHTFULWFQT5LREVZYVS3KWUMEPRQFIX3WLNDR

Interface

fn bump_ttl(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), ProtocolError>
fn get_loan(env: soroban_sdk::Env, loan_id: u64) -> Result
fn set_admin(
    env: soroban_sdk::Env,
    current_admin: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
) -> Result<(), ProtocolError>

Wire the settlement engine reference. One-shot; callable only by the admin bound at construction.

fn initialize(
    env: soroban_sdk::Env,
    settlement_engine: soroban_sdk::Address,
) -> Result<(), ProtocolError>
fn is_matured(env: soroban_sdk::Env, loan_id: u64) -> Result
fn create_loan(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    request_id: u64,
    borrower: soroban_sdk::Address,
    lender: soroban_sdk::Address,
    principal_amount: i128,
    collateral_amount: i128,
    interest_rate_schedule: soroban_sdk::Vec,
    maturity_time: u64,
    collateral_policy: CollateralPolicy,
    oracle_liquidation: Option,
) -> Result
fn mark_repaid(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
    interest_amount: i128,
) -> Result<(), LoanError>

Bind the admin to the deploying identity atomically with deployment (HAL-01).

Runs in the same operation as deploy, eliminating the deploy→configure window an attacker could otherwise front-run.

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

Refresh the TTL on a single Loan(loan_id) persistent entry. Long-lived loans (term > the default Soroban persistent TTL window) need this called on a schedule so the loan record doesn't get archived mid-life — mark_repaid / mark_default / mark_liquidated would otherwise revert with LoanNotFound until the entry is restored off-chain.

Admin-gated. Settlement-engine writes (create_loan, status transitions) already bump TTL automatically; this entrypoint covers loans that are idle between writes (e.g., a 6-month note with no oracle liquidations).

fn bump_loan_ttl(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    loan_id: u64,
) -> Result<(), LoanError>

Cancel a pending upgrade proposal.

fn cancel_upgrade(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), ProtocolError>
fn mark_defaulted(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
) -> Result<(), LoanError>

Execute a previously proposed upgrade once the timelock has elapsed.

fn execute_upgrade(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), ProtocolError>
fn mark_bought_out(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
) -> Result<(), LoanError>
fn mark_liquidated(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
) -> Result<(), LoanError>

Stage an upgrade to be executed after the timelock period (48 h).

fn propose_upgrade(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), ProtocolError>
fn get_next_loan_id(env: soroban_sdk::Env) -> u64
fn set_liquidation_trigger(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    loan_id: u64,
    trigger: LiquidationTrigger,
) -> Result<(), LoanError>

Imports

WebAssembly Text (WAT) ▶