Improved error handling style: assert -> require#778
Improved error handling style: assert -> require#778tholop wants to merge 1 commit intoOpenZeppelin:masterfrom tholop:fix/safemath-require
Conversation
|
Those asserts are invariants, and follow the documentation correctly :) |
|
Correct me if I'm wrong. Because |
|
@shrugs I disagree that those asserts are invariants.
|
|
I guess the correct thing I should have said is is they "should be invariants". But obviously they aren't because nobody is doing requires before calling safemath anyway. I've come around to your argument in #1120, so let's continue it there? |
🚀 Description
Replaced
assertconvenience function byrequirefollowing Solidity documentation's advice.Indeed, such exceptions can be reached even if the contract is correct, and are more a valid condition to be met.
This is not really an issue but a style improvement.
http://solidity.readthedocs.io/en/develop/control-structures.html#error-handling-assert-require-revert-and-exceptions
npm run lint:all:fix).