Contract 1c2144c8c73e8ef26dc035dfae2ba719ec254d0433ac08db32debb83e4c70876

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.94.0

Instances

  • CAIM2JSJBQK3ADYFYHK3INPL6N3LSLH6NUIO7GKXAXTN4GVC7Y4OK6CJ

Interface

One-shot configuration. Writes the offer_book and settlement_engine addresses the router will forward to. The router has no admin-only entrypoints beyond initialization — past these two immutable pointers it is stateless; deploy a fresh instance at a new address to change them.

admin must sign this call (require_auth). The auth gate prevents an attacker from front-running the legitimate deployer between deploy and initialize and pointing the router at attacker-controlled offer_book / settlement_engine addresses (which would otherwise turn every create_request_bundle call into a confused-deputy on attacker contracts signed under the user's auth root).

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

View: configured offer_book address (or None before initialize).

fn get_offer_book(env: soroban_sdk::Env) -> Option

Atomically create a borrow request, deploy its per-request lending vault, and pledge the borrower's collateral into the collateral vault — all under a single auth root signed by creator.

Returns (request_id, vault_address) so callers can reference both new entities without an extra read. Any failure in any of the three underlying calls aborts the whole transaction — no partial state is ever persisted across the bundle.

fn create_request_bundle(
    env: soroban_sdk::Env,
    creator: soroban_sdk::Address,
    params: CreateRequestBundleParams,
) -> Result<(u64, soroban_sdk::Address), ProtocolError>

View: configured settlement_engine address (or None before initialize).

fn get_settlement_engine(env: soroban_sdk::Env) -> Option

Imports

WebAssembly Text (WAT) ▶