Acton
Linting rules

E020: reserve-mode-literal

Warns when `reserve` mode is passed as numeric literal instead of `RESERVE_MODE_*` constants.

Metadata

  • Code: E020
  • Rule: reserve-mode-literal
  • Status: Stable since v0.0.1
  • Quick fix: sometimes available

What it does

Warns when reserve mode is passed as numeric literal instead of RESERVE_MODE_* constants.

Why is this bad?

Numeric reserve modes are hard to read and easy to misuse. Named constants make intent explicit and reduce mistakes.

Example

reserveToncoinsOnBalance(ton("0.1"), 3);
E020: reserve mode should use RESERVE_MODE_* constants

Use instead:

reserveToncoinsOnBalance(ton("0.1"), RESERVE_MODE_ALL_BUT_AMOUNT + RESERVE_MODE_AT_MOST);
Source code

Last updated on

On this page