-
Notifications
You must be signed in to change notification settings - Fork 982
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve slither-find-paths + add travis unit tests
- Loading branch information
Showing
4 changed files
with
62 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
### Test slither-check-upgradability | ||
|
||
DIR_TESTS="tests/possible_paths" | ||
|
||
slither-find-paths "$DIR_TESTS/paths.sol" A.destination --solc solc-0.5.0 > test_possible_paths.txt 2>&1 | ||
DIFF=$(diff test_possible_paths.txt "$DIR_TESTS/paths.txt") | ||
if [ "$DIFF" != "" ] | ||
then | ||
echo "slither-find-paths failed" | ||
cat test_possible_paths.txt | ||
cat "$DIR_TESTS/paths.txt" | ||
exit -1 | ||
fi | ||
rm test_possible_paths.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
contract A{ | ||
function destination() private{ | ||
|
||
} | ||
|
||
function call() public{ | ||
destination(); | ||
} | ||
} | ||
|
||
contract B{ | ||
|
||
|
||
function call2(A a) public{ | ||
a.call(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Target functions: | ||
- A.destination() | ||
|
||
|
||
The following functions reach the specified targets: | ||
- A.call() | ||
- B.call2(A) | ||
|
||
|
||
The following paths reach the specified targets: | ||
A.call() -> A.destination() | ||
|
||
B.call2(A) -> A.call() -> A.destination() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters