Repository navigation
88 lines (85 loc) · 2.81 KB
/
Copy pathsolidity-static-analysis.yml
File metadata and controls
88 lines (85 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Slither Analysis
on:
workflow_call:
inputs:
disable-divide-before-multiply:
description: 'skip divide before multiply'
required: false
default: false
type: boolean
disable-encode-packed-collision:
description: 'skip abi.encodepacked() collision checks'
required: false
default: false
type: boolean
disable-arbitrary-send-erc20:
description: 'skip arbitrary send checks'
required: false
default: false
type: boolean
disable-array-by-reference:
description: 'skip storage array by value modification checks'
required: false
default: false
type: boolean
disable-tautology:
description: 'skip tautology checks'
required: false
default: false
type: boolean
# May be removed soon as per the removal of the selfdestruct opcode
disable-suicidal:
description: 'skip suicidal'
required: false
default: false
type: boolean
jobs:
slither-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Run Forge build
run: |
forge --version
forge build --build-info
id: build
- name: Install Slither
run: |
pip3 install slither-analyzer
- name: Run detector divide-before-multiply
if: ${{ !inputs.disable-divide-before-multiply }}
run : |
slither --version
slither . --detect=divide-before-multiply --ignore-compile --fail-high
- name: Run detector encode-packed-collision
if: ${{ !inputs.disable-encode-packed-collision }}
run : |
slither --version
slither . --detect=encode-packed-collision --ignore-compile --fail-high
- name: Run detector arbitrary-send-erc20
if: ${{ !inputs.disable-arbitrary-send-erc20 }}
run : |
slither --version
slither . --detect=arbitrary-send-erc20 --ignore-compile --fail-high
- name: Run detector array-by-reference
if: ${{ !inputs.disable-array-by-reference }}
run : |
slither --version
slither . --detect=array-by-reference --ignore-compile --fail-high
- name: Run detector tautology
if: ${{ !inputs.disable-tautology }}
run : |
slither --version
slither . --detect=tautology --ignore-compile --fail-high
- name: Run detector suicidal
if: ${{ !inputs.disable-suicidal }}
run : |
slither --version
slither . --detect=suicidal --ignore-compile --fail-high