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