Skip to content

VIP: Rename @constant decorator to @view #2040

@fubuloubu

Description

@fubuloubu

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions