Skip to content

Commit

Permalink
Merge branch 'main' into popzxc-fix-redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc authored Dec 9, 2024
2 parents 260157d + 03ec55a commit b9ad35d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions content/20.zksync-protocol/70.differences/10.evm-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ Contract bytecode cannot be accessed on zkEVM architecture. Only its size is acc

`EXTCODECOPY` always produces a compile-time error with the zkEVM compiler.

## `EXTCODEHASH`

Retrieving the code hash of a smart contract in the zkEVM protocol differs slightly from EVM. In EVM hash of non-existing account
is always `0`, and hash of existing account without code is `keccak("")`. Nonexisting contracts have no code, and their nonce and
balance are both zero.

In zkEVM `EXTCODEHASH` operation has the following differences:

- It doesn't check the balance of account.
- All contracts in precompiles space (plus `0x00`) are treated as existing empty accounts.
- For zkEVM contracts with bytecode it returns a versioned code hash based on sha3, rather than the keccak256 of the bytecode specified in EIP-1052.

## `DATASIZE`, `DATAOFFSET`, `DATACOPY`

Contract deployment is handled by two parts of the zkEVM protocol: the compiler front end and the system contract called `ContractDeployer`.
Expand Down

0 comments on commit b9ad35d

Please sign in to comment.