diff --git a/slither/core/scope/scope.py b/slither/core/scope/scope.py index 5e0241309..2fe40bdab 100644 --- a/slither/core/scope/scope.py +++ b/slither/core/scope/scope.py @@ -85,7 +85,7 @@ def add_accessible_scopes(self) -> bool: # pylint: disable=too-many-branches if not set(new_scope.exported_symbols).issubset(self.exported_symbols): # We are using lists and specifically extending them to keep the order in which # elements are added. This will come handy when we have name collisions. - # See issue : + # See issue : https://github.com/crytic/slither/issues/2477 new_symbols = [ symbol for symbol in new_scope.exported_symbols diff --git a/slither/slither.py b/slither/slither.py index b565cc12d..4b30048dc 100644 --- a/slither/slither.py +++ b/slither/slither.py @@ -57,8 +57,9 @@ def _update_file_scopes( if refId in sol_parser.contracts_by_id: contract = sol_parser.contracts_by_id[refId] - # Only add elements if they are not present. Since we kept the exported symbols in - # we resolve from the most local imports first. + # Add elements only if they are not already present. By keeping the exported symbols + # in the order they were encountered, we ensure that the most local imports are + # resolved first. if contract.name not in scope.contracts: scope.contracts[contract.name] = contract