Description:
A logic flaw in the epoch and locking mechanism can cause deposited rewards to be permanently locked and unclaimable in two scenarios:
-
Initial Epoch Issue: Rewards deposited via depositReward() during epoch 0 are stored in epochReward[0]. However, the lock() function always begins locking from currentEpoch() + 1 (epoch 1). Consequently, rewards for epoch 0 have no corresponding lock positions and are irretrievable.
-
Empty Previous Epoch Issue: For any epoch n, if there are zero active lockers from the previous epoch (n-1), then rewards deposited for epoch n will also be unclaimable, as there is no eligible stake to distribute them to.
Recommendation:
- Prevent
depositReward() from being called in epoch 0.
- Add a validation check to ensure there is existing eligible stake (
lockers from epoch n-1) before accepting rewards for epoch n.
Description:
A logic flaw in the epoch and locking mechanism can cause deposited rewards to be permanently locked and unclaimable in two scenarios:
Initial Epoch Issue: Rewards deposited via
depositReward()during epoch0are stored inepochReward[0]. However, thelock()function always begins locking fromcurrentEpoch() + 1(epoch1). Consequently, rewards for epoch0have no corresponding lock positions and are irretrievable.Empty Previous Epoch Issue: For any epoch
n, if there are zero active lockers from the previous epoch (n-1), then rewards deposited for epochnwill also be unclaimable, as there is no eligible stake to distribute them to.Recommendation:
depositReward()from being called in epoch0.lockersfrom epochn-1) before accepting rewards for epochn.