Skip to content

Commit

Permalink
Merge pull request #2394 from nsiregar/filter-name-reused-only-truffle
Browse files Browse the repository at this point in the history
Filter name-reused detector to only run on Truffle projects (#2390)
  • Loading branch information
0xalpharush authored Apr 7, 2024
2 parents b4f4a20 + 5de2360 commit 7071098
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions slither/detectors/slither/name_reused.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from collections import defaultdict
from typing import List

from crytic_compile.platform import Type as PlatformType

from slither.core.compilation_unit import SlitherCompilationUnit
from slither.core.declarations import Contract
from slither.detectors.abstract_detector import (
Expand Down Expand Up @@ -61,6 +63,8 @@ class NameReused(AbstractDetector):
def _detect(self) -> List[Output]:
results = []
compilation_unit = self.compilation_unit
if compilation_unit.core.crytic_compile.platform != PlatformType.TRUFFLE:
return []

all_contracts = compilation_unit.contracts
all_contracts_name = [c.name for c in all_contracts]
Expand Down

0 comments on commit 7071098

Please sign in to comment.