diff --git a/src/executor/stack/executor.rs b/src/executor/stack/executor.rs index 8eea59d9a..1b8d52780 100644 --- a/src/executor/stack/executor.rs +++ b/src/executor/stack/executor.rs @@ -423,6 +423,42 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> } } + /// Execute a `CREATE` transaction with fixed contract address. + pub fn transact_create_with_address( + &mut self, + caller: H160, + contract_address: H160, + value: U256, + init_code: Vec, + gas_limit: u64, + access_list: Vec<(H160, Vec)>, // See EIP-2930 + ) -> (ExitReason, Vec) { + event!(TransactCreate { + caller, + value, + init_code: &init_code, + gas_limit, + address: contract_address, + }); + + if let Err(e) = self.record_create_transaction_cost(&init_code, &access_list) { + return emit_exit!(e.into(), Vec::new()); + } + self.initialize_with_access_list(access_list); + + match self.create_inner( + caller, + CreateScheme::Fixed(contract_address), + value, + init_code, + Some(gas_limit), + false, + ) { + Capture::Exit((s, _, v)) => emit_exit!(s, v), + Capture::Trap(_) => unreachable!(), + } + } + /// Execute a `CREATE2` transaction. pub fn transact_create2( &mut self,