Contract 6f90cb9a0ee81cff03ef4aec7dbbea75eb065e79e6718d9ec27830459531e396

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.85.0

Instances

  • CBRQ4GDQHREK3RTRSNV26ALOHPD3VMYACPTUTTJMVH4OWOYK2VR2I6XO

Interface

Initialize the staking contract with configuration

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    xqbl_token: soroban_sdk::Address,
    xqbusd_contract: soroban_sdk::Address,
)

Stake XQBL for XQBUSD minting (Environmental Contribution) tier: 0 = no contribution, 1 = 0.1% tier, 2 = 0.5% tier

fn stake_for_minting(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    tier: u32,
    xqbusd_mint_amount: i128,
    project_id: u64,
) -> Result<(), soroban_sdk::Error>

Withdraw XQBL after 30-day lock period

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

Create new environmental project (admin only)

fn create_environmental_project(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    name: soroban_sdk::Symbol,
    co2_offset_tons: i128,
    funding_required: i128,
    verification_hash: soroban_sdk::Symbol,
) -> u64

Complete environmental project with government API verification

fn complete_project(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    project_id: u64,
    final_verification_hash: soroban_sdk::Symbol,
) -> Result<(), soroban_sdk::Error>

Monthly reward distribution (30% of FOBXX yields)

fn distribute_monthly_rewards(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    reward_pool_amount: i128,
) -> Result

Get user's stake position and calculated rewards

fn get_stake_position(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
) -> Option

Get environmental project details

fn get_project(env: soroban_sdk::Env, project_id: u64) -> Option

Get total staking statistics

fn get_staking_stats(env: soroban_sdk::Env) -> (i128, u64, i128)

Update FOBXX backing attestation (daily)

fn update_fobxx_attestation(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    backing_ratio: i128,
    attestation_hash: soroban_sdk::Symbol,
) -> Result<(), soroban_sdk::Error>

Imports

WebAssembly Text (WAT) ▶