Solhint

Solhint

Community Analyzer

Function order is incorrect SOLHINT-W1032

Style
Minor

Function order is incorrect.

Bad Practice

  1. Constructor is placed after other functions
    pragma solidity 0.4.4;
    
    
    contract A {
    
              function () public payable {}
              constructor() public {}
    
    }
    

Recommended

  1. Constructor is placed before other functions
    pragma solidity 0.4.4;
    
    
    contract A {
    
              constructor() public {}
              function () public payable {}
    
    }
    

Learn more

func-order on Solhint's documentation.