-
Notifications
You must be signed in to change notification settings - Fork 310
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
Convert SafeMath to use assert instead of require #312
Comments
Can I help on this? |
Hi @tabshaikh , thanks a lot for the offering! This issue is not a high priority now, for 2 reasons:
To change this, we should analyze first all the usages of Safe Math along our code base, and make sure that legit reverts like for instance due to user input are properly protected. If you still feel like you want to give it a try, I would be happy to review it and help. |
Then @bingen could me point to anything that's high priority would like to help and learn :) |
Generally speaking, at least for subtraction and division, we are not using SafeMath for input validation, so having underflows or zero divisions would likely mean a bug. Having
assert
instead ofrequire
would allow some of these bugs to be caught by tools like Echidna.Some references:
OpenZeppelin/openzeppelin-contracts#1120
https://media.consensys.net/when-to-use-revert-assert-and-require-in-solidity-61fb2c0e5a57
The text was updated successfully, but these errors were encountered: