diff --git a/slither/detectors/statements/unused_custom_errors.py b/slither/detectors/statements/unused_custom_errors.py index d73111a1f..b3873ec57 100644 --- a/slither/detectors/statements/unused_custom_errors.py +++ b/slither/detectors/statements/unused_custom_errors.py @@ -54,7 +54,6 @@ def _detect(self) -> List[Output]: # Collect all custom errors defined in the contracts for contract in self.compilation_unit.contracts: - contract.custom_errors_declared for custom_error in contract.custom_errors: declared_custom_errors.append(custom_error) @@ -76,6 +75,7 @@ def _detect(self) -> List[Output]: ): unused_custom_errors.append(declared_error) + # Format results results = [] if len(unused_custom_errors) > 0: info: DETECTOR_INFO = ["The following unused error(s) should be removed:"]