Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Valid

Use of incorrect error selector

Description: The MathMasters::mulWad & MathMasters::mulWadUp functions uses an incorrect selector(0xbac65e5b) for MathMasters::MathMasters__MulWadFailed error.

Impact: low, as specified by the MathMasters Documentation

POC:
0xbac65e5b is not the selector for MathMasters::MathMasters__MulWadFailed that would be 0xa56044f7

function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z) {
// @solidity memory-safe-assembly
assembly {
// Equivalent to `require(y == 0 || x <= type(uint256).max / y)`.
if mul(y, gt(x, div(not(0), y))) {
@> mstore(0x40, 0xbac65e5b) // `MathMasters__MulWadFailed()`.
revert(0x1c, 0x04) //
}
z := div(mul(x, y), WAD)
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Wrong error selector

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.