Skip to content
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

VIP: Rename @constant decorator to @view #2040

Closed
fubuloubu opened this issue Jun 25, 2020 · 1 comment · Fixed by #2049
Closed

VIP: Rename @constant decorator to @view #2040

fubuloubu opened this issue Jun 25, 2020 · 1 comment · Fixed by #2049
Assignees
Labels
VIP: Approved VIP Approved

Comments

@fubuloubu
Copy link
Member

fubuloubu commented Jun 25, 2020

Simple Summary

Change the @constant decorator to @view for methods

Motivation

To be consistent with the ABI stateMutability field, we should use the term view instead of constant when decorating a method

Specification

Contracts and Vyper interfaces should be specified using the following syntax to denote a method that does not modify state:

@view
@public
def getSender() -> address:
    return msg.sender

Backwards Compatibility

Breaks backwards compatibility because of a name change.

Dependencies

No dependencies

References

Copyright

Copyright and related rights waived via CC0

@iamdefinitelyahuman
Copy link
Contributor

Violent agreement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Approved VIP Approved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants