diff --git a/content/20.zksync-protocol/70.differences/10.evm-instructions.md b/content/20.zksync-protocol/70.differences/10.evm-instructions.md index cd49a639..5155a728 100644 --- a/content/20.zksync-protocol/70.differences/10.evm-instructions.md +++ b/content/20.zksync-protocol/70.differences/10.evm-instructions.md @@ -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`.