solhint

func-order

Deprecated Badge Category Badge Default Severity Badge warn

This rule is deprecated

Description

Function order is incorrect.

Options

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

Example Config

{
  "rules": {
    "func-order": "warn"
  }
}

Examples

👍 Examples of correct code for this rule

Constructor is placed before other functions


      pragma solidity 0.4.4;
        
        
      contract A {
        
                constructor() public {}
                function () public payable {}
            
      }
    

👎 Examples of incorrect code for this rule

Constructor is placed after other functions


      pragma solidity 0.4.4;
        
        
      contract A {
        
                function () public payable {}
                constructor() public {}
            
      }
    

Version

This rule was introduced in Solhint 2.0.0-alpha.0

Resources