Skip to content

Keyword for readonly modifiers #1402

@ethers

Description

@ethers

Looking across contracts, it appears that most modifiers don't change state: they're generally used for checking preconditions and "condition-orientated" programming. IMO this is good since they are kept simple, and since they don't change state, their order doesn't matter. So instead of the term modifier, as a starting point how about another (additional) keyword for them? The cases where people are changing state in a modifier can remain the same and use modifier, but for new contracts where they don't change state, a term other than modifier seems more fitting as the contract isn't getting modified.

Some suggestions are condition, precondition, pre. Other languages from https://en.wikipedia.org/wiki/Design_by_contract could be consulted for other potential names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed due inactivityThe issue/PR was automatically closed due to inactivity.language design :rage4:Any changes to the language, e.g. new featuresstaleThe issue/PR was marked as stale because it has been open for too long.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions