A detector that identifies cell overflow and underflow problems.

Cell overflow and underflow are issues specific to the TON blockchain. TON stores data in cells, which are low-level data structures used for serialization and deserialization.

The overflow issue occurs when the user attempts to store more data in a cell than it supports. The current limitation is 1023 bits and 4 references to other cells. When these limits are exceeded, the contract throws an error with the exit code 8 during the compute phase.

The underflow issue occurs when the user attempts to get more data from a structure than it supports. cells. When it happens, the contract throws an error with the exit code 9 during the compute phase.

// Bad: storeRef is used more than 4 times
beginCell()
  .storeRef(...)
  .storeAddress(myAddress())
  .storeRef(...)
  .storeRef(...)
  .storeRef(...)
  .storeRef(...)
  .endCell()

Use instead:

// OK: Fixed after the analyzer highlighted it
beginCell()
  .storeRef(...)
  .storeAddress(myAddress())
  .storeRef(...)
  .storeRef(...)
  .storeRef(...)
  .endCell()
  1. Cell & Bag of Cells (BoC) | TON Docs
  2. TVM Exit codes | TON Docs
  3. Cells, Builders and Slices | Tact Docs

Hierarchy (view full)

Constructors

Properties

severity: Severity = Severity.CRITICAL

Gets the severity of the detector.

Accessors

  • get id(): string
  • Gets the short identifier of the detector, used in analyzer warnings.

    Returns string

    The unique identifier of the detector.

  • get shareImportedWarnings(): WarningsBehavior
  • Defines the behavior of warnings generated by this detector when working with multiple projects within a single Tact configuration.

    Here are the available options:

    1. "union" Leave this value if you don't care about warnings generated in other projects.
    2. "intersect" If the warning is generated for some source location of the imported file, it should be generated by each of the projects. Example: Constants from an imported file should not be reported iff they are unused in all the projects, so you need "intersect".

    Returns WarningsBehavior

  • get usesSouffle(): boolean
  • Checks whether this detector needs the Soufflé binary to be executed.

    Returns boolean

Methods