Skip to main content
Additional ways to suppress warning
Source Link
Milk
  • 477
  • 3
  • 11

The line is there to suppress a compiler warning. Without it you get:

Warning (9302): Return value of low-level calls not used.

The line (success); indicates to the compiler that you are "using" the variable. However, the compiler will optimise this line out of the compiled code so it actually does nothing.

(Adding this as the accepted answer as the other answers do not answer the question. They explain what the variable success does and why you should check it's value. They do not explain what the line (success); does or why it is there.)

Another possible way to suppress this warning is by wrapping the call statement in brackets. See this issue comment for details or as below.

(payable(msg.sender).call{
    value: missingAccountFunds,
    gas: type(uint256).max
(""));

The line is there to suppress a compiler warning. Without it you get:

Warning (9302): Return value of low-level calls not used.

The line (success); indicates to the compiler that you are "using" the variable. However, the compiler will optimise this line out of the compiled code so it actually does nothing.

(Adding this as the accepted answer as the other answers do not answer the question. They explain what the variable success does and why you should check it's value. They do not explain what the line (success); does or why it is there.)

The line is there to suppress a compiler warning. Without it you get:

Warning (9302): Return value of low-level calls not used.

The line (success); indicates to the compiler that you are "using" the variable. However, the compiler will optimise this line out of the compiled code so it actually does nothing.

(Adding this as the accepted answer as the other answers do not answer the question. They explain what the variable success does and why you should check it's value. They do not explain what the line (success); does or why it is there.)

Another possible way to suppress this warning is by wrapping the call statement in brackets. See this issue comment for details or as below.

(payable(msg.sender).call{
    value: missingAccountFunds,
    gas: type(uint256).max
(""));
Source Link
Milk
  • 477
  • 3
  • 11

The line is there to suppress a compiler warning. Without it you get:

Warning (9302): Return value of low-level calls not used.

The line (success); indicates to the compiler that you are "using" the variable. However, the compiler will optimise this line out of the compiled code so it actually does nothing.

(Adding this as the accepted answer as the other answers do not answer the question. They explain what the variable success does and why you should check it's value. They do not explain what the line (success); does or why it is there.)