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)

Last updated