Why Does EXTCODECOPY
Always Throw an Error?
#86
-
EnvironmentTestnet Provide a brief description of the functionality you're trying to implement.I want to implement a contract method that fetches the bytecode of a deployed contract on another account. Currently the documentation accurately points out that this always throws an error on zkEVM. I was wondering however why is this? What is the specific issue or error you're encountering?The terminal output containing the error: An unexpected error occurred:
Error: Command failed: /Users/dennis/Library/Caches/hardhat-nodejs/compilers-v2/zksolc/zksolc-v1.3.13 --standard-json --system-mode --solc /Users/dennis/Library/Caches/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.17+commit.8df45f5f.js.executable
Contract `contracts/Tutorials.sol:Tutorial` compiling error: The contract `contracts/Tutorials.sol:Tutorial` LLVM IR generator definition pass error: 49:25 The `EXTCODECOPY` instruction is not supportedThe contract `contracts/Tutorials.sol:Tutorial` LLVM IR generator definition pass error: 49:25 The `EXTCODECOPY` instruction is not supported
at ChildProcess.exithandler (node:child_process:402:12)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
code: 1,
killed: false,
signal: null,
cmd: '/Users/dennis/Library/Caches/hardhat-nodejs/compilers-v2/zksolc/zksolc-v1.3.13 --standard-json --system-mode --solc /Users/dennis/Library/Caches/hardhat-nodejs/compilers-v2/wasm/soljson-v0.8.17+commit.8df45f5f.js.executable'
}
error Command failed with exit code 1. Can you share the error messages or logs you're receiving, if any?Shared above Have you made any recent changes to the contract before encountering this issue?No Are there any external libraries or contracts that your contract interacts with?No Can you provide the relevant portions of your contract code where the issue is occurring?// SPDX-License-Identifier: MIT
pragma solidity >=0.8.17;
contract Tutorial {
function getCode(address _addr) public view returns (bytes memory o_code) {
return _addr.code;
}
} Have you tried to isolate the problem, and if so, what were the results?NA What steps have you already taken to try to resolve the issue?NA Repo Link (Optional)No response Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
@idea404 Per the zkSync docs:
https://era.zksync.io/docs/reference/architecture/differences-with-ethereum.html#extcodecopy |
Beta Was this translation helpful? Give feedback.
@idea404 Per the zkSync docs:
https://era.zksync.io/docs/reference/architecture/differences-with-ethereum.html#extcodecopy