Replies: 1 comment
|
Three ways to suppress it: 1. CLI flag (per run) slither . --exclude gas-strict-inequalities2. Config file (persistent) Add to {
"exclude_detectors": ["gas-strict-inequalities"]
}Slither picks this up automatically on every run. 3. Inline suppression (per line) // slither-disable-next-line gas-strict-inequalities
uint256 result = a >= b ? a : b;Option 2 is usually the cleanest if you want it off project-wide. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thank you for your work on providing such an awesome automated tooling to improve the quality of Solidity code!
Context
When I get the:
warning on line:
//slither-disable-next-line gas-strict-inequalities require(strBytes[i] >= "0" && strBytes[i] <= "9", "String contains non-numeric characters");I tried looking up the
DETECTOR_NAMEaccompanying thegas-strict-inequalitieswarning on this page. However I did not yet find the strict inequality warning. So instead I tried what I thought was the closest match://slither-disable-next-line incorrect-equality require(strBytes[i] >= "0" && strBytes[i] <= "9", "String contains non-numeric characters");Question
How can I (find how to) disable the
gas-strict-inequalitiesdetection on the next line?Answer
By looking at SolHint documentation instead of Slither documentation. My apologies for this sloppiness. I did not yet know how to delete this post.
All reactions