Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: Add initial EVM emulation support #318

Open
0xVolosnikov opened this issue Nov 15, 2024 · 0 comments
Open

feature request: Add initial EVM emulation support #318

0xVolosnikov opened this issue Nov 15, 2024 · 0 comments
Assignees

Comments

@0xVolosnikov
Copy link

0xVolosnikov commented Nov 15, 2024

🌟 Feature Request

Support EVM-like contracts and transactions in block explorer.

📝 Description

The EVM emulator adds the ability to deploy and execute EVM bytecode on top of EraVM. For this reason, we would like to support the EVM contracts in the block explorer.

Deployment of EVM contracts differs from deployment of EraVM contracts. For deployment of EVM contracts, a transaction without the to field is used. The data field of this transaction is used as initCode in constructor of the contract being created.

Basic compatibility (allowed transactions without field to in DB schema, small changes in UI) is implemented there:
https://github.com/0xVolosnikov/block-explorer/tree/evm-emulator-support
This branch is a PoC and requires some work.

At the first step we would like to have the following result:

  1. For EVM-contract deploy transactions, display that this is a contract deploy to address X
  2. For EVM contracts, display in the frontend that it is an EVM contract. In calls to EVM contracts, also display that this is a EVM contract.

📋 Additional Context

How to determine if a smart contract is a EVM contract or not

In AccountCodeStorage system contract isAccountEVM function can be used to check if the contract is EVM smart-contract.

How to launch chain with EVM emulator locally.
Install deps and prepare:

git clone https://github.com/matter-labs/zksync-era
cd zksync-era
git checkout evm-emulator/testing
git submodule update --init
export ZKSYNC_HOME=$(pwd) && export PATH=$ZKSYNC_HOME/bin:$PATH
zk

Init chain:

zk init --skip-submodules-checkout --allow-evm-emulator

Run server:

zk server
@petarTxFusion petarTxFusion self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants