Skip to content

Commit

Permalink
Add section about EXTCODEHASH
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Dec 9, 2024
1 parent 0d4b6ad commit cc8ab6f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,15 @@ 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 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.


## `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 cc8ab6f

Please sign in to comment.