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

`Incorrect use` of function selector in `mulWad` function.

Summary

  • The function selector for the mulWad function is incorrect. The function selector for the mulWad function is 0xfb4e5e87. When we look at the this, we see that the function selector for the mulWad function is not in the Ethereum 4byte directory. So, we rename the function to work as expected.

Vulnerability Details

  • The function selector for the mulWad function is 0xfb4e5e87 which is not in the Ethereum 4byte directory. This means that the mulWad function will not be called correctly and will not work as expected.

  • To calculate the correct function selector from the function signature we can use this

  • To check the function selector present in the Ethereum 4byte directory we can use this

function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z) // giving function selector 0xfb4e5e87

Impact

  • mulWad function will not be called correctly and will not work as expected.

Tools Used

  • Manual Review

Recommendations

  • We rename the function to work as expected.

  • mulWadDown giving function selector 0xe524f849 which is present in the Ethereum 4byte directory

- function mulWad(uint256 x, uint256 y) internal pure returns (uint256 z)
+ function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256 z)
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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