Contract 1bcf80cf878b2f8c323a6fac315aa091d645fa6e3e511eb706e32a0d05f5c1c2

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.92.0

Instances

  • CA7IABBKABHWTDP5GV2VFSGRNHS4ET45OIBCXWGOPTUTP67W3XKA7V4L

Interface

Admin getter.

fn admin(env: soroban_sdk::Env) -> soroban_sdk::Address

Claim accrued rewards without unstaking.

fn claim(env: soroban_sdk::Env, user: soroban_sdk::Address) -> Result

Stake amount BFAB into a tier (0=flex, 1=core, 2=prime). User must have approved the BFAB token transfer to this contract beforehand.

fn stake(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    amount: i128,
    tier_id: u32,
) -> Result<(), StakeError>

BFAB token address getter.

fn token(env: soroban_sdk::Env) -> soroban_sdk::Address

Unstake: return the user's staked BFAB after the lock period. Any unclaimed rewards are also sent.

fn unstake(env: soroban_sdk::Env, user: soroban_sdk::Address) -> Result<(), StakeError>

Get tier configuration.

fn get_tier(env: soroban_sdk::Env, tier_id: u32) -> TierConfig

Initialize the staking vault. admin — the address that can deposit rewards and manage the contract. bfab_token — the contract address of the BFAB SAC (Stellar Asset Contract).

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    bfab_token: soroban_sdk::Address,
) -> Result<(), StakeError>

Get a user's staking position. Returns None-equivalent if not staked.

fn get_position(env: soroban_sdk::Env, user: soroban_sdk::Address) -> StakePosition

Get global pool stats.

fn get_pool_info(env: soroban_sdk::Env) -> PoolInfo

Admin: deposit BFAB into the reward pool.

fn deposit_rewards(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    amount: i128,
) -> Result<(), StakeError>

Get pending rewards for a user (without claiming).

fn pending_rewards(env: soroban_sdk::Env, user: soroban_sdk::Address) -> i128

Imports

WebAssembly Text (WAT) ▶