There is a rounding adjustment in the mulWadUp
function, which appears to be unnecessary given the existing rounding logic. This additional rounding adjustment has been identified as the cause of an assertion failure during fuzz testing.
In the mulWadUp
function, the following code snippet is unnecessary:
This code attempts a rounding adjustment, but the existing rounding logic in the function effectively handles rounding up after the multiplication. The unnecessary adjustment is causing assertion failures during fuzz testing.
This unnecessary rounding adjustment is leading to assertion failures. However, in normal execution scenarios, it does not contribute to the correct functionality of the rounding process. Removing this unnecessary code will likely result in cleaner and more efficient code execution.
Make sure to configure foundry.toml runs = 1000000
Run the fuzz test on original code and you will get this result
Now remove/comment the unnecessary rounding code and run the fuzzer via cmd orge test --match-test testMulWadUpFuzz -vvvvv
Result:
Foundry fuzzing
The following recommendations are provided:
Remove Unnecessary Rounding Adjustment:
The unnecessary rounding adjustment code should be removed from the mulWadUp
function to streamline the logic and prevent assertion failures during fuzz testing.
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.