The mulWadUp
performs unnecessary round up.
The assembly operation in line 56 of MathMasters.sol
results in true even when x is equal to y. Valid round up operations is included on line 57, iszero(iszero(mod(mul(x, y), WAD)))
.
The test below represents the case when mulWadUp
rounds up the result even when x is equal to y.
Add the test in MathMasters.t.sol
and run forge test -vvvv --mt testMulWadUpWithUnnecessaryRoundUp
to see the result.
Unnecessary round up leads to losses in the context of calculating token amount.
Foundry
Delete line 56.
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.