Contract 6bb5e9008b05099dc34415bf031823f42c09c0b0c9c87c5b886e8f64aab6e221

← Back to Index 📥 Download WASM

Meta

cliver 23.2.0#8c559e832fd969aa469784b66e70891fadf94f0a
rssdkver 23.1.0#7456be9d91fe1f4cb070fc2732bac78244ce6c3f
rsver 1.94.0

Instances

  • CA3Y2CMIEFNTX7KJEIJDYYMYOYSXU2G2O3KPQZYKVIXAWD6WOG7MIKYV

Interface

fn has_role(
    env: soroban_sdk::Env,
    account: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
) -> Option
fn get_admin(env: soroban_sdk::Env) -> Option

Get a single deployed vault address by its zero-based index.

fn get_vault(env: soroban_sdk::Env, index: u32) -> Option

Get all deployed vault addresses.

Convenience getter that reads each vault's persistent entry in turn, so its cost grows with the vault count. Deployment never depends on it; prefer get_vault_count + get_vault(index) (or the VaultDeployed event) for indexing at scale.

fn get_vaults(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn grant_role(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    account: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
)
fn revoke_role(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    account: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
)

Deploy and initialize Vault contract

fn deploy_vault(
    env: soroban_sdk::Env,
    config: VaultInitConfig,
) -> Result

Current address holding the upgrader role (if any).

fn get_upgrader(env: soroban_sdk::Env) -> Option
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    wasm_hash: soroban_sdk::BytesN<32>,
    wasm_hash_change_cooldown_secs: u64,
    upgrader: Option,
) -> Result<(), FactoryError>
fn renounce_role(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    role: soroban_sdk::Symbol,
)

Apply the pending WASM upgrade after the upgrade timelock expires.

Applies exactly the hash recorded by propose_upgrade; the caller cannot substitute a different hash here.

fn accept_upgrade(
    env: soroban_sdk::Env,
    operator: soroban_sdk::Address,
) -> Result<(), FactoryUpgradeError>

Cancel a pending WASM upgrade before it is applied.

fn cancel_upgrade(
    env: soroban_sdk::Env,
    operator: soroban_sdk::Address,
) -> Result<(), FactoryUpgradeError>
fn get_role_admin(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
) -> Option
fn renounce_admin(env: soroban_sdk::Env)
fn set_role_admin(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    admin_role: soroban_sdk::Symbol,
)

Accept a pending upgrader change after the cooldown (admin-gated).

fn accept_upgrader(env: soroban_sdk::Env) -> Result<(), FactoryError>
fn get_role_member(
    env: soroban_sdk::Env,
    role: soroban_sdk::Symbol,
    index: u32,
) -> soroban_sdk::Address

Total number of vaults deployed by this factory.

fn get_vault_count(env: soroban_sdk::Env) -> u32

Propose a WASM upgrade of the factory's OWN code. Starts the fixed upgrade timelock ([UPGRADE_COOLDOWN_SECS]) before the new code can be applied.

WASM replacement is the most powerful operation in the protocol, so — unlike a single-step upgrade — it is split into a timelocked propose/accept flow. The proposed hash is recorded and bound: accept_upgrade applies exactly this hash, so the timelock cannot be bypassed by proposing a benign hash and later applying a different one.

fn propose_upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
) -> Result<(), FactoryUpgradeError>

Propose a new upgrader for the factory (admin-gated). Starts the timelock.

fn propose_upgrader(
    env: soroban_sdk::Env,
    new_upgrader: soroban_sdk::Address,
) -> Result<(), FactoryError>

Pending WASM upgrade awaiting the upgrade timelock (if any).

fn get_pending_upgrade(env: soroban_sdk::Env) -> Option
fn get_vault_wasm_hash(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>
fn transfer_admin_role(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
    live_until_ledger: u32,
)

Pending upgrader change awaiting cooldown (if any).

fn get_pending_upgrader(env: soroban_sdk::Env) -> Option
fn accept_admin_transfer(env: soroban_sdk::Env)
fn get_role_member_count(env: soroban_sdk::Env, role: soroban_sdk::Symbol) -> u32

Accept the pending vault WASM hash change after cooldown expires.

fn accept_vault_wasm_hash(env: soroban_sdk::Env) -> Result<(), FactoryError>

Cancel a pending vault WASM hash proposal without committing or replacing it, returning the factory to a no-pending state.

propose_vault_wasm_hash rejects while a proposal is pending (PendingWasmHashExists), so this is the only way to clear an erroneous proposal: the admin must cancel here before a replacement can be proposed. Emits a distinct WasmHashChangeCancelled event so every clearance is observable on-chain.

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

Propose a new vault WASM hash. Starts the timelock cooldown.

fn propose_vault_wasm_hash(
    env: soroban_sdk::Env,
    wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), FactoryError>
fn get_pending_vault_wasm_hash(env: soroban_sdk::Env) -> Option

Imports

WebAssembly Text (WAT) ▶