Linting rules
E028: no-global-variables
Disallows top-level `global` variable declarations.
Metadata
Code:E028Rule:no-global-variablesStatus: Stable sincev0.0.1Quick fix: not available
What it does
Disallows top-level global variable declarations.
Why is this bad?
Global mutable state makes contracts harder to reason about and audit. Keeping state in explicit storage structures and passing values through function scope is clearer and less error-prone.
Example
global counter: intUse instead:
struct State {
counter: int
}Last updated on