Pārlūkot izejas kodu

Ignore reentrancy in`executeBatch` and update Slither config (#3955)

Co-authored-by: Francisco <fg@frang.io>
(cherry picked from commit a5af0adce4276cc0931083d612e31c7319a78a1d)
alpharush 2 gadi atpakaļ
vecāks
revīzija
ab9cc4c4db

+ 1 - 1
.github/workflows/checks.yml

@@ -76,7 +76,7 @@ jobs:
       - uses: actions/checkout@v3
       - name: Set up environment
         uses: ./.github/actions/setup
-      - uses: crytic/slither-action@v0.1.1
+      - uses: crytic/slither-action@v0.2.0
 
   codespell:
     if: github.repository != 'OpenZeppelin/openzeppelin-contracts-upgradeable'

+ 3 - 0
contracts/governance/TimelockController.sol

@@ -316,6 +316,9 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
      *
      * - the caller must have the 'executor' role.
      */
+    // This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,
+    // thus any modifications to the operation during reentrancy should be caught.
+    // slither-disable-next-line reentrancy-eth
     function executeBatch(
         address[] calldata targets,
         uint256[] calldata values,

+ 2 - 1
slither.config.json

@@ -1,4 +1,5 @@
 {
     "detectors_to_run": "reentrancy-eth,reentrancy-no-eth,reentrancy-unlimited-gas",
-    "filter_paths": "contracts/mocks"
+    "filter_paths": "contracts/mocks",
+    "compile_force_framework": "hardhat"
 }