Last Man Standing

First Flight #45
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Impact: high
Likelihood: medium
Invalid

PUSH0 is not supported by all chains

PUSH0 is not supported by all chains

Description

  • The PUSH0 opcode was introduced in Ethereum's Shanghai upgrade (April 2023) as part of EIP-3855 to optimize gas costs. While supported on Ethereum mainnet and most modern EVM chains, some L2s and alternative EVM implementations may not yet support this opcode.

  • Contracts compiled with Solidity 0.8.20+ may include PUSH0 instructions by default, potentially causing deployment failures or runtime errors on unsupported chains like:

    • Older Ethereum testnets not upgraded

    • Certain Layer 2 solutions

    • Alternative EVM chains (Polygon zkEVM, BSC before upgrades)

// Compiling with Solidity 0.8.20+ may generate PUSH0 instructions
pragma solidity ^0.8.20; // @> May produce chain-incompatible bytecode

Risk

Likelihood: Medium

  • Deploying to chains that haven't implemented Shanghai upgrades

  • Using development environments with inconsistent EVM versions

  • Maintaining cross-chain compatible codebases

Impact:

  • Complete deployment failure on unsupported chains

  • Bytecode execution failures if somehow deployed

  • Fragmented deployment capabilities across ecosystems

Proof of Concept

The issue can be demonstrated by compiling with Solidity ≥0.8.20 and attempting deployment on unsupported chains (e.g., legacy testnets or non-upgraded L2s), resulting in PUSH0-related revert errors.

Chain Compatibility Check:

// Test contract to detect PUSH0 support
contract Push0Checker {
function check() public pure returns (bool) {
assembly {
let x := 0
// This will compile to PUSH0 on 0.8.20+
}
return true;
}
}

Recommended Mitigation

Either:

  1. Downgrade to Solidity 0.8.19 (pragma solidity 0.8.19;), or

  2. Explicitly set EVM version in configs:

pragma solidity 0.8.20;
pragma evm-version "london"; // Disables PUSH0
Updates

Appeal created

inallhonesty Lead Judge 16 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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