15,000 USDC
View results
Submission Details
Severity: low
Valid

Floating pragma

Vulnerability Details

In the three smart contracts in scope for this audit, the floating pragma ^0.8.18 is employed. This practice of locking the pragma version helps to enforce that contracts are not unintentionally deployed using a different pragma.
By doing so, the contract system avoids potential issues that may arise from utilizing outdated pragma versions that could introduce bugs or from using recently released pragma versions that might have unknown security vulnerabilities.

File: src/libraries/OracleLib.sol
3: pragma solidity ^0.8.18;

OracleLib.sol#L3

File: src/DSCEngine.sol
24: pragma solidity ^0.8.18;

DSCEngine.sol#L24

File: src/DecentralizedStableCoin.sol
24: pragma solidity ^0.8.18;

DecentralizedStableCoin.sol#L24

Recommendations

It is recommended to lock the pragma version with a known bug-free compiler version. Avoid using floating pragma in the final live deployment whenever possible. By specifying a fixed compiler version, you ensure that the bytecode produced remains consistent across different builds. This is particularly crucial if you rely on bytecode-level verification of the code.

- pragma solidity ^0.8.18;
+ pragma solidity 0.8.18;

Support

FAQs

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