Contract 7e7d8965d08e60385b89e55999994effcc334f2923b2b20b2209b4581271fa60

← Back to Index 📥 Download WASM

Meta

rssdkver 21.7.7#5da789c50b18a4c2be53394138212fed56f0dfc4
rsver 1.97.0

Instances

  • CCNLL3EPYFNUXUZIQSPNWJUBUVPA7A2VGWMRJWO6E7SR43UT7UYCKVPB

Interface

Get user's current stage

fn get_stage(env: soroban_sdk::Env, user: soroban_sdk::Address) -> InviteStage

Transfer admin role

fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), InviteError>

Initialize the invite system

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    main_wallet: soroban_sdk::Address,
    token_contract: soroban_sdk::Address,
) -> Result<(), InviteError>

Get user's invite profile

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

Get sponsor of a user

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

Get total registered members

fn total_members(env: soroban_sdk::Env) -> u32

Walk up the invite tree (returns sponsors from gen1 to gen8)

fn get_invite_tree(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
) -> soroban_sdk::Vec

Register a new user with a sponsor If no sponsor provided (sponsor == user), auto-assign Main Wallet

fn register_invite(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
    sponsor: soroban_sdk::Address,
) -> Result<(), InviteError>

Update main wallet address (admin only)

fn set_main_wallet(
    env: soroban_sdk::Env,
    new_main: soroban_sdk::Address,
) -> Result<(), InviteError>

Get direct invitees of a user

fn get_direct_invites(
    env: soroban_sdk::Env,
    user: soroban_sdk::Address,
) -> soroban_sdk::Vec

Get commission tier configuration

fn get_commission_tiers(env: soroban_sdk::Env) -> CommissionTiers

Get stage thresholds

fn get_stage_thresholds(env: soroban_sdk::Env) -> StageThresholds

Update commission tiers (admin only)

fn set_commission_tiers(
    env: soroban_sdk::Env,
    tiers: CommissionTiers,
) -> Result<(), InviteError>

Update stage thresholds (admin only)

fn set_stage_thresholds(
    env: soroban_sdk::Env,
    thresholds: StageThresholds,
) -> Result<(), InviteError>

Distribute 8-generation commissions when a stake is activated Called by the card_staking contract or by admin

fn distribute_commission(
    env: soroban_sdk::Env,
    staker: soroban_sdk::Address,
    stake_amount: i128,
) -> Result, InviteError>

Imports

WebAssembly Text (WAT) ▶