Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix edge case in SignedWadMath #380

Merged
merged 5 commits into from
Aug 7, 2023
Merged

🐛 Fix edge case in SignedWadMath #380

merged 5 commits into from
Aug 7, 2023

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.

1 participant