ProtocolRewardsPool
This contract is a derivative version of Synthetix StakingRewards.sol and is responsible for distributing protocol rewards to esLBR stakers and converting esLBR to LBR.
Differences from the original contract include:
Getting
totalStaked
fromtotalSupply()
in the esLBR contract.Getting
stakedOf(user)
frombalanceOf(user)
in the esLBR contract.Calling the
refreshReward
method when the esLBR balance of an address changes to update the rewards to be claimed.This contract includes the functionality to convert between esLBR and LBR tokens. When converting from esLBR to LBR, there is a gradual unlocking process over a period of time. Users are allowed to unlock in advance, but they will lose a portion of their esLBR tokens. These lost esLBR tokens can be purchased by other users using a small amount of LBR.
Functions
stake
Stakes LBR tokens.
unstake
Unlocks esLBR and converts it to LBR.
Requirements:
If the current time is less than the unlock time of the user's lock status in the esLBRBoost contract, the locked portion in the esLBRBoost contract cannot be unlocked.
reStake
Converts unredeemed and converting esLBR tokens back to LBR.
withdraw
Claim unlocked LBR on behalf of a user.
unlockPrematurely
Redeems and converts the esLBR being claimed in advance, with the lost portion being recorded in the contract and available for others to purchase in LBR at a certain ratio.
grabEsLBR
Purchases the accumulated amount of pre-claimed lost esLBR in the contract using LBR or eUSD.
getPreUnlockableAmount
Returns the amount of LBR that can be unlocked prematurely.
getClaimAbleLBR
Returns the amount of LBR that can be claimed by the user.
getReservedLBRForVesting
Returns the amount of LBR that is reserved for vesting.
earned
Returns the total amount of rewards earned by the _account
.
getReward
Claims the protocol rewards earnings for the caller.
notifyRewardAmount
Receives stablecoin tokens sent by the configurator contract and records the protocol rewards accumulation per esLBR held. This function is called by the configurator contract to distribute rewards. When receiving stablecoin tokens other than peUSD, the decimals of the token are converted to 18 for consistent calculations.
Last updated