The LinearDistributionIntervalDecrease
library in Solidity calculates rewards over time with linear distribution and interval decrease. Its main function, getPeriodReward
, computes rewards based on various parameters like initial amount, decrease amount, and time intervals.
A thorough review revealed a key oversight: the omission of startTime_
in the calculation of thirdPeriodReward_
within the getPeriodReward
function. This could result in inaccurate reward calculations for the final part of the distribution period. Additionally, the code's calculations involving divisions and multiplications might suffer from precision loss due to Solidity's integer arithmetic limitations. The library's reliance on block timestamps raises concerns about the potential impact of miner manipulation on these calculations.
The missing startTime_
parameter could lead to financial discrepancies in reward distribution. Precision issues might cause minor inaccuracies in the rewards, affecting distribution fairness. Reliance on timestamps could introduce vulnerabilities if miner manipulation affects critical calculations.
Manual Review
It's recommended to correct the thirdPeriodReward_
calculation by including startTime_
.
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.