Contract b427363f17a2bfd6007b33c1827c94f4c0d58646adfe3cfa65b4499ae77c24f0

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.5.3#d3e1ab2424388b10893b796b0c8e405c5edd03d2
rsver 1.94.0

Instances

  • CA4UAKAGVIR4FNGLICNNO63NRAF3PJ234OCFER5TLXQS32DQKTTOEBJR

Interface

fn bump_ttl(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), FactoryError>
fn get_vault(
    env: soroban_sdk::Env,
    request_id: u64,
) -> Result
fn has_vault(env: soroban_sdk::Env, request_id: u64) -> bool
fn set_admin(
    env: soroban_sdk::Env,
    current_admin: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
) -> Result<(), FactoryError>

Wire the cross-contract references and vault WASM hash. One-shot; callable only by the admin bound at construction.

fn initialize(
    env: soroban_sdk::Env,
    vault_wasm_hash: soroban_sdk::BytesN<32>,
    settlement_engine: soroban_sdk::Address,
    offer_book: soroban_sdk::Address,
) -> Result<(), ProtocolError>
fn deploy_vault(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    request_id: u64,
    asset_token: soroban_sdk::Address,
    max_capacity: i128,
    min_capacity: i128,
    deposit_deadline: u64,
    share_name: soroban_sdk::String,
    share_symbol: soroban_sdk::String,
    borrower: soroban_sdk::Address,
) -> Result

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)

Cancel a pending upgrade proposal.

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

Execute a previously proposed upgrade once the timelock has elapsed.

fn execute_upgrade(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), ProtocolError>
fn get_vault_count(env: soroban_sdk::Env) -> u64

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_vault_wasm_hash(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>

Cancel a pending vault WASM hash proposal before it is executed.

fn cancel_vault_wasm_hash(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), FactoryError>

Execute a previously proposed vault WASM hash once the timelock has elapsed.

fn execute_vault_wasm_hash(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
) -> Result<(), FactoryError>

HAL-10: stage a new vault WASM hash behind the same 48h timelock the factory applies to its own code upgrades. The stored hash is the template every future deploy_vault stamps out for funds-custodying vaults, so an instant overwrite would let a compromised admin silently swap in backdoored vault code with zero notice — defeating the notice-and-cancel guarantee. Two-phase (propose -> wait -> execute) plus a cancel, all of which emit events, restores that guarantee.

fn propose_vault_wasm_hash(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    new_hash: soroban_sdk::BytesN<32>,
) -> Result<(), FactoryError>

Imports

WebAssembly Text (WAT) ▶