stopAndReturnStateDiff
doesn't record CREATE2
deployed bytecode in some cases
#7603
Closed
2 tasks done
Labels
T-bug
Type: bug
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (14daacf 2024-04-09T00:16:23.595685880Z)
What command(s) is the bug in?
forge script
Operating System
Linux
Describe the bug
There seems to be an edge case in which
stopAndReturnStateDiff
won't record the deployed bytecode ofCREATE2
access kinds. AnAccountAccess
of kindCreate
will be recorded, but thedeployedBytecode
will be0x
if the contract is deployed viaCREATE2
.The first failing Foundry commit is
05d89ca01b7a3d7c19198985ea6fbe2afd2ff437
, which corresponds to the merging of #7207 (cc @RPate97)I have not found a way to minimize this example, so we'll need to use Optimism's codebase to reproduce.
Reproduction steps
foundryup --commit 05d89ca01b7a3d7c19198985ea6fbe2afd2ff437
(the first failing commit)cd packages/contracts-bedrock
scripts/Deploy.s.sol
, change thestateDiff
modifier to:AccountAccess
of kindCreate
recorded in the deployment process.contracts-bedrock
folder, runforge script scripts/Deploy.s.sol:Deploy --sig runWithStateDiff\(\)
CREATE2
has aCreate
Account Access with no deployed bytecode. For instance, from the logs we get thatSuperchainConfig
is indeed deployed withCREATE2
.However, if we inspect the
deployedCode
corresponding to theCreate
kind for0x068E44eB31e111028c41598E4535be7468674D0A
we see the followingforge script scripts/Deploy.s.sol:Deploy --sig runWithStateDiff\(\)
with the previous Foundry commit (eb5d8d46e3f2b70177ef4b2ef24d50373b446faf
), we'll get the following output:(14daacf 2024-04-09T00:16:23.597031217Z)
also shows empty bytecodeThe text was updated successfully, but these errors were encountered: