Skip to content

Commit 45e3571

Browse files
authored
update doc about interpreter action (bluealloy#1419)
1 parent ff2dcf5 commit 45e3571

File tree

4 files changed

+41
-31
lines changed

4 files changed

+41
-31
lines changed

documentation/src/SUMMARY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- [gas](./crates/interpreter/gas.md)
1313
- [memory](./crates/interpreter/memory.md)
1414
- [host](./crates/interpreter/host.md)
15-
- [inner_models](./crates/interpreter/inner_models.md)
15+
- [interpreter_action](./crates/interpreter/interpreter_action.md)
1616
- [instruction_result](./crates/interpreter/instruction_result.md)
1717
- [instructions](./crates/interpreter/instructions.md)
1818
- [Primitives](./crates/primitives.md)

documentation/src/crates/interpreter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ It is structured as follows:
88

99
- [gas](./interpreter/gas.md): Handles gas mechanics in the EVM, such as calculating gas costs for operations.
1010
- [host](./interpreter/host.md): Defines the EVM context `Host` trait.
11-
- [inner_models](./interpreter/inner_models.md): Contains inner data structures used in the EVM implementation.
11+
- [interpreter_action](./interpreter/interpreter_action.md): Contains data structures used in the EVM implementation.
1212
- [instruction_result](./interpreter/instruction_result.md): Defines results of instruction execution.
1313
- [instructions](./interpreter/instructions.md): Defines the EVM opcodes (i.e. instructions).
1414

documentation/src/crates/interpreter/inner_models.md

-29
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# The `interpreter_action.rs` Module in the Rust Ethereum Virtual Machine (EVM)
2+
3+
The `interpreter_action.rs` module within this Rust EVM implementation encompasses a collection of datastructures 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.
4+
5+
## Data Structures
6+
7+
- `CallInputs` Struct
8+
9+
The `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).
10+
11+
- `CallScheme` Enum
12+
13+
The `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.
14+
15+
- `CallValue` Enum
16+
17+
The `CallValue` Enum represents a value transfer between two accounts.
18+
19+
- `CallOutcome`
20+
21+
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.
22+
23+
- `CreateInputs` Struct
24+
25+
The `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.
26+
27+
- `CreateOutcome` Struct
28+
29+
Represents 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.
30+
31+
- `EOFCreateInput` Struct
32+
33+
Inputs for EOF create call.
34+
35+
- `EOFCreateOutcome` Struct
36+
37+
Represents the outcome of a create operation in an interpreter.
38+
39+
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.

0 commit comments

Comments
 (0)