On the function MathMasters::mulWadUp
, overflow from the multiplication of x * y
should result in the function reverting, however, this does not occur.
The overflow check of x * y
performed in MathMasters::mulWadUp
is:
if mul(y, gt(x, or(div(not(0), y), x)))
This check is flawed and will not detect overflows.
By inserting the following test in MathMasters.t.sol
And running forge test --mt testMulWadUpOverFlowCheckFuzz
we get that the function will return an invalid result when the expected behavior would be to revert.
The function will give an incorrect result instead of reverting, in the event of the multiplication of x * y
overflowing.
Foundry fuzzer.
To fix this issue it is recommended that the overflow check of x * y
in MathMasters::mulWadUp
be equal to the one found in MathMasters::mulWad
.
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.