Repository: pessimistic-io/slitherin (language: python)

Issue:
Version 0.6.1
# Major Updates
## Crucial Fixes
1. `pess-arb-solidity-version`: Removed detector. `PUSH0` opcode is now [supported](https://docs.arbitrum.io/for-devs/concepts/differences-between-arbitrum-ethereum/solidity-support) in ArbitrumOS. Thx **@Yhtiyar**, **@0xalpharush** and **@0xEVom**.

# Minor Updates and Optimization
## Minor Fixes
1. Removed a redundant directory.



Discussion / hints:

Fix patch:
diff --git a/docs/arb_solidity_version.md b/docs/arb_solidity_version.md
deleted file mode 100644
index cfc5b68..0000000
--- a/docs/arb_solidity_version.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Arbitrum solidity version
-
-## Configuration
-
-- Check: `pess-arb-solidity-version`
-- Severity: `High`
-- Confidence: `Low`
-
-## Description
-
-Checks that sol version >= 0.8.20 is not used inside an Arbitrum contract. Solidity in these versions will utilize PUSH0 opcode, which is not supported on Arbitrum.
-
-## Vulnerable Scenario
-
-[test scenarios](../tests/arbitrum_prevrandao_solidity_version_test.sol)
-
-## Recommendation
-
-Either, use versions `0.8.19`` and below, or EVM versions below shanghai
diff --git a/slitherin/__init__.py b/slitherin/__init__.py
index 35c1218..cd9e78b 100644
--- a/slitherin/__init__.py
+++ b/slitherin/__init__.py
@@ -26,7 +26,6 @@
 from slitherin.detectors.arbitrum.arbitrum_prevrandao_difficulty import (
     ArbitrumPrevrandaoDifficulty,
 )
-from slitherin.detectors.arbitrum.solidity_version import ArbitrumSolidityVersion
 from slitherin.detectors.arbitrum.block_number_timestamp import (
     ArbitrumBlockNumberTimestamp,
 )
@@ -34,7 +33,6 @@
 
 artbitrum_detectors = [
     ArbitrumPrevrandaoDifficulty,
-    ArbitrumSolidityVersion,
     ArbitrumBlockNumberTimestamp,
 ]
 
diff --git a/slitherin/consts.py b/slitherin/consts.py
index d20d4c5..6820379 100644
--- a/slitherin/consts.py
+++ b/slitherin/consts.py
@@ -1,2 +1,2 @@
 ARBITRUM_KEY = "SLITHERIN_ARBITRUM"
-SLITHERIN_VERSION = "0.6.0"
+SLITHERIN_VERSION = "0.6.1"
diff --git a/slitherin/detectors/arbitrum/solidity_version.py b/slitherin/detectors/arbitrum/solidity_version.py
deleted file mode 100644
index 34a2def..0000000
--- a/slitherin/detectors/arbitrum/solidity_version.py
+++ /dev/null
@@ -1,61 +0,0 @@
-import os
-from typing import List
-from slither.utils.output import Output
-from slither.core.cfg.node import Node
-from slither.detectors.abstract_detector import (
-    AbstractDetector,
-    DetectorClassification,
-    make_solc_versions,
-)
-from slither.core.declarations import Function
-from slither.slithir.operations.event_call import EventCall
-from slither.analyses.data_dependency.data_dependency import is_dependent
-from slither.slithir.operations import SolidityCall
-from slither.core.declarations.solidity_variables import (
-    SolidityVariableComposed,
-    SolidityFunction,
-)
-
-from ...consts import ARBITRUM_KEY
-
-
-class ArbitrumSolidityVersion(AbstractDetector):
-    """
-    Checks that sol version >= 0.8.20 is not used inside an Arbitrum contract
-    """
-
-    ARGUMENT = "pess-arb-solidity-version"  # slither will launch the detector with slither.py --detect mydetector
-    HELP = "sol version >= 0.8.20 is used in contract that will be deployed to Arbitrum (Potential usage of PUSH0, which is not supported)"
-    IMPACT = DetectorClassification.HIGH
-    CONFIDENCE = DetectorClassification.LOW
-
-    WIKI = "https://github.com/pessimistic-io/slitherin/blob/master/docs/arb_difficulty_randao.md"
-    WIKI_TITLE = "Arbitrum solidity version"
-    WIKI_DESCRIPTION = "Potential usage of PUSH0 opcode"
-    WIKI_EXPLOIT_SCENARIO = "N/A"
-    WIKI_RECOMMENDATION = (
-        "Either, use versions 0.8.19 and below, or EVM versions below shanghai"
-    )
-
-    def _detect(self) -> List[Output]:
-        """Main function"""
-        results = []
-
-        if os.getenv(ARBITRUM_KEY) is None:
-            return results
-
-        if (
-            self.compilation_unit.is_solidity
-            and self.compilation_unit.solc_version in make_solc_versions(8, 20, 99)
-        ):
-            results.append(
-                self.generate_result(
-                    [
-                        "Potential usage of solidity version >= 0.8.20 detected. Solidity in these versions will utilize PUSH0 opcode, ",
-                        "which is not supported on Arbitrum. ",
-                        "Either, use versions 0.8.19 and below, or EVM versions below shanghai",
-                    ]
-                )
-            )
-
-        return results
diff --git a/slitherin/detectors/uniswap-v3/callback.py b/slitherin/detectors/uniswap-v3/callback.py
deleted file mode 100644
index 4681a40..0000000
--- a/slitherin/detectors/uniswap-v3/callback.py
+++ /dev/null
@@ -1,99 +0,0 @@
-import re
-from typing import List, Tuple
-
-from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification
-from slither.slithir.operations import SolidityCall, Condition
-from slither.core.declarations import (
-    FunctionContract,
-    SolidityVariableComposed,
-    Function,
-)
-from slither.core.cfg.node import Node
-from slither.slithir.operations import LowLevelCall
-from slither.analyses.data_dependency.data_dependency import is_dependent
-
-
-class AAVEFlashloanCallbackDetector(AbstractDetector):
-    """
-    Detects if the flashloan callback `executeOperation` has `initiator` and `msg.sender` validation
-    """
-
-    ARGUMENT = "pess-aave-flashloan-callback"  # slither will launch the detector with slither.py --detect mydetector
-    HELP = "see `executeOperation`callback docs"
-    IMPACT = DetectorClassification.HIGH
-    CONFIDENCE = DetectorClassification.HIGH
-
-    WIKI = "https://github.com/pessimistic-io/slitherin/blob/master/docs/aave/flashloan_callback.md"
-    WIKI_TITLE = "AAVE Flashloan callback"
-    WIKI_DESCRIPTION = "Check docs"
-    WIKI_EXPLOIT_SCENARIO = (
-        "Attacker can directly call or initiate flashloan to this address"
-    )
-    WIKI_RECOMMENDATION = "Validate the msg.sender and `initiator` argument"
-
-    def _analyze_function(
-        self,
-        function: FunctionContract,
-        args_to_verify,
-        check_recursive=False,
-        visited=[],
-    ) -> Tuple[set, set]:
-        checked = set()
-        unchecked = set(args_to_verify)
-
-        for node in function.nodes:
-            if node.is_conditional(include_loop=False):  # contains if/assert/require
-                for a in unchecked:
-                    if any([is_dependent(arg, a, node) for arg in node.variables_read]):
-                        checked.add(a)
-
-        unchecked.difference_update(checked)  # remove all checked
-
-        visited.append(function)
-        if check_recursive:
-            for node in function.nodes:
-                for internal_call in node.internal_calls:
-                    # Filter to Function, as internal_call can be a solidity call
-                    if isinstance(internal_call, Function):
-                        _checked, _unchecked = self._analyze_function(
-                            internal_call, unchecked, False, visited
-                        )  # We are going only 1 step into in recursion
-                        checked |= _checked
-                        unchecked = _unchecked
-
-        return checked, unchecked
-
-    def _detect(self):
-        results = []
-        for contract in self.compilation_unit.contracts_derived:
-            for f in contract.functions:
-                if (
-                    f.signature_str
-                    == "executeOperation(address[],uint256[],uint256[],address,bytes) returns(bool)"
-                ):
-                    _, unchecked = self._analyze_function(
-                        f,
-                        [
-                            SolidityVariableComposed("msg.sender"),
-                            f.parameters[3],  # initiator parameter
-                        ],
-                        check_recursive=True,
-                    )
-                    if unchecked:
-                        info = [
-                            "Unchecked function parameters in AAVE callback: ",
-                            f,
-                            "\n",
-                        ]
-                        for var in unchecked:
-                            if var == SolidityVariableComposed("msg.sender"):
-                                info += ["\t", "'msg.sender' is not checked", "\n"]
-                            else:
-                                info += ["\t'", var.name, "' is not checked\n"]
-
-                        tres = self.generate_result(info)
-                        # for var in unchecked:
-                        #     tres.add(var)
-                        # tres.add(f)
-                        results.append(tres)
-        return results


Test patch:
diff --git a/tests/arbitrum_solidity_version_test.sol b/tests/arbitrum_solidity_version_test.sol
deleted file mode 100644
index fbe7da6..0000000
--- a/tests/arbitrum_solidity_version_test.sol
+++ /dev/null
@@ -1,4 +0,0 @@
-// SPDX-License-Identifier: SEE LICENSE IN LICENSE
-pragma solidity 0.8.21;
-
-contract Test {}