|
|
|
@ -6,51 +6,51 @@ DIR_TESTS="tests/check-upgradeability" |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contractV1.sol" ContractV1 --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 > test_1.txt 2>&1 |
|
|
|
|
DIFF=$(diff test_1.txt "$DIR_TESTS/test_1.txt") |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
then |
|
|
|
|
echo "slither-check-upgradeability 1 failed" |
|
|
|
|
cat test_1.txt |
|
|
|
|
echo "" |
|
|
|
|
cat "$DIR_TESTS/test_1.txt" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contractV1.sol" ContractV1 --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 --new-contract-filename "$DIR_TESTS/contractV2.sol" --new-contract-name ContractV2 > test_2.txt 2>&1 |
|
|
|
|
DIFF=$(diff test_2.txt "$DIR_TESTS/test_2.txt") |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
then |
|
|
|
|
echo "slither-check-upgradeability 2 failed" |
|
|
|
|
cat test_2.txt |
|
|
|
|
echo "" |
|
|
|
|
cat "$DIR_TESTS/test_2.txt" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contractV1.sol" ContractV1 --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 --new-contract-filename "$DIR_TESTS/contractV2_bug.sol" --new-contract-name ContractV2 > test_3.txt 2>&1 |
|
|
|
|
DIFF=$(diff test_3.txt "$DIR_TESTS/test_3.txt") |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
then |
|
|
|
|
echo "slither-check-upgradeability 3 failed" |
|
|
|
|
cat test_3.txt |
|
|
|
|
echo "" |
|
|
|
|
cat "$DIR_TESTS/test_3.txt" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contractV1.sol" ContractV1 --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 --new-contract-filename "$DIR_TESTS/contractV2_bug2.sol" --new-contract-name ContractV2 > test_4.txt 2>&1 |
|
|
|
|
DIFF=$(diff test_4.txt "$DIR_TESTS/test_4.txt") |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
then |
|
|
|
|
echo "slither-check-upgradeability 4 failed" |
|
|
|
|
cat test_4.txt |
|
|
|
|
echo "" |
|
|
|
|
cat "$DIR_TESTS/test_4.txt" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contract_initialization.sol" Contract_no_bug --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 > test_5.txt 2>&1 |
|
|
|
|
DIFF=$(diff test_5.txt "$DIR_TESTS/test_5.txt") |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
if [ "$DIFF" != "" ] |
|
|
|
|
then |
|
|
|
|
echo "slither-check-upgradeability 5 failed" |
|
|
|
|
cat test_5.txt |
|
|
|
@ -58,7 +58,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_5.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contract_initialization.sol" Contract_no_bug --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 > test_5.txt 2>&1 |
|
|
|
@ -71,7 +71,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_5.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,7 +85,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_6.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -99,7 +99,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_7.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contract_initialization.sol" Contract_no_bug_inherits --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 > test_8.txt 2>&1 |
|
|
|
@ -112,7 +112,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_8.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contract_initialization.sol" Contract_double_call --proxy-filename "$DIR_TESTS/proxy.sol" --proxy-name Proxy --solc solc-0.5.0 > test_9.txt 2>&1 |
|
|
|
@ -125,7 +125,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_9.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contractV1.sol" ContractV1 --solc solc-0.5.0 --new-contract-filename "$DIR_TESTS/contract_v2_constant.sol" --new-contract-name ContractV2 > test_10.txt 2>&1 |
|
|
|
@ -138,7 +138,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_10.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
slither-check-upgradeability "$DIR_TESTS/contract_v1_var_init.sol" ContractV1 --solc solc-0.5.0 > test_11.txt 2>&1 |
|
|
|
@ -151,7 +151,7 @@ then |
|
|
|
|
cat "$DIR_TESTS/test_11.txt" |
|
|
|
|
echo "" |
|
|
|
|
echo "$DIFF" |
|
|
|
|
exit -1 |
|
|
|
|
exit 255 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
rm test_1.txt |
|
|
|
|