ProtocolRewardsPool
Last updated
Last updated
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
from totalSupply()
in the esLBR contract.
Getting stakedOf(user)
from balanceOf(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.
stake
Stakes LBR tokens.
Parameter | Type | Description |
---|---|---|
unstake
Unlocks esLBR and converts it to LBR.
Parameter | Type | Description |
---|---|---|
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.
Returns the amount of LBR that can be unlocked prematurely.
Returns the amount of LBR that can be claimed by the user.
Returns the amount of LBR that is reserved for vesting.
Returns the total amount of rewards earned by the _account
.
Claims the protocol rewards earnings for the caller.
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.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
amount
uint256
The amount of LBR tokens to stake.
amount
uint256
The amount of esLBR tokens to unstake.
user
address
The address of the user.
amount
uint256
The amount of esLBR to be purchased.
useEUSD
bool
Indicates if the purchase will be made using eUSD.
user
address
User address
user
address
User address
user
address
User address
_account
address
User address
amount
uint
The amount of rewards to be distributed.
tokenType
uint
The type of token (0 for peUSD, 1 for other stablecoins).