@@ -32,7 +32,10 @@ use foundry_common::{
3232} ;
3333use foundry_config:: Config ;
3434use foundry_evm:: {
35- executor:: fork:: { BlockchainDb , BlockchainDbMeta , SharedBackend } ,
35+ executor:: {
36+ fork:: { BlockchainDb , BlockchainDbMeta , SharedBackend } ,
37+ inspector:: DEFAULT_CREATE2_DEPLOYER ,
38+ } ,
3639 revm,
3740 revm:: primitives:: { BlockEnv , CfgEnv , SpecId , TxEnv , U256 as rU256} ,
3841 utils:: { apply_chain_and_block_specific_env_changes, h256_to_b256, u256_to_ru256} ,
@@ -163,6 +166,8 @@ pub struct NodeConfig {
163166 pub init_state : Option < SerializableState > ,
164167 /// max number of blocks with transactions in memory
165168 pub transaction_block_keeper : Option < usize > ,
169+ /// Disable the default CREATE2 deployer
170+ pub disable_default_create2_deployer : bool ,
166171}
167172
168173impl NodeConfig {
@@ -398,6 +403,7 @@ impl Default for NodeConfig {
398403 prune_history : Default :: default ( ) ,
399404 init_state : None ,
400405 transaction_block_keeper : None ,
406+ disable_default_create2_deployer : false ,
401407 }
402408 }
403409}
@@ -1005,6 +1011,15 @@ latest block number: {latest_block}"
10051011 )
10061012 . await ;
10071013
1014+ // Writes the default create2 deployer to the backend,
1015+ // if the option is not disabled and we are not forking.
1016+ if !self . disable_default_create2_deployer && self . eth_rpc_url . is_none ( ) {
1017+ backend
1018+ . set_create2_deployer ( DEFAULT_CREATE2_DEPLOYER )
1019+ . await
1020+ . expect ( "Failed to create default create2 deployer" ) ;
1021+ }
1022+
10081023 if let Some ( ref state) = self . init_state {
10091024 backend
10101025 . get_db ( )
0 commit comments