Repository navigation
[Application Development] Target EVM version for Solidity contracts #935
Did you check the documentation?
Documentation Feedback (Optional)The documentation doesn't clearly specify which EVM version to target when compiling Solidity smart contracts to EVM bytecode. The closest to an accurate answer is analyze the EIPs included in each network upgrade, and see if all the EIPs in an Ethereum execution-layer hardfork are contemplated. What type of issue are you experiencing?
Issue DescriptionI would like to know which official resource from the OP Stack documentation states which EVM version I should target when compiling Solidity smart contracts meant to be deloyed to OP Stack networks (such as OP Mainnet, OP Sepolia, Base Mainnet, Base Sepolia, etc). This is crucial information. For example, compiling contracts with Solidity 0.8.35 targets the Osaka EVM version, which features the CLZ opcode. However, executing such opcode on OP Mainnet today would fail, because it is an invalid opcode there. Steps to ReproduceConsult the official documentation. Are you using a specific library or SDK?
Are you using the latest version of the library/SDK?
Environment DetailsNo response Troubleshooting AttemptsNo response What type of support do you need?
Additional InformationNo response FeedbackNo response |
Replies: 1 comment 2 replies
|
There isn't a single "EVM version" setting in the docs, but each OP Stack network upgrade states which Ethereum execution-layer fork it adopts, so the target follows from which upgrades are active on the chain you deploy to:
Sources: the "Execution Layer" sections of the Isthmus and Karst specs, and the Upgrade 19 – Karst notice. Your CLZ example has changed since you asked. Karst activated on OP Mainnet (and OP, Soneium, Ink, Unichain, Mode, Metal, Zora) at timestamp So For any other OP Stack chain, don't assume: check which upgrades it has activated (its rollup config / superchain-registry entry), or run the same one-liner against its RPC before deploying:
|
There isn't a single "EVM version" setting in the docs, but each OP Stack network upgrade states which Ethereum execution-layer fork it adopts, so the target follows from which upgrades are active on the chain you deploy to:
evmVersionit enablesshanghai(PUSH0)cancun(MCOPY, TSTORE/TLOAD, BLOBBASEFEE; no blob transactions on L2)pragueosakaSources: the "Execution Layer" sections of the Isthmus and Karst specs, and the Upgrade 19 – Karst notice.
Your CLZ example has changed since you asked. Kar…