# custom-errors

# Description

Enforces the use of Custom Errors over Require and Revert statements

# Options

This rule does not require any options.

# Example Config

{
  "id": "custom-errors",
  "severity": "WARNING"
}

# Examples

# Good

Use Custom Errors

revert CustomErrorFunction();

Use of Custom Errors with arguments

revert CustomErrorFunction({ msg: "Insufficient Balance" });

# Bad

Use of require statement

require(userBalance >= availableAmount, "Insufficient Balance");

Use of plain revert statement

revert();

Use of revert statement with message

revert("Insufficient Balance");

# References