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

Floating Pragma

Summary

Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly.

Vulnerability Details

The DecentralizedStableCoin, DSCEngine, and OracleLib contract uses floating pragma. It is considered unsafe.

pragma solidity ^0.8.18;

It's a good practice to avoid the use of floating pragma. Code must be compiled with the same version it as been tested the most. It also avoids the use of any nightly builds which can have unexpected and unknown behaviors
See SWC-103 for more details.

Impact

Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.

Tools Used

Manual Analysis

Recommendations

Consider replacing ^0.8.18 by 0.8.18

Support

FAQs

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