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
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