The function selector, functions are reverting with, is not the intended one of the error MathMasters__MulWadFailed()
.
Both functions are indicating that in case of overflow, they will revert with the function selector of the error MathMasters__MulWadFailed()
, but instead of that they revert with the function selector of the MulWadFailed()
error located in the Solady library (https://github.com/vectorized/solady/blob/main/src/utils/FixedPointMathLib.sol#L69).
Business logic in third-party contracts may depend on matching the reverted reason with the function selector of the error MathMasters__MulWadFailed()
, which could lead to unexpected results if the error is not successfully caught and properly handled.
With the command cast sig
, we can find the function selector of any function or custom error.
Executing cast sig "MathMasters__MulWadFailed()"
shows that the output is 0xa56044f7
, a function selector different from the one used in the codebase (0xbac65e5b
).
Manual review
Foundry
cast
We should replace the function selector 0xbac65e5b
with the function selector of the error MathMasters__MulWadFailed()
, which is 0xa56044f7
.
Recommended changes to the MathMasters.sol::mulWad()
function:
Recommended changes to the MathMasters.sol::mulWadUp()
function:
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.