Contract dbbaa6c65feb77b2afdf7f13fbf3a5d020e632c57d15340683a215d7d64c5af1

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.96.0

Instances

  • CBFROBSJE57V4KZWMDZOPSFFFGZIYQEJ7HNVBUZXMY52Y3PWROMRZMNL

Interface

The only authority over every pool this Factory deployed. Pools have no owner of their own.

fn admin(env: soroban_sdk::Env) -> Result

The pool's coins, in index order. Empty for a pool this Factory never deployed.

  • pool: a pool this Factory deployed.
fn get_coins(
    env: soroban_sdk::Env,
    pool: soroban_sdk::Address,
) -> soroban_sdk::Vec

The pool's address at a given deployment position, or None past the end.

  • index: 0-based deployment order; index = 0 is the first pool ever deployed.
fn pool_list(env: soroban_sdk::Env, index: u32) -> Option

Number of pools ever deployed.

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

How many coins the pool trades. Zero for a pool this Factory never deployed.

  • pool: a pool this Factory deployed.
fn get_n_coins(env: soroban_sdk::Env, pool: soroban_sdk::Address) -> u32

Destination of every pool's withdraw_admin_fees. Call is permissionless; the destination is not.

fn fee_receiver(
    env: soroban_sdk::Env,
) -> Result

The pending admin, if a transfer is in flight. Holds no authority until accepted.

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

Each coin's decimals, read from the token at deploy time. Empty for an unknown pool.

  • pool: a pool this Factory deployed.
fn get_decimals(
    env: soroban_sdk::Env,
    pool: soroban_sdk::Address,
) -> soroban_sdk::Vec

Set up the Factory: record the admin and fee receiver.

  • admin: the sole authority over every pool this Factory deploys.
  • fee_receiver: destination of every pool's admin-fee sweep.
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    fee_receiver: soroban_sdk::Address,
)

Redirect the admin-fee destination for every pool at once.

fn set_fee_receiver(
    env: soroban_sdk::Env,
    new_receiver: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

Deploy and register a pool from a registered implementation.

Permissionless: deployer is authorized only to prove identity. Duplicates are allowed — the salt is the pool counter, so identical deploys cannot collide. Coin order is fixed verbatim and never sorted; coin 0's position is permanent, as it is the base the pool's price oracle prices every other coin against.

  • deployer: pays for and is recorded as the deployer; does not gate the call.
  • name, symbol: the LP share token's name and symbol.
  • coins: token addresses; order is permanent, with coin 0 as the price-oracle base.
  • a: amplification coefficient, unscaled.
  • fee: swap fee charged on each trade.
  • offpeg_fee_multiplier: scales the fee up as the pool depegs.
  • implementation_idx: which registered implementation to deploy.
  • ma_exp_time, asset_types, method_ids, oracles: reserved for asset-type-1 (rate-oracle) support, which this build does not implement. They are currently accepted but ignored — only `asset_types.le
fn deploy_plain_pool(
    env: soroban_sdk::Env,
    deployer: soroban_sdk::Address,
    name: soroban_sdk::String,
    symbol: soroban_sdk::String,
    coins: soroban_sdk::Vec,
    a: i128,
    fee: i128,
    offpeg_fee_multiplier: i128,
    ma_exp_time: u64,
    implementation_idx: u32,
    asset_types: soroban_sdk::Vec,
    method_ids: soroban_sdk::Vec>,
    oracles: soroban_sdk::Vec,
) -> Result

The wasm hash bound to pool's index, or None if unregistered or retired.

  • index: the implementation slot to read.
fn pool_implementation(
    env: soroban_sdk::Env,
    index: u32,
) -> Option>

Bind an implementation index to a pool wasm hash, or retire it by passing None.

  • index: the implementation slot to bind or clear.
  • wasm_hash: the pool wasm hash to bind, or None to retire the slot.
fn set_pool_implementations(
    env: soroban_sdk::Env,
    index: u32,
    wasm_hash: Option>,
) -> Result<(), soroban_sdk::Error>

Second step of ownership transfer. Callable only by the pending admin; promotes it and clears the pending slot.

fn accept_transfer_ownership(env: soroban_sdk::Env) -> Result<(), soroban_sdk::Error>

First step in a two-step ownership transfer: records new_admin as pending.

Step two is accept_transfer_ownership, which the pending admin calls to take authority. The two steps make the new admin prove they can sign before any authority moves, so a typo in the address can't hand the pools to a key nobody controls.

  • new_admin: the address that may later accept to become the Factory admin.
fn commit_transfer_ownership(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>

The wasm hash of the implementation a pool was built from, or None for an unknown pool. Retiring that implementation index leaves this pool untouched.

  • pool: a pool this Factory deployed.
fn get_implementation_address(
    env: soroban_sdk::Env,
    pool: soroban_sdk::Address,
) -> Option>

Imports

WebAssembly Text (WAT) ▶