Open Ferret-san opened 6 months ago
Tracked it down to Address::from_slice
, this is the only call in forge script (and all of forge): https://github.com/foundry-rs/foundry/blob/6818c846ad54455721deae0adc10efbf87a0f11f/crates/script/src/transaction.rs#L79
cc @klkvr can we bundle the fix for this in https://github.com/foundry-rs/foundry/pull/7247? Not very familiar with this code
it's probably related to create2 deployer not being present on the forked chain, however, we should detect that before simulation.
@Ferret-san are you using any uncommon patterns with create2 deployments? Would be great if you could provide a repro for this
it's probably related to create2 deployer not being present on the forked chain, however, we should detect that before simulation.
@Ferret-san are you using any uncommon patterns with create2 deployments? Would be great if you could provide a repro for this
hm, the only issue I can think of is that I'm running the scripts against a local private geth network, in which I load the bytecode for the CREATE2 deployer into the genesis block
I think it makes sense to transform this ticket into a feature request to detect and throw an error if the create2 deployer is not being present on the forked chain before simulation
@Ferret-san, any extra additional details (and especially a minimal reproduction) would be great
I think it makes sense to transform this ticket into a feature request to detect and throw an error if the create2 deployer is not being present on the forked chain before simulation
Yeah, we are already detecting this here https://github.com/foundry-rs/foundry/blob/6bb5c8ea8dcd00ccbc1811f1175cabed3cb4c116/crates/evm/core/src/utils.rs#L160
this looks like some edge case when this is missed
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (551bcb5 2024-02-28T07:38:22.868037648Z)
What command(s) is the bug in?
forge script DeployContract --slow --force --rpc-url $rpc --private-key $PRIVATE_KEY --broadcast
Operating System
Linux
Describe the bug
While trying to deploy some contracts to a private geth instance using forge script, I encounter the following error:
Note that it seems like the contracts do get deployed on my local instance, but perhaps some after-deployment logic is being hit and results in this issue.