-
Notifications
You must be signed in to change notification settings - Fork 979
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 upgradeability utils #1757
Merged
Merged
Add upgradeability utils #1757
Changes from 52 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
d04fc9e
Start `slither.utils.upgradeability`
webthethird ec537e5
Merge remote-tracking branch 'crytic/slither/dev' into dev-compare-up…
webthethird f08d2af
Implement `compare(v1: Contract, v2: Contract)`
webthethird ebd2201
Pylint
webthethird 04c71c2
Add return statement (whoops!)
webthethird 6b0124c
Merge remote-tracking branch 'crytic/slither/dev' into dev-compare-up…
webthethird 5b361e8
Also consider an unmodified function tainted if it reads/writes the s…
webthethird 6b9d21a
Make pylint happy (reduce branches)
webthethird 3757601
Avoid duplicates, constants and immutables
webthethird 770ca81
Avoid constructor
webthethird 596b4d0
Avoid `slitherConstructorConstantVariables()`
webthethird 480ee60
Avoid `slitherConstructorConstantVariables()`
webthethird 37554ec
Bump to re-run CI tests
webthethird f1947bb
Add additional upgradeability utils
webthethird 8181fae
Add docstrings
webthethird 4c57168
Separate `get_proxy_implementation_var`
webthethird 09128ab
pylint
webthethird a6d49d5
Merge remote-tracking branch 'crytic/slither/dev' into dev-upgradeabi…
webthethird 3655708
Redesign `utils.upgradeability.is_function_modified`
webthethird c195a15
Handle `sload` from slot in `delegatecall` args
webthethird ccb98d8
Merge remote-tracking branch 'crytic/slither/dev' into dev-upgradeabi…
webthethird 317af45
Minor bug fixes
webthethird 9f4be7d
Include variables touched by tainted functions
webthethird 6ff59f9
Copy/paste and tweak `encode_ir` to compare ir
webthethird 701c8f3
Add test for slither.utils.upgradeability.compare
webthethird a035d27
pylint
webthethird c5b5463
Rename shadowed var
webthethird 5622230
Return six lists instead of dictionary of lists
webthethird c159f56
Rewrite test for `utils.upgradeability`
webthethird a6f6fc0
Use `.state_variables_ordered` and `.is_constructor_variables`
webthethird af6727c
Add `Contract.fallback_function` and `.receive_function` properties
webthethird 26f80cf
Use `Contract.fallback_function`
webthethird 1a54d0d
Handle hardcoded slot sloaded in delegatecall
webthethird 24dad03
Document when a newly created variable can be returned
webthethird 9a9acbe
Comment when a newly created variable can be returned
webthethird f148bbc
Also search `parent_func.returns` in `find_delegate_from_name`
webthethird 722a343
Remove unused TEST_upgrade_diff.json
webthethird fc1b94c
Handle named variable declared in assembly
webthethird cbbcb8c
pylint and black
webthethird bff30a3
Update upgradeability util tests
webthethird 574afbe
Add `get_missing_vars` to util, use it in `compare`
webthethird f216817
Use `get_missing_vars` in MissingVariable detector
webthethird 1588334
Fix `compare` return signature
webthethird 0e708e6
Handle sload from integer slot, i.e., `sload(0)`
webthethird 9192fef
Comment out ZosProxy test for now
webthethird 72c6d78
Add SynthProxy.sol to test_upgradeability_util.py test
webthethird a292d8d
Merge remote-tracking branch 'crytic/slither/dev' into dev-upgradeabi…
webthethird 78e2ea3
Add types to function signatures
webthethird c094818
Pylint
webthethird 0ac4c01
Black
webthethird 2695243
Create separate `encore_var_for_compare`
webthethird 47c92f8
Fix ir encoding in comparison
webthethird ac88e8c
Merge remote-tracking branch 'crytic/slither/dev' into dev-upgradeabi…
webthethird be0e405
Move upgradeability util test files
webthethird 8731a92
Add Path import
webthethird 5703b9d
Add test for `Contract.fallback_function`
webthethird File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test case under
slither/tests/unit/core
to ensure that it works for examples like #1331 (comment)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!