solhint

no-unchecked-calls

Recommended Badge Category Badge Default Severity Badge warn

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

Description

Check return value of low-level calls (call, staticcall, delegatecall).

Options

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

Example Config

{
  "rules": {
    "no-unchecked-calls": "warn"
  }
}

Notes

Examples

👍 Examples of correct code for this rule

Return value of low-level call checked with tuple assignment

(bool success, ) = addr.call(data);
(bool success, bytes memory result) = addr.call(data);
if(addr.call(data)) {}
require(addr.call(data));
assert(addr.call(data));

👎 Examples of incorrect code for this rule

Return value of low-level call ignored

addr.call(data);
addr.staticcall(data);
addr.delegatecall(data);
addr.call{value: 1 ether}("");
addr.call.value(1)();

Version

This rule was introduced in the latest version.

Resources