Skip to content

Commit

Permalink
contracts-bedrock: fix slither
Browse files Browse the repository at this point in the history
`slither` crashes on new solidity features, one is used
in the forge tests. Not exactly sure what it is, but
this will prevent that problem by moving the tests
to a temp dir when running slither and then moving them
back.
  • Loading branch information
tynes committed Jul 31, 2022
1 parent 70bf922 commit 056cb98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/angry-cameras-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/contracts-bedrock': patch
---

Fix slither script
1 change: 1 addition & 0 deletions packages/contracts-bedrock/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ remappings = [
extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
bytecode_hash = 'none'
build_info = true
build_info_path = 'artifacts/build-info'
ffi = true
fuzz_runs = 16

Expand Down
9 changes: 5 additions & 4 deletions packages/contracts-bedrock/scripts/slither.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

if [ ! -d forge-artifacts/build-info ]; then
npx hardhat compile
fi
# Handle slither bug unable to work with the foundry tests
TEMP=$(mktemp -d)
mv contracts/test $TEMP/test

cp -rf forge-artifacts/build-info artifacts/build-info
slither .

mv $TEMP/test contracts/test

0 comments on commit 056cb98

Please sign in to comment.