diff --git a/evm/src/lib.rs b/evm/src/lib.rs index 8e4d6468..422fae29 100644 --- a/evm/src/lib.rs +++ b/evm/src/lib.rs @@ -12,6 +12,7 @@ pub mod cross_table_lookup; mod get_challenges; pub mod keccak; pub mod logic; +pub mod memory; pub mod permutation; pub mod proof; pub mod prover; diff --git a/evm/src/memory/memory_stark.rs b/evm/src/memory/memory_stark.rs new file mode 100644 index 00000000..0cc42d30 --- /dev/null +++ b/evm/src/memory/memory_stark.rs @@ -0,0 +1,16 @@ +#[derive(Default)] +pub struct TransactionMemory { + pub calls: Vec, +} + +/// A virtual memory space specific to the current contract call. +pub struct ContractMemory { + pub code: MemorySegment, + pub main: MemorySegment, + pub calldata: MemorySegment, + pub returndata: MemorySegment, +} + +pub struct MemorySegment { + pub content: Vec, +} diff --git a/evm/src/memory/mod.rs b/evm/src/memory/mod.rs new file mode 100644 index 00000000..53108262 --- /dev/null +++ b/evm/src/memory/mod.rs @@ -0,0 +1,2 @@ +pub mod memory_stark; +pub mod registers; \ No newline at end of file diff --git a/evm/src/memory/registers.rs b/evm/src/memory/registers.rs new file mode 100644 index 00000000..1373d0d8 --- /dev/null +++ b/evm/src/memory/registers.rs @@ -0,0 +1,3 @@ +//! Memory unit. + +pub(super) const END: usize = super::START_MEMORY;