Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Improper use of assert() in BasicToken and other places #435
So, when sender's balance is insufficient, assert will fail and execution will be aborted. According to Solidity docs:
but insufficient sender's balance is not internal error, so
and insufficient sender's balance is neither malformed input, not error in external component. So the best fit would be to use
@mikhail-vladimirov sorry to disagree, require is meant to be used for validations, while assert should be used in order to prevent conditions which should never be possible, in this case, we are preventing an overflow.
I highly recommend this article, a detailed explanation about this subject.
Sorry to re-vitalize this old issue but I agree @3sGgpQ8H and @frangio.
The asserts in SafeMath are implicitly performing input validation and IMO should be replaced by