Skip to content

Floating / Unlocked Pragma

SAFE-0078 Best Practice Checked automatically by the scanner
1

What goes wrong

A floating pragma (e.g. ^0.8.0) lets the contract compile with compiler versions not tested against, risking compiler-specific bugs or behavioral differences in deployment.

2

How to fix it

the pattern that is safe
pragma solidity 0.8.24; // locked
SWC-103. Lock the compiler version.
3

Where this has happened

Largest recorded losses in the same failure class — related, not the same bug:

Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0078 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs