OWASP·SC08·high

Integer overflow and underflow

The OWASP framing of SWC-101, with emphasis on unchecked blocks and unsafe casts.

What it is

On current compilers the classic wrap is handled, so the remaining exposure is deliberate: unchecked blocks added for gas, downcasts that truncate without warning, and division that truncates before a multiplication that would have preserved precision.

Why it matters

Balances, supplies and reward accruals that are wrong by enormous margins from a single truncation or wrap.

How to fix it

  • Compile on 0.8+ and justify every unchecked block in a comment.
  • Use a safe-cast library for every downcast.
  • Order arithmetic to multiply before dividing.

How it is detected

Every audit on EVM Smart Audit checks for SC08 and reports it as passed or flagged in the standards coverage grid — so the report tells you it was checked even when nothing was found. See the detector suite for what else runs alongside it, or the full database for the other 21 checks.

Related weaknesses

Check your contract for integer overflow and underflow

The engine runs this check and 21 others on every audit, and shows what passed as well as what failed.

Start your auditSee pricing