We have an edge case where no stakers exist in the FjordPoints contract, calling distributePoints() results in points accumulating and being awarded to the first staker. I believe it should rather be discarded.
Given how rewards are structured in the FjordStaking
contract, which aims to allocate rewards on an epoch basis to previous epoch stakers, the current implementation of FjordPoints deviates from this approach.
Presently, if no stakers are present, Points accumulate within the FjordPoints
contract and are granted to the first subsequent staker, rather than being forfeited for epochs without stakers. A fairer solution would be to forfeit Points for any epochs lacking stakers.
This accumulation of Points is facilitated by the following code:
Although the code correctly exits when totalStaked == 0
, it fails to update the lastDistribution
variable, resulting in unfair accumulation of Points.
From a user's perspective, this issue leads to new stakers unfairly receiving accumulated rewards from epochs with no stakers, creating an inequitable distribution and potential discouragement for early participation.
Manual Review
Modify the FjordPoints.distributePoints()
function to update the lastDistribution
variable when totalStaked == 0
, preventing unfair accumulation of Points.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.