solhint

comprehensive-interface

Category Badge Default Severity Badge warn

Description

Check that all public or external functions are override. This is iseful to make sure that the whole API is extracted in an interface.

Options

This rule accepts a string option of rule severity. Must be one of “error”, “warn”, “off”. Default to warn.

Example Config

{
  "rules": {
    "comprehensive-interface": "warn"
  }
}

Examples

👍 Examples of correct code for this rule

All public functions are overrides

pragma solidity ^0.7.0;

contract Foo is FooInterface {
  function foo() public override {}
}

👎 Examples of incorrect code for this rule

A public function is not an override

pragma solidity ^0.7.0;

contract Foo {
  function foo() public {}
}

Version

This rule was introduced in Solhint 3.3.0

Resources