rtvm_interpreter/interpreter_action/
eof_create_inputs.rs

1use crate::primitives::{Address, Eof, U256};
2use core::ops::Range;
3
4/// Inputs for EOF create call.
5#[derive(Debug, Default, Clone, PartialEq, Eq)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7pub struct EOFCreateInput {
8    /// Caller of Eof Craate
9    pub caller: Address,
10    /// New contract address.
11    pub created_address: Address,
12    /// Values of ether transfered
13    pub value: U256,
14    /// Init eof code that is going to be executed.
15    pub eof_init_code: Eof,
16    /// Gas limit for the create call.
17    pub gas_limit: u64,
18    /// Return memory range. If EOF creation Reverts it can return the
19    /// the memory range.
20    pub return_memory_range: Range<usize>,
21}
22
23impl EOFCreateInput {
24    /// Returns a new instance of EOFCreateInput.
25    pub fn new(
26        caller: Address,
27        created_address: Address,
28        value: U256,
29        eof_init_code: Eof,
30        gas_limit: u64,
31        return_memory_range: Range<usize>,
32    ) -> EOFCreateInput {
33        EOFCreateInput {
34            caller,
35            created_address,
36            value,
37            eof_init_code,
38            gas_limit,
39            return_memory_range,
40        }
41    }
42}