Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaMaul committed Jun 10, 2024
1 parent 6eb48d4 commit db5e053
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion slither/core/scope/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions slither/slither.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit db5e053

Please sign in to comment.