Initialize the contract
backstop - The backstop addressbackstop_token - The backstop token addresspool_factory_address - The pool factory addressAlreadyInitializedError - If the contract has already been initializedfn initialize(
env: soroban_sdk::Env,
backstop: soroban_sdk::Address,
backstop_token: soroban_sdk::Address,
pool_factory_address: soroban_sdk::Address,
)
Fetch data for a bootstrap
id - The id of the bootstrapfn get_bootstrap(env: soroban_sdk::Env, id: u32) -> Bootstrap
Fetch the next bootstrap's ID. The previous (and most recently created) bootsrap's ID will be this value decremented by 1.
fn get_next_id(env: soroban_sdk::Env) -> u32
Fetch a deposit for a user in a bootstrap
id - The id of the bootstrapuser - The address of the userfn get_deposit(
env: soroban_sdk::Env,
id: u32,
user: soroban_sdk::Address,
) -> DepositData
Add a new bootstrap
Returns the ID of the bootstrap
config - The configuration for the bootstrapfn bootstrap(env: soroban_sdk::Env, config: BootstrapConfig) -> u32
Join a bootstrap by depositing a given amount of pair tokens
Returns the total amount of pair tokens deposited by from in this bootstrap
from - The address of the user joining the bootstrapid - The bootstrap id to joinamount - The amount of tokens to join withfn join(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
id: u32,
amount: i128,
) -> i128
Exits a bootstrap by withdrawing a given amount of pair tokens
Returns the remaining amount of pair tokens deposited by from in this bootstrap
from - The address of the user joining the bootstrapid - The bootstrap id to joinamount - The amount of tokens to join withfn exit(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
id: u32,
amount: i128,
) -> i128
Close the bootstrap by depositing bootstrapping tokens into the comet
id - The id of the bootstrapfn close(env: soroban_sdk::Env, id: u32) -> i128
Claim and deposit pool tokens into backstop
Returns the amount of backstop shares minted
from - The address of the user claiming their bootstrap proceedsid - The address of the bootstrap initiatorfn claim(env: soroban_sdk::Env, from: soroban_sdk::Address, id: u32) -> i128
Refund funds from a cancelled bootstrap
Returns the amount of funds returned
from - The address of the user claiming their bootstrap proceedsid - The address of the bootstrap initiatorfn refund(env: soroban_sdk::Env, from: soroban_sdk::Address, id: u32) -> i128