-
-
Notifications
You must be signed in to change notification settings - Fork 872
fix[lang]: disallow staticcall in pure context #4619
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
fix[lang]: disallow staticcall in pure context #4619
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4619 +/- ##
==========================================
- Coverage 92.50% 92.49% -0.01%
==========================================
Files 128 128
Lines 18510 18521 +11
Branches 3208 3210 +2
==========================================
+ Hits 17122 17131 +9
- Misses 944 945 +1
- Partials 444 445 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| """ | ||
| @pure | ||
| def foo(a: address): | ||
| x: Bytes[32] = raw_call(a, b'', max_outsize=32, is_static_call=True or False) |
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.
nice -- please add comment saying this is to test constant folding
vyper/semantics/analysis/local.py
Outdated
| self._check_call_mutability(func_type.mutability) # type: ignore | ||
| from vyper.builtins.functions import RawCall | ||
|
|
||
| # opposed to other funs, raw_call's mutability depends on its arguments |
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.
| # opposed to other funs, raw_call's mutability depends on its arguments | |
| # as opposed to other functions, raw_call's mutability depends on its arguments |
vyper/semantics/analysis/local.py
Outdated
|
|
||
| self.visit(node.func, func_type) | ||
|
|
||
| def get_raw_call_mutability(self, node: vy_ast.Call): |
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.
this method should rather be on RawCall
charles-cooper
left a 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.
looks good, just some small changes
|
the recent changes seem good |
What I did
puremutability context #3093Commit Message
How to verify it