Overview
ZKsync Era integrates an EVM bytecode interpreter that enables compatibility with EVM bytecode. The interpreter works by translating EVM instructions into EraVM instructions at execution time.
This allows developers to deploy and interact with smart contracts without the need of using the ZKsync custom compilers
(zksolc
and zkvyper
). Additionally, standard EVM tooling like Foundry and Hardhat works out of the box without the need
for plugins or custom versions.
All while maintaining the core functionalities of EraVM, like native account abstraction.
Main Features
- EVM Bytecode Support: Contracts do not need to be compiled with ZKsync-specific compilers (
zksolc
orzkvyper
). - Tooling Compatibility: Development tools such as Foundry, Hardhat, and Remix work without requiring additional plugins or modifications.
- Address Derivation Consistency: Addresses generated using
create
andcreate2
match the behavior on the EVM. - Pre Deployed Contracts: Provides contracts such as
create2
,multicall3
andsingletonFactory
(ERC2470). Refer to the protocol documentation for the full list.
Limitations
- Debugging: EVM-compatible debugging is not supported yet due to EraVM-specific nuances of the system.
- Gas Model: EVM gas model is interpreted on top of EraVM for compatibility. Actual costs are paid in EraVM native gas. For details see EVM gas interpretation.
- Unsupported Opcodes: The same opcodes unsupported in EraVM remain unsupported:
CALLCODE
,SELFDESTRUCT
,BLOBHASH
,BLOBBASEFEE
. - Transaction Costs: Instruction translation increases transaction fees, typically by 1.5x to 4x, depending on the complexity of the operation.
Learn more about the differences from Ethereum (Cancun).
Considerations for Developers
The EVM interpreter allows developers to leverage familiar EVM-compatible tools and workflows without requiring ZKsync-specific compilers or plugins. However, the higher transaction costs should be accounted for during development. When possible, it’s recommended to use native EraVM bytecode by compiling contracts with the ZKsync custom compilers as it provides a native execution and better performance.