LogoLogo
AppAbout
  • 🙂Meet TokensFarm
  • Overview
    • 💻Our Products
    • ⚙️Features
    • 🚀Launch a Farm for Your Project
    • 🔏Using Gnosis Safe
  • For Developers
    • TokensFarmSDK
      • Getters
      • Setters
      • Parameters
      • ISDK.sol
      • Deposit
      • Withdraw
    • Integrate TokensFarm
      • Requesting Farm Data
      • Get Farm Address and Full Details
      • Monitoring a Farm's Status
      • Deposit into a farm
      • Withdraw from a farm
      • TokensFarm Contract Interface
      • How to integrate TokensFarmSDK
      • How to Embed TokensFarm
      • Getters of TokensFarm Contract
    • PerpetualTokensFarmSDK
      • Getters
      • Setters
      • Parameters
      • ISDK.sol
      • Deposit
      • Withdraw
    • PerpetualTokensFarm
      • Getters
      • Setters
      • Parameters
      • Deposit
      • Withdraw
  • About
    • 🔉Social Media
    • 🏢About DcentraLab
    • ❓FAQ
    • 📜Tokensfarm Audits
    • 📞Support
    • ⚖️Legal
Powered by GitBook
On this page

Was this helpful?

  1. For Developers
  2. PerpetualTokensFarmSDK

Withdraw

WITHDRAW SYSTEM :

  • If yours project wants to take a fee or report unstake from stake of specific user you need to call ISDK(farmAddress).noticeReducedStakeWithoutStakeId

function noticeReducedStakeWithoutStakeId(  
    address _user,   
    uint256 _amount
)
  • Once the stake was updated to new state there is mapping called

    mapping(address => uint256) public totalPendingAmountForUser;

that after noticeReducedStakeWithoutStakeId was called, contains newly collected rewards that stake that was updated was earning during staking time.

  • In order for user to collect those collected rewards from totalPendingAmountForUser he can call directly from contract TokensFarmSDK.withdrawRewards(msg.sender) or you can execute withdraw from contract admin through ISDK(farmAddress).withdrawRewards(addressOfUser)

PreviousDepositNextPerpetualTokensFarm

Last updated 2 years ago

Was this helpful?