The interpreter_action.rs
Module in the Rust Ethereum Virtual Machine (EVM)
The interpreter_action.rs
module within this Rust EVM implementation encompasses a collection of data structures used as internal models within the EVM. These models represent various aspects of EVM operations such as call and create inputs, call context, value transfers, and the result of self-destruction operations.
Data Structures
-
CallInputs
StructThe
CallInputs
struct is used to encapsulate the inputs to a smart contract call in the EVM. This struct includes the target contract address, the value to be transferred (if any), the input data, the gas limit for the call, the call context, and a boolean indicating if the call is a static call (a read-only operation). -
CallScheme
EnumThe
CallScheme
enum represents the type of call being made to a smart contract. The different types of calls (CALL
,CALLCODE
,DELEGATECALL
,STATICCALL
) represent different modes of interaction with a smart contract, each with its own semantics concerning the treatment of the message sender, value transfer, and the context in which the called code executes. -
CallValue
EnumThe
CallValue
Enum represents a value transfer between two accounts. -
CallOutcome
Represents the outcome of a call operation in a virtual machine. This struct encapsulates the result of executing an instruction by an interpreter, including the result itself, gas usage information, and the memory offset where output data is stored.
-
CreateInputs
StructThe
CreateInputs
struct encapsulates the inputs for creating a new smart contract. This includes the address of the creator, the creation scheme, the value to be transferred, the initialization code for the new contract, and the gas limit for the creation operation. -
CreateOutcome
StructRepresents the outcome of a create operation in an interpreter. This struct holds the result of the operation along with an optional address. It provides methods to determine the next action based on the result of the operation.
-
EOFCreateInput
StructInputs for EOF create call.
-
EOFCreateOutcome
StructRepresents the outcome of a create operation in an interpreter.
In summary, the interpreter_action.rs
module provides several crucial data structures that facilitate the representation and handling of various EVM operations and their associated data within this Rust EVM implementation.