Closed CedarMist closed 4 days ago
Hi @CedarMist, this feature is already supported in Solidity v0.8.26 in via-ir
codegen pipeline (you can read more about it in our release blog post). And it was recently added to legacy codegen in https://github.com/ethereum/solidity/pull/15174, but it is not released yet, it will be available for legacy codegen in the next release.
My bad, I tried to search before submitting.
Glad to hear this will be in the upcoming release
The
require(cond, message);
syntax is nice and lets you think clearly about the restrictions you're enforcing because the condition is a positive (it's easier to think 'when this condition is true, do X', versus 'when this condition isn't true, do X').And custom errors are nice, because it lets you include additional contextual information along-side an error. However to raise custom errors you must invert the condition which can be slightly more annoying to think about.
I suggest that the second parameter of
require
be adjusted to either pass a message string or an expression which returns an Error type: