Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slither analysis to CI #22

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,16 @@ jobs:

- name: Lint
run: make lint

slither:
name: Slither analysis
needs: contract-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: crytic/[email protected]
with:
node-version: 20.13
slither-version: 0.10.1
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SOLC_VERSION=0.8.20
FORGE=forge
SLITHER=slither
TEST_UPGRADEABLE=false

.PHONY: build
Expand All @@ -18,6 +19,10 @@ test:
coverage:
@$(FORGE) coverage --ffi --use solc:$(SOLC_VERSION)

.PHONY: slither
slither:
@$(SLITHER) .

.PHONY: fmt
fmt:
@$(FORGE) fmt $(FORGE_FMT_OPTS) \
Expand Down
4 changes: 4 additions & 0 deletions slither.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"detectors_to_run": "arbitrary-send-erc20,array-by-reference,incorrect-shift,name-reused,rtlo,suicidal,uninitialized-storage,arbitrary-send-erc20-permit,controlled-array-length,controlled-delegatecall,delegatecall-loop,msg-value-loop,reentrancy-eth,unchecked-transfer,weak-prng,domain-separator-collision,erc20-interface,erc721-interface,locked-ether,mapping-deletion,shadowing-abstract,tautology,write-after-write,boolean-cst,reentrancy-no-eth,reused-constructor,tx-origin,unchecked-lowlevel,unchecked-send,variable-scope,void-cst,events-access,events-maths,incorrect-unary,boolean-equal,deprecated-standards,erc20-indexed,function-init-state,pragma,reentrancy-unlimited-gas,immutable-states,var-read-using-this",
"filter_paths": "(test/|node_modules/|contracts/proto/)"
}