-
Notifications
You must be signed in to change notification settings - Fork 132
/
slither.sh
executable file
·62 lines (54 loc) · 1.33 KB
/
slither.sh
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
#!/usr/bin/env bash
CONTRACTS=(
'GovernorAlpha'
'LoanFactory2'
'FixedTermLoan'
'StkTruToken'
'TrueRatingAgencyV2'
'TrustToken'
'Timelock'
'RateModel'
'TrueMultiFarm'
'TrueFiPool2'
'TrueFiCreditOracle'
'LineOfCreditAgency'
'TimeAveragedBaseRateOracle'
'SpotBaseRateOracle'
'SAFU'
'PoolFactory'
'Liquidator2'
'DeficiencyToken'
'BorrowingMutex'
'CurveYearnStrategy'
'ChainlinkTruOracle'
'ChainlinkTruTusdOracle'
)
if [ ! $(which python3) ]; then
echo "python3 is required to run this script"
exit 1
fi
if [ ! $(which pip3) ]; then
echo "pip3 is required to run this script"
exit 1
fi
if [ ! -d "venv" ]; then
echo "Generating python virtual environment..."
python3 -m venv venv
fi
source venv/bin/activate
pip3 install slither-analyzer --disable-pip-version-check
pip3 install solc-select --disable-pip-version-check
solc-select install 0.6.10
solc-select use 0.6.10
yarn flatten
status=0
for f in "${CONTRACTS[@]}"
do
# Replace all ABIEncoderV2 lines with a single one on the 1st line
if grep -q "pragma experimental ABIEncoderV2;" "flatten/$f.sol"; then
sed -i -e 's/pragma experimental ABIEncoderV2;//g' "flatten/$f.sol"
echo -e 'pragma experimental ABIEncoderV2;\n' | cat - "flatten/$f.sol" > temp && mv temp "flatten/$f.sol"
fi
slither flatten/$f.sol || status=1
done
exit $status