The core issue lies in the calculation of totalDollars
in the getTotalRecapDollarsNeeded
function. The expression used in the code is:
Incorrect Calculation:
The current expression effectively cancels out the operations, resulting in totalDollars
remaining unchanged.
For instance, given totalDollars = 1000000
:
totalDollars / 1e6 * 1e6
results in 1000000
, which does not modify the value as intended.
Correct Calculation:
The intended operation seems to be scaling down totalDollars
for precision purposes. The correct way to perform this operation would be:
The incorrect calculation causes erroneous values in the logic where totalDollars
is used, particularly affecting the redemption logic in getPenalizedUnderlying
.
Manual Review
Fix the Calculation in getTotalRecapDollarsNeeded
:
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.