revm_interpreter/interpreter_action/
create_inputs.rsuse context_interface::CreateScheme;
use primitives::{Address, Bytes, U256};
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct CreateInputs {
pub caller: Address,
pub scheme: CreateScheme,
pub value: U256,
pub init_code: Bytes,
pub gas_limit: u64,
}
impl CreateInputs {
pub fn created_address(&self, nonce: u64) -> Address {
match self.scheme {
CreateScheme::Create => self.caller.create(nonce),
CreateScheme::Create2 { salt } => self
.caller
.create2_from_code(salt.to_be_bytes(), &self.init_code),
}
}
}