Acton
Linting rules

E021: dangerous-send-mode-missing-safety-comment

Requires a `SAFETY` comment for `msg.send(...)` calls that use dangerous send-mode flags.

Metadata

  • Code: E021
  • Rule: dangerous-send-mode-missing-safety-comment
  • Status: Stable since v0.0.1
  • Quick fix: not available

What it does

Requires a SAFETY comment for msg.send(...) calls that use dangerous send-mode flags.

Why is this bad?

Flags like SEND_MODE_CARRY_ALL_BALANCE or SEND_MODE_DESTROY can drain balance or destroy the contract. These calls should always document their assumptions.

Example

outMsg.send(SEND_MODE_CARRY_ALL_BALANCE);
E021: send with dangerous mode requires safety comment

Use instead:

// SAFETY: this path intentionally drains balance during controlled migration.
outMsg.send(SEND_MODE_CARRY_ALL_BALANCE);
Source code

Last updated on

On this page