warning | layout | title |
---|---|---|
This is a dynamically generated file. Do not edit manually. |
default |
payable-fallback | Solhint |
The {"extends": "solhint:recommended"} property in a configuration file enables this rule.
When fallback is not payable and there is no receive function you will not be able to receive currency.
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn.
{
"rules": {
"payable-fallback": "warn"
}
}
- Solhint allows this rule to automatically fix the code with
--fix
option - Instead of having a fallback function to receive native currency it is recommended to code a receive() function [here]
function() public payable {}
fallback() external payable {}
function() {} function g() payable {}
fallback() {} function g() payable {}
This rule was introduced in Solhint 5.0.4