You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current check for isPure in the type checker should be extended to similar means of access and to AST nodes beyond expressions.
The isPure AST annotation should be extended, so that it is possible to determine:
whether the code reads from the state (i.e. is non-pure)
whether the code might modify state (i.e. storage, balance, create contracts, etc)
Both of these properties should also take variables and function calls into account. I.e. a statement assigning to a storage variable modifies state, a call to a non-constant function does not modify state, but reads from state.
For now, we assume that passing a storage variable to a constant function can modify storage.
At some point, we also have to determine whether variables declared constant are accessed in a way that makes it possible to modify them. This includes passing constant variables to functions as non-constant non-value parameters or accessing "deep elements" of a variable in such a way, i.e. assigning to an element of a constant array.
The current check for
isPure
in the type checker should be extended to similar means of access and to AST nodes beyond expressions.The
isPure
AST annotation should be extended, so that it is possible to determine:Both of these properties should also take variables and function calls into account. I.e. a statement assigning to a storage variable modifies state, a call to a non-constant function does not modify state, but reads from state.
For now, we assume that passing a storage variable to a constant function can modify storage.
At some point, we also have to determine whether variables declared
constant
are accessed in a way that makes it possible to modify them. This includes passing constant variables to functions as non-constant non-value parameters or accessing "deep elements" of a variable in such a way, i.e. assigning to an element of a constant array.Part of #715 and #992
The text was updated successfully, but these errors were encountered: