-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Require Statements Revert Custom Errors #13312
Comments
Related: #7877 (comment) We considered this but so far we could not agree on a good syntax. |
(I'm sorry to revive a closed thread, but...) Not being able to use I don't know how hard it would be to implement or if there are any considerations that are being left out, but moving forward with a proposal like the one described in #7877 (comment) would be very much appreciated. |
I would like this revisited as well please because I believe it is a safety issue. Most dev don't use the braces around the if-statement when using Naturally I tried to do In any case, please reconsider due to the risks of allowing braces in an if-statement to be optional which is what most devs are resorting to which doesn't really guard the code after it like |
|
FEATURE REQUEST
Abstract
The
require
are very helpful and easy to understand, but the problem withrequire
statements is that they store a string as an error message. And strings are not much gas optimized. To make the contract gas optimized we use custom errors withinif-else
statements. Which are not quite sometimes easy to understand especially when they get rooted in.Motivation
I think we can solve this problem by making
Require
statements revertCustom Error
instead of string.Check This:
Specification
IDk C++, I wish I could make a PR with this functionality.
Backwards Compatibility
N/A
The text was updated successfully, but these errors were encountered: