diff --git a/crates/exex/src/serde.rs b/crates/exex/src/serde.rs index 0ed89d157..dc1c6f3ba 100644 --- a/crates/exex/src/serde.rs +++ b/crates/exex/src/serde.rs @@ -12,6 +12,15 @@ use cairo_vm::{ use std::collections::HashMap; use thiserror::Error; +/// Represents the different types of values that can be stored in a pointer. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum PointerValue { + /// Relocatable value. + Relocatable, + /// Integer value. + Felt, +} + /// Represents errors that can occur during the serialization and deserialization processes between /// Cairo VM programs and Rust representations. #[derive(Debug, Error, PartialEq)] @@ -64,6 +73,26 @@ pub enum KakarotSerdeError { /// The memory location that was expected to contain a value. location: Relocatable, }, + + /// Error variant indicating that a pointer member is missing from a struct. + #[error("The pointer member '{member}' is missing.")] + MissingPointerMember { + /// The name of the missing pointer member. + member: String, + }, + /// Error variant indicating that a pointer member has an incorrect value. + #[error( + "The pointer member '{member}' has an incorrect value. Got: {got_value:?}, + Expected: {expected_value:?}" + )] + IncorrectPointerValue { + /// The name of the pointer member. + member: String, + /// The obtained value. + got_value: Option>, + /// The expected value type. + expected_value: PointerValue, + }, } /// Represents the types used in Cairo, including felt types, pointers, tuples, and structs. @@ -485,6 +514,88 @@ impl KakarotSerde { Ok(output) } + /// Serializes the contents of the Kakarot OS `model.Memory` starting from a given pointer into + /// a hexadecimal string. + /// + /// The `model.Memory` struct is a structured memory layout that contains the following fields: + /// - `word_dict_start`: The pointer to a `DictAccess` used to store the memory's value at a + /// given index. + /// - `word_dict`: The pointer to the end of the `DictAccess`. + /// - `words_len`: Number of 32-byte words. + /// + /// This function reads and validates specific fields from a structured memory layout and + /// serializes the contents into a compact, hexadecimal string format. + /// + /// The process involves: + /// - Extracting key pointers, + /// - Converting values, and handling potential errors gracefully. + pub fn serialize_memory(&self, ptr: Relocatable) -> Result { + // Serialize pointers of the "model.Memory" struct + let raw = self.serialize_pointers("model.Memory", ptr)?; + + // Extract and validate the `word_dict_start` pointer. + // This should be a pointer to the start of the dictionary (`Relocatable`). + let dict_start = match raw.get("word_dict_start") { + Some(Some(MaybeRelocatable::RelocatableValue(ptr))) => *ptr, + other => { + return Err(KakarotSerdeError::IncorrectPointerValue { + member: "word_dict_start".to_string(), + got_value: other.cloned(), + expected_value: PointerValue::Relocatable, + }) + } + }; + + // Extract and validate the `word_dict` pointer. + // This should be a pointer to the end of the dictionary (`Relocatable`). + let dict_end = match raw.get("word_dict") { + Some(Some(MaybeRelocatable::RelocatableValue(word_dict))) => *word_dict, + other => { + return Err(KakarotSerdeError::IncorrectPointerValue { + member: "word_dict".to_string(), + got_value: other.cloned(), + expected_value: PointerValue::Relocatable, + }) + } + }; + + // Serialize the dictionary from `dict_start` to `dict_end`. + let memory_dict = self.serialize_dict(dict_start, None, Some((dict_end - dict_start)?))?; + + // Extract and validate the `words_len` field. + // This should be a `Felt` value representing the number of 32-byte words. + let words_len = match raw.get("words_len") { + Some(Some(MaybeRelocatable::Int(words_len))) => words_len + .to_string() + .parse::() + .map_err(|_| MathError::Felt252ToUsizeConversion(Box::new(*words_len)))?, + other => { + return Err(KakarotSerdeError::IncorrectPointerValue { + member: "words_len".to_string(), + got_value: other.cloned(), + expected_value: PointerValue::Felt, + }) + } + }; + + // Construct the serialized memory by iterating over the dictionary. + // The memory is serialized as a string of 32-byte words. + let serialized_memory = (0..words_len * 2) + .map(|i| { + if let Some(Some(MaybeRelocatable::Int(value))) = + memory_dict.get(&MaybeRelocatable::Int(i.into())) + { + format!("{value:032x}") + } else { + String::new() + } + }) + .collect::(); + + // Return the serialized memory as a single string. + Ok(serialized_memory) + } + /// Serializes inner data types in Cairo by determining the type of data at a given pointer /// location. /// @@ -520,6 +631,7 @@ mod tests { enum TestProgram { KeccakAddUint256, ModelOption, + ModelMemory, } impl TestProgram { @@ -531,6 +643,7 @@ mod tests { match self { Self::KeccakAddUint256 => include_bytes!("../testdata/keccak_add_uint256.json"), Self::ModelOption => include_bytes!("../testdata/model_option.json"), + Self::ModelMemory => include_bytes!("../testdata/model_memory.json"), } } } @@ -1520,4 +1633,302 @@ mod tests { Err(KakarotSerdeError::NoValueAtMemoryLocation { location }) if location == (dict_ptr + 3usize).unwrap() )); } + + #[test] + fn test_serialize_memory_empty() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Add an empty memory segment for the Stack + let ptr = kakarot_serde.runner.vm.add_memory_segment(); + + // Call serialize_memory on the empty memory + let result = kakarot_serde.serialize_memory(ptr); + + // The result should be an empty string + assert_eq!( + result, + Err(KakarotSerdeError::IncorrectPointerValue { + member: "word_dict_start".to_string(), + got_value: None, + expected_value: PointerValue::Relocatable + }) + ); + } + + #[test] + fn test_serialize_memory_with_valid_pointers_simple() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Some dictionary pointers indicating: + // - the start of the dictionary + // - the end of the dictionary + // - the length of the dictionary in words + let dict_start = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 3 }); + let dict_end = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 15 }); + let words_len = MaybeRelocatable::Int(Felt252::from(2)); + + // Key-value pairs to be inserted into the dictionary + let key1 = MaybeRelocatable::Int(Felt252::from(0)); + let key2 = MaybeRelocatable::Int(Felt252::from(1)); + let key3 = MaybeRelocatable::Int(Felt252::from(2)); + let key4 = MaybeRelocatable::Int(Felt252::from(3)); + let value1 = MaybeRelocatable::Int(Felt252::from(10)); + let value2 = MaybeRelocatable::Int(Felt252::from(20)); + let value3 = MaybeRelocatable::Int(Felt252::from(30)); + let value4 = MaybeRelocatable::Int(Felt252::from(40)); + + // Insert the dictionary key-value pairs into memory + let dict_ptr = kakarot_serde + .runner + .vm + .gen_arg(&vec![ + dict_start, + dict_end, + words_len, + key1, + MaybeRelocatable::Int(Felt252::ZERO), + value1, + key2, + MaybeRelocatable::Int(Felt252::ZERO), + value2, + key3, + MaybeRelocatable::Int(Felt252::ZERO), + value3, + key4, + MaybeRelocatable::Int(Felt252::ZERO), + value4, + ]) + .unwrap() + .get_relocatable() + .expect("failed to insert key-value pairs into memory"); + + // Call serialize_memory with the valid pointers + let result = kakarot_serde.serialize_memory(dict_ptr).expect("failed to serialize memory"); + + // The result should be a string representation of the serialized memory + assert_eq!(result, "0000000000000000000000000000000a000000000000000000000000000000140000000000000000000000000000001e00000000000000000000000000000028".to_string()); + } + + #[test] + fn test_serialize_memory_with_valid_pointers_holes() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Some dictionary pointers indicating: + // - the start of the dictionary + // - the end of the dictionary + // - the length of the dictionary in words + let dict_start = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 3 }); + let dict_end = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 15 }); + let words_len = MaybeRelocatable::Int(Felt252::from(3)); + + // Key-value pairs to be inserted into the dictionary + let key1 = MaybeRelocatable::Int(Felt252::from(0)); + let key2 = MaybeRelocatable::Int(Felt252::from(1)); + let key3 = MaybeRelocatable::Int(Felt252::from(2)); + let key4 = MaybeRelocatable::Int(Felt252::from(5)); + + let value1 = MaybeRelocatable::Int(Felt252::from(10)); + let value2 = MaybeRelocatable::Int(Felt252::from(20)); + let value3 = MaybeRelocatable::Int(Felt252::from(30)); + let value4 = MaybeRelocatable::Int(Felt252::from(40)); + + // Insert the dictionary key-value pairs into memory + let dict_ptr = kakarot_serde + .runner + .vm + .gen_arg(&vec![ + dict_start, + dict_end, + words_len, + key2, + MaybeRelocatable::Int(Felt252::ZERO), + value2, + key1, + MaybeRelocatable::Int(Felt252::ZERO), + value1, + key3, + MaybeRelocatable::Int(Felt252::ZERO), + value3, + key4, + MaybeRelocatable::Int(Felt252::ZERO), + value4, + ]) + .unwrap() + .get_relocatable() + .expect("failed to insert key-value pairs into memory"); + + // Call serialize_memory with the valid pointers + let result = kakarot_serde.serialize_memory(dict_ptr).expect("failed to serialize memory"); + + // The result should be a string representation of the serialized memory + assert_eq!(result, "0000000000000000000000000000000a000000000000000000000000000000140000000000000000000000000000001e00000000000000000000000000000028".to_string()); + } + + #[test] + fn test_serialize_memory_only_word_dict_start() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Insert only the `word_dict_start` pointer in memory + let word_dict_start = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 3 }); + let ptr = kakarot_serde + .runner + .vm + .gen_arg(&vec![word_dict_start]) + .unwrap() + .get_relocatable() + .expect("failed to insert word_dict_start into memory"); + + // Call serialize_memory with incomplete dictionary pointers + let result = kakarot_serde.serialize_memory(ptr); + + // The result should be an error due to the missing `word_dict` + assert_eq!( + result, + Err(KakarotSerdeError::IncorrectPointerValue { + member: "word_dict".to_string(), + got_value: None, + expected_value: PointerValue::Relocatable + }) + ); + } + + #[test] + fn test_serialize_memory_word_dict_start_non_relocatable_pointers() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Set `word_dict_start` as non-relocatable value + let dict_start = MaybeRelocatable::Int(Felt252::from(123)); + let dict_end = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 15 }); + let ptr = kakarot_serde + .runner + .vm + .gen_arg(&vec![dict_start.clone(), dict_end]) + .unwrap() + .get_relocatable() + .expect("failed to insert non-relocatable pointers into memory"); + + // Call serialize_memory with non-relocatable pointers + let result = kakarot_serde.serialize_memory(ptr); + + // The result should be an error indicating incorrect pointer values + assert_eq!( + result, + Err(KakarotSerdeError::IncorrectPointerValue { + member: "word_dict_start".to_string(), + got_value: Some(Some(dict_start)), + expected_value: PointerValue::Relocatable + }) + ); + } + + #[test] + fn test_serialize_memory_word_dict_end_non_relocatable_pointers() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Set`word_dict` as non-relocatable value + let dict_start = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 15 }); + let dict_end = MaybeRelocatable::Int(Felt252::from(123)); + + let ptr = kakarot_serde + .runner + .vm + .gen_arg(&vec![dict_start, dict_end.clone()]) + .unwrap() + .get_relocatable() + .expect("failed to insert non-relocatable pointers into memory"); + + // Call serialize_memory with non-relocatable pointers + let result = kakarot_serde.serialize_memory(ptr); + + // The result should be an error indicating incorrect pointer values + assert_eq!( + result, + Err(KakarotSerdeError::IncorrectPointerValue { + member: "word_dict".to_string(), + got_value: Some(Some(dict_end)), + expected_value: PointerValue::Relocatable + }) + ); + } + + #[test] + fn test_serialize_memory_relocatable_words_len() { + // Setup + let mut kakarot_serde = setup_kakarot_serde(&TestProgram::ModelMemory); + + // Some dictionary pointers indicating: + // - the start of the dictionary + // - the end of the dictionary + // - we voluntarily set the length of the dictionary to be relocatable (not correct) + let dict_start = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 3 }); + let dict_end = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 15 }); + let words_len = + MaybeRelocatable::RelocatableValue(Relocatable { segment_index: 0, offset: 16 }); + + // Key-value pairs to be inserted into the dictionary + let key1 = MaybeRelocatable::Int(Felt252::from(0)); + let key2 = MaybeRelocatable::Int(Felt252::from(1)); + let key3 = MaybeRelocatable::Int(Felt252::from(2)); + let key4 = MaybeRelocatable::Int(Felt252::from(3)); + let value1 = MaybeRelocatable::Int(Felt252::from(10)); + let value2 = MaybeRelocatable::Int(Felt252::from(20)); + let value3 = MaybeRelocatable::Int(Felt252::from(30)); + let value4 = MaybeRelocatable::Int(Felt252::from(40)); + + // Insert the dictionary key-value pairs into memory + let dict_ptr = kakarot_serde + .runner + .vm + .gen_arg(&vec![ + dict_start, + dict_end, + words_len, + key1, + MaybeRelocatable::Int(Felt252::ZERO), + value1, + key2, + MaybeRelocatable::Int(Felt252::ZERO), + value2, + key3, + MaybeRelocatable::Int(Felt252::ZERO), + value3, + key4, + MaybeRelocatable::Int(Felt252::ZERO), + value4, + ]) + .unwrap() + .get_relocatable() + .expect("failed to insert key-value pairs into memory"); + + // Call serialize_memory with missing `words_len` + let result = kakarot_serde.serialize_memory(dict_ptr); + + // The result should be an error indicating the missing `words_len` field + assert_eq!( + result, + Err(KakarotSerdeError::IncorrectPointerValue { + member: "words_len".to_string(), + got_value: Some(Some(MaybeRelocatable::RelocatableValue(Relocatable { + segment_index: 0, + offset: 16 + }))), + expected_value: PointerValue::Felt + }) + ); + } } diff --git a/crates/exex/testdata/model_memory.cairo b/crates/exex/testdata/model_memory.cairo new file mode 100644 index 000000000..35d0452f4 --- /dev/null +++ b/crates/exex/testdata/model_memory.cairo @@ -0,0 +1,12 @@ +%builtins output range_check + +from src.model import model +from starkware.cairo.common.default_dict import default_dict_new +from starkware.cairo.common.dict import DictAccess + +func main{output_ptr: felt*, range_check_ptr}() { + let (word_dict_start: DictAccess*) = default_dict_new(0); + let stack = model.Memory(word_dict_start, word_dict_start, 0); + + return (); +} diff --git a/crates/exex/testdata/model_memory.json b/crates/exex/testdata/model_memory.json new file mode 100644 index 000000000..dcf01ce8a --- /dev/null +++ b/crates/exex/testdata/model_memory.json @@ -0,0 +1,1304 @@ +{ + "attributes": [], + "builtins": ["output", "range_check"], + "compiler_version": "0.13.2", + "data": [ + "0x40780017fff7fff", + "0x2", + "0x1104800180018000", + "0x7", + "0x10780017fff7fff", + "0x0", + "0x40780017fff7fff", + "0x1", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x0", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffffc", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x208b7fff7fff7ffe" + ], + "debug_info": null, + "hints": { + "6": [ + { + "accessible_scopes": [ + "starkware.cairo.common.default_dict", + "starkware.cairo.common.default_dict.default_dict_new" + ], + "code": "if '__dict_manager' not in globals():\n from starkware.cairo.common.dict import DictManager\n __dict_manager = DictManager()\n\nmemory[ap] = __dict_manager.new_default_dict(segments, ids.default_value)", + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "starkware.cairo.common.default_dict.default_dict_new.default_value": 0 + } + } + } + ] + }, + "identifiers": { + "__main__.DictAccess": { + "destination": "starkware.cairo.common.dict.DictAccess", + "type": "alias" + }, + "__main__.__end__": { + "pc": 4, + "type": "label" + }, + "__main__.__start__": { + "pc": 0, + "type": "label" + }, + "__main__.default_dict_new": { + "destination": "starkware.cairo.common.default_dict.default_dict_new", + "type": "alias" + }, + "__main__.main": { + "decorators": [], + "pc": 9, + "type": "function" + }, + "__main__.main.Args": { + "full_name": "__main__.main.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.main.ImplicitArgs": { + "full_name": "__main__.main.ImplicitArgs", + "members": { + "output_ptr": { + "cairo_type": "felt*", + "offset": 0 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "__main__.main.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.main.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.main.output_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.main.output_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-4), felt**)]" + } + ], + "type": "reference" + }, + "__main__.main.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__main__.main.range_check_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.stack": { + "cairo_type": "src.model.model.Memory", + "full_name": "__main__.main.stack", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "cast(([ap + (-1)], [ap + (-1)], 0), src.model.model.Memory)" + } + ], + "type": "reference" + }, + "__main__.main.word_dict_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "full_name": "__main__.main.word_dict_start", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "[cast(ap + (-1), starkware.cairo.common.dict_access.DictAccess**)]" + } + ], + "type": "reference" + }, + "__main__.model": { + "destination": "src.model.model", + "type": "alias" + }, + "src.model.DictAccess": { + "destination": "starkware.cairo.common.dict.DictAccess", + "type": "alias" + }, + "src.model.Uint256": { + "destination": "starkware.cairo.common.uint256.Uint256", + "type": "alias" + }, + "src.model.model": { + "type": "namespace" + }, + "src.model.model.Account": { + "full_name": "src.model.model.Account", + "members": { + "balance": { + "cairo_type": "starkware.cairo.common.uint256.Uint256*", + "offset": 10 + }, + "code": { + "cairo_type": "felt*", + "offset": 1 + }, + "code_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256*", + "offset": 2 + }, + "code_len": { + "cairo_type": "felt", + "offset": 0 + }, + "created": { + "cairo_type": "felt", + "offset": 12 + }, + "nonce": { + "cairo_type": "felt", + "offset": 9 + }, + "selfdestruct": { + "cairo_type": "felt", + "offset": 11 + }, + "storage": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 4 + }, + "storage_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 3 + }, + "transient_storage": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 6 + }, + "transient_storage_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 5 + }, + "valid_jumpdests": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 8 + }, + "valid_jumpdests_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 7 + } + }, + "size": 13, + "type": "struct" + }, + "src.model.model.Args": { + "full_name": "src.model.model.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "src.model.model.Block": { + "full_name": "src.model.model.Block", + "members": { + "block_header": { + "cairo_type": "src.model.model.BlockHeader*", + "offset": 0 + }, + "transactions": { + "cairo_type": "src.model.model.TransactionEncoded*", + "offset": 2 + }, + "transactions_len": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "src.model.model.BlockHeader": { + "full_name": "src.model.model.BlockHeader", + "members": { + "base_fee_per_gas": { + "cairo_type": "src.model.model.Option", + "offset": 23 + }, + "blob_gas_used": { + "cairo_type": "src.model.model.Option", + "offset": 25 + }, + "bloom": { + "cairo_type": "felt*", + "offset": 13 + }, + "coinbase": { + "cairo_type": "felt", + "offset": 4 + }, + "difficulty": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 14 + }, + "excess_blob_gas": { + "cairo_type": "src.model.model.Option", + "offset": 27 + }, + "extra_data": { + "cairo_type": "felt*", + "offset": 34 + }, + "extra_data_len": { + "cairo_type": "felt", + "offset": 33 + }, + "gas_limit": { + "cairo_type": "felt", + "offset": 17 + }, + "gas_used": { + "cairo_type": "felt", + "offset": 18 + }, + "mix_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 20 + }, + "nonce": { + "cairo_type": "felt", + "offset": 22 + }, + "number": { + "cairo_type": "felt", + "offset": 16 + }, + "ommers_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 2 + }, + "parent_beacon_block_root": { + "cairo_type": "src.model.model.Option", + "offset": 29 + }, + "parent_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 0 + }, + "receipt_root": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 9 + }, + "requests_root": { + "cairo_type": "src.model.model.Option", + "offset": 31 + }, + "state_root": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 5 + }, + "timestamp": { + "cairo_type": "felt", + "offset": 19 + }, + "transactions_root": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 7 + }, + "withdrawals_root": { + "cairo_type": "src.model.model.Option", + "offset": 11 + } + }, + "size": 35, + "type": "struct" + }, + "src.model.model.EVM": { + "full_name": "src.model.model.EVM", + "members": { + "gas_left": { + "cairo_type": "felt", + "offset": 5 + }, + "gas_refund": { + "cairo_type": "felt", + "offset": 6 + }, + "message": { + "cairo_type": "src.model.model.Message*", + "offset": 0 + }, + "program_counter": { + "cairo_type": "felt", + "offset": 3 + }, + "return_data": { + "cairo_type": "felt*", + "offset": 2 + }, + "return_data_len": { + "cairo_type": "felt", + "offset": 1 + }, + "reverted": { + "cairo_type": "felt", + "offset": 7 + }, + "stopped": { + "cairo_type": "felt", + "offset": 4 + } + }, + "size": 8, + "type": "struct" + }, + "src.model.model.Environment": { + "full_name": "src.model.model.Environment", + "members": { + "base_fee": { + "cairo_type": "felt", + "offset": 9 + }, + "block_gas_limit": { + "cairo_type": "felt", + "offset": 6 + }, + "block_number": { + "cairo_type": "felt", + "offset": 5 + }, + "block_timestamp": { + "cairo_type": "felt", + "offset": 7 + }, + "chain_id": { + "cairo_type": "felt", + "offset": 2 + }, + "coinbase": { + "cairo_type": "felt", + "offset": 8 + }, + "gas_price": { + "cairo_type": "felt", + "offset": 1 + }, + "origin": { + "cairo_type": "felt", + "offset": 0 + }, + "prev_randao": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 3 + } + }, + "size": 10, + "type": "struct" + }, + "src.model.model.Event": { + "full_name": "src.model.model.Event", + "members": { + "data": { + "cairo_type": "felt*", + "offset": 3 + }, + "data_len": { + "cairo_type": "felt", + "offset": 2 + }, + "topics": { + "cairo_type": "felt*", + "offset": 1 + }, + "topics_len": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 4, + "type": "struct" + }, + "src.model.model.ImplicitArgs": { + "full_name": "src.model.model.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "src.model.model.Memory": { + "full_name": "src.model.model.Memory", + "members": { + "word_dict": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 1 + }, + "word_dict_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 0 + }, + "words_len": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "src.model.model.MemoryExpansion": { + "full_name": "src.model.model.MemoryExpansion", + "members": { + "cost": { + "cairo_type": "felt", + "offset": 0 + }, + "new_words_len": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "src.model.model.Message": { + "full_name": "src.model.model.Message", + "members": { + "address": { + "cairo_type": "felt", + "offset": 9 + }, + "bytecode": { + "cairo_type": "felt*", + "offset": 0 + }, + "bytecode_len": { + "cairo_type": "felt", + "offset": 1 + }, + "cairo_precompile_called": { + "cairo_type": "felt", + "offset": 15 + }, + "calldata": { + "cairo_type": "felt*", + "offset": 4 + }, + "calldata_len": { + "cairo_type": "felt", + "offset": 5 + }, + "caller": { + "cairo_type": "felt", + "offset": 7 + }, + "code_address": { + "cairo_type": "felt", + "offset": 10 + }, + "depth": { + "cairo_type": "felt", + "offset": 13 + }, + "env": { + "cairo_type": "src.model.model.Environment*", + "offset": 14 + }, + "is_create": { + "cairo_type": "felt", + "offset": 12 + }, + "parent": { + "cairo_type": "src.model.model.Parent*", + "offset": 8 + }, + "read_only": { + "cairo_type": "felt", + "offset": 11 + }, + "valid_jumpdests": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 3 + }, + "valid_jumpdests_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 2 + }, + "value": { + "cairo_type": "starkware.cairo.common.uint256.Uint256*", + "offset": 6 + } + }, + "size": 16, + "type": "struct" + }, + "src.model.model.Opcode": { + "full_name": "src.model.model.Opcode", + "members": { + "gas": { + "cairo_type": "felt", + "offset": 1 + }, + "number": { + "cairo_type": "felt", + "offset": 0 + }, + "stack_input": { + "cairo_type": "felt", + "offset": 2 + }, + "stack_size_diff": { + "cairo_type": "felt", + "offset": 4 + }, + "stack_size_min": { + "cairo_type": "felt", + "offset": 3 + } + }, + "size": 5, + "type": "struct" + }, + "src.model.model.Option": { + "full_name": "src.model.model.Option", + "members": { + "is_some": { + "cairo_type": "felt", + "offset": 0 + }, + "value": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "src.model.model.Parent": { + "full_name": "src.model.model.Parent", + "members": { + "evm": { + "cairo_type": "src.model.model.EVM*", + "offset": 0 + }, + "memory": { + "cairo_type": "src.model.model.Memory*", + "offset": 2 + }, + "stack": { + "cairo_type": "src.model.model.Stack*", + "offset": 1 + }, + "state": { + "cairo_type": "src.model.model.State*", + "offset": 3 + } + }, + "size": 4, + "type": "struct" + }, + "src.model.model.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "src.model.model.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "src.model.model.Stack": { + "full_name": "src.model.model.Stack", + "members": { + "dict_ptr": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 1 + }, + "dict_ptr_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 0 + }, + "size": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "src.model.model.State": { + "full_name": "src.model.model.State", + "members": { + "accounts": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 1 + }, + "accounts_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 0 + }, + "events": { + "cairo_type": "src.model.model.Event*", + "offset": 3 + }, + "events_len": { + "cairo_type": "felt", + "offset": 2 + }, + "transfers": { + "cairo_type": "src.model.model.Transfer*", + "offset": 5 + }, + "transfers_len": { + "cairo_type": "felt", + "offset": 4 + } + }, + "size": 6, + "type": "struct" + }, + "src.model.model.Transaction": { + "full_name": "src.model.model.Transaction", + "members": { + "access_list": { + "cairo_type": "felt*", + "offset": 11 + }, + "access_list_len": { + "cairo_type": "felt", + "offset": 10 + }, + "amount": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 6 + }, + "chain_id": { + "cairo_type": "src.model.model.Option", + "offset": 12 + }, + "destination": { + "cairo_type": "src.model.model.Option", + "offset": 4 + }, + "gas_limit": { + "cairo_type": "felt", + "offset": 1 + }, + "max_fee_per_gas": { + "cairo_type": "felt", + "offset": 3 + }, + "max_priority_fee_per_gas": { + "cairo_type": "felt", + "offset": 2 + }, + "payload": { + "cairo_type": "felt*", + "offset": 9 + }, + "payload_len": { + "cairo_type": "felt", + "offset": 8 + }, + "signer_nonce": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 14, + "type": "struct" + }, + "src.model.model.TransactionEncoded": { + "full_name": "src.model.model.TransactionEncoded", + "members": { + "rlp": { + "cairo_type": "felt*", + "offset": 1 + }, + "rlp_len": { + "cairo_type": "felt", + "offset": 0 + }, + "sender": { + "cairo_type": "felt", + "offset": 4 + }, + "signature": { + "cairo_type": "felt*", + "offset": 3 + }, + "signature_len": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 5, + "type": "struct" + }, + "src.model.model.Transfer": { + "full_name": "src.model.model.Transfer", + "members": { + "amount": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 2 + }, + "recipient": { + "cairo_type": "felt", + "offset": 1 + }, + "sender": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.cairo.common.bitwise.ALL_ONES": { + "type": "const", + "value": -106710729501573572985208420194530329073740042555888586719234 + }, + "starkware.cairo.common.bitwise.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.bool.FALSE": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.bool.TRUE": { + "type": "const", + "value": 1 + }, + "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "x_and_y": { + "cairo_type": "felt", + "offset": 2 + }, + "x_or_y": { + "cairo_type": "felt", + "offset": 4 + }, + "x_xor_y": { + "cairo_type": "felt", + "offset": 3 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", + "members": { + "m": { + "cairo_type": "felt", + "offset": 4 + }, + "p": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 0 + }, + "q": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 2 + }, + "r": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcPoint": { + "destination": "starkware.cairo.common.ec_point.EcPoint", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.HashBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "members": { + "result": { + "cairo_type": "felt", + "offset": 2 + }, + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 8 + } + }, + "size": 16, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.ModBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.ModBuiltin", + "members": { + "n": { + "cairo_type": "felt", + "offset": 6 + }, + "offsets_ptr": { + "cairo_type": "felt*", + "offset": 5 + }, + "p": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384", + "offset": 0 + }, + "values_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384*", + "offset": 4 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 3 + } + }, + "size": 6, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { + "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", + "members": { + "message": { + "cairo_type": "felt", + "offset": 1 + }, + "pub_key": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.UInt384": { + "full_name": "starkware.cairo.common.cairo_builtins.UInt384", + "members": { + "d0": { + "cairo_type": "felt", + "offset": 0 + }, + "d1": { + "cairo_type": "felt", + "offset": 1 + }, + "d2": { + "cairo_type": "felt", + "offset": 2 + }, + "d3": { + "cairo_type": "felt", + "offset": 3 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.cairo.common.default_dict.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.cairo.common.default_dict.default_dict_new": { + "decorators": [], + "pc": 6, + "type": "function" + }, + "starkware.cairo.common.default_dict.default_dict_new.Args": { + "full_name": "starkware.cairo.common.default_dict.default_dict_new.Args", + "members": { + "default_value": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.default_dict.default_dict_new.ImplicitArgs": { + "full_name": "starkware.cairo.common.default_dict.default_dict_new.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "starkware.cairo.common.default_dict.default_dict_new.Return": { + "cairo_type": "(res: starkware.cairo.common.dict_access.DictAccess*)", + "type": "type_definition" + }, + "starkware.cairo.common.default_dict.default_dict_new.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.default_dict.default_dict_new.default_value": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.default_dict.default_dict_new.default_value", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.default_dict.dict_squash": { + "destination": "starkware.cairo.common.dict.dict_squash", + "type": "alias" + }, + "starkware.cairo.common.dict.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.cairo.common.dict.squash_dict": { + "destination": "starkware.cairo.common.squash_dict.squash_dict", + "type": "alias" + }, + "starkware.cairo.common.dict_access.DictAccess": { + "full_name": "starkware.cairo.common.dict_access.DictAccess", + "members": { + "key": { + "cairo_type": "felt", + "offset": 0 + }, + "new_value": { + "cairo_type": "felt", + "offset": 2 + }, + "prev_value": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.ec_point.EcPoint": { + "full_name": "starkware.cairo.common.ec_point.EcPoint", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.keccak_state.KeccakBuiltinState": { + "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + }, + "s3": { + "cairo_type": "felt", + "offset": 3 + }, + "s4": { + "cairo_type": "felt", + "offset": 4 + }, + "s5": { + "cairo_type": "felt", + "offset": 5 + }, + "s6": { + "cairo_type": "felt", + "offset": 6 + }, + "s7": { + "cairo_type": "felt", + "offset": 7 + } + }, + "size": 8, + "type": "struct" + }, + "starkware.cairo.common.math.FALSE": { + "destination": "starkware.cairo.common.bool.FALSE", + "type": "alias" + }, + "starkware.cairo.common.math.TRUE": { + "destination": "starkware.cairo.common.bool.TRUE", + "type": "alias" + }, + "starkware.cairo.common.math_cmp.RC_BOUND": { + "type": "const", + "value": 340282366920938463463374607431768211456 + }, + "starkware.cairo.common.math_cmp.assert_le_felt": { + "destination": "starkware.cairo.common.math.assert_le_felt", + "type": "alias" + }, + "starkware.cairo.common.math_cmp.assert_lt_felt": { + "destination": "starkware.cairo.common.math.assert_lt_felt", + "type": "alias" + }, + "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { + "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.pow.assert_le": { + "destination": "starkware.cairo.common.math.assert_le", + "type": "alias" + }, + "starkware.cairo.common.pow.get_ap": { + "destination": "starkware.cairo.common.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.pow.get_fp_and_pc": { + "destination": "starkware.cairo.common.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.pow.sign": { + "destination": "starkware.cairo.common.math.sign", + "type": "alias" + }, + "starkware.cairo.common.registers.get_ap": { + "destination": "starkware.cairo.lang.compiler.lib.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.registers.get_fp_and_pc": { + "destination": "starkware.cairo.lang.compiler.lib.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.squash_dict.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.cairo.common.squash_dict.assert_lt_felt": { + "destination": "starkware.cairo.common.math.assert_lt_felt", + "type": "alias" + }, + "starkware.cairo.common.uint256.ALL_ONES": { + "type": "const", + "value": 340282366920938463463374607431768211455 + }, + "starkware.cairo.common.uint256.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.uint256.HALF_SHIFT": { + "type": "const", + "value": 18446744073709551616 + }, + "starkware.cairo.common.uint256.SHIFT": { + "type": "const", + "value": 340282366920938463463374607431768211456 + }, + "starkware.cairo.common.uint256.Uint256": { + "full_name": "starkware.cairo.common.uint256.Uint256", + "members": { + "high": { + "cairo_type": "felt", + "offset": 1 + }, + "low": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.uint256.assert_in_range": { + "destination": "starkware.cairo.common.math.assert_in_range", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_le": { + "destination": "starkware.cairo.common.math.assert_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_nn_le": { + "destination": "starkware.cairo.common.math.assert_nn_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_not_zero": { + "destination": "starkware.cairo.common.math.assert_not_zero", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_and": { + "destination": "starkware.cairo.common.bitwise.bitwise_and", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_or": { + "destination": "starkware.cairo.common.bitwise.bitwise_or", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_xor": { + "destination": "starkware.cairo.common.bitwise.bitwise_xor", + "type": "alias" + }, + "starkware.cairo.common.uint256.get_ap": { + "destination": "starkware.cairo.common.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.uint256.get_fp_and_pc": { + "destination": "starkware.cairo.common.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.uint256.is_le": { + "destination": "starkware.cairo.common.math_cmp.is_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.pow": { + "destination": "starkware.cairo.common.pow.pow", + "type": "alias" + }, + "starkware.cairo.common.uint256.split_felt": { + "destination": "starkware.cairo.common.math.split_felt", + "type": "alias" + } + }, + "main_scope": "__main__", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "reference_manager": { + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-4), felt**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "[cast(ap + (-1), starkware.cairo.common.dict_access.DictAccess**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "cast(([ap + (-1)], [ap + (-1)], 0), src.model.model.Memory)" + } + ] + } +} diff --git a/crates/exex/testdata/model_stack.cairo b/crates/exex/testdata/model_stack.cairo new file mode 100644 index 000000000..7b90721a0 --- /dev/null +++ b/crates/exex/testdata/model_stack.cairo @@ -0,0 +1,12 @@ +%builtins output range_check + +from src.model import model +from starkware.cairo.common.default_dict import default_dict_new +from starkware.cairo.common.dict import DictAccess + +func main{output_ptr: felt*, range_check_ptr}() { + let (dict_ptr_start: DictAccess*) = default_dict_new(0); + let stack = model.Stack(dict_ptr_start, dict_ptr_start, 0); + + return (); +} diff --git a/crates/exex/testdata/model_stack.json b/crates/exex/testdata/model_stack.json new file mode 100644 index 000000000..7ca23003f --- /dev/null +++ b/crates/exex/testdata/model_stack.json @@ -0,0 +1,1304 @@ +{ + "attributes": [], + "builtins": ["output", "range_check"], + "compiler_version": "0.13.2", + "data": [ + "0x40780017fff7fff", + "0x2", + "0x1104800180018000", + "0x7", + "0x10780017fff7fff", + "0x0", + "0x40780017fff7fff", + "0x1", + "0x208b7fff7fff7ffe", + "0x480680017fff8000", + "0x0", + "0x1104800180018000", + "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffffc", + "0x480a7ffc7fff8000", + "0x480a7ffd7fff8000", + "0x208b7fff7fff7ffe" + ], + "debug_info": null, + "hints": { + "6": [ + { + "accessible_scopes": [ + "starkware.cairo.common.default_dict", + "starkware.cairo.common.default_dict.default_dict_new" + ], + "code": "if '__dict_manager' not in globals():\n from starkware.cairo.common.dict import DictManager\n __dict_manager = DictManager()\n\nmemory[ap] = __dict_manager.new_default_dict(segments, ids.default_value)", + "flow_tracking_data": { + "ap_tracking": { + "group": 2, + "offset": 0 + }, + "reference_ids": { + "starkware.cairo.common.default_dict.default_dict_new.default_value": 0 + } + } + } + ] + }, + "identifiers": { + "__main__.DictAccess": { + "destination": "starkware.cairo.common.dict.DictAccess", + "type": "alias" + }, + "__main__.__end__": { + "pc": 4, + "type": "label" + }, + "__main__.__start__": { + "pc": 0, + "type": "label" + }, + "__main__.default_dict_new": { + "destination": "starkware.cairo.common.default_dict.default_dict_new", + "type": "alias" + }, + "__main__.main": { + "decorators": [], + "pc": 9, + "type": "function" + }, + "__main__.main.Args": { + "full_name": "__main__.main.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "__main__.main.ImplicitArgs": { + "full_name": "__main__.main.ImplicitArgs", + "members": { + "output_ptr": { + "cairo_type": "felt*", + "offset": 0 + }, + "range_check_ptr": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "__main__.main.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "__main__.main.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "__main__.main.dict_ptr_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "full_name": "__main__.main.dict_ptr_start", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "[cast(ap + (-1), starkware.cairo.common.dict_access.DictAccess**)]" + } + ], + "type": "reference" + }, + "__main__.main.output_ptr": { + "cairo_type": "felt*", + "full_name": "__main__.main.output_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-4), felt**)]" + } + ], + "type": "reference" + }, + "__main__.main.range_check_ptr": { + "cairo_type": "felt", + "full_name": "__main__.main.range_check_ptr", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "__main__.main.stack": { + "cairo_type": "src.model.model.Stack", + "full_name": "__main__.main.stack", + "references": [ + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "cast(([ap + (-1)], [ap + (-1)], 0), src.model.model.Stack)" + } + ], + "type": "reference" + }, + "__main__.model": { + "destination": "src.model.model", + "type": "alias" + }, + "src.model.DictAccess": { + "destination": "starkware.cairo.common.dict.DictAccess", + "type": "alias" + }, + "src.model.Uint256": { + "destination": "starkware.cairo.common.uint256.Uint256", + "type": "alias" + }, + "src.model.model": { + "type": "namespace" + }, + "src.model.model.Account": { + "full_name": "src.model.model.Account", + "members": { + "balance": { + "cairo_type": "starkware.cairo.common.uint256.Uint256*", + "offset": 10 + }, + "code": { + "cairo_type": "felt*", + "offset": 1 + }, + "code_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256*", + "offset": 2 + }, + "code_len": { + "cairo_type": "felt", + "offset": 0 + }, + "created": { + "cairo_type": "felt", + "offset": 12 + }, + "nonce": { + "cairo_type": "felt", + "offset": 9 + }, + "selfdestruct": { + "cairo_type": "felt", + "offset": 11 + }, + "storage": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 4 + }, + "storage_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 3 + }, + "transient_storage": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 6 + }, + "transient_storage_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 5 + }, + "valid_jumpdests": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 8 + }, + "valid_jumpdests_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 7 + } + }, + "size": 13, + "type": "struct" + }, + "src.model.model.Args": { + "full_name": "src.model.model.Args", + "members": {}, + "size": 0, + "type": "struct" + }, + "src.model.model.Block": { + "full_name": "src.model.model.Block", + "members": { + "block_header": { + "cairo_type": "src.model.model.BlockHeader*", + "offset": 0 + }, + "transactions": { + "cairo_type": "src.model.model.TransactionEncoded*", + "offset": 2 + }, + "transactions_len": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "src.model.model.BlockHeader": { + "full_name": "src.model.model.BlockHeader", + "members": { + "base_fee_per_gas": { + "cairo_type": "src.model.model.Option", + "offset": 23 + }, + "blob_gas_used": { + "cairo_type": "src.model.model.Option", + "offset": 25 + }, + "bloom": { + "cairo_type": "felt*", + "offset": 13 + }, + "coinbase": { + "cairo_type": "felt", + "offset": 4 + }, + "difficulty": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 14 + }, + "excess_blob_gas": { + "cairo_type": "src.model.model.Option", + "offset": 27 + }, + "extra_data": { + "cairo_type": "felt*", + "offset": 34 + }, + "extra_data_len": { + "cairo_type": "felt", + "offset": 33 + }, + "gas_limit": { + "cairo_type": "felt", + "offset": 17 + }, + "gas_used": { + "cairo_type": "felt", + "offset": 18 + }, + "mix_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 20 + }, + "nonce": { + "cairo_type": "felt", + "offset": 22 + }, + "number": { + "cairo_type": "felt", + "offset": 16 + }, + "ommers_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 2 + }, + "parent_beacon_block_root": { + "cairo_type": "src.model.model.Option", + "offset": 29 + }, + "parent_hash": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 0 + }, + "receipt_root": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 9 + }, + "requests_root": { + "cairo_type": "src.model.model.Option", + "offset": 31 + }, + "state_root": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 5 + }, + "timestamp": { + "cairo_type": "felt", + "offset": 19 + }, + "transactions_root": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 7 + }, + "withdrawals_root": { + "cairo_type": "src.model.model.Option", + "offset": 11 + } + }, + "size": 35, + "type": "struct" + }, + "src.model.model.EVM": { + "full_name": "src.model.model.EVM", + "members": { + "gas_left": { + "cairo_type": "felt", + "offset": 5 + }, + "gas_refund": { + "cairo_type": "felt", + "offset": 6 + }, + "message": { + "cairo_type": "src.model.model.Message*", + "offset": 0 + }, + "program_counter": { + "cairo_type": "felt", + "offset": 3 + }, + "return_data": { + "cairo_type": "felt*", + "offset": 2 + }, + "return_data_len": { + "cairo_type": "felt", + "offset": 1 + }, + "reverted": { + "cairo_type": "felt", + "offset": 7 + }, + "stopped": { + "cairo_type": "felt", + "offset": 4 + } + }, + "size": 8, + "type": "struct" + }, + "src.model.model.Environment": { + "full_name": "src.model.model.Environment", + "members": { + "base_fee": { + "cairo_type": "felt", + "offset": 9 + }, + "block_gas_limit": { + "cairo_type": "felt", + "offset": 6 + }, + "block_number": { + "cairo_type": "felt", + "offset": 5 + }, + "block_timestamp": { + "cairo_type": "felt", + "offset": 7 + }, + "chain_id": { + "cairo_type": "felt", + "offset": 2 + }, + "coinbase": { + "cairo_type": "felt", + "offset": 8 + }, + "gas_price": { + "cairo_type": "felt", + "offset": 1 + }, + "origin": { + "cairo_type": "felt", + "offset": 0 + }, + "prev_randao": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 3 + } + }, + "size": 10, + "type": "struct" + }, + "src.model.model.Event": { + "full_name": "src.model.model.Event", + "members": { + "data": { + "cairo_type": "felt*", + "offset": 3 + }, + "data_len": { + "cairo_type": "felt", + "offset": 2 + }, + "topics": { + "cairo_type": "felt*", + "offset": 1 + }, + "topics_len": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 4, + "type": "struct" + }, + "src.model.model.ImplicitArgs": { + "full_name": "src.model.model.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "src.model.model.Memory": { + "full_name": "src.model.model.Memory", + "members": { + "word_dict": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 1 + }, + "word_dict_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 0 + }, + "words_len": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "src.model.model.MemoryExpansion": { + "full_name": "src.model.model.MemoryExpansion", + "members": { + "cost": { + "cairo_type": "felt", + "offset": 0 + }, + "new_words_len": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "src.model.model.Message": { + "full_name": "src.model.model.Message", + "members": { + "address": { + "cairo_type": "felt", + "offset": 9 + }, + "bytecode": { + "cairo_type": "felt*", + "offset": 0 + }, + "bytecode_len": { + "cairo_type": "felt", + "offset": 1 + }, + "cairo_precompile_called": { + "cairo_type": "felt", + "offset": 15 + }, + "calldata": { + "cairo_type": "felt*", + "offset": 4 + }, + "calldata_len": { + "cairo_type": "felt", + "offset": 5 + }, + "caller": { + "cairo_type": "felt", + "offset": 7 + }, + "code_address": { + "cairo_type": "felt", + "offset": 10 + }, + "depth": { + "cairo_type": "felt", + "offset": 13 + }, + "env": { + "cairo_type": "src.model.model.Environment*", + "offset": 14 + }, + "is_create": { + "cairo_type": "felt", + "offset": 12 + }, + "parent": { + "cairo_type": "src.model.model.Parent*", + "offset": 8 + }, + "read_only": { + "cairo_type": "felt", + "offset": 11 + }, + "valid_jumpdests": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 3 + }, + "valid_jumpdests_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 2 + }, + "value": { + "cairo_type": "starkware.cairo.common.uint256.Uint256*", + "offset": 6 + } + }, + "size": 16, + "type": "struct" + }, + "src.model.model.Opcode": { + "full_name": "src.model.model.Opcode", + "members": { + "gas": { + "cairo_type": "felt", + "offset": 1 + }, + "number": { + "cairo_type": "felt", + "offset": 0 + }, + "stack_input": { + "cairo_type": "felt", + "offset": 2 + }, + "stack_size_diff": { + "cairo_type": "felt", + "offset": 4 + }, + "stack_size_min": { + "cairo_type": "felt", + "offset": 3 + } + }, + "size": 5, + "type": "struct" + }, + "src.model.model.Option": { + "full_name": "src.model.model.Option", + "members": { + "is_some": { + "cairo_type": "felt", + "offset": 0 + }, + "value": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "src.model.model.Parent": { + "full_name": "src.model.model.Parent", + "members": { + "evm": { + "cairo_type": "src.model.model.EVM*", + "offset": 0 + }, + "memory": { + "cairo_type": "src.model.model.Memory*", + "offset": 2 + }, + "stack": { + "cairo_type": "src.model.model.Stack*", + "offset": 1 + }, + "state": { + "cairo_type": "src.model.model.State*", + "offset": 3 + } + }, + "size": 4, + "type": "struct" + }, + "src.model.model.Return": { + "cairo_type": "()", + "type": "type_definition" + }, + "src.model.model.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "src.model.model.Stack": { + "full_name": "src.model.model.Stack", + "members": { + "dict_ptr": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 1 + }, + "dict_ptr_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 0 + }, + "size": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "src.model.model.State": { + "full_name": "src.model.model.State", + "members": { + "accounts": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 1 + }, + "accounts_start": { + "cairo_type": "starkware.cairo.common.dict_access.DictAccess*", + "offset": 0 + }, + "events": { + "cairo_type": "src.model.model.Event*", + "offset": 3 + }, + "events_len": { + "cairo_type": "felt", + "offset": 2 + }, + "transfers": { + "cairo_type": "src.model.model.Transfer*", + "offset": 5 + }, + "transfers_len": { + "cairo_type": "felt", + "offset": 4 + } + }, + "size": 6, + "type": "struct" + }, + "src.model.model.Transaction": { + "full_name": "src.model.model.Transaction", + "members": { + "access_list": { + "cairo_type": "felt*", + "offset": 11 + }, + "access_list_len": { + "cairo_type": "felt", + "offset": 10 + }, + "amount": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 6 + }, + "chain_id": { + "cairo_type": "src.model.model.Option", + "offset": 12 + }, + "destination": { + "cairo_type": "src.model.model.Option", + "offset": 4 + }, + "gas_limit": { + "cairo_type": "felt", + "offset": 1 + }, + "max_fee_per_gas": { + "cairo_type": "felt", + "offset": 3 + }, + "max_priority_fee_per_gas": { + "cairo_type": "felt", + "offset": 2 + }, + "payload": { + "cairo_type": "felt*", + "offset": 9 + }, + "payload_len": { + "cairo_type": "felt", + "offset": 8 + }, + "signer_nonce": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 14, + "type": "struct" + }, + "src.model.model.TransactionEncoded": { + "full_name": "src.model.model.TransactionEncoded", + "members": { + "rlp": { + "cairo_type": "felt*", + "offset": 1 + }, + "rlp_len": { + "cairo_type": "felt", + "offset": 0 + }, + "sender": { + "cairo_type": "felt", + "offset": 4 + }, + "signature": { + "cairo_type": "felt*", + "offset": 3 + }, + "signature_len": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 5, + "type": "struct" + }, + "src.model.model.Transfer": { + "full_name": "src.model.model.Transfer", + "members": { + "amount": { + "cairo_type": "starkware.cairo.common.uint256.Uint256", + "offset": 2 + }, + "recipient": { + "cairo_type": "felt", + "offset": 1 + }, + "sender": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.cairo.common.bitwise.ALL_ONES": { + "type": "const", + "value": -106710729501573572985208420194530329073740042555888586719234 + }, + "starkware.cairo.common.bitwise.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.bool.FALSE": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.bool.TRUE": { + "type": "const", + "value": 1 + }, + "starkware.cairo.common.cairo_builtins.BitwiseBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "x_and_y": { + "cairo_type": "felt", + "offset": 2 + }, + "x_or_y": { + "cairo_type": "felt", + "offset": 4 + }, + "x_xor_y": { + "cairo_type": "felt", + "offset": 3 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 5, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcOpBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.EcOpBuiltin", + "members": { + "m": { + "cairo_type": "felt", + "offset": 4 + }, + "p": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 0 + }, + "q": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 2 + }, + "r": { + "cairo_type": "starkware.cairo.common.ec_point.EcPoint", + "offset": 5 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.EcPoint": { + "destination": "starkware.cairo.common.ec_point.EcPoint", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.HashBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.HashBuiltin", + "members": { + "result": { + "cairo_type": "felt", + "offset": 2 + }, + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.KeccakBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "offset": 8 + } + }, + "size": 16, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.KeccakBuiltinState": { + "destination": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.ModBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.ModBuiltin", + "members": { + "n": { + "cairo_type": "felt", + "offset": 6 + }, + "offsets_ptr": { + "cairo_type": "felt*", + "offset": 5 + }, + "p": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384", + "offset": 0 + }, + "values_ptr": { + "cairo_type": "starkware.cairo.common.cairo_builtins.UInt384*", + "offset": 4 + } + }, + "size": 7, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.PoseidonBuiltin", + "members": { + "input": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 0 + }, + "output": { + "cairo_type": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "offset": 3 + } + }, + "size": 6, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.PoseidonBuiltinState": { + "destination": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "type": "alias" + }, + "starkware.cairo.common.cairo_builtins.SignatureBuiltin": { + "full_name": "starkware.cairo.common.cairo_builtins.SignatureBuiltin", + "members": { + "message": { + "cairo_type": "felt", + "offset": 1 + }, + "pub_key": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.cairo_builtins.UInt384": { + "full_name": "starkware.cairo.common.cairo_builtins.UInt384", + "members": { + "d0": { + "cairo_type": "felt", + "offset": 0 + }, + "d1": { + "cairo_type": "felt", + "offset": 1 + }, + "d2": { + "cairo_type": "felt", + "offset": 2 + }, + "d3": { + "cairo_type": "felt", + "offset": 3 + } + }, + "size": 4, + "type": "struct" + }, + "starkware.cairo.common.default_dict.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.cairo.common.default_dict.default_dict_new": { + "decorators": [], + "pc": 6, + "type": "function" + }, + "starkware.cairo.common.default_dict.default_dict_new.Args": { + "full_name": "starkware.cairo.common.default_dict.default_dict_new.Args", + "members": { + "default_value": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 1, + "type": "struct" + }, + "starkware.cairo.common.default_dict.default_dict_new.ImplicitArgs": { + "full_name": "starkware.cairo.common.default_dict.default_dict_new.ImplicitArgs", + "members": {}, + "size": 0, + "type": "struct" + }, + "starkware.cairo.common.default_dict.default_dict_new.Return": { + "cairo_type": "(res: starkware.cairo.common.dict_access.DictAccess*)", + "type": "type_definition" + }, + "starkware.cairo.common.default_dict.default_dict_new.SIZEOF_LOCALS": { + "type": "const", + "value": 0 + }, + "starkware.cairo.common.default_dict.default_dict_new.default_value": { + "cairo_type": "felt", + "full_name": "starkware.cairo.common.default_dict.default_dict_new.default_value", + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + } + ], + "type": "reference" + }, + "starkware.cairo.common.default_dict.dict_squash": { + "destination": "starkware.cairo.common.dict.dict_squash", + "type": "alias" + }, + "starkware.cairo.common.dict.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.cairo.common.dict.squash_dict": { + "destination": "starkware.cairo.common.squash_dict.squash_dict", + "type": "alias" + }, + "starkware.cairo.common.dict_access.DictAccess": { + "full_name": "starkware.cairo.common.dict_access.DictAccess", + "members": { + "key": { + "cairo_type": "felt", + "offset": 0 + }, + "new_value": { + "cairo_type": "felt", + "offset": 2 + }, + "prev_value": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.ec_point.EcPoint": { + "full_name": "starkware.cairo.common.ec_point.EcPoint", + "members": { + "x": { + "cairo_type": "felt", + "offset": 0 + }, + "y": { + "cairo_type": "felt", + "offset": 1 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.keccak_state.KeccakBuiltinState": { + "full_name": "starkware.cairo.common.keccak_state.KeccakBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + }, + "s3": { + "cairo_type": "felt", + "offset": 3 + }, + "s4": { + "cairo_type": "felt", + "offset": 4 + }, + "s5": { + "cairo_type": "felt", + "offset": 5 + }, + "s6": { + "cairo_type": "felt", + "offset": 6 + }, + "s7": { + "cairo_type": "felt", + "offset": 7 + } + }, + "size": 8, + "type": "struct" + }, + "starkware.cairo.common.math.FALSE": { + "destination": "starkware.cairo.common.bool.FALSE", + "type": "alias" + }, + "starkware.cairo.common.math.TRUE": { + "destination": "starkware.cairo.common.bool.TRUE", + "type": "alias" + }, + "starkware.cairo.common.math_cmp.RC_BOUND": { + "type": "const", + "value": 340282366920938463463374607431768211456 + }, + "starkware.cairo.common.math_cmp.assert_le_felt": { + "destination": "starkware.cairo.common.math.assert_le_felt", + "type": "alias" + }, + "starkware.cairo.common.math_cmp.assert_lt_felt": { + "destination": "starkware.cairo.common.math.assert_lt_felt", + "type": "alias" + }, + "starkware.cairo.common.poseidon_state.PoseidonBuiltinState": { + "full_name": "starkware.cairo.common.poseidon_state.PoseidonBuiltinState", + "members": { + "s0": { + "cairo_type": "felt", + "offset": 0 + }, + "s1": { + "cairo_type": "felt", + "offset": 1 + }, + "s2": { + "cairo_type": "felt", + "offset": 2 + } + }, + "size": 3, + "type": "struct" + }, + "starkware.cairo.common.pow.assert_le": { + "destination": "starkware.cairo.common.math.assert_le", + "type": "alias" + }, + "starkware.cairo.common.pow.get_ap": { + "destination": "starkware.cairo.common.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.pow.get_fp_and_pc": { + "destination": "starkware.cairo.common.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.pow.sign": { + "destination": "starkware.cairo.common.math.sign", + "type": "alias" + }, + "starkware.cairo.common.registers.get_ap": { + "destination": "starkware.cairo.lang.compiler.lib.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.registers.get_fp_and_pc": { + "destination": "starkware.cairo.lang.compiler.lib.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.squash_dict.DictAccess": { + "destination": "starkware.cairo.common.dict_access.DictAccess", + "type": "alias" + }, + "starkware.cairo.common.squash_dict.assert_lt_felt": { + "destination": "starkware.cairo.common.math.assert_lt_felt", + "type": "alias" + }, + "starkware.cairo.common.uint256.ALL_ONES": { + "type": "const", + "value": 340282366920938463463374607431768211455 + }, + "starkware.cairo.common.uint256.BitwiseBuiltin": { + "destination": "starkware.cairo.common.cairo_builtins.BitwiseBuiltin", + "type": "alias" + }, + "starkware.cairo.common.uint256.HALF_SHIFT": { + "type": "const", + "value": 18446744073709551616 + }, + "starkware.cairo.common.uint256.SHIFT": { + "type": "const", + "value": 340282366920938463463374607431768211456 + }, + "starkware.cairo.common.uint256.Uint256": { + "full_name": "starkware.cairo.common.uint256.Uint256", + "members": { + "high": { + "cairo_type": "felt", + "offset": 1 + }, + "low": { + "cairo_type": "felt", + "offset": 0 + } + }, + "size": 2, + "type": "struct" + }, + "starkware.cairo.common.uint256.assert_in_range": { + "destination": "starkware.cairo.common.math.assert_in_range", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_le": { + "destination": "starkware.cairo.common.math.assert_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_nn_le": { + "destination": "starkware.cairo.common.math.assert_nn_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.assert_not_zero": { + "destination": "starkware.cairo.common.math.assert_not_zero", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_and": { + "destination": "starkware.cairo.common.bitwise.bitwise_and", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_or": { + "destination": "starkware.cairo.common.bitwise.bitwise_or", + "type": "alias" + }, + "starkware.cairo.common.uint256.bitwise_xor": { + "destination": "starkware.cairo.common.bitwise.bitwise_xor", + "type": "alias" + }, + "starkware.cairo.common.uint256.get_ap": { + "destination": "starkware.cairo.common.registers.get_ap", + "type": "alias" + }, + "starkware.cairo.common.uint256.get_fp_and_pc": { + "destination": "starkware.cairo.common.registers.get_fp_and_pc", + "type": "alias" + }, + "starkware.cairo.common.uint256.is_le": { + "destination": "starkware.cairo.common.math_cmp.is_le", + "type": "alias" + }, + "starkware.cairo.common.uint256.pow": { + "destination": "starkware.cairo.common.pow.pow", + "type": "alias" + }, + "starkware.cairo.common.uint256.split_felt": { + "destination": "starkware.cairo.common.math.split_felt", + "type": "alias" + } + }, + "main_scope": "__main__", + "prime": "0x800000000000011000000000000000000000000000000000000000000000001", + "reference_manager": { + "references": [ + { + "ap_tracking_data": { + "group": 2, + "offset": 0 + }, + "pc": 6, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-4), felt**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 0 + }, + "pc": 9, + "value": "[cast(fp + (-3), felt*)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "[cast(ap + (-1), starkware.cairo.common.dict_access.DictAccess**)]" + }, + { + "ap_tracking_data": { + "group": 3, + "offset": 4 + }, + "pc": 13, + "value": "cast(([ap + (-1)], [ap + (-1)], 0), src.model.model.Stack)" + } + ] + } +}