solhint

payable-fallback

Recommended Badge Category Badge Default Severity Badge warn

The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.

Description

When fallback is not payable you will not be able to receive ethers.

Options

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

Example Config

{
  "rules": {
    "payable-fallback": "warn"
  }
}

Examples

👍 Examples of correct code for this rule

Fallback is payable


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

👎 Examples of incorrect code for this rule

Fallback is not payable


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

Version

This rule was introduced in Solhint 2.0.0-alpha.0

Resources