Contract 1fd5d59a8705d1658ccc16d7b8eeba3716c945abcd7e56947b77440f962c1cd0

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 23.4.0#673d6c4f2368d282d25da29bda55c21b8be69ca6
rsver 1.90.0

Instances

  • CAL4VHBDGF4LF24KKFDZ7ID3DPFLUF26WY6A5VYM2EHZOX7Y5P2C722Y

Interface

Constructs an account-controlled insurance fund contract

fn __constructor(env: soroban_sdk::Env, admin: soroban_sdk::Address)

Sets an insured market contract address in the storage

fn set_market(
    env: soroban_sdk::Env,
    market: soroban_sdk::Address,
) -> Result<(), ContractError>

Returns

Request with given request_id if exists

fn get_request(env: soroban_sdk::Env, request_id: u64) -> Option

Withdraws tokens, respecting the locked liquidity needed for pending claims

Panics

If the fund does not have enough free liquidity for available for withdraw

fn withdraw(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    to: soroban_sdk::Address,
    amount: i128,
)

Marks existing request as ready and locks the liquidity

Panics

If the fund does not have enough free liquidity to cover this request

fn mark_ready(env: soroban_sdk::Env, request_id: u64, covered_amount: i128)

Updates market status (Descriptive/Helper). Funds can decide that a market is not insured enough to proceed safely and update its status accordingly. Owned market admins can always overwrite this behavior

fn update_market_status(env: soroban_sdk::Env, new_status: u32)

Proposes a new fund's admin

fn propose_new_admin(
    env: soroban_sdk::Env,
    proposed_admin: soroban_sdk::Address,
) -> Result<(), ContractError>
fn accept_proposed_admin(env: soroban_sdk::Env) -> Result<(), ContractError>
fn add_reserves(env: soroban_sdk::Env, token: soroban_sdk::Address, amount: i128)
fn request_coverage(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
    amount: i128,
) -> IssueRequestResult
fn get_status(env: soroban_sdk::Env, request_id: u64) -> Option
fn claim_coverage(env: soroban_sdk::Env, request_id: u64) -> i128
fn cancel(env: soroban_sdk::Env, request_id: u64)

Imports

WebAssembly Text (WAT) ▶