From edf9bf1b8afddabb4f6b4073fb226a1f1cb3f9c0 Mon Sep 17 00:00:00 2001 From: Nisheeth Barthwal Date: Mon, 9 Sep 2024 15:31:57 +0200 Subject: [PATCH] link extcodecopy limitation with its mitigation --- src/zksync-specifics/limitations/compilation.md | 2 ++ src/zksync-specifics/limitations/general.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zksync-specifics/limitations/compilation.md b/src/zksync-specifics/limitations/compilation.md index f032dec25..f47bffa1a 100644 --- a/src/zksync-specifics/limitations/compilation.md +++ b/src/zksync-specifics/limitations/compilation.md @@ -21,6 +21,8 @@ contract FooTest is Test { } ``` +See [here](./general.md#accessing-contract-bytecode-and-hash) on how to circumvent this issue. + ### Contract Size Limit `zksolc` currently limits the number of instructions to 2^16 that are compiled for a contract. As such for large contracts, the compilation will fail with the error: diff --git a/src/zksync-specifics/limitations/general.md b/src/zksync-specifics/limitations/general.md index cde2a492d..f4babf707 100644 --- a/src/zksync-specifics/limitations/general.md +++ b/src/zksync-specifics/limitations/general.md @@ -114,7 +114,7 @@ function createAddress(sender: Address, senderNonce: BigNumberish) { ### Accessing Contract Bytecode and Hash -zkEVM does not allow obtaining bytecodes from `address.code` or computing their respective hashes. This is particularly useful when computing CREATE2 addresses. +zkEVM does not allow obtaining bytecodes from `address.code` or computing their respective hashes, which will be raised as an error during [compilation](./compilation.md#contract-bytecode-access). This is particularly useful when computing CREATE2 addresses. To circumvent this limitation, it is recommended to use the FFI functionality of cheatcodes: