The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.
Enforces the use of Custom Errors over Require and Revert statements
This rule accepts a string option of rule severity. Must be one of “error”, “warn”, “off”. Default to error.
{
"rules": {
"custom-errors": "error"
}
}
revert CustomErrorFunction();
revert CustomErrorFunction({ msg: "Insufficient Balance" });
require(userBalance >= availableAmount, "Insufficient Balance");
revert();
revert("Insufficient Balance");
This rule was introduced in Solhint 3.7.0-rc02