Submitted by bart1e
https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L30-L32 https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L20 https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/ProtocolRewardsPool.sol#L73-L77
Im assuming that esLBR is distributed as a reward in StakingRewardsV2 - its not clear from the docs. But rewardsToken is of type IesLBR and in order to calculate boost for rewards esLBRBoost contract is used, so I think that its a reasonable assumption.
The esLBR token has a total supply of 100 000 000 and this is enforced in the esLBR contract:
However, the StakingRewardsV2 contract which is approved to mint new esLBR tokens doesnt enforce that new tokens can always be minted.
Either due to admin mistake (its possible to call StakingRewardsV2::notifyRewardAmount with arbitrarily high _amount, which is not validated; its also possible to set duration to an arbitrarily low value, so rewardRatio may be very high), or by normal protocol functioning, 100 000 000 of esLBR may be finally minted.
If that happens, no user will be able to claim their reward via getReward, since mint will revert. It also wont be possible to stake esLBR tokens in ProtocolRewardsPool or call any functions that use esLBR.mint underneath.
Lack of the possibility to stake esLBR is impacting important functionality of the protocol, while no possibility to withdraw earned rewards, this is a loss of assets for users.
From Code4Rena docs:
Here, assets definitely can be lost. Also, while it could happen because of a misconfiguration by the admin, it can also happen naturally, since esLBR is inflationary and there is no mechanism that enforces the supply being far enough from the max supply. The only thing that could be done to prevent it is that the admin would have to calculate the current supply, analyse the number of stakers, control staking boosts, and set reward ratio accordingly, which is hard to do and error prone.
Since assets can be lost and there arent any needed external requirements here (and it doesnt have hand-wavy hypotheticals, in my opinion), Im submitting this finding as High.
Number of reward tokens that users get is calculated here: https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/stakerewardV2pool.sol#L106-L108
Users can get their rewards by calling getReward: https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/stakerewardV2pool.sol#L111-L118
There is no mechanism preventing too high rewardRatio when its set: https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/miner/stakerewardV2pool.sol#L132-L145
mint will fail on too high supply: https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L30-L36
Users wont be able to claim acquired rewards, which is a loss of assets for them.
VS Code
Do one of the following:
ERC20
LybraFinance acknowledged
0xean (judge) decreased severity to Low and commented:
0xean (judge) increased severity to Medium and commented:
