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 warn.
{
"rules": {
"gas-custom-errors": "warn"
}
}
revert CustomErrorFunction();
revert CustomErrorFunction({ msg: "Insufficient Balance" });
require(userBalance >= availableAmount, "Insufficient Balance");
revert();
revert("Insufficient Balance");
This rule was introduced in Solhint 4.5.0