Not logged in
SOROBAN • RUST • WASM

⛏️ Staking Contract

Lock & Earn Compound Rewards — OLIGHFT SMART COIN Platinum Tier

PLAT STAKE
OLIGHFT SMART COIN Staking Protocol
⛏️
Contract ID
CPLT9STK2QK3R5STAKF6EHJG9SVX2YLD
Network
Stellar Testnet
Base APY
8.5%
Max Boost
2.5x
SOROBAN RUNTIME v21
Total Staked
$6.8M
Stakers
3,412
Avg APY
12.1%

💰 Staking Tiers

🟢 Flex Stake
Lock PeriodNone
Base APY6.0%
Boost1.0x
Min Stake100 XLM
🔵 30-Day Lock
Lock Period30 days
Base APY8.5%
Boost1.5x
Min Stake500 XLM
🟣 90-Day Lock
Lock Period90 days
Base APY12.0%
Boost2.0x
Min Stake1000 XLM
🟡 180-Day Lock
Lock Period180 days
Base APY16.0%
Boost2.5x
Min Stake5000 XLM

📝 Contract Source

Rust — staking.rs
#![no_std]
use soroban_sdk::{
    contract, contractimpl, contracttype,
    Address, Env, token,
};

#[contracttype]
pub struct StakePosition {
    pub owner: Address,
    pub amount: i128,
    pub start_ledger: u32,
    pub lock_until: u32,
    pub reward_debt: i128,
    pub boost_multiplier: u32, // 100 = 1.0x
    pub auto_compound: bool,
}

#[contracttype]
pub struct PoolConfig {
    pub reward_token: Address,
    pub stake_token: Address,
    pub reward_per_ledger: i128,
    pub acc_reward_per_share: i128,
    pub total_staked: i128,
    pub last_update_ledger: u32,
}

#[contract]
pub struct PlatinumStake;

#[contractimpl]
impl PlatinumStake {
    /// Stake tokens with optional lock period
    pub fn stake(
        env: Env, user: Address,
        amount: i128, lock_days: u32,
        auto_compound: bool,
    ) -> StakePosition {
        user.require_auth();
        let boost = match lock_days {
            0 => 100,
            1..=30 => 150,
            31..=90 => 200,
            _ => 250,
        };
        // Transfer stake_token from user to contract
        // Update pool accumulators
        // Create position in persistent storage
        StakePosition { /* ... */ }
    }

    /// Compound accrued rewards back into stake
    pub fn compound(env: Env, user: Address) -> i128 {
        user.require_auth();
        // pending = (pos.amount * acc_reward_per_share) - pos.reward_debt
        // pos.amount += pending (compound rewards)
        // pos.reward_debt = pos.amount * acc_reward_per_share
        0 // returns compounded amount
    }

    /// Unstake tokens (must respect lock period)
    pub fn unstake(
        env: Env, user: Address, amount: i128,
    ) -> i128 {
        user.require_auth();
        assert!(env.ledger().sequence() >= pos.lock_until,
            "lock period active");
        // Claim pending rewards + withdraw stake
        0
    }

    /// Claim rewards without unstaking
    pub fn claim_rewards(env: Env, user: Address) -> i128 {
        user.require_auth();
        0
    }

    /// View pending rewards for a position
    pub fn pending_rewards(env: Env, user: Address) -> i128 { 0 }
}

⚙️ Contract Functions

FunctionDescriptionAuthGas (XLM)
stakeLock tokens with optional time boostUser~0.014
unstakeWithdraw after lock period expiresUser~0.012
compoundReinvest rewards into positionUser~0.010
claim_rewardsWithdraw accrued rewards to walletUser~0.010
pending_rewardsRead-only: check unclaimed rewardsNone~0.001
get_positionQuery user's stake detailsNone~0.001
get_pool_infoQuery pool TVL, APY, totalsNone~0.001
set_rewardsAdmin: update reward rate per ledgerAdmin~0.008

✨ Platinum Staking Features

🔒

Lock Boost

Up to 2.5x rewards for longer lock periods

BOOST
🔄

Auto-Compound

Reinvest rewards automatically each epoch

YIELD
📈

Per-Ledger Accrual

Rewards accumulate every 5-second ledger close

PRECISION

Instant Claim

Harvest rewards without touching principal

FLEXIBLE
🛡️

Lock Enforcement

On-chain lock prevents early withdrawal

SAFETY
📊

Transparent APY

Pool rewards and positions fully on-chain

AUDIT

💰 Platinum Staking Contract

Stake $300 to activate your Platinum tier and earn $18 daily rewards. Choose your contract period:

Activation Stake
$300
Daily Earnings
$18 / day
Service Fee
$120
Contract Period
3 Months
90 Days
Total Payout$1,620
Stake + Fee-$420
Net Profit
$1,200
POPULAR
Contract Period
6 Months
180 Days
Total Payout$3,240
Stake + Fee-$420
Net Profit
$2,820
BEST VALUE
Contract Period
1 Year
365 Days
Total Payout$6,570
Stake + Fee-$420
Net Profit
$6,150

⚡ Activate Platinum Staking

Select your contract period and enter your sponsor code to activate:
Required — commissions flow through 8-generation binary tree
You Pay
$420
$300 stake + $120 fee
Period
180 days
Net Profit
$2,820
Stellar Testnet • Transaction requires wallet signature

📋 How It Works

1
Stake $300 to Activate
Deposit $300 to activate your Platinum tier staking contract
2
Choose Your Period
Select 3 months (90 days), 6 months (180 days), or 1 year (365 days)
3
Earn $18 Daily
Receive $18 in rewards every day for your chosen contract period
4
$120 System Service Fee
A one-time $120 service fee is deducted for platform maintenance
5
Collect Your Rewards
3mo: $1,620 ($1,200 profit) • 6mo: $3,240 ($2,820 profit) • 1yr: $6,570 ($6,150 profit)

🌳 $300 Activation Fee Distribution — 8-Generation Binary Tree

When a user activates with $300, the fee is distributed across the 8-level upline binary tree:

GenerationRoleCommissionAmount
Main Wallet (Platform)$180
Gen 1Direct Inviter10%$30
Gen 2Inviter’s Inviter6%$18
Gen 3Upline Level 34%$12
Gen 4Upline Level 44%$12
Gen 5Upline Level 54%$12
Gen 6Upline Level 64%$12
Gen 7Upline Level 74%$12
Gen 8Upline Level 84%$12
TOTAL$300
🌳
Binary Tree Structure: Each user has 2 direct slots (left & right). Commissions flow upward through 8 generations. If an upline slot is empty, that generation’s commission rolls to the main wallet.

📜 Platinum Staking Contract Source

Rust — platinum_staking.rs
#[contracttype]
pub struct PlatStake {
    pub staker: Address,
    pub stake_amount: i128,      // $300 activation
    pub daily_reward: i128,      // $18 per day
    pub duration_days: u32,     // 90 | 180 | 365 days
    pub service_fee: i128,      // $120 platform fee
    pub sponsor: Address,       // direct inviter (Gen 1)
    pub start_time: u64,
    pub claimed_days: u32,
}

// 8-generation binary tree commission rates (in $)
const GEN_COMMISSIONS: [i128; 8] = [
    30_0000000, // Gen 1: $30 (direct inviter)
    18_0000000, // Gen 2: $18
    12_0000000, // Gen 3: $12
    12_0000000, // Gen 4: $12
    12_0000000, // Gen 5: $12
    12_0000000, // Gen 6: $12
    12_0000000, // Gen 7: $12
    12_0000000, // Gen 8: $12
];  // Total referral: $120 | Main wallet: $180 | Grand total: $300

#[contractimpl]
impl PlatinumStake {

    /// Activate Platinum staking — $300 deposit + $120 service fee
    /// $300 split: $180 main wallet + $120 across 8-gen binary tree
    /// duration: 90 (3mo) | 180 (6mo) | 365 (1yr)
    pub fn activate_stake(
        env: Env, staker: Address, sponsor: Address,
        duration: u32,
    ) {
        staker.require_auth();

        // Valid periods: 90 (3mo), 180 (6mo), 365 (1yr)
        assert!(duration == 90 || duration == 180 || duration == 365);

        let token = get_payment_token(&env);
        let tok = token::Client::new(&env, &token);
        let activation = 300_0000000; // $300
        let fee = 120_0000000;        // $120 service fee

        // Transfer $300 + $120 fee from user to contract
        tok.transfer(&staker, &env.current_contract_address(),
                     &(activation + fee));

        // ── Distribute $300 activation across binary tree ──
        let main_wallet = get_main_wallet(&env);
        let mut remaining = activation; // $300
        let mut current = sponsor.clone();

        for gen in 0..8 {
            let commission = GEN_COMMISSIONS[gen];
            if let Some(upline) = get_sponsor(&env, ¤t) {
                tok.transfer(
                    &env.current_contract_address(),
                    ¤t, &commission,
                );
                remaining -= commission;
                current = upline;
            } else {
                // No upline — remaining goes to main wallet
                break;
            }
        }

        // Send remainder ($180 or more) to main wallet
        tok.transfer(
            &env.current_contract_address(),
            &main_wallet, &remaining,
        );

        let stake = PlatStake {
            staker: staker.clone(),
            stake_amount: activation,
            daily_reward: 18_0000000,  // $18/day
            duration_days: duration,
            service_fee: fee,
            sponsor: sponsor.clone(),
            start_time: env.ledger().timestamp(),
            claimed_days: 0,
        };
        env.storage().persistent().set(&staker, &stake);
    }

    /// Claim accrued daily rewards
    pub fn claim_rewards(env: Env, staker: Address) -> i128 {
        staker.require_auth();
        let mut stake: PlatStake = env.storage().persistent().get(&staker).unwrap();

        let elapsed = (env.ledger().timestamp() - stake.start_time) / 86400;
        let claimable = elapsed.min(stake.duration_days as u64) as u32
                        - stake.claimed_days;

        let payout = (claimable as i128) * stake.daily_reward;
        stake.claimed_days += claimable;
        env.storage().persistent().set(&staker, &stake);

        // Transfer rewards to staker
        token::Client::new(&env, &get_payment_token(&env))
            .transfer(&env.current_contract_address(), &staker, &payout);
        payout  // 90d→$1,620 | 180d→$3,240 | 365d→$6,570
    }
}
FunctionDescriptionAuthCost
activate_stakeDeposit $300 + $120 fee, choose period (90/180/365 days)User$420 total
claim_rewardsClaim accrued $18/day rewardsUser~0.01 XLM
get_sponsorGet upline address for a given userNone~0.001 XLM

🧪 Unit Test

Rust — test.rs
#[test]
fn test_stake_and_compound() {
    let env = Env::default();
    env.mock_all_auths();
    let client = PlatinumStakeClient::new(&env,
        &env.register_contract(None, PlatinumStake));

    // Stake 10000 XLM for 90 days (2.0x boost)
    let pos = client.stake(&user, &10000_0000000, &90, &true);
    assert_eq!(pos.boost_multiplier, 200);

    // Advance 1000 ledgers (~83 minutes)
    env.ledger().set_sequence_number(1000);
    let pending = client.pending_rewards(&user);
    assert!(pending > 0);

    // Compound rewards back into position
    let compounded = client.compound(&user);
    assert!(compounded > 0);
    let new_pos = client.get_position(&user);
    assert!(new_pos.amount > 10000_0000000);
}
🏠 Home 💳 Wallet ⚙️ Admin 🔒 Login 🏆 Gold Token 💳 Visa Payment 🔄 MC DEX 🏛️ Amex DAO ⛏️ Plat Staking 🗄️ Black Vault

OLIGHFT SMART COIN Platinum Staking v1.5.0 • Stellar Testnet • Rust/WASM

Built with soroban-sdk 21.0.0 • April 2026

🔒 Verify Withdrawal

Confirm your identity before withdrawing funds
🔐 Google Authenticator