Contract 0c9e090b9232777fc2c023aa85a5ddd00700204c9b393134efb1870956cbf80d

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.94.0

Instances

  • CA3YQCW6JOOMXWPJE5JP2GCSG2UXK2PHRFVYESSXSKIEKQU3JQNCFLII

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>
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    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>

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) ▶