Initialize factory with config
fn init(
env: soroban_sdk::Env,
adm: soroban_sdk::Address,
wasm: soroban_sdk::BytesN<32>,
xlm: soroban_sdk::Address,
fee: i128,
) -> Result<(), Err>
Get pool by address
fn pool(env: soroban_sdk::Env, adr: soroban_sdk::Address) -> Result
Sync TVL/staker count from pool (called by staking contracts)
fn sync(
env: soroban_sdk::Env,
pool: soroban_sdk::Address,
tvl: i128,
cnt: u32,
) -> Result<(), Err>
List pools with pagination
fn pools(env: soroban_sdk::Env, from: u32, lim: u32) -> soroban_sdk::Vec
Get platform stats: (pool_count, total_stakers, total_tvl)
fn stats(env: soroban_sdk::Env) -> (u32, u32, i128)
Get config
fn config(env: soroban_sdk::Env) -> Result
Deploy new staking pool
fn deploy(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
token: soroban_sdk::Address,
rate: u32,
lock: u64,
min: i128,
max: i128,
cap: i128,
max_s: u32,
) -> Result
Update deploy fee
fn set_fee(env: soroban_sdk::Env, fee: i128) -> Result<(), Err>
Get pools by owner
fn by_owner(env: soroban_sdk::Env, own: soroban_sdk::Address) -> soroban_sdk::Vec
Update WASM hash for new pool deployments
fn set_wasm(env: soroban_sdk::Env, wasm: soroban_sdk::BytesN<32>) -> Result<(), Err>
Update admin address
fn set_admin(env: soroban_sdk::Env, new: soroban_sdk::Address) -> Result<(), Err>
Extend contract TTL
fn extend_ttl(env: soroban_sdk::Env, threshold: u32, extend_to: u32)
Withdraw collected fees to admin
fn withdraw_fees(
env: soroban_sdk::Env,
to: soroban_sdk::Address,
amount: i128,
) -> Result<(), Err>