Javsphere Docs
Open AppJoin Trading Competition
  • Open Javsphere App
  • Welcome to Javsphere
  • Javsphere Stats
  • Fundamentals
    • Javsphere Set Up
      • Base Chain
      • Connect Wallet
      • Add Tokens
      • New to Crypto
    • Buy & add JAV
  • Products
    • LeverageX
      • Assets
        • Cryptocurrencies
        • Stocks
        • Forex
        • Commodities
      • Fees & Spread
      • Trader
        • Open Trade
        • Edit & Close Trade
      • Earn LLP Pool
        • Buy LLP
        • LLP Price & APY
      • xJAV Vault
        • FAQ
      • Limitations
      • Testing
      • Trading Competitions
      • Referral
    • StakeX
    • CryoVault
  • Trading Competitions
    • Current Competition
      • Create Profile
      • Create Community
      • Old competitions
        • Competition Vol. 3
        • Competition Vol. 2
        • Competition Vol. 1
        • Tournament
    • Zealy Campaign
      • Old Airdrops
        • Infinity Pass
        • CFR
        • UPT
        • DTL
        • RNG
        • DPM & Baby Dana
        • GRWV
    • Become a Sponsor
  • JAV Token
    • Utility
    • Whitepaper
      • Javsphere and JAV Token
        • JAV Token
          • Javsphere Fee Structure
          • Tokenomics
        • Added Value for Holders
        • Javsphere Technology
          • StakeX
          • CryoVault
          • LeverageX
      • Disclaimer
    • Governance
      • Onchain Proposals
      • Migration to Base
      • Offchain Proposals
      • Submit a Proposal
    • Base Migration
    • JAV Burn
  • JAVLIS
    • The Ultimate AI Agent
      • Ecosystem
      • USPs
      • Boost for LeverageX
      • Business Model
      • Roadmap
      • Virtuals as Infrastructure
      • More than a hype
      • Hiring
    • Buy JAVLIS
  • Engineering
    • Oracle System
    • Smart Contracts
      • LeverageX
        • JavBorrowingFees
        • JavFeeTiers
        • JavPairsStorage
        • JavPriceAggregator
        • JavPriceImpact
        • JavReferrals
        • JavTradingInteractions
        • JavTradingProcessing
        • JavTradingStorage
        • JavBorrowingProvider
        • LLPToken
        • Feeds
      • JavPriceAggregator
      • JavFreezer
      • JavStakeX
    • Github
    • Bug Bounty Program
  • Community & More
    • Content Library
      • Logos
      • UI Mockups
    • Social Content
    • Socials
      • Telegram Guidelines
  • LEGAL
    • Privacy Policy
    • Terms of Use
      • Excluded Jurisdictions
    • Migration Terms
    • Cookie Policy
    • Trading Competition Terms
    • Bug Bounty Terms
Powered by GitBook
On this page
  • General Description
  • Contract State Variables
  • Core Functionalities

Was this helpful?

  1. Engineering
  2. Smart Contracts

JavStakeX

General Description

The JavStakeX contract is an upgradable staking platform designed to allow users to stake tokens in various pools and earn rewards. It incorporates features such as reward configuration, fee structures and integration with terms and conditions agreements.

Key Features:

  • Multi-token staking pools with adjustable reward parameters.

  • Dynamic pool creation and configuration.

  • Reward distribution with support for ERC20 tokens.

  • Integration with terms and conditions for user actions.

  • Burn mechanics for token handling.

  • Support for NFTs to boost rewards through the "Infinity Pass" feature.

Contract State Variables

Core Pool Structures:

  1. PoolInfo[] poolInfo: Stores details for each pool, such as:

    • Base and reward tokens.

    • Accumulated rewards per share.

    • Total shares in the pool.

  2. PoolFee[] poolFee: Defines fee structures for each pool, including deposit, withdraw, and claim fees.

  3. mapping(uint256 => mapping(address => UserInfo)) userInfo: Tracks user-specific staking information such as shares and reward debts.

  4. mapping(address => TokenPrecisionInfo) tokensPrecision: Holds precision configurations for base and reward tokens.

Core Functionalities

User Staking and Rewards

  1. stake(uint256 _pid, uint256 _amount): Allows users to stake tokens in a specific pool.

  2. unstake(uint256 _pid, uint256 _amount): Allows users to withdraw their staked tokens.

  3. claim(uint256 _pid): Claims rewards from a specific pool for the user.

  4. claimAll(): Claims rewards from all pools for the user.

Reward Distribution

  1. addRewards(uint256 _pid, uint256 _amount): Adds rewards to a specified pool. Only callable by the rewards distributor.

  2. pendingReward(uint256 _pid, address _user): Returns the pending reward amount for a user in a specific pool.

  3. apr(uint256 _pid): Calculates the annual percentage rate (APR) for a specific pool.

Migration and Burn Functions (will be deleted after base migration)

  1. burnTokens(uint256 _pid, address _holder): Burns all staked tokens of a user in a specified pool. Only callable by the migrator.

  2. makeMigration(uint256 _pid, uint256 _amount, address _holder): Facilitates token migration for a user. Only callable by the migrator.

Last updated 6 months ago

Was this helpful?