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

Solidity version 0.8.20 may not work on other chains due to `PUSH0`

Summary

The protocol is expected to be functional on any EVM chain (source: discord contest channel). The compiler for Solidity 0.8.20 switches the default target EVM version to Shanghai, which includes the new PUSH0 op code. This op code may not yet be implemented on all L2s, so deployment on these chains will fail.

Vulnerability Details

See this relevant issue on the official Solidity github for reference. To work around this issue, use an earlier EVM version.

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

Impact

Contracts may become completely non-functional on other chains.

Tools Used

Manual review

Recommendations

To work around this issue, modify the pragma to exclude Solidity version 0.8.20:

pragma solidity ^0.8.18 <0.8.20;

Support

FAQs

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