Contract d7430b0cc13a32e426511bcad059011445862cc79453d102dbabfed77a24385a

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.7#211569aa49c8d896877dfca1f2eb4fe9071121c8
rsver 1.81.0
source_repo github:yieldblox/backstop-manager

Instances

  • CBZUCS36UVRY4ZAHJIKUOGFZWOOK6SPZOIZIA25IOP47P5W6BMVUAEM5

Interface

Initialize the backstop manager

Arguments

  • owner - The address of the owner of the funds
  • manager - The address of the manager of the funds
  • bootstrapper - The address of the backstop bootstrapper contract
  • backstop_token - The address of the backstop token the manager can interact with. This is fixed as the backstop manager only supports the BLND-USDC LP token as the backstop token.
  • backstops - The addresses of the backstops the manager can interact with initially
  • pools - The addresses of the pools the manager can interact with initially

Errors

  • AlreadyInitializedError - The contract has already been initialized
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

Arguments

  • token - The address of the token to transfer
  • to - The address to transfer the tokens to
  • amount - The amount of tokens to transfer
fn transfer_token(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

(Only Owner) Set the manager for the contract

Arguments

  • manager - The address of the manager
  • scope - The scope of the manager. 0 = None, 1 = Low, 2 = High
fn set_manager(env: soroban_sdk::Env, manager: soroban_sdk::Address, scope: u32)

(Only Owner) Set the backstop bootstrapper contract

Arguments

  • bootstrapper - The address of the backstop bootstrapper contract
fn set_backstop_bootstrapper(env: soroban_sdk::Env, bootstrapper: soroban_sdk::Address)

(Only Owner) Set the list of valid backstops

Arguments

  • backstops - The addresses of the backstops the manager can interact with
fn set_backstops(
    env: soroban_sdk::Env,
    backstops: soroban_sdk::Vec,
)

(Only Owner) Set the list of valid pools

Arguments

  • pools - The addresses of the backstops the manager can interact with
fn set_pools(env: soroban_sdk::Env, pools: soroban_sdk::Vec)

(Manager, Low) Transfer tokens from the contract back to the owner

Arguments

  • token - The address of the token to transfer
  • to - The address to transfer the tokens to
  • amount - The amount of tokens to transfer
fn 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

Arguments

  • from - The caller of the function
  • backstop - The address of the backstop contract
  • pool_address - The address of the pool to claim from
  • min_lp_tokens_out - The minimum amount of backstop tokens to mint with emissions

Errors

If 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

Arguments

  • from - The caller of the function
  • backstop - The address of the backstop contract
  • pool_address - The address of the pool
  • amount - The amount of tokens to deposit
fn 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

Arguments

  • from - The address of the backstop contract
  • backstop - The address of the backstop contract
  • pool_address - The address of the pool
  • amount - The amount of shares to queue for withdraw
fn 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

Arguments

  • from - The caller of the function
  • backstop - The address of the backstop contract
  • pool_address - The address of the pool
  • amount - The amount of shares to dequeue
fn 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

Arguments

  • from - The caller of the function
  • backstop - The address of the backstop contract
  • pool_address - The address of the pool
  • amount - The amount of shares to withdraw
fn 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.

Arguments

  • from - The caller of the function
  • backstop_token - The address of the backstop token
  • pool_amount_out - The amount of pool shares to mint
  • max_amounts_in - The maximum amount of tokens to deposit
fn 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.

Arguments

  • from - The caller of the function
  • burn_amount - The amount of pool shares to burn
  • min_amounts_out - The minimum amount of tokens to receive
fn 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

Arguments

  • from - The caller of the function
  • bootstrap_id - The id of the bootstrapper
  • backstop - The address of the backstop the bootstrap is for
fn 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

Arguments

  • from - The caller of the function
  • bootstrap_id - The id of the bootstrapper
fn bb_refund_bootstrap(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    bootstrap_id: u32,
) -> i128

(Manager, High) Creates a Backstop Bootstrapping with BLND

Arguments

  • from - The caller of the function
  • bootstrap_token - The address of the bootstrap token
  • bootstrap_amount - The amount of tokens to bootstrap
  • pair_min - The minimum amount of pool shares to mint
  • duration - The duration of the bootstrapping period
  • pool_address - The address of the pool
fn 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

Imports

WebAssembly Text (WAT) ▶