From bd60f56272e1fb5c5338f85455817cca6578871e Mon Sep 17 00:00:00 2001 From: garrettjmu Date: Thu, 2 Mar 2023 20:29:40 -0500 Subject: [PATCH 1/5] add slither workflow --- .github/workflows/slither.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/slither.yml diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml new file mode 100644 index 00000000..d3ebd37e --- /dev/null +++ b/.github/workflows/slither.yml @@ -0,0 +1,30 @@ +name: Slither Analysis + +on: + push: + branches: + - main + pull_request: + +jobs: + analyze: + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Run Slither + uses: crytic/slither-action@v0.2.0 + id: slither + with: + node-version: 16 + sarif: results.sarif + fail-on: none + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: ${{ steps.slither.outputs.sarif }} \ No newline at end of file From 118459d51b0d41c4a08dfc04e8b60e83614b53c1 Mon Sep 17 00:00:00 2001 From: garrettjmu Date: Thu, 2 Mar 2023 20:59:17 -0500 Subject: [PATCH 2/5] update ci workflow --- .github/workflows/ci.yml | 13 +++++++++++++ .github/workflows/slither.yml | 30 ------------------------------ .gitignore | 3 +++ 3 files changed, 16 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/slither.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78d7c548..a0b94701 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,19 @@ jobs: - name: Check forge snapshots run: forge snapshot --check --match-contract Gas + - name: Run Slither + uses: crytic/slither-action@main + id: slither + continue-on-error: true + with: + sarif: results.sarif + fails_on: none + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: ${{ steps.slither.outputs.sarif }} + - name: Check code coverage run: | forge coverage --report lcov diff --git a/.github/workflows/slither.yml b/.github/workflows/slither.yml deleted file mode 100644 index d3ebd37e..00000000 --- a/.github/workflows/slither.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Slither Analysis - -on: - push: - branches: - - main - pull_request: - -jobs: - analyze: - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Run Slither - uses: crytic/slither-action@v0.2.0 - id: slither - with: - node-version: 16 - sarif: results.sarif - fail-on: none - - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: ${{ steps.slither.outputs.sarif }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 88680894..44f86c31 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ .pnp.* yarn-debug.log* yarn-error.log* + +# ide +.idea \ No newline at end of file From 1de113acb7fecf28e8f829ac0e546367841c8602 Mon Sep 17 00:00:00 2001 From: garrettjmu Date: Sat, 4 Mar 2023 12:31:26 -0500 Subject: [PATCH 3/5] omit node modules --- slither.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither.config.json b/slither.config.json index 56d83e43..27c09e64 100644 --- a/slither.config.json +++ b/slither.config.json @@ -5,6 +5,6 @@ "exclude_medium": false, "exclude_high": false, "disable_color": false, - "filter_paths": "(test/|lib/forge-std/|script/)", + "filter_paths": "(test/|lib/forge-std/|script/|node_modules/)", "legacy_ast": false } From a72acb8285d6ac3e92946cbb2bb41734b3c35934 Mon Sep 17 00:00:00 2001 From: garrettjmu Date: Sat, 4 Mar 2023 12:43:03 -0500 Subject: [PATCH 4/5] see speed change --- slither.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither.config.json b/slither.config.json index 27c09e64..71b394a9 100644 --- a/slither.config.json +++ b/slither.config.json @@ -5,6 +5,6 @@ "exclude_medium": false, "exclude_high": false, "disable_color": false, - "filter_paths": "(test/|lib/forge-std/|script/|node_modules/)", + "filter_paths": "(test/|lib/|script/|node_modules/)", "legacy_ast": false } From c5a8b6069e58dda7761be80105d22975a125982c Mon Sep 17 00:00:00 2001 From: garrettjmu Date: Sat, 4 Mar 2023 12:58:54 -0500 Subject: [PATCH 5/5] trying varying exclusions for high cost evaluation --- slither.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither.config.json b/slither.config.json index 71b394a9..d8d2a406 100644 --- a/slither.config.json +++ b/slither.config.json @@ -1,5 +1,5 @@ { - "detectors_to_exclude": "assembly-usage, block-timestamp, conformance-to-solidity-naming-conventions, incorrect-versions-of-solidity", + "detectors_to_exclude": "assembly-usage, block-timestamp, conformance-to-solidity-naming-conventions, incorrect-versions-of-solidity, similar-variables, low-level-calls", "exclude_informational": false, "exclude_low": false, "exclude_medium": false,