Skip to content

Conversation

@transmissions11
Copy link
Owner

@transmissions11 transmissions11 commented Aug 7, 2023

Description

"For "a*b" on signed integer, there is a specific edge case, where "a == -1", and "b == min int256", where "-b" does not fit into the representation, and thus the multiplication should revert (overflow)" - @montyly

Credit to @milotruck and @magnetto90 for discovering this bug!

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Ran forge snapshot?
  • Ran npm run lint?
  • Ran forge test?

Pull requests with an incomplete checklist will be thrown out.

@transmissions11 transmissions11 changed the title ✅ Edge case 🐛 Fix edge case in SignedWadMath Aug 7, 2023
@transmissions11 transmissions11 merged commit 2e27e00 into main Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants