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

wrong memory pointer for error MathMasters__MulWadFailed, error pointing at incorrect memory position

Summary

The error message given for functions mulWad and mulWadUp when overflow is reached is generic. This is because the memory pointer in revert is wrong.

Vulnerability Details

none

Impact

Might make it harder to troubleshoot or the user may not know what going on.

message shown:

revert
The transaction has been reverted to the initial state.
Note: The called function should be payable if you send value and the value you send should be less than your current balance.
Debug the transaction to get more information.

Expected:

revert
The transaction has been reverted to the initial state.
Error provided by the contract:
MathMasters__MulWadFailed
Parameters:
{}

Tools Used

  • remix

  • foundry

Recommendations

- revert(0x1c, 0x04)
+ revert(0x40, 0x04)

This is because when storing the error, it is stored at 0x40, not 0x1c

Recommendations

mstore(0x40, 0xa56044f700000000000000000000000000000000000000000000000000000000)
Updates

Lead Judging Commences

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

Wrong error storage

Support

FAQs

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