Contract 9f9b1f8baf9be725465e23a8bf1d864af480a2e8ff6b15de2aaec8924835ccae

← Back to Index 📥 Download WASM

Meta

cliver 25.2.0#
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.92.0

Instances

  • CD2GCABUASQQWQDEYMAVIZP7RPZSSOEHX4RBNUPA4PDRX4CVBHGVFF76

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=7d, 1=1m, 2=3m, 3=6m, 4=12m). 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

Minimum stake amount (BFAB stroops).

fn min_stake(env: soroban_sdk::Env) -> i128

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

Admin: update tier lock duration/APR without redeploying.

fn set_tier_config(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    tier_id: u32,
    config: TierConfig,
) -> Result<(), StakeError>

Admin: withdraw unused BFAB rewards from the reward pool.

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

Imports

WebAssembly Text (WAT) ▶