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
Support the use of @pure as a decorator for methods
Motivation
To be consistent with the ABI stateMutability field, we should add support for specifying a method as @pure.
Specification
A method that is decorated as @pure must not read any blockchain state such as storage variables, environment variables, querying contract code or account balances, or making a call to nonpure methods, or to other contracts. In the event this happens, this should raise an exception that uniquely details a violation of reading blockchain state. Such a function might be useful for complex math or other purposes.
Simple Summary
Support the use of
@pure
as a decorator for methodsMotivation
To be consistent with the ABI
stateMutability
field, we should add support for specifying a method as@pure
.Specification
A method that is decorated as
@pure
must not read any blockchain state such as storage variables, environment variables, querying contract code or account balances, or making a call to nonpure
methods, or to other contracts. In the event this happens, this should raise an exception that uniquely details a violation of reading blockchain state. Such a function might be useful for complex math or other purposes.A method decorated with
@pure
looks like:Backwards Compatibility
No backwards compatibility issues
Dependencies
No dependencies. Related to #2040
References
Copyright
Copyright and related rights waived via CC0
The text was updated successfully, but these errors were encountered: