Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

[L-2] Prefer Explicit and Up-to-Date Solidity Version Over ^ Range Pragma

Description

Your contracts declare Solidity pragmas like:

pragma solidity ^0.8.18;

This uses the caret (^) operator, allowing compilation under any minor version above 0.8.18 but below 0.9.0. While this can allow rapid iteration on minor updates, it also can introduce unexpected issues if a future compiler release changes behavior in ways you do not anticipate. Additionally, Solidity 0.8.28 is now available, which defaults the EVM target to “Cancun” and may bring optimizations and improvements you can leverage.


Impact

  • Potential Compiler Breakage: Future minor releases might contain changes or features that could break assumptions in your contract code.

  • Version Mismatch Confusion: Collaborators or external integrators may compile your contract with a version different from the one it was originally audited or tested against.

  • Missing Improvements: Sticking to an older minor version (like 0.8.18) means you might miss out on improvements, optimizations, and bug fixes in newer versions—particularly now that 0.8.28 is available.


Recommendations

  1. Lock to a Specific Version

    • Replace:

      pragma solidity ^0.8.18;

      with:

      pragma solidity 0.8.28;
    • This ensures you consistently compile against a well-known compiler version and eliminates unexpected behavior caused by future releases.

  2. Adopt the Latest Compiler (0.8.28)

    • Version 0.8.28 offers default compilation to the “Cancun” EVM target, including various optimizations and improvements.

Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.