Trick or Treat

First Flight #27
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

L-7: Potential Incompatibility Due to PUSH0 Opcode in Solidity 0.8.20+

Description:

Starting from Solidity 0.8.20, the compiler targets the Shanghai EVM, which includes the PUSH0 opcode. Not all blockchain networks, particularly some Layer 2 solutions, support this opcode.

Instance:

  • Pragma Statement (Line 2):

    pragma solidity ^0.8.24;

Impact:

  • Deployment Failures on Some Networks:

    • Attempting to deploy the contract on networks that do not support the Shanghai upgrade will result in deployment failures.

  • Limited Network Compatibility:

    • This restricts the contract's usability to only those networks that have implemented the latest EVM updates.

Recommendation:

  • Specify Compatible EVM Version:

    • Set the compiler to target an EVM version compatible with the intended deployment networks.

      • In your compiler settings:

        {
        "settings": {
        "evmVersion": "berlin"
        }
        }
  • Use an Earlier Solidity Version if Necessary:

    • If deploying to networks without Shanghai support, consider using Solidity 0.8.19 or earlier.

      pragma solidity 0.8.19;
  • Verify Network Support:

    • Before deployment, confirm that the target network supports the required EVM version and opcodes.

Updates

Appeal created

bube Lead Judge 10 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.