Skip to content

In-depth lesson · Rounding and precision errors

Root causes

Every point the Rounding and precision errors reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 6 of 6
  1. Rounding in the wrong direction or inconsistently between functions.

    Seen in 13 reports
  2. Share price set by the first depositor without a virtual offset or minimum liquidity.

    Seen in 10 reports
  3. Casting or truncating integers between widths or precisions without bounds checks.

    Seen in 3 reports
  4. Dividing before multiplying so intermediate values truncate to zero or lose precision.

    Seen in 2 reports
  5. Precision constants or scaling factors that are too small for the value range.

    Seen in 1 report
  6. Assuming a fixed number of decimals or precision that low-decimal tokens do not have.

    Seen in 1 report