-
Notifications
You must be signed in to change notification settings - Fork 979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid handling of try-catch code #982
Comments
It looks that slither does not handle Solidity try-catch properly. Issue reported: crytic/slither#982
It looks that slither does not handle Solidity try-catch properly. Issue reported: crytic/slither#982
Ran into this as well. The try expression triggers an "unused return value" warning, even though it is assigned to a variable and used. Another reproduction: // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
interface Foo {
function foo() external returns (uint);
}
contract Test {
function test(Foo a) external returns (uint y) {
try a.foo() returns (uint x) {
y = x;
} catch {}
}
}
|
Got this same issue from using the Openzeppelin ERC721 library contract. It seems odd that slither is reporting errors in my dependencies - is this intentional? Is there any way to configure it to only check the primary sources and not deps? |
You can use the filter_paths parameter to filter out openzeppelin contracts. I use json config file, and it's as simple as adding "filter_paths": "openzeppelin" to it. |
Yep, I figured that out thanks. Seems like a strange design choice to include dependencies by default though. |
seems related or same as #511 |
Bumping this, we're facing the same issue 👍 |
Please consider the following code:
Slither says:
This is a pretty standard try-catch block from Solidity.
The text was updated successfully, but these errors were encountered: