DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: low
Valid

[L-1] Wrong points value for PointsDistributed event in distributePoints function

Vulnerability Details

The distributePoints() function calculates the correct amount of variables for points distribution and emits the PointsDistributed event. According to the documentation, the first argument of the event should be 'the total number of points distributed.' There is a storage variable that holds this number.

FjordPoints::distributePoints()
totalPoints = totalPoints.add(pointsPerEpoch * weeksPending);

However, instead of totalPoints, pointsPerEpoch is used as the points parameter.

FjordPoints::distributePoints()
emit PointsDistributed(pointsPerEpoch, pointsPerToken);

Impact

Frontend or other off-chain services may display incorrect values, potentially misleading users.

Tools Used

Manual

Recommendations

Use totalPoints instead of pointsPerEpoch.

@@ -244,7 +244,7 @@ contract FjordPoints is ERC20, ERC20Burnable, IFjordPoints {
totalPoints = totalPoints.add(pointsPerEpoch * weeksPending);
lastDistribution = lastDistribution + (weeksPending * 1 weeks);
- emit PointsDistributed(pointsPerEpoch, pointsPerToken);
+ emit PointsDistributed(totalPoints, pointsPerToken);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

distributePoints calls `emit PointsDistributed` with pointsPerEpoch, instead of totalPoints

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.