Able Pastel Lion - The bumpEarningPower
function can't change the depositId's earning power
#87
Labels
Won't Fix
The sponsor confirmed this issue will not be fixed
Able Pastel Lion
Medium
The
bumpEarningPower
function can't change the depositId's earning powerSummary
Vulnerability Detail
In the GovernanceStaker contract, users can stake their tokens and set a
_delegatee
address that earns rewards based on that. However, after some time, the_delegatee
may become ineligible for earning power. When a user claims their rewards, the_delegatee
may become eligible again. The problem is that thebumpEarningPower
function cannot change this depositId's earning power becausedeposit.scaledUnclaimedRewardCheckpoint
will always be zero. This means that the delegatee has the voting power, but the staker cannot earn rewards. This breaks the invariant of bumpEarningPower that states that when a qualifying change in the earning power is returned by the earning power calculator, the deposit's earning power should be updated.Impact
The delegatee has the voting power, but the staker cannot earn rewards.
Code Snippet
https://github.com/sherlock-audit/2024-11-tally/blob/main/staker/src/GovernanceStaker.sol#L462-L514
Tool used
Manual Review
Recommendation
The text was updated successfully, but these errors were encountered: