Skip to content
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

[Bug]: detectors unused-import, solc-version and pragma ignore filter_paths config #2415

Open
cruzdanilo opened this issue Apr 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@cruzdanilo
Copy link

Describe the issue:

the detectors unused-import, solc-version and pragma report issues in files that should be filtered out by path, via filter_paths option.

Code example to reproduce the issue:

src/Contracts.sol:

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.25;

import { IMultiOwnerPlugin } from "modular-account/src/plugins/owner/IMultiOwnerPlugin.sol";

contract Contract {
  IMultiOwnerPlugin public plugin;
}

slither.config.json:

{
  "filter_paths": "lib/"
}

.gitsubmodules:

[submodule "lib/modular-account"]
  path = lib/modular-account
  url = https://github.com/alchemyplatform/modular-account

Version:

0.10.2

Relevant log output:

INFO:Detectors:
2 different versions of Solidity are used:
	- Version constraint ^0.8.22 is used by:
 		- lib/modular-account/src/interfaces/erc4337/UserOperation.sol#7
		- lib/modular-account/src/plugins/owner/IMultiOwnerPlugin.sol#18
	- Version constraint ^0.8.25 is used by:
 		- src/Contract.sol#2
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used
INFO:Detectors:
Version constraint ^0.8.22 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)
	- VerbatimInvalidDeduplication.
 It is used by:
	- lib/modular-account/src/interfaces/erc4337/UserOperation.sol#7
	- lib/modular-account/src/plugins/owner/IMultiOwnerPlugin.sol#18
Version constraint ^0.8.25 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)
.
 It is used by:
	- src/Contract.sol#2
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-versions-of-solidity
INFO:Detectors:
The following unused import(s) in lib/modular-account/src/plugins/owner/IMultiOwnerPlugin.sol should be removed:
	-import {UserOperation} from "../../interfaces/erc4337/UserOperation.sol"; (lib/modular-account/src/plugins/owner/IMultiOwnerPlugin.sol#20)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unused-imports
INFO:Slither:. analyzed (2 contracts with 95 detectors), 4 result(s) found
@cruzdanilo cruzdanilo added the bug-candidate Bugs reports that are not yet confirmed label Apr 9, 2024
cruzdanilo added a commit to exactly/webauthn-owner-plugin that referenced this issue Apr 10, 2024
cruzdanilo added a commit to exactly/webauthn-owner-plugin that referenced this issue Apr 10, 2024
cruzdanilo added a commit to exactly/webauthn-owner-plugin that referenced this issue Apr 10, 2024
@0xalpharush 0xalpharush added bug Something isn't working and removed bug-candidate Bugs reports that are not yet confirmed labels Apr 15, 2024
@0xalpharush 0xalpharush changed the title [Bug-Candidate]: detectors unused-import, solc-version and pragma ignore filter_paths config [Bug]: detectors unused-import, solc-version and pragma ignore filter_paths config Apr 15, 2024
@zeGzD
Copy link

zeGzD commented May 6, 2024

More generally it seems slither.config.json is not used even if forced with the CLI option --config-file slither.config.json.

@0xalpharush
Copy link
Member

0xalpharush commented May 6, 2024

@zeGzD Can you open an issue with more info on what you're running into and how to reproduce please? This issue is related to the detector metadata not containing the file name and thus not getting filtered out, and it is not related to the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants