From 5f5aacdde7083dddb34a8c9436b1c6026de90331 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Fri, 29 Mar 2024 21:27:59 -0500 Subject: [PATCH 1/2] feat: add detector for unused imports --- slither/detectors/all_detectors.py | 1 + slither/detectors/statements/unused_import.py | 77 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 slither/detectors/statements/unused_import.py diff --git a/slither/detectors/all_detectors.py b/slither/detectors/all_detectors.py index 4151759f0..ff1c352c3 100644 --- a/slither/detectors/all_detectors.py +++ b/slither/detectors/all_detectors.py @@ -98,3 +98,4 @@ from .operations.incorrect_exp import IncorrectOperatorExponentiation from .statements.tautological_compare import TautologicalCompare from .statements.return_bomb import ReturnBomb from .functions.out_of_order_retryable import OutOfOrderRetryable +from .statements.unused_import import UnusedImport diff --git a/slither/detectors/statements/unused_import.py b/slither/detectors/statements/unused_import.py new file mode 100644 index 000000000..9426e27a8 --- /dev/null +++ b/slither/detectors/statements/unused_import.py @@ -0,0 +1,77 @@ +from typing import List +from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification, Output + + +class UnusedImport(AbstractDetector): + """ + Detector unused imports. + """ + + ARGUMENT = "unused-import" + HELP = "Detects unused imports" + IMPACT = DetectorClassification.INFORMATIONAL + CONFIDENCE = DetectorClassification.HIGH + + WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-imports" + + WIKI_TITLE = "Unused Imports" + WIKI_DESCRIPTION = "Importing a file that is not used in the contract likely indicates a mistake. The import should be removed until it is needed." + + # region wiki_exploit_scenario + WIKI_EXPLOIT_SCENARIO = """ + ```solidity + import {A} from "./A.sol"; + contract B {} + ``` + B either should import from A and it was forgotten or the import is not needed and should be removed. + """ + # endregion wiki_exploit_scenario + WIKI_RECOMMENDATION = ( + "Remove the unused import. If the import is needed later, it can be added back." + ) + + def _detect(self) -> List[Output]: + results: List[Output] = [] + # This is computed lazily and then memoized so we need to trigger the computation. + self.slither._compute_offsets_to_ref_impl_decl() + + for unit in self.slither.compilation_units: + for filename, scope in unit.scopes.items(): + unused = [] + for i in scope.imports: + # `scope.imports` contains all transitive imports so we need to filter out imports not explicitly imported in the file. + # Otherwise, we would recommend removing an import that is used by a leaf contract and cause compilation errors. + if i.scope != scope: + continue + + import_path = self.slither.crytic_compile.filename_lookup(i.filename) + + use_found = False + # Search through all references to the imported file + for _, refs in self.slither._offset_to_references[import_path].items(): + for ref in refs: + # If there is a reference in this file to the imported file, it is used. + if ref.filename == filename: + use_found = True + break + + if use_found: + break + + if not use_found: + unused.append(f"{i.source_mapping.content} ({i.source_mapping}") + + if len(unused) > 0: + unused_list = "" + for i in unused: + unused_list += f"\n\t-{i}" + + results.append( + self.generate_result( + [ + f"The following unused import(s) in {filename.used} should be removed: {unused_list}\n", + ] + ) + ) + + return results From 098851cbd2e4894b84cf913cd098517e8391be0b Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Sun, 7 Apr 2024 15:42:04 -0500 Subject: [PATCH 2/2] add tests Co-authored-by: bart1e --- slither/detectors/statements/unused_import.py | 8 +- ..._detector_UnusedImport_0_8_16_C_sol__0.txt | 6 + ...ContractLevelUsedInContractTest_sol__0.txt | 0 ...ntContractLevelUsedTopLevelTest_sol__0.txt | 0 ...stantTopLevelUsedInContractTest_sol__0.txt | 0 ...onstantTopLevelUsedTopLevelTest_sol__0.txt | 0 ..._16_ContractUsedInContractTest1_sol__0.txt | 0 ..._16_ContractUsedInContractTest2_sol__0.txt | 0 ...0_8_16_ContractUsedTopLevelTest_sol__0.txt | 0 ...ErrorTopLevelUsedInContractTest_sol__0.txt | 0 ...ContractLevelUsedInContractTest_sol__0.txt | 0 ...ntContractLevelUsedTopLevelTest_sol__0.txt | 0 ...ontractLevelUsedInContractTest1_sol__0.txt | 0 ...ontractLevelUsedInContractTest2_sol__0.txt | 0 ...ontractLevelUsedInContractTest3_sol__0.txt | 0 ...ontractLevelUsedInContractTest4_sol__0.txt | 0 ...eContractLevelUsedTopLevelTest1_sol__0.txt | 0 ...eContractLevelUsedTopLevelTest2_sol__0.txt | 0 ...TypeTopLevelUsedInContractTest1_sol__0.txt | 0 ...TypeTopLevelUsedInContractTest2_sol__0.txt | 0 ...TypeTopLevelUsedInContractTest3_sol__0.txt | 0 ...TypeTopLevelUsedInContractTest4_sol__0.txt | 0 ...omTypeTopLevelUsedTopLevelTest1_sol__0.txt | 0 ...omTypeTopLevelUsedTopLevelTest2_sol__0.txt | 0 ...ContractLevelUsedInContractTest_sol__0.txt | 0 ...umContractLevelUsedTopLevelTest_sol__0.txt | 0 ..._EnumTopLevelUsedInContractTest_sol__0.txt | 0 ...16_EnumTopLevelUsedTopLevelTest_sol__0.txt | 0 ...ContractLevelUsedInContractTest_sol__0.txt | 0 ...onContractLevelUsedTopLevelTest_sol__0.txt | 0 ...ctionTopLevelUsedInContractTest_sol__0.txt | 0 ...unctionTopLevelUsedTopLevelTest_sol__0.txt | 0 ..._8_16_LibraryUsedInContractTest_sol__0.txt | 0 ..._0_8_16_LibraryUsedTopLevelTest_sol__0.txt | 0 ...ContractLevelUsedInContractTest_sol__0.txt | 0 ...ctContractLevelUsedTopLevelTest_sol__0.txt | 0 ...tructTopLevelUsedInContractTest_sol__0.txt | 0 ..._StructTopLevelUsedTopLevelTest_sol__0.txt | 0 .../test_data/unused-import/0.8.16/A.sol | 10 + .../test_data/unused-import/0.8.16/B.sol | 9 + .../test_data/unused-import/0.8.16/C.sol | 12 ++ .../unused-import/0.8.16/C.sol-0.8.16.zip | Bin 0 -> 2146 bytes .../0.8.16/ConstantContractLevel.sol | 7 + ...onstantContractLevelUsedInContractTest.sol | 9 + ...ractLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2178 bytes .../ConstantContractLevelUsedTopLevelTest.sol | 12 ++ ...ntractLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 2219 bytes .../unused-import/0.8.16/ConstantTopLevel.sol | 10 + .../ConstantTopLevelUsedInContractTest.sol | 9 + ...tTopLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 1809 bytes .../ConstantTopLevelUsedTopLevelTest.sol | 12 ++ ...antTopLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1742 bytes .../unused-import/0.8.16/Contract.sol | 7 + .../0.8.16/ContractUsedInContractTest1.sol | 9 + ...ContractUsedInContractTest1.sol-0.8.16.zip | Bin 0 -> 1515 bytes .../0.8.16/ContractUsedInContractTest2.sol | 9 + ...ContractUsedInContractTest2.sol-0.8.16.zip | Bin 0 -> 1380 bytes .../0.8.16/ContractUsedTopLevelTest.sol | 12 ++ .../ContractUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1886 bytes .../0.8.16/CustomErrorTopLevel.sol | 10 + .../CustomErrorTopLevelUsedInContractTest.sol | 17 ++ ...rTopLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2124 bytes .../0.8.16/CustomEventContractLevel.sol | 7 + ...omEventContractLevelUsedInContractTest.sol | 12 ++ ...ractLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2122 bytes ...stomEventContractLevelUsedTopLevelTest.sol | 15 ++ ...ntractLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 2068 bytes .../0.8.16/CustomTypeContractLevel.sol | 7 + ...omTypeContractLevelUsedInContractTest1.sol | 9 + ...actLevelUsedInContractTest1.sol-0.8.16.zip | Bin 0 -> 1674 bytes ...omTypeContractLevelUsedInContractTest2.sol | 12 ++ ...actLevelUsedInContractTest2.sol-0.8.16.zip | Bin 0 -> 2223 bytes ...omTypeContractLevelUsedInContractTest3.sol | 13 ++ ...actLevelUsedInContractTest3.sol-0.8.16.zip | Bin 0 -> 1824 bytes ...omTypeContractLevelUsedInContractTest4.sol | 12 ++ ...actLevelUsedInContractTest4.sol-0.8.16.zip | Bin 0 -> 1745 bytes ...stomTypeContractLevelUsedTopLevelTest1.sol | 15 ++ ...tractLevelUsedTopLevelTest1.sol-0.8.16.zip | Bin 0 -> 1800 bytes ...stomTypeContractLevelUsedTopLevelTest2.sol | 12 ++ ...tractLevelUsedTopLevelTest2.sol-0.8.16.zip | Bin 0 -> 2076 bytes .../0.8.16/CustomTypeTopLevel.sol | 10 + .../CustomTypeTopLevelUsedInContractTest1.sol | 9 + ...TopLevelUsedInContractTest1.sol-0.8.16.zip | Bin 0 -> 1733 bytes .../CustomTypeTopLevelUsedInContractTest2.sol | 12 ++ ...TopLevelUsedInContractTest2.sol-0.8.16.zip | Bin 0 -> 2277 bytes .../CustomTypeTopLevelUsedInContractTest3.sol | 13 ++ ...TopLevelUsedInContractTest3.sol-0.8.16.zip | Bin 0 -> 1878 bytes .../CustomTypeTopLevelUsedInContractTest4.sol | 12 ++ ...TopLevelUsedInContractTest4.sol-0.8.16.zip | Bin 0 -> 1801 bytes .../CustomTypeTopLevelUsedTopLevelTest1.sol | 15 ++ ...peTopLevelUsedTopLevelTest1.sol-0.8.16.zip | Bin 0 -> 1778 bytes .../CustomTypeTopLevelUsedTopLevelTest2.sol | 12 ++ ...peTopLevelUsedTopLevelTest2.sol-0.8.16.zip | Bin 0 -> 2003 bytes .../0.8.16/EnumContractLevel.sol | 10 + .../EnumContractLevelUsedInContractTest.sol | 9 + ...ractLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2017 bytes .../EnumContractLevelUsedTopLevelTest.sol | 12 ++ ...ntractLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1965 bytes .../unused-import/0.8.16/EnumTopLevel.sol | 13 ++ .../0.8.16/EnumTopLevelUsedInContractTest.sol | 9 + ...mTopLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2032 bytes .../0.8.16/EnumTopLevelUsedTopLevelTest.sol | 12 ++ ...numTopLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1893 bytes .../0.8.16/FunctionContractLevel.sol | 10 + ...unctionContractLevelUsedInContractTest.sol | 12 ++ ...ractLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2035 bytes .../FunctionContractLevelUsedTopLevelTest.sol | 15 ++ ...ntractLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 2104 bytes .../unused-import/0.8.16/FunctionTopLevel.sol | 13 ++ .../FunctionTopLevelUsedInContractTest.sol | 12 ++ ...nTopLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 2003 bytes .../FunctionTopLevelUsedTopLevelTest.sol | 14 ++ ...ionTopLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1881 bytes .../unused-import/0.8.16/Library.sol | 7 + .../0.8.16/LibraryUsedInContractTest.sol | 9 + .../LibraryUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 1535 bytes .../0.8.16/LibraryUsedTopLevelTest.sol | 16 ++ .../LibraryUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1220 bytes .../0.8.16/StructContractLevel.sol | 10 + .../StructContractLevelUsedInContractTest.sol | 12 ++ ...ractLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 1719 bytes .../StructContractLevelUsedTopLevelTest.sol | 15 ++ ...ntractLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1790 bytes .../unused-import/0.8.16/StructTopLevel.sol | 13 ++ .../StructTopLevelUsedInContractTest.sol | 12 ++ ...tTopLevelUsedInContractTest.sol-0.8.16.zip | Bin 0 -> 1792 bytes .../0.8.16/StructTopLevelUsedTopLevelTest.sol | 15 ++ ...uctTopLevelUsedTopLevelTest.sol-0.8.16.zip | Bin 0 -> 1761 bytes tests/e2e/detectors/test_detectors.py | 185 ++++++++++++++++++ 129 files changed, 795 insertions(+), 5 deletions(-) create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest1_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest2_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomErrorTopLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest1_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest2_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest3_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest4_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest1_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest2_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest1_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest2_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest3_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest4_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest1_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest2_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedInContractTest_sol__0.txt create mode 100644 tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedTopLevelTest_sol__0.txt create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/A.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/B.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/Contract.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomErrorTopLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomErrorTopLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomErrorTopLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest2.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest2.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest4.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest4.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest3.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest3.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest1.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest1.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumContractLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionTopLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionTopLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionTopLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionTopLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionTopLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/Library.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevel.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedInContractTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedInContractTest.sol-0.8.16.zip create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol create mode 100644 tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol-0.8.16.zip diff --git a/slither/detectors/statements/unused_import.py b/slither/detectors/statements/unused_import.py index 9426e27a8..fe29a91d8 100644 --- a/slither/detectors/statements/unused_import.py +++ b/slither/detectors/statements/unused_import.py @@ -1,7 +1,7 @@ from typing import List from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification, Output - +# pylint: disable=protected-access,too-many-nested-blocks class UnusedImport(AbstractDetector): """ Detector unused imports. @@ -59,12 +59,10 @@ class UnusedImport(AbstractDetector): break if not use_found: - unused.append(f"{i.source_mapping.content} ({i.source_mapping}") + unused.append(f"{i.source_mapping.content} ({i.source_mapping})") if len(unused) > 0: - unused_list = "" - for i in unused: - unused_list += f"\n\t-{i}" + unused_list = "\n\t-" + "\n\t-".join(unused) results.append( self.generate_result( diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt new file mode 100644 index 000000000..f5556857b --- /dev/null +++ b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_C_sol__0.txt @@ -0,0 +1,6 @@ +The following unused import(s) in tests/e2e/detectors/test_data/unused-imports/0.8.16/B.sol should be removed: + -import "./A.sol"; (tests/e2e/detectors/test_data/unused-imports/0.8.16/B.sol#4) + +The following unused import(s) in tests/e2e/detectors/test_data/unused-imports/0.8.16/C.sol should be removed: + -import "./B.sol"; (tests/e2e/detectors/test_data/unused-imports/0.8.16/C.sol#4) + diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantContractLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ConstantTopLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest1_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedInContractTest2_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_ContractUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomErrorTopLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomErrorTopLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomEventContractLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest1_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest2_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest3_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest3_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest4_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedInContractTest4_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest1_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeContractLevelUsedTopLevelTest2_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest1_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest2_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest3_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest3_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest4_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedInContractTest4_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest1_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest1_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest2_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_CustomTypeTopLevelUsedTopLevelTest2_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumContractLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_EnumTopLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionContractLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_FunctionTopLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_LibraryUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructContractLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedInContractTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedInContractTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedTopLevelTest_sol__0.txt b/tests/e2e/detectors/snapshots/detectors__detector_UnusedImport_0_8_16_StructTopLevelUsedTopLevelTest_sol__0.txt new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/A.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/A.sol new file mode 100644 index 000000000..e09079341 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/A.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +library A +{ + function a() public + { + + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/B.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/B.sol new file mode 100644 index 000000000..0c51c9935 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/B.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./A.sol"; + +contract B +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol new file mode 100644 index 000000000..cc978727b --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./B.sol"; + +contract C +{ + constructor() + { + A.a(); + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/C.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..53f094deda6c20141f3d0b4e2b79b6de5cf4f0b2 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d9S|*U=jl2(swCy-PnjX`P#>8MAV?bP=lyhxEq%hiHE~#b<3qQ%AD5W05g6;ZiZK zvtJ}OIMX<>_n}o_4?fo0Hnn;QIr=ktIqJZeE)ct%SC1rcoXaxs`floyD`2gZ6*O7rfbiwEhK}P*45FoQec}L*J)? zj6_i{w6AEi>-viR#2d^g)wd*IXq?S?de3}!=qI+yhK@Fo+#ft0NqC#8CoRSf{Vu~M z|3o9dxTUUU_q*mUL@6-dhx82jYB-4T=<)Oyi7!js6YMU4XI*-znr~Kyl;U{R*Ag6; zYp+0Cd7IO~%jMf)6JdmrrlI2kv$+Elv4^>KKTk5o*=!-ne?;?Dtqog@=(n`5X;!cd z#>1uKBB|VFh<5&A=w|sx&s*6hE7?VYmBntx~)e=C`#?f%h=2OVe1xm8b}6)baLF4tJ~DB5dh9wb_X>@n{aoMnrYPgt#{t3QRW z#ywh}*$oYsO2?A$${?FNl74}nJ~wGFC%r(C288fS%Q_dI>=E?+p$tj^!PzuAj)*Z~ zQE(|P@dCmDHp3wY!XvYv)m)>OnsY=mza3B$)%>v5Mb3ma4R%3+yi8_dbK9u9L|fj3 ziyfJ$-QY)0+;DABraET81}_^K{#0llzR&Yw^WEwM8{LHPaNspDu=#EuSOQ}ikyKnyUAmV`XI(gpckRK7U*5-4T?bi{AlCPbMZl{D|&*!+Rjm{y;@W_U@CK zzOqth+)>%R@lY-^+cYOT5OW=RKS(O9+I-faYMX7N5t2~;vGzwD6@RCc!6s^7+fzpv zb1{HGmIH`ItI%p70#uTo*?-=ll1pcoiw%_ru VP=K-qas3{!{j&M51o8ZC{{z&r0RaF2 literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevel.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevel.sol new file mode 100644 index 000000000..d19dc2657 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevel.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +library ConstantContractLevel +{ + uint constant public CONSTANT = 0; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol new file mode 100644 index 000000000..e63e3aea9 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./ConstantContractLevel.sol"; + +contract ConstantContractLevelUsedInContractTest +{ + uint private v = ConstantContractLevel.CONSTANT; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedInContractTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..c9493124fae7712a6d5633bc70f5e74dcebb978c GIT binary patch literal 2178 zcmbuBX*ARg8^-@5#x7$k#MmYyL&=ggJ(g!M)MQPzEQ3k5nXzTfHkgJYj4f-~Vl=WP zdm^Gj+1D^xQrXfVkLNw-{rG-*@9V?woa@8&@jgE^>IAbczy$CBi3t_fxQ-;hB31y1 zlLi1?008uTeeeWlAHp#SIA>RaDJBqe#|n>eGxqs!Wr@KP6!E@yoG`(DzBq!DGtSi$ z8;DW7jra9oXJ!E$03ZqgbP^Igln<2s3x@{lwYYP;eXy`L@i?-%$Yoh7XR~T)SwKU74lZZ&WluRQxfgbjhF`&uaycK1)_4}n6#m=~S?QGbRfMa0sJj9OQ;8B)s!I6)g``VP2${r@h8jd3DEf8H& zN8mqtP;YqdT6hCI(d9g0yRfAw$A&VjDLf1KL= ziH%iP(%C>wA^NJ+)K!MZ=EO5nDi<3Xm^PT|FAXc5Mzho9p7H=n?JWH6S@;690dz-U zeG%f1eRHn+*+CF?**Yb$z4Uc5B?*YR)}bpwu}le})ag6`xxoo1?^lS|0%Ig=Qrsph z5nbh9r;Ld;pW&*0@)oC2?AaKeIL56bcz3guyv)Ux!s58rH`fv6G zLtVaIeRMX8J}WA=w4S}S0iuV+ZT31fddV;`;4_g0?7ecb4;{KPM`EsDjI?`UP$C({ zd)+)(^Y-4zs>dKR)yfNll(78x^L0q!lxlD$_mc3SRY;?yue~IF82tH3PUN7U=bp}lKkaaPfxczcvLq>vQbU!h#wbS_u^&7M7JYQ>L^4Dt~ z2vc`h)B($(Fq>dw@OVV5*QBOOt0Pp*0c5@`^UNJ3thnRR(-*zB@nraZ^(<@2VuQ?T z=BeRVe|v}{^7`M|$#(e_)Rs~8Dgkr=7`FN1&)1!YtSUPxgW!UJqFw*qG+pDso0YAj?6Rln1zX)DWOv{QIT6il8j$AzRS-xi zL;lU_R2-H&FnQBzDMBbETlv&qX2eU%W7exVa;zXCEB3svws)G z_!3F4LtZYUrgR1TNEg-?POy^fROV(VaYD~YzILYXBe^8XI!)#Sg<=nQOKo}`PIb3J zb-HQOF?4-}3?Uc8ixT#myUM-ZFWObG2B`uWQ>jGNIVdMDQAMP)VP|5v;5yCrKuv0Y zi_^~5C=ubZEOof5z1gH>a+`3v4WS42HaSZ;3B_{a3_K6FN zggvAbMBtpvPkqvudffHN-Km+cD0DYH%21bqOP7L8mk;^-#sWrkI#nceoR8zX&U+HYiyI=Y zPi6FPKB5N5^hUJ*0)2*`(Dc4q4w*tkO*CR*ocqkTW`{IHHKYwC2L#Wvq%{IoCi+{W z3u)bE!&GtNFD_fI%L^8QyDI*-7IX9_Znw-8-6Fm{$`GM>;y&CZS##YLwNmz@^{dQp z@unlgCku)DV*^!^s#deeOUj<)Eg<10quf{Qv*} literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol new file mode 100644 index 000000000..b8ce9dd61 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./ConstantContractLevel.sol"; + +uint constant __ = ConstantContractLevel.CONSTANT; + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantContractLevelUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..9be3aa487d2dcdcad23985b1d49f1d15b0ffb82c GIT binary patch literal 2219 zcmbuBX&@60AIIkym0LX$Ho{m$Ff8;ZHdHS6*0cvPRL+CUo_Uq1?}qbBoL|S ziSb39Wd{Nt0ss-er|@`pH_j z1k`qApffh>+lwFx9gw3G3r>&_aIB>Y#fF#TI78dp^bLE!dCL&LO=d{;Wyy_p0=BX?4;in$dy`gPyvC1JpiSWt-L*l1{x7%~~DjLZvx<}3f zHZLud!Z`$t?kp3X@ae9l8Pmg;XD4V>|Dpknl|YG-w_>#K3GG@qw#68TNJBn1%z>p* z+bT~U?LQTThurMtvMk@grS6qI`s{2L#m4ssT{_l?YA|2WcM}f5SI-d<}E+mJJuDS_glYI(e^g0IS54H5HU% zSp}150`Rnhd7#YGv8}+-0_pJ;2chC?m)|Wvfrd6d^7*8(pE5`>X5+h5WM#Leff#M* z%^*aowiXORq?s>r1xd%0_DIvT=OI2{R&n6iW>;_e=jhZg(BiSptn9L?3;VQnn8tF2 z{B5w{=~EVk=*V5=e4P5(&UJC2@?Vv@-!7O1i0gV4QaZ{k9_}z$qo4a~LmWRJiX`@R zx1D)FofDwK`{kCDZq$_6%ss~*#Yqrd$VqgaD}?Z$28nW&?-XQJlJ#%k4+y6|o>5!! zq$m|foGh%S*M5l%{Og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|T~=HLB6z`_S8X$QZGajn&T zkuY(o2F}jDL)G_qi5UT^Ke!%Tma?9{nIdTOGb>@}vPgcJzVI{qbT%cNpI6ZK;j*4vwn{p>e z(TCv&zG5c_p==Ewdh9i>31#OkBGR7`o5pTZj&kyx0)I(S8kfY&IfrduPJzBQ&&H1Qkzc zHYVfnv8tmdm#U${E!nA&E zaWB1{^tgkoewoAkK}7ti#wLv=(+9xJj=AfIgDu}q<{vDh9xEmOTumcu-R?s2IQS9Y z<^hV=kHMcm>pcu4WHgW#Bt{Wt!9M8WO( RPEZE`Tqh1X$((=Me*mChT3-MF literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol new file mode 100644 index 000000000..a3466c383 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./ConstantTopLevel.sol"; + +uint constant __ = ConstantTopLevel; + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy_ +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/ConstantTopLevelUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..ef39a1f2e701105ae9619b6a1b881c5f35945de6 GIT binary patch literal 1742 zcmbW2S6I`B0>%FjFd$(>Rv4lvBOqIlV1-;{rtH1TGK^A)WFfMV6p+0n2u($$tRN9; z%2HMs5d;J&NEo8#O3IKGPzX}(_x16<+;bkzIS=Rg=WGWOKmz=L7?7RS;Q3IiXpkoe z0ACaV0097i1ttcE501gRW3JnyiRhm^aOi9Qc6T%muY<$<6o|fY9fQRO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`V5yGIMlm~}->N_rsi zc^u=qgL%G4nQZ$`4gA8xihgMU`^5+36|h0ih%E}&A!Z)SW^(=OEn3e92w~@t`LyJ` zr9i5+1$c3A3wrg|)f~08Cpm;bc&6#%D7A6Y@VO^GDed#df>p=~{;j@g-rc;nhe&Xc z4+DBxicla|eIew-ng22===5F2?Fa#9c`54IpJfk3Y4GR-Zr?cnj!X!c)Ao1z?PU+(Pi54Xu#_!bB)}$IIv;GFc CXf81T literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/Contract.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/Contract.sol new file mode 100644 index 000000000..0b2b32661 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/Contract.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +contract Contract +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol new file mode 100644 index 000000000..733c0b05b --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./Contract.sol"; + +contract ContractUsedInContractTest1 +{ + Contract c; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest1.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..e17f06327aa9b8e08aaf8f7f1780d71819a6dc3f GIT binary patch literal 1515 zcmb8vYdF&j90&0Km|M(Ta#`+ah%@FElIxr_Hf*k-6Ko+<{W%^Oi_(OHY z03bjW0L%dZK#_-QzOI zjL-K6n&31JTu_v_h|jB#u2N$~)*q@}-%VZYGa?xqJPdfMdRT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}TTP{U zOhrFqC5aH{?cS(+u3B%kMRI$z;=z-7f{DcGng(Gz@sK!Goij`%X&K&V6H= zK!-es`P(yUOWIo;*^2PB%JfD*C(!LZ1Z5kP0Y;{0Kg2AZ2P;imD}Yz=<~;~lNLFUgK55oVt(;rsYYIrE6$H5@9J`p`gh(Tf1$VU38Y|N p?jR8d(f?NWJG}oU6ZB(#s{20-_Hq{!|M3d?UflPkd?y_M{sCrCzzhHY literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol new file mode 100644 index 000000000..96ccbb8d3 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./Contract.sol"; + +contract ContractUsedInContractTest2 is Contract +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedInContractTest2.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..af70ee5ecf227d0cec44a6814b618bc6b42ce127 GIT binary patch literal 1380 zcmb8vX*kpg90%|}M!BV)WQi~gI^2viy9i@O#u?Vp#JJK-nISR}gB(Lkq|AiY(aJHN z9Ag+J69&b^xMo(4Ei$fc(&5@|wa?SbeX-x~i|_M$@q7D0!o@&#fG8jbWM@6`^)>!V zr+@$;K@k8<003~nV(_u3P`nQg9R|aEzr4{nysn;)01 z_rBT}a_MUuXzH13qzJ>$rHFEJhKA`5SoioQKKPCF71YtD<8|imc*dSo7<*D}DZyPo z%+Z(HYUx-K5soanmRq1YoGf&l;ka!zip@;0$wCU|HUS|EZKSI#pPcMMZ!@`_#@=^i zMy*=5-4((3iGuDjJ0~AC2z0&ShNbEF1)0}V+aUr@O`i3uo2$=Z(dB7ihQ)I&Dm9~H z65Py1t<@xfWR>qIKr|G3ZJ_R;LDsoA*-Fww$qlKQ2#c^-j`Rfr>fN8Ll-ir;Wl$r3l`t=P|1jdx*dx{oFZ=9rSZpjTu4M z4CzQ~lwcRDZ8XBp@;ip3!*hf>~q)Tn2vJpGOKUJzwiV7%wP89okMwxwVS6eU;v zK6UzVAP{^G->aFX83`@lk{n+9E8f+w89S`bh^<~r&%I4=T&GCCvgzpPDBtryP_ zJ8vs|Lt7tm^Wfb-JQieLB89p-Q%!*{&QDfk_gXSGtjxrmhrEAz0?6UsKbpl5tWK^x&nEVn=N{;X9wy$xAld@=n^QQ3w zW`Ee5jt1q=!xTFf<$3}LJ;ggoPL+8F(F(5y?G}Q0*Si-%eTubl;JWKXkR$;vyUuLT z9nrc0f2RJxE722koDx%cIN7ZQ_OjD(nt2VMU9jBqA^2zZkSkEn0QexuJ?-a3@JR3kONxdjCwE8 zh4;=_xmz$9V}21PH(S6ZQ4Vyabkmx)7efm@I}_Zuwk|*M=cm4Am%1C77(~82W~u2b zTlOQNt@(l7X?lKCw>&LLEt6xg-QG}@Cz8u`X-nNMV@Ef7+(4v%F~lJw$FQE*-<5h9 zA;(SzwiNl=_^ddtQV9Md;?5O40lY%lHw+uIwu29{SS|rvsn8tD4>nTlNi literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol new file mode 100644 index 000000000..0c2adb4cd --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./Contract.sol"; + +Contract constant c = Contract(address(0x0)); + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/ContractUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..a7db8fce0dedf8607aa235b0f32b3f76c697bb9b GIT binary patch literal 1886 zcmb8w_dnE+0|)Rojxs}(z2_Zggk*MSh7f0ma-WlVC(inm@v*PsQ}H1)GD7z3tjgh> znKN=m8R4u5*~ho<=lAaq-`DGh*W>jUJgv7eZzyaWr%I%HerolN(000vO0A&CG z3@~VH;C&?4E(rAp0ux|?3PJfHP(fH|5XR3P6&8RA#Jb-PM0$CLprAfM7&J485pV^7 zXaLYnN_ueZ^xDG$@=%jDdrmjnTl#}Ye6o#zo@_O1tNPn_tDSY&rb`(W!Oi{If!RAP z#4_oWUg^`+pjFh<9M(L+8m~gBf}bbhtDO)GRIc55m`|Q-wCS!B7ypA(*T>cA=kS-K z_>CW^YQ?~R&c=3?zTWa--uftcwF*r;EFVHFIez>mtyI(Hz8(=Y%X^s@O@J(l_je*%@klp_+2UDi{X)zJEou}*(yaVH+}^0S{^)Q@Tw(6q;Cx4==ocUE9jz?XcF*~$Wcrs(+yE*OIM6eenaXnH@x|*$hgFnnR~BDyNtSS` z_}l|{!GXU?VAd@eZV~I}iDbrN>lKh7L)ai*gZVLe+l!!JRsds?1z0~5Ul+E9;voWD zhMyRJ-8L-m`&^X^7HV)bOGq}7)KC$FN)-V&s@cEZQ)zR53VaSblbxze5R+qkB5$*q z`0d?4L0XdXrzu#cK(2lU1zvSo8z0aJ;#ICh21F<>qUTk?H83R+({Q4E?>qnExU+$u zO-f`9ML_-yy^LRE{7mg-n5~wkp%-=I4x5Y6+Q9jkYrl}*c7&1cK|I>CWNAW|0WpaL zQ;}Z0+S@GQs)Qqup5`mwu!h2y60!FgK^N>9YaPRl`F)_9cgT&{*Y+H zgJ2Bjf`j{}x}T?kS9mZBIrs~~+{CeElKDigfv|+ZqKgt6vn4wsMFQ@sgS*~jof@)u zr`I^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=v2`As^0+Ohbu zsbZC}>-AFk$IM35%1Oa-HQQEWw#oY<3Biw}Z{N#{uM5qTHgyu&O=#@#y#7hEs+CgK z%44}67~jPb(uC4JlXkI+PAKKaJ`>Jw&!2rew@Qo<$wJrW6`tyKx$M;bIbrE^=(ON5 z`?F|_%Y!p*PW!12^6Cmskv@Z2B9byPWdko7a7Sw=$_;u#0=a9m9o!OlXa}FoNzeldX*~$zbijZ1T8<2PL)xQE$ z3@;;>u>GW0O3gDF`ni}PXt literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol new file mode 100644 index 000000000..712126b5f --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomEventContractLevel.sol"; + +function f() +{ + emit CustomEventContractLevel.CustomEvent(); +} + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomEventContractLevelUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..d6a9a738bb240634e96e68d2bc536c39c74b79bb GIT binary patch literal 2068 zcmbuAX&@5{0LSO7(Xb+uULKO1IdbQo%n{3(SZKzG4Vw}3Mvg|C=A2N7VR+9OA<5N} zo;ga#qp-?QHYs7e*aJZuRpkxkgz2{5Fi1_B-eWNTpqcvcK`qg`4s@L z0ssKEF*rOn!j6E#;BB!Od~_fZ?~Ed#!aZ@QAP;QhzuNY8md}|*%c5$#cw9uu?Nt10Q$)@%^{^kmE54smU+byaXBjmC zC0IN+LU;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nZzEgP8@PJ3A zMoz)(qO-QRUSbga`PAvdb=__Xn>2`R&`GWA z_&C$Ok)YTyQIZq*fYs(3F7htSMrw7*>Z>#)(vYk7!!|rPKax^S+JkO%JXT~-VL{6c zVq4~2L-*{?llW%ZE|;xskJijC5tG2qm2Laq-bTr|NbyMEQMnw2^aVed#!l1hx(|&< z=DFOm;BIS}lqV`E>?STT;7$U9mO}q+*Vt$hL)BOOz E-(1DgKmY&$ literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevel.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevel.sol new file mode 100644 index 000000000..10e1b5df4 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevel.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +contract CustomTypeContractLevel +{ + type CustomType is uint; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol new file mode 100644 index 000000000..90f0d473c --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeContractLevel.sol"; + +contract CustomTypeContractLevelUsedInContractTest1 +{ + CustomTypeContractLevel.CustomType private v; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest1.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..8ef93e5563e91db40bb06509c45863536868392c GIT binary patch literal 1674 zcmbuAdpy$%0L6cvH*IT(th_1>i4Q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m<*0`h7 z^&yB|y=4l^YnY8_xobi;WM{K-gC}%g!SssiigE zc;V4=c!j#KOgOJw_>*(%Qyc{^QJ!7a8o)t^(5{4l5Ty!mU93&N(GuR5jEcA32qW>= znWIrjMmGrlR?UlBw(c5&Hss15OOqX=iW6>w{B1Wb_2P#&BwH&dmJ7|Ew<4z`#mv9MbfK<;OYy)!R7 zhJC7Vr4(J}kdMru;~{qz>pz>VhCAHap4OfoBknD7?)C*&bg9}N5w;joX27sGJ$~d| zPD4ea`TR&^&FiXTKA}Mz-gCPLti{eG5R$3=CuK%Mguq8@%&;tb%@{Yy5s3Zw&xje` zekJQO;p1vM#nV+ZPebPtC`>-;A*1Vw;7hLQg)pbvQ!;LsyL(8{1+Mki*Wy6Mm;44X zZ-2iz`%GNo2;;3##E$}c1|n5eB&L3VNpKB7U+?v{lY&F8I_b5>DQAPy2<(H>i7)AX zH41_gPYpZaY7p1{wv3ni;N{>E&qYzn-U*K{n&(}}YifSAW}{T7Ok+UbS1r@9pq$Nx z{9^RIHOtbhKptVod6SCwQ)BnMZ?Q&e^p}lG`edsHXCAw1_Ol$S{bJ!v(uX&lA1&gC z#SOKp=Gaw$kDu>FjTsw6i4)9mL{Z&jGZ9jnm`={j0CH(jPu8h-^tSCv7;h16|5|D8 z8%1gOIoLzS!t7@1}6Bd5sTZRboP7)Gs|YE zc7_2T(Kp+Yh4S~>M1@D>%=k-Gxp6R`&==P%R>b`7)1Tx#EFqBB#9zg_L>(2-?nO5| zn=LHAvQotE7Dsgx5|Ex>7arnwM|lu~M@H8tbTjuQve=UpvVPPv1yi8wf@y^nc3ha9 z_^P2PTeP}oNRr;kXYq+ugcTc5AN0Rf;ioP9=VIA@;r|y0gcS$puTN}06ZDgckYDXz D@aiJ! literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol new file mode 100644 index 000000000..d22fd9ce6 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeContractLevel.sol"; + +contract CustomTypeContractLevelUsedInContractTest3 +{ + modifier m() + { + CustomTypeContractLevel.CustomType ___; + _; + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedInContractTest3.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..3c8b0acc496a84e451ac4e94471f8e50f991cfca GIT binary patch literal 1824 zcmbuA_dDB*0>-~qdsWdTcF<6()JP94N!03bIF)16c#x(I5jFo z?W&kTjS6blxYSmpgsR;}-QM#&_s9FwecvBG&-?xZAEYH8KLX$dM1Vx<%lk91lc?Kg z0H6g70LB0Sn2-XAI6pfw9%F*@ClcH}h*p>&%er|Gn%mfka)+K-}*rOb8xF zAfns}9^Tj>jHXW@&R>vU0B{9>2mpXlsb0EV-GGA8L56{FZnr;HsSOzH9_yJ7gY#-au=%p&2S2m(|V1Eu{&x>sU9bchNGPj z%t?Wk{E7A58uccKr&bzbQV#6a{z!C>PHGsMB0>!^+r!^$Oc2_p#C+9?iY?w8V6uGZ zGpy_S-^*T%zO(97U0~kw@+rhR!RO^YOO#~urWYqy<7`chBKpWq-*3i{=tKu% z0E3)sWZzW&jir*MFO(eznv=ZzcFR#wbJp-=wmW3uKu7B2BJioTp!vgxqu%AXqe^f3 z*CV(I_otBp#Z&s7rGKajI*JD0AE|Gj%QeM&r5r1|1!>oU+WYDUptSsXs0oT2w6A7! zo1Nb3BlJ|l`Ng-n@uE>)qbIlh?GW4Ps672NVRzx+ch>>8@9(jMP(D#Z^~{AU;`Q+@ zG0mhACSQV7NuAD}Dj@?9myxw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TbPBsm)Vhixk&PR=`1;< zN6GkmTXs?iE4g_~W#O^cfQP=K@yw`g!*qJJ7tL5M zoj*TRK8r&%U-IPDD@Hx};Zm)h^JOjv!D=Pr4_A4oy9Dc%fNQXj9?jc?Lgp2}9y?5D z1jXA)W0&ssrMY%ZpD%;#F1qe~{GPK+Evi`NWg z3tO?OxL-;V#&#P{_A|3$Y~96o#mqn@10n%xXY12FRhNm#v^BMW_Ipz?1 z!DP6FveIa?L*2d^*xZK~O)#iuU=YOqpVVjDp@=M68CzXoEYos$X;$`A_n%Uo6b9t_ zDfbSr4yd{ujqLfTeTA{ci( z_$|f@0h~HacG@|6mA zEALS(9n4pIm46uHZ`W@rAm@wdU~!acB6svD=v-*lYamCsGJr#OEE^dh_esfGI0g*E7EP%MFNmNl}cX9Ne*EZ!j1H-!;9SoLHP! zXB9D<2jd6{FQK2FV1yNM&4u(UFK#R8R8I3wa|cZJ?IqIW)#og;)L$%jCy!N=Iey&7zSa~xSE-?TV)fQlq z2EE6W*PZQ0(5}_;v7JZbzXmHwk;DcJZGXXLLsSgp&uq}6{AXpB-1PTro@fOfN8i_& ztKThzn!@ucYE;bi`)p!cTA7?Azh zVsmgoR}k3kU=(hD?Z@+0?UW~1II!N1jb^WqWpvq;J3r?;K#pQUZL zts!!PzTktVR{c~lW(K&Bp8QWD$_i*BFu7*sQE&7B^FiG~DLJptOT&zNAwX$kg*q3e zAV`=f)_)8{Z@IOF|8YEA7Y@F5K zoa#2!9FiT)@#yI1xIN@A!?q%Bl=5NIle(fkzmIDms;7l4v-nGI1znd|bhb{}*jpbG{rd^@%^}~?`k(d}=Y=x& literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol new file mode 100644 index 000000000..d745e645b --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeContractLevel.sol"; + +struct CustomTypeContractLevelUsedTopLevelTest1 +{ + CustomTypeContractLevel.CustomType __; +} + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest1.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..af1a8f9b951dd41c09fee79d61f3c924cc05f687 GIT binary patch literal 1800 zcmbuA_aoa01IE9IEplpA+Dkda=+$Ur3sTye;S@bHA|lnZ#jYzF#MXEZF)wzFa^<2% zW0z{tv-j1?m2$DUNbCCc_xGpwd4Bjj&tLGdv*H061KfZpkV>v~YTgc8f%5@C`nLdJ z0sw$%SST^j-ytdpZyFdt48h`v*7$I|pJOQA+aWOM>vq705;fIA1N|`g$e_RwA_g0R zyYCy0S9=f|7$6AZ1>6B34gip3GT{d2MlfxBlx_en8VK-J?1Cj`*h7t!8ihNws_Qm; zpA+ejy!x=#H-#aE`|X2I6*GqvIXR)5__QM7l1okZ%N1yQXHlEIR|D0QU%HH4R1uq? zyE%)=5IF7+8*|TZ){qe_`Nfr*@;JNIw%sj{51NKp zt~d{-&=7Twac|4>&S(Ag!F>L>xl0Y^(8dqQ43fr?R8_d;xTV$wqIJE>C(}yo3y8^@ zKJ(d~-w*VTX`t0=kvX{c_G#`|CB?L^?(=4Kp{X&sbJiJ)sfB?OH<3aGm%|QPB66}X zfV5wDW(Et>D@cz_4EKj(uS>FY^xK%vWKRi`UUIn3l>On;3B`$%-iXj+RCII2%2Q}U ziv+i%VVH&l^k-#2nl%Wupq2zicXIRJHJTIC_F$mUyP`ELGP4mqGrm)WQk9zZd_WtY zx&O1k(OP#R#_96($Z=UKmIragm*r4VJ*|{JuK|ybT%=PsrES6_)T+AL(&T4$*F}c( zZ8sYrhrWKF2Y|ij-)T}9fYBSocz7i5TB4Q4(q}zpJ%8Q6*@o$ukB}s7|DSWEodfL- z1Cc?#8XZA*S>l!pY-y!eAuEGW!2UFw4tBj{PJOz%v>tGA2seg2p}5*{bE7X(K9GBT z%Vf$Qc5s+`r0>>a#*_HAaM(>gc?pRny;LpRGeptqc+_Yi2`9ALR518)#7V5IerUVZ zTW$bw@`ArlQerFzfC>|PQ`+X~6=s zXn)H}1Ie0m@0p>#K|8chR_AIBSgEwkwOG2J@0uay?^O3w0@D#q$Tpyc?fBR$acAFI&o|?h@2I(!kc>sHD8U*0S+U zn`1>OWj5P?hD+Q9)^TpePljdQvGc6mORB*NvJz&bf;s7KcOGFx5}nlRX&ZNWB4~#FEf9KW5Zr4-MWkp0L zXLgr?3wQo0&fN9MFXoWc?1xWz+@{-5CQnT4va%!=t>ae*ip0&CEIRT!OHrSA)%w7B`2mAXR=>NkB=;Tda+B~l>m8bh9}OPjV=ecrN^ z$<_RN>nDcaZIcuKyL~r_yv|+$Tfb#9$n;%8w{T2MZosh0!or>i#BuU=mHwh;{x3Gj zY-FfKMtO(oX*NwyFvI6k2#D;F*7?>A$dWbQXa1=*m&-7Nx5)mOM4T%ZDy5vqoUS%e zvbIEBETpE?iogp&gn8((#%l*L%}GJ1&A72WmfuHR w?}_5aoj1BG%Gz0RaU1jeZwq}9(bvRr{TKhQlkBW`zZebxxV|*t3rSz!zxr}lKL7v# literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol new file mode 100644 index 000000000..3e6d5bac0 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeContractLevel.sol"; + +CustomTypeContractLevel.CustomType constant __ = CustomTypeContractLevel.CustomType.wrap(0); + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeContractLevelUsedTopLevelTest2.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..f7c8452f8e53d314c86240f1d202bacfe33c8b07 GIT binary patch literal 2076 zcmbuBX&}>&1IE81E4PxPIl`QYkfel^<{vVQtlVpxSQ|ETR&q{CIdYA%YzP^K9Dg~= zFG-H(${EQuEpkle`1Sj}|G)Y_&x_}I^}PK&FdKdWb6_7J1|*S7T#Uulh0lTjph^`0 zEC2ww7)&7IZ^Od^P#5tyVvskIXp17Du+9Y3O*lT_-wsC+hz7a@Jk}Ex8h{TXdU^*T zeQ%Lax_$&a?x4Vaz#Rah0N^~Cj4|9c45WVUu01E3+m5@X)~p!!$nmI|21B^fsHk+I zt%_JHo>>}3i_AbRg#*w+ffjJF_IT~CFgpT5B z>$gkEJ}&2X{|nRKnDk12afbLSXO*EtbkoosKztuP&P^u^34Q=P?#s5ujBpP$DIQ}e zO_%ORK%|i(X0R04eji!qwQ31N*RwIyZe`%ZMOw{0Z-2f`b)hq{=Y9(+T9+N;uKXbQ zaV9I!a=UK#&@I9+DZ&@&$7WYM7M4{El@HUF?(ov(LkkiuQ;i-Rd`@gFdibqoB?W#r z!AUs(+VaDV2X9SWBlBps{`qaCnioprX~evU{l0fwUz)#9`p7-7eDniq!`PF}G(7#a zOFQk-^r%s$LXkpb9Ita1b0xF-Q*61Il7rAd7~gCV0;0%Ff$aK;mBu_n+27sm^u+-6zX%DXPc7Gw19Sa+fSn6@JFj3<+-;8pK)J zX#@_sz3GjCkaVlUJ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jdG7dC=G z;O}n>2s3jFh@o@jFJt0UzIS)`!F~D_O{R8h!Je)%e(b`C@RQW+rW1|FIG{c*cd#-M zubJc3_Z*w`yLr_rvD-;9!+&0N#R5Kji76u)3c=9a-8UdR!49Tyxyknv6Sln=sCqKU zTJ7H48iR^;xleZ<4iS_2AVO;ytU`$wmSK4Xm-%bcb}Dc2)ycN1j@ATb`t+?kS-;|T z+N^DQ%oXNDP-zE0^%nP164kL`0eREAy&ZNi8@_$!{QsNGf8hMDqWJ!a|CiG+oBe|S Q?C||D?oVd@`2Ya$H!Q&5uK)l5 literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevel.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevel.sol new file mode 100644 index 000000000..92bfe9e96 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevel.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +type CustomType is uint; + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol new file mode 100644 index 000000000..7f543ee48 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeTopLevel.sol"; + +contract CustomTypeTopLevelUsedInContractTest1 +{ + CustomType private v; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest1.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..bd27a67ef58af0c494d71e63e3d55b266893e836 GIT binary patch literal 1733 zcmbuASv=bZ0LTA{i4ml6RNO~HNaL#ej5aBCtD@?@;%o&;9IcyRtE9TjF=y3PR~c(u z>l715mC`O+)QG7@s@e>#qqA=Bd)n{!@caB;zOP?5M}e=f02mMlZWgq7@s;T{TtNW% zULF9f006*INMzzQkCZrq2QkixkVv@dNg{;V$Kr^wc*vIl`g*4H5suLcs5UK_x29UCtWS0Ua=E zYUK`hk(sd4HcHRqii8S&|5&p+eO&#BLE;i_Rzj=gJ0t6mwI2>sxWlK3I+_oCW)NEN zXH35|J06><8v*!X~E2gRuYCG8oN*3*JzZ>owLJ;wXOB2pNwUOF1iM(jf`a* z-2DY-c|9Kj<-Wz(c>>z+MD%QOdoYh1ZP<`eV@35-c{t1rTB*nhO7t->8*Y74!xhdWj(MiEy5U$BE++jqEceFCba) z&HZnj>7n7io6$tNu8)81cbD{XQ6i*@M00!1DQC$)JG*xG7m^|jeq9(&PzIwfoiff2 zEej9kB^L0OzXfuwpKtentPt}RO8KQ~h`)!0$yc`t^%kUBaweKo+IDoQ(rI%o!Gqjw zcCKesXuH|TK)Xl&yRt4(wv(vPmi>0jy@w|HM$I$BjDtTXDV=dkyiE#n^&P!Xx7Kgo zFW~jWy`$p|7r(~ZCBi^ke4mh0t}DVa{DsEXc%P)wNX5iAThB-799*AK*^!^rC*~Dx zR<*ma-1)@!z6%h+*+VJYkNG^PiR4`GkVFw9VEN~AH(}inOrog?^Shia=SW5A1(^pX zV9Toee~GH#LiS{?#DNZ0G;k>`qNFJa&x z21C3y>+LL-Aqk(WoK>>T&+4y9M)dL?fO4=IReQd@3zjaKCk}HEw=0#dE0mwsHg|kU zaU>qLFLlU8?|E~`q=kTrw6J_wjh*2*7T=pZ6(RDy!>p%DBRP!IRwv==0E89O1|Ef5 zMGcLJLewasa8z+YI`M)b zXmfBN^8|R~+N}+7fvnV586ee$aYBDsP*C!tXXo(mClbfTp~-D~3RMylV~_4oq_!Bl zNceRl|E4ENeA|>%a~H1o-9C#YJ-MXPTG9FBEK|y~wi>~rm7m2x?KZ{o&qZ&X9f+Nj z6_9gHI_YAErk+Vta=mMnap1rG9P-gu<2nepLLE$d%ePzUG0V^=riKO8&t1b{Y~@>t zejmOuJ|9%<*2pY{zU78cs;S~rM$#8ru@v+bL-LA@?UY+d=S`B=>%c{@Gfu*|!_Z8d z|Eh2G!fZ{RdWj=bKP(1rrz>r8A31>h;ltfiC~>_*$HD%}!x}yyZu@pyp*4c_hw4Nm zyzXS=9hE7C1nq_Lrgk%=qesju4OAX`28X!=nc&c{iVN=34f-oD-N&kenZ5wI>zs|3Lu=dgx&Gg&1ctM!vA5S4z zpVrnFsa|@*B!XR%OWN%mL$xB;+=dAJ6XkBW_YliTsU8r`^Xw{2=f&8sZ;Pjgb;)oz zN;G8~RHQ+@KMZSs81PWIrOz$(%<$dM-3q5GIS~PG#}v;=^maxG>>3@h qV>VGo*Ub?G#tQtmMZSpS-(-URng8V!H%CFpKM>HD#(Y`)zwd7pZV%-E literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol new file mode 100644 index 000000000..04c0e201b --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeTopLevel.sol"; + +contract CustomTypeTopLevelUsedInContractTest2 +{ + function f(CustomType) public + { + + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest2.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..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a;`?dPJ}tj#zfk%fv&Ru gyVg$4_D>Sn{*V78IiwB8sV@P5?X-7KIr-1}A8JT&wg3PC literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol new file mode 100644 index 000000000..ef0d8110a --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeTopLevel.sol"; + +contract CustomTypeTopLevelUsedInContractTest4 +{ + struct CustomStruct + { + CustomType ___; + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedInContractTest4.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..c60e44f4e37eeced82f227e5859b2949eb8740d4 GIT binary patch literal 1801 zcmbuAYdq5n1IPaua?R~vQ*Ik_+>#~HI4C6^x4Es6XR(H2W3F{-CTgxFW{>;5xfBv| zn?@~in~+xM>iPX%d_TW8zqel}I{}adzz;|QNt88%2 zA55sPe?SCQKahwI76AzY-T)ADbVZ@yjP{K}iiQRn%_MSJ!2ud?l;cxeAm&;%Vy$QC zRh-Vcu*T!G=i#q=b3${rTDmGUQoA+w(}^5xQm$COQmuaptY~vDn$xL+*FVL$##Ypp z9&YqPNrQ3w-oMvm{$*7ecMsFZK*+#vXz~VK=2OBwYCm==&aW*7)Eg@-*EAO)4#wNR zonKaJTaTVx%$C0|KiO6quVLl~COmp7o&?i#GDcf&SdzNg$v;A-#C*lBw=CI6vp-o*rJ~xWo0xiL8hWv);n>(u z0mQaQS&_Q+ccTJcV%O}2V6B05nyrcOJaOaqztC5V%bE$-Zd`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e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol new file mode 100644 index 000000000..b0e6a96ca --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./CustomTypeTopLevel.sol"; + +CustomType constant __ = CustomType.wrap(0); + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy_ +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/CustomTypeTopLevelUsedTopLevelTest2.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..5ba1891554cc90dd2bf2ae44230381e749ac6b0b GIT binary patch literal 2003 zcmbuAc|6mN1INFm!owVql&i-`=Dr^^)hrrQY%8e=F>_yYRTgsO*pLZJksLGD9de9V zd0Ne!b4-rNilPW3*RSXIdj0o z`A6gQ0|=oZ;=6VO?f{Sg0MN8Fyvc@1cxf-U&Kh+0O^Cl{t7-}vb0SfwPpM2 zux_#k@Eh)NkMp--)yYJ!Iwo|l>E*-A-KZ&YRC_rkccRpVoj8jn2Fs&g?e4&i$gfS( zKTB2B_qkQje8kk+GV-$=WIcc89c*6QN-b9tWc;{)5ohhs)E6G55AsqMA;oOp>PKD;yr~w6+?Y=Y_&^CM+^=TW1)$RsK{DU(X1x#>Z3}S%l07S%PG){%UY9k-Cwem z^5eeN#t=m5)9IRLdC_rDEcuGH;)1S^bEjFm=<&PwrDClki8jJkMUAj!V>Bsl)1MTv%?U#_2^ssC~VLis65+(M#}f51Zf4Z|jkspv2B=R@Sn z_f88Dpyo?3sZouuufV#}Z9unR%VavpTp!ujEyp5dFjY%r_tO_nc6i2Z<$1cA-?TH@ z#Jb%`JbASKfzck0JAG6VX??eO(0=UOO?Gr*Y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c>fqip&E zM-V1W_9jY*GP#$gr6BjVVpExN;A~yNfsNOJuIw9Q=-x^X)o1e>)uQjAS>h(sK-ONX zyNnRIUFY)-^QW2=zz%32$U@-1jrmKO|Aqqm2mjlj4rrlY R8U_G>zv}yoCq({ve*?U%qvZeq literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevel.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevel.sol new file mode 100644 index 000000000..d061c79e8 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevel.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +enum EnumTopLevel +{ + __ +} + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol new file mode 100644 index 000000000..6672d2d06 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./EnumTopLevel.sol"; + +contract EnumTopLevelUsedInContractTest +{ + uint private v = uint(EnumTopLevel.__); +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/EnumTopLevelUsedInContractTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..defd5c3af5b6fe8f299b7ffaa3355935f1839636 GIT binary patch literal 2032 zcmbW&YakN}0|wx+F(&!uejBESnk3GUk|mc)A+f`7%4M#ziEWMMvY1q?O{8*(+{sx+ zI2^akkz7OMo=e9iQj#UJozD0F`}4i;kN4O6`*Cpuf~*1Jfc=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(x z)*Q)$my>vFOh)U5(nHyoctcuwgW^X(-$t1bDiEKXYlH7$`- z>2se~ZtyosHIV$=xa%QNuUbVbk2V2{2BGS%UB#hx4m7oD((~nxYk7M~V1ICz`P&xX z8Syr={Ir()>xYStswHpVL@0pH^pJzq^6Z($-Wc20qtw0WNLWYnnpCc{>yN@AA$2yN zv{jR%oYhC4I7TyJ2mxo)6%Ycp79x_9!?bt8Z?^lAPFqE(Ky)j4UCYuroru`?*BI+C zBQs25H1Evm>kxmfJk7b;_4@{Unf%5NK6oT1WOgtYU&F8%-|CK*YeMlF2O)U zhC%u@R^;2lkNfsd6qrV+U~CO2*>QVgMHdDLo}RgG5fb{;uZV+?Zeuc*WO2L|=4L{b zE0A4cE~J*ph4BQ9$+k!(Av^hqZJiQ5O?e4bCtHuR;)`x5y(gf6fuAi0r&n3L?p0Dd`G4y&Bea_*q$S zNMFGpGN;uoD!u%ZyUmeGk+JRPlhM+>m|!qW`tme|c{FuFZT!?t9vxI7c2m7ISt8t~ z@5eRp)#C6OzqmT)So~_V<2vC{yjW-oTn}OBW-TxJT_2)tj$&7OtOT3KlSlzsh-i20 zSC;vM2Met!*WR7z(58RZ;@kQ1jW}5v1AZbQ&Gis3z?o(yY%J#{{C8xp6EV)Zz&`Ni z#kU(?(+BetslDk-(YaycmqD)K&TwA;+d(Ft#KE8ZNUN>xU>)MK)( zCTD(Aci9WiBsXHbprx6c7A%z;$f-G1jn{?KiqG@0O z{!srieb&=KLcI()2P!;}5)%C~nwqx3++ZBJ0(YagE=BIXaE4Ivm+nFFywcd-nO*2C_Uf?B+L-7U-dM{gCGHy2Bg<5mA9>LKvh>qv ygmu+7H*Fp7Au&~UNDhzz=l|E;FXR1_I~@PTzmcCElKYoF0f6IIeSeYl&-)J)b9?;& literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevel.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevel.sol new file mode 100644 index 000000000..6a083b696 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevel.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +library FunctionContractLevel +{ + function f() public pure + { + + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol new file mode 100644 index 000000000..25b1c9b4c --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./FunctionContractLevel.sol"; + +contract FunctionContractLevelUsedInContractTest +{ + function f2() private pure + { + FunctionContractLevel.f(); + } +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/FunctionContractLevelUsedInContractTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..504d983a9d40d4280d386f7d4d4f04f2399b62e8 GIT binary patch literal 2035 zcmbuAYdq5n1IPcvVs2T=!9+D=>hPNNOA;33=H4^APE4hGBZiWyT;Vg;Q`JCnL=Jfux6`jTDF@qLaR>dg=s~# zfZGtoIef1sx~Y#zV}5(yRjHZNt+~sH6a?HVlzIrO4=OuVy0#N1;Odd#+ONC^6?LE^ z93L;J5@{EgP?vvzp=OyFDm6*xRM_dyyo89wg{S)W(k{sq1f_s~tJtg|ZhPFeXHl02 zhE^=v=Uwi}Ayo2&#`z>wtYR=Fqg56~W?Ugrm-s{tw1tlYc&W36ZkfCe&H2E5=;GCj zhm+-Mhu;l}2j|BpCu%#v42|B*7n1aY>X)lE=FmTJitU;PVQR)LiQ_Iu*0c5D!es~# zm*u%*jAbNr7tWku)sG+VdanwMCLKK}I_vb&XCx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esY(6Wqm>?qa0jvizEJo>=DLPOTTMsy7UKJ-T$l6JC5DR?jEPx~ i<$vq#hvEKBEYpAR|H{q^#`Z&*0KoL4zCSqk@B0V(0D?*Y literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/Library.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/Library.sol new file mode 100644 index 000000000..5a55dc215 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/Library.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +library L +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol new file mode 100644 index 000000000..6ecfd3c3f --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./Library.sol"; + +contract LibraryUsedInContractTest +{ + using L for uint; +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedInContractTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..33ac2597f37c59b20855ab96acf8c495f89f4aaf GIT binary patch literal 1535 zcmb8vX*|;n00;0tM!6m%KCZGHQ?4;`JSJCGWSI)Z(j41k$i|FODr$Q&SI&_$GFNg& zMu;WN(Q>q@M?^a0AxD%ekDm9>i|6-y@q6`q`*n2|0oee;z;8fue3i!-NqHC{3IJ7# z000L702Sy*_9aKVhvRWh#A75Ph3xB3al?mGVBw@oSbS6{iA=%zlKlyRk$6~8IEg3@ z5(T^gAQk|Q#>WSkY?*`=55H(eNayzu1EHO2^yD)t)`w~(+f2*v&vrLZnq{)9BOdkV zk@J>Ydn=(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e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol new file mode 100644 index 000000000..059ad1776 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +// Top level UsingForDirective not supported yet in Slither. +// The following code may be uncommented when the support is added. +/* +import "./Library.sol"; + +using L for uint; +*/ + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} \ No newline at end of file diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/LibraryUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..9929912ad200d6b63e85d884afcc983ed61ef481 GIT binary patch literal 1220 zcmWIWW@fQxU}E57=wCngv)xHy|ej zGq=!-2EO~hQ<=^`UORi~7Of^uvo{kH6T4EsD`qGe|MxsR>6@fdY<<`zp8pFswI2KY zB=g_KGY1oFtV_o#lQ08Xt?>S3z>LY#F1MdIUjJ8{Qvdb$z z?tIiOv2O=tzH@Ug4NFpBvCg)6_^f!xY%WRXu&}wN3@0O2uX-|%>Ex@ge)qbu zRo-PGk5we8UqJa+PD_jW22K4}y0ewkV$HJKd!zP-be2&FVT!0YQU%Nr9^m&;D9{ zVdw2Wi&aMY`8&R*-!67M(eGyOnz7t|&5O7l6Mq;R>X}8`ocYH8nEU(T&p}_lNE*pL zoU~&8t#0;m|A-d$T^6D8E!}5|F8gUuvg-U$d;g5%f*q~NHMc_r_Ki{*}Djl1&C5*Q)=`Z8)SZy+=)ibF3=Y!UDiaMNWn`5t?E_(cG z;ar~Lzvl1SjjwOq;nu76ex9!E?0pwb29&!S0%9}o4@jEpt%Fk!+i28fzFaE(`q0+(PxVf5>~t6QAndszfldC z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6L$ifd7x6^TgBNCJ{?s^YQh%EpIMBX#y84OpM&i@K_L*JzO@i7N zV6bE>w!b({y5GcG+)r|~HL_(lWH!kTcd4sF7Ppt2&B0u2{S|n1MgVcCY<*>B2OI~E zznoRri}ZOqiW9B?j*mc$RZ@<|@5@=Df4yP$Fu>Iv!@J9SYMqJ80Nuw*E6tyzai#6j z(~BSaj03|bHWiEXKL2~?Wi;G3AS*)ZU@Myf7W!JnaKP(TM+Xq%io5eM2|LOE&5f_< c_*<#R{)+#LBJR#o$NxGx_SHAPrupCPKW|7PtpET3 literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol new file mode 100644 index 000000000..0b3a733c0 --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./StructContractLevel.sol"; + +struct CustomStruct +{ + StructContractLevel.CustomStruct __; +} + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy +{ + +} diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/StructContractLevelUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..c2d7968aea5092fd42ff4fa7f9ea55a166ef6050 GIT binary patch literal 1790 zcmbuA`6JVf1IIt)9=VIj;ALZZh|d_{1r7uEspSqEK=sZ^0RWJK00062 z09$f!h!@$M7(fp8@FHKthvNP0NqC$cG4R*6!;{D`644Kf4-X^;ld&GbUId>|Jj|Cw z3=rny2V4Q*762frRB!!V{h)%ueg;A;yFI{1wHXq3|1#J}jSgx&UHWXHwVKQjPp5^v z=*TX3+?UU*0^WH<4lTZmgeWRi`oj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W5wSbTR~ZxrLwWRdRLzKG^kULaO|$@=hd-X&O&vK|uVkvZgB zJK>D&@M~TuHJ2I7k!)&QV&(l%Fi>%8KiRqxyfYSdA0$2&*L%-koYnPaqR6?bjS)RhDf6xcte_R{vY@AXNV*ide-^xJx_Zb#!Fl~_PVW_M(iTQX zb`vKRxg`)sZ*}53VF%bK(8&QLVt(x3Ep#NJe?kNOAOF=!P7dHBvjG6;sQyP}{ImWC D2E$TG literal 0 HcmV?d00001 diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol b/tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol new file mode 100644 index 000000000..b2b16b43f --- /dev/null +++ b/tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity 0.8.16; + +import "./StructTopLevel.sol"; + +struct CustomStruct +{ + StructTopLevel __; +} + +// dummy contract, so that "No contract were found ..." message is not being thrown by Slither +contract Dummy_ +{ + +} diff --git a/tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol-0.8.16.zip b/tests/e2e/detectors/test_data/unused-import/0.8.16/StructTopLevelUsedTopLevelTest.sol-0.8.16.zip new file mode 100644 index 0000000000000000000000000000000000000000..5a490dae6f70d3d81eb3ea04ec0e307f0d3c65a8 GIT binary patch literal 1761 zcmbW2`9Bj51IIVVWV3nXzH%?sH;nJXS7SDt8!kQ`C8 z&6$KK*EfBMMUK?Ia^&vm`MzGykIyg9=kvq+^Z5(j7_^{}1wa4*17tHFd4Vj>2S|bd zfM8_+;5+~T@SsIT5ouUTgcFHQ3iG6r{QtYLBq~jZN(sA6iiw~^(k@?(BnAc3Njf1^ z3RzT07=Qx+k^lfRCNog~K>u3ByEm;S(6T;quom~kjcj)X^OFsb4uglaE8R`BR`EM^ zQEh{zk)_|;`)jmrz0x|!r>>AP%OK^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