💛
BETFIN DOCS
ABOUT BETFIN
ABOUT BETFIN
  • ⭐INTRO
  • 🎯TERMS & CONDITIONS OVERVIEW
  • 📗FAQ OVERVIEW
  • TOKENOMY
    • 🪙BET Token
      • 💛Buy BET token
    • 📊BET initial distribution
      • 📊Team Pool
      • 📊Partners Pool
      • 📊Airdrop Pool
      • 📊Affiliate Pool
      • 📊Bonus Pool
    • 💹Vesting & Unlock plan
    • 🔏Liquidity and lockups
      • Community lockup
      • Team.finance lockups
    • 📗Tokenomy FAQ
  • BETFIN GOVERNANCE
    • 📄Betfin Contract Addresses
      • 👀Verify contracts
    • 🏩Betfin governance
      • ⚙️Timelock Principle
      • ⚙️Multisignature (multisig) Principle
    • 👁️‍🗨️Internal Wallets & External Contracts
    • 📗General FAQ
  • SMARTCONTRACTS DESCRIPTION
    • 🌍Contracts Overview
    • 🤖Core
      • 🤖Partner
      • 🤖Tariff
    • 🤖Conservative Staking
      • 🤖Conservative Staking Pool
    • 🤖Dynamic Staking
      • 🤖Dynamic Staking Pool
    • 🤖Pass Contract
      • 🤖Affiliate Member
    • 🤖Affiliate Contract
      • 🤖Affiliate Fund
    • 🖥️Game Interface
    • 🖥️Bet Interface
    • 📟Predict Contract
      • 📟Predict Game
    • 📟Roulette
      • 📟Roulette Bet
    • 🐞Error Codes
  • AUDITS & BUG BOUNTY
    • ☢️Betfin security audits
    • 🔰Bug Bounty
    • 👷Report an Issue
  • For Developers
    • 💻Web Template
    • 📑Smart Contract Template
Powered by GitBook
On this page
  • Features
  • Variables
  • Functions
  1. SMARTCONTRACTS DESCRIPTION
  2. Dynamic Staking

Dynamic Staking Pool

The DynamicStakingPool smart contract is a versatile and secure solution for creating dynamic staking pools. This contract utilizes several OpenZeppelin libraries for added security and functionality, including AccessControl, ERC20, Math, and ReentrancyGuard.

Features

  • Dynamic Profit Distribution: Automatically distributes profits among stakers based on their stake in the pool.

  • Reentrancy Guard: Protects against reentrancy attacks, ensuring the security of transactions.

  • Access Control: Implements role-based access control, allowing only authorized addresses to perform certain actions.

  • Event Logging: Logs significant actions and changes through events for transparency and tracking.

Variables

  • duration: Duration of the staking pool.

  • startCycle: The start timestamp of the staking cycle.

  • totalStaked: Total amount of tokens staked in the pool.

  • totalProfit: Total profit earned by stakers.

Functions

  • getStakersCount(): Returns the number of stakers in the pool.

  • getStake(address staker): Returns the stake information for a specific staker.

  • isStaker(address staker): Checks if an address is a staker in the pool.

  • isFull(): Checks if the pool has reached its maximum capacity.

  • getClaimed(address staker): Returns the amount of profit claimed by a staker.

  • stake(address staker, uint256 amount): Allows an authorized role to add a stake for a staker.

  • withdraw(): Withdraws staked tokens and distributes profits at the end of the staking cycle.

  • profit(uint256 _profit): Records profit to be distributed among stakers.

  • loss(uint256 amount): Records a loss, reducing the real stake amount.

  • distributeProfit(): Distributes profits among stakers based on their stake.

PreviousDynamic StakingNextPass Contract

Last updated 1 year ago

🤖
🤖