Skip to content

Commit

Permalink
added OZ upgradeable versions to whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
Yhtiyar committed Jun 19, 2024
1 parent f3324ab commit 391e8d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion slitherin/detectors/dubious_typecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ class DubiousTypecast(AbstractDetector):
)
WIKI_RECOMMENDATION = "Use clear constants"

WHITELIST = ["SafeCast", "SignedMath"] # OZ
WHITELIST = [
"SafeCast",
"SignedMath",
"SafeCastUpgradeable",
"SignedMathUpgradeable",
] # OZ

def analyze_irs(self, irs: List[Operation]) -> List[Tuple[str, str]]:
results = []
Expand Down
2 changes: 1 addition & 1 deletion slitherin/detectors/magic_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MagicNumber(AbstractDetector):

EXCEPTION = {"0", "1", "2", "1000", "1e18"}
used_count = defaultdict(lambda: {"count": 0, "nodes": []})
WHITELIST = ["SafeCast", "Math"]
WHITELIST = ["SafeCast", "Math", "MathUpgradeable", "SafeCastUpgradeable"]

def _check_if_pow_10(self, str: str) -> bool:
reg = re.fullmatch(r"^10*$|^10*e\d+$", str) # 1(0..) or 1(0..)eX
Expand Down

0 comments on commit 391e8d2

Please sign in to comment.