Skip to content

Rules

This section documents the available rules in Natrix.

Rule Code Name Severity Description
NTX1 Memory Expansion Warning Detects when a function's memory frame size is too large
NTX2 Constant Naming Convention Style Ensures that constants are named in UPPER_SNAKE_CASE
NTX3 Implicit Internal Style Detects when internal functions are missing the @internal decorator
NTX4 Implicit View Style Detects when view functions are missing the @view decorator
NTX5 Implicit Pure Style Detects when pure functions are missing the @pure decorator
NTX6 Print Left Warning Detects when print statements are left in the code
NTX7 Cache Storage Variable Optimization Detects when a storage variable is accessed multiple times and suggests caching
NTX8 Unused Variable Warning Detects variables that are declared but never used
NTX9 Implicit Export Important Detects when a module exposes all its functions using __interface__
NTX10 Unused Argument Warning Detects function arguments that are declared but never used
NTX11 Argument Naming Convention Warning Ensures function arguments follow a specified naming convention
NTX12 Modifiers Ordering Style Enforces consistent ordering of function modifiers
NTX13 Unused Event Warning Detects events that are defined but never emitted
NTX14 Unused Imports Warning Detects imports that are defined but never used

Rule Categories

Rules are categorized by severity:

  • Style: Suggestions to improve code readability and consistency.
  • Warning: Potential issues that could lead to bugs or inefficiencies.
  • Optimization: Suggestions to improve gas efficiency.
  • Important: Issues that could have significant impact on security or correctness.