0

I have a low level call in my smart contract

    (bool success, ) = address.call{ value: amount * percentage / 100 }("");
    require(success, "some error");     

and is detected by slither.

[{
    "resource": "/home/.../path/.../MyContract.sol",
    "owner": "Slither",
    "severity": 2,
    "message": "Low level call in MyContract.function(string,uint8) (contracts/MyContract.sol#341-365):\n\t- (success) = address.call{value: amount * percentage / 100}() (contracts/MyContract.sol#353)",
    "startLineNumber": 341,
    "startColumn": 2,
    "endLineNumber": 342,
    "endColumn": 1
}]

The call is supposed to send ether to another smart contract fallback function. Whereas this is the recommended way by solidity to call fallback function, Slither hits a positive here.

https://solidity-by-example.org/call/

This is the recommended method to use when you're just sending Ether via calling the fallback function.

So, in order to remove the positive from audit reports, what should I do?

1 Answer 1

2

To ignore a finding, you can manually add a comment indicating that the next row should be disregarded

//slither-disable-next-line low-level-calls
(bool success, ) = address.call{ value: amount * percentage / 100 }("");
require(success, "some error");  

or by running Slither in triage mode

slither . --triage-mode

and idenfying all false positives. More details can be found in the docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.