floating-pragma

Detect floating pragmas in Solidity contracts and provide locked pragma remediation.

1|1|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/Apegurus/solidity-argus --skill floating-pragma
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: floating-pragma
Source: https://github.com/Apegurus/solidity-argus/tree/main/skills/vulnerability-patterns/floating-pragma
Command: npx skills add https://github.com/Apegurus/solidity-argus --skill floating-pragma

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the security risk associated with using floating or range pragmas in Solidity smart contracts, which can lead to unexpected behavior or vulnerabilities due to compilation with untested compiler versions.

Core Features & Use Cases

  • Identifies Floating Pragmas: Detects pragma solidity ^0.8.0 or pragma solidity >=0.7.0 <0.9.0 declarations.
  • Distinguishes Libraries: Differentiates between deployable contracts and libraries/packages where floating pragmas might be acceptable.
  • Provides Remediation: Offers clear guidance on how to use locked pragmas for deterministic compilation.
  • Use Case: Ensure that your deployed smart contracts are compiled with a specific, tested version of the Solidity compiler, preventing potential bugs introduced by newer, unvetted versions.

Quick Start

Audit the VaultContract.sol for security vulnerabilities.

Frequently Asked Questions about floating-pragma

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why are floating pragmas a security risk in Solidity smart contracts?

Floating pragmas allow Solidity smart contracts to compile with untested compiler versions, leading to unpredictable behavior and potential security vulnerabilities. Locking pragmas enforces deterministic compilation with a specific, tested compiler version.

How do I detect floating or range pragmas in my Solidity code?

Audit Solidity code to identify declarations like `pragma solidity ^0.8.0` or `pragma solidity >=0.7.0 <0.9.0`. The scan distinguishes deployable contracts from libraries and provides remediation steps to enforce locked pragmas.

Can I use floating pragmas in Solidity libraries?

Yes, floating pragmas might be acceptable in Solidity libraries and packages. The detection process distinguishes between deployable contracts, which require locked pragmas for security, and libraries where flexible compiler versions are permitted.

What is the best way to lock Solidity compiler versions for deployment?

Use a specific pragma statement instead of floating or range declarations to lock Solidity compiler versions. This enforces deterministic compilation, preventing potential bugs introduced by newer, unvetted compiler versions during smart contract deployment.

What are the limitations of using range pragmas in smart contract auditing?

Range pragmas limit smart contract auditing by allowing compilation across multiple Solidity versions, which introduces unpredictable behavior. It prevents guaranteeing that the deployed contract matches the specifically tested and audited compiler version.