Initialize the backstop manager
fn __constructor(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
manager: soroban_sdk::Address,
admin_scope: u32,
bootstrapper: soroban_sdk::Address,
backstop_token: soroban_sdk::Address,
backstops: soroban_sdk::Vec,
pools: soroban_sdk::Vec,
)
Get owner
fn owner(env: soroban_sdk::Env) -> soroban_sdk::Address
Get manager
fn manager(env: soroban_sdk::Env) -> Manager
Get the backstop bootstrapper contract
fn backstop_bootstrapper(env: soroban_sdk::Env) -> soroban_sdk::Address
Get the backstops this contract can interact with
fn backstops(env: soroban_sdk::Env) -> soroban_sdk::Vec
Get the pools this contract can interact with
fn pools(env: soroban_sdk::Env) -> soroban_sdk::Vec
(Only Owner) Transfer tokens from the manager contract to another address
token - The address of the token to transferto - The address to transfer the tokens toamount - The amount of tokens to transferfn transfer_token(
env: soroban_sdk::Env,
token: soroban_sdk::Address,
to: soroban_sdk::Address,
amount: i128,
)
(Only Owner) Set the manager for the contract
manager - The address of the managerscope - The scope of the manager. 0 = None, 1 = Low, 2 = Highfn set_manager(env: soroban_sdk::Env, manager: soroban_sdk::Address, scope: u32)
(Only Owner) Set the backstop bootstrapper contract
bootstrapper - The address of the backstop bootstrapper contractfn set_backstop_bootstrapper(env: soroban_sdk::Env, bootstrapper: soroban_sdk::Address)
(Only Owner) Set the list of valid backstops
backstops - The addresses of the backstops the manager can interact withfn set_backstops(
env: soroban_sdk::Env,
backstops: soroban_sdk::Vec,
)
(Only Owner) Set the list of valid pools
pools - The addresses of the backstops the manager can interact withfn set_pools(env: soroban_sdk::Env, pools: soroban_sdk::Vec)
(Manager, Low) Transfer tokens from the contract back to the owner
token - The address of the token to transferto - The address to transfer the tokens toamount - The amount of tokens to transferfn refund_token(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
token: soroban_sdk::Address,
amount: i128,
)
(Manager, Low) Claim backstop deposit emissions from a list of pools for the contract
Returns the amount of BLND emissions claimed
from - The caller of the functionbackstop - The address of the backstop contractpool_address - The address of the pool to claim frommin_lp_tokens_out - The minimum amount of backstop tokens to mint with emissionsIf an invalid pool address is included
fn b_claim(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
backstop: soroban_sdk::Address,
pool_address: soroban_sdk::Address,
min_lp_tokens_out: i128,
) -> i128
(Manger, Medium) Deposit "amount" backstop tokens from the contract into the backstop for "pool_address"
Returns the number of backstop pool shares minted
from - The caller of the functionbackstop - The address of the backstop contractpool_address - The address of the poolamount - The amount of tokens to depositfn b_deposit(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
backstop: soroban_sdk::Address,
pool_address: soroban_sdk::Address,
amount: i128,
) -> i128
(Manager, Medium) Queue deposited pool shares from the contract for withdraw from a backstop of a pool
Returns the created queue for withdrawal
from - The address of the backstop contractbackstop - The address of the backstop contractpool_address - The address of the poolamount - The amount of shares to queue for withdrawfn b_queue_withdrawal(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
backstop: soroban_sdk::Address,
pool_address: soroban_sdk::Address,
amount: i128,
)
(Manager, Medium) Dequeue a currently queued pool share withdraw for the contract from the backstop of a pool
from - The caller of the functionbackstop - The address of the backstop contractpool_address - The address of the poolamount - The amount of shares to dequeuefn b_dequeue_withdrawal(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
backstop: soroban_sdk::Address,
pool_address: soroban_sdk::Address,
amount: i128,
)
(Manager, High) Withdraw shares from the contract's withdraw queue for a backstop of a pool
Returns the amount of tokens returned
from - The caller of the functionbackstop - The address of the backstop contractpool_address - The address of the poolamount - The amount of shares to withdrawfn b_withdraw(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
backstop: soroban_sdk::Address,
pool_address: soroban_sdk::Address,
amount: i128,
) -> i128
(Manager, High) Join the BLND-USDC LP.
from - The caller of the functionbackstop_token - The address of the backstop tokenpool_amount_out - The amount of pool shares to mintmax_amounts_in - The maximum amount of tokens to depositfn c_join_pool(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
pool_amount_out: i128,
max_amounts_in: soroban_sdk::Vec,
)
(Manager, High) Exit a backstop token's liquidity pool.
from - The caller of the functionburn_amount - The amount of pool shares to burnmin_amounts_out - The minimum amount of tokens to receivefn c_exit_pool(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
burn_amount: i128,
min_amounts_out: soroban_sdk::Vec,
)
(Manager, Low) Claims the proceeds of a backstop bootstrapping
from - The caller of the functionbootstrap_id - The id of the bootstrapperbackstop - The address of the backstop the bootstrap is forfn bb_claim_bootstrap(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
bootstrap_id: u32,
backstop: soroban_sdk::Address,
) -> i128
(Manager, Low) Refunds a cancelled backstop bootstrapping
from - The caller of the functionbootstrap_id - The id of the bootstrapperfn bb_refund_bootstrap(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
bootstrap_id: u32,
) -> i128
(Manager, High) Creates a Backstop Bootstrapping with BLND
from - The caller of the functionbootstrap_token - The address of the bootstrap tokenbootstrap_amount - The amount of tokens to bootstrappair_min - The minimum amount of pool shares to mintduration - The duration of the bootstrapping periodpool_address - The address of the poolfn bb_start_bootstrap(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
bootstrap_token_index: u32,
bootstrap_amount: i128,
pair_min: i128,
duration: u32,
pool_address: soroban_sdk::Address,
) -> u32