From 3aae095dea4bfa1110dedf85d563e6d769458d10 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Wed, 29 May 2024 14:56:23 +0530 Subject: [PATCH 01/88] feat: init calldata for dojo contract (#1964) * initial commit * add tests * pass calldata during deploy_contract * complete todo in world.cairo * wip: work on dojo-lang macro for dojo init * wip: add dojo init impl * wip: work on compiler extension for dojo contract * clean up macro code * use logic similar to functions in other implementations and add to spawn-and-move that is: * allow ref self only if specified * add world if specified in parameters * update example, handle case where no dojo_init is specified and add plugin test * clean up fix tests * fix tests and lints * make suggested changes * fix class hash and address after world update * rename constructor_calldata to init_calldata --------- Co-authored-by: glihm --- Cargo.lock | 7 + Cargo.toml | 3 + crates/dojo-bindgen/src/lib.rs | 2 +- crates/dojo-core/src/base_test.cairo | 28 +- crates/dojo-core/src/world.cairo | 39 +- crates/dojo-core/src/world_test.cairo | 24 + crates/dojo-lang/src/contract.rs | 87 ++- .../dev/abis/base/dojo_world_world.json | 4 + .../compiler_cairo_cairo_24_cairo_v240.toml | 1 + .../compiler_cairo_cairo_26_cairo_v260.toml | 1 + .../manifests/dev/base/dojo_world_world.toml | 4 +- crates/dojo-lang/src/plugin.rs | 2 +- crates/dojo-lang/src/plugin_test_data/system | 368 ++++++++++- crates/dojo-test-utils/src/compiler.rs | 3 +- crates/dojo-test-utils/src/migration.rs | 15 +- crates/dojo-world/Cargo.toml | 1 + crates/dojo-world/src/contracts/abi/world.rs | 4 + crates/dojo-world/src/contracts/world_test.rs | 22 +- .../dojo-world/src/manifest/manifest_test.rs | 23 +- crates/dojo-world/src/manifest/mod.rs | 3 + crates/dojo-world/src/manifest/types.rs | 6 + crates/dojo-world/src/metadata_test.rs | 7 +- crates/dojo-world/src/migration/class.rs | 2 +- crates/dojo-world/src/migration/contract.rs | 3 +- crates/dojo-world/src/migration/mod.rs | 21 +- crates/dojo-world/src/migration/strategy.rs | 27 +- crates/dojo-world/src/migration/world.rs | 63 ++ crates/dojo-world/src/migration/world_test.rs | 67 ++ crates/sozo/ops/src/migration/migrate.rs | 6 +- crates/sozo/ops/src/migration/mod.rs | 5 +- crates/sozo/ops/src/tests/migration.rs | 3 +- crates/torii/core/src/sql_test.rs | 5 +- .../grpc/src/server/tests/entities_test.rs | 7 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- examples/spawn-and-move/Scarb.toml | 2 +- .../dojo_examples_actions_actions.json | 18 + .../dojo_examples_others_others.json | 146 +++++ .../dev/abis/base/dojo_world_world.json | 4 + ...es_others_others_contract_initialized.json | 367 +++++++++++ .../dojo_examples_actions_actions.json | 18 + .../dojo_examples_others_others.json | 146 +++++ .../abis/deployments/dojo_world_world.json | 4 + ...es_others_others_contract_initialized.json | 367 +++++++++++ .../dojo_examples_actions_actions.toml | 5 +- .../dojo_examples_others_others.toml | 10 + .../manifests/dev/base/dojo_world_world.toml | 4 +- ...es_others_others_contract_initialized.toml | 20 + .../manifests/dev/manifest.json | 589 +++++++++++++++++- .../manifests/dev/manifest.toml | 54 +- .../dojo_examples_actions_actions.toml | 2 + .../dojo_examples_others_others.toml | 5 + examples/spawn-and-move/src/actions.cairo | 2 +- examples/spawn-and-move/src/lib.cairo | 1 + examples/spawn-and-move/src/others.cairo | 31 + 54 files changed, 2585 insertions(+), 77 deletions(-) create mode 100644 examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json create mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml create mode 100644 examples/spawn-and-move/src/others.cairo diff --git a/Cargo.lock b/Cargo.lock index a4158a0ae4..e021fa153f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4257,6 +4257,7 @@ dependencies = [ "thiserror", "tokio", "toml 0.8.13", + "topological-sort", "tracing", "url", ] @@ -13339,6 +13340,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + [[package]] name = "torii" version = "0.7.0-alpha.4" diff --git a/Cargo.toml b/Cargo.toml index 8c2d72ad0a..3fefe8f63b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,9 @@ dojo-test-utils = { path = "crates/dojo-test-utils" } dojo-types = { path = "crates/dojo-types" } dojo-world = { path = "crates/dojo-world" } +# dojo-world +topological-sort = "0.2" + # katana katana-cairo = { path = "crates/katana/cairo" } katana-codecs = { path = "crates/katana/storage/codecs" } diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index ed2605f18a..3b25f4528d 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -261,7 +261,7 @@ mod tests { ) .unwrap(); - assert_eq!(data.models.len(), 5); + assert_eq!(data.models.len(), 6); assert_eq!(data.world.name, "dojo_example"); diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index 84ef74bf15..f52aea79f4 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -52,12 +52,20 @@ fn deploy_world() -> IWorldDispatcher { spawn_test_world(array![]) } +// A test contract needs to be used instead of previously used base contract since. +// contracts now require a `dojo_init` method which normal base contract doesn't have +#[dojo::contract] +mod test_contract {} + #[test] #[available_gas(6000000)] fn test_upgrade_from_world() { let world = deploy_world(); - let base_address = world.deploy_contract('salt', base::TEST_CLASS_HASH.try_into().unwrap()); + let base_address = world + .deploy_contract( + 'salt', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); let new_class_hash: ClassHash = contract_upgrade::TEST_CLASS_HASH.try_into().unwrap(); world.upgrade_contract(base_address, new_class_hash); @@ -74,7 +82,10 @@ fn test_upgrade_from_world() { fn test_upgrade_from_world_not_world_provider() { let world = deploy_world(); - let base_address = world.deploy_contract('salt', base::TEST_CLASS_HASH.try_into().unwrap()); + let base_address = world + .deploy_contract( + 'salt', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); let new_class_hash: ClassHash = contract_invalid_upgrade::TEST_CLASS_HASH.try_into().unwrap(); world.upgrade_contract(base_address, new_class_hash); @@ -86,7 +97,10 @@ fn test_upgrade_from_world_not_world_provider() { fn test_upgrade_direct() { let world = deploy_world(); - let base_address = world.deploy_contract('salt', base::TEST_CLASS_HASH.try_into().unwrap()); + let base_address = world + .deploy_contract( + 'salt', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); let new_class_hash: ClassHash = contract_upgrade::TEST_CLASS_HASH.try_into().unwrap(); let upgradeable_dispatcher = IUpgradeableDispatcher { contract_address: base_address }; @@ -144,8 +158,9 @@ mod invalid_model { #[abi(embed_v0)] impl InvalidModelSelector of super::IMetadataOnly { fn selector(self: @ContractState) -> felt252 { + // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x455fe9471cb954574b16581868043841391545b9225af00bf545f9acf923295 + 0x3dc3b5d2f73350ccda67b655bfae01e747c5db6e6f570743ee2867649da2a73 } fn name(self: @ContractState) -> ByteArray { @@ -179,12 +194,13 @@ mod invalid_model_world { fn test_deploy_from_world_invalid_model() { let world = deploy_world(); - let base_address = world.deploy_contract(0, base::TEST_CLASS_HASH.try_into().unwrap()); + let contract_address = world + .deploy_contract(0, test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span()); // This print allows to know the address of the deployed contract which must be returned // by the selector() function of invalid model, to simulate a ACL issue // (see register_model function) - base_address.print(); + contract_address.print(); world.register_model(invalid_model::TEST_CLASS_HASH.try_into().unwrap()); } diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index 0544b1d385..6517a21d21 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -9,7 +9,9 @@ trait IWorld { fn set_metadata(ref self: T, metadata: ResourceMetadata); fn model(self: @T, selector: felt252) -> (ClassHash, ContractAddress); fn register_model(ref self: T, class_hash: ClassHash); - fn deploy_contract(ref self: T, salt: felt252, class_hash: ClassHash) -> ContractAddress; + fn deploy_contract( + ref self: T, salt: felt252, class_hash: ClassHash, init_calldata: Span + ) -> ContractAddress; fn upgrade_contract(ref self: T, address: ContractAddress, class_hash: ClassHash) -> ClassHash; fn uuid(ref self: T) -> usize; fn emit(self: @T, keys: Array, values: Span); @@ -97,9 +99,11 @@ mod world { const WORLD: felt252 = 0; - // the minimum internal size of an empty ByteArray + // the minimum internal size of an empty ByteArray const MIN_BYTE_ARRAY_SIZE: u32 = 3; + const DOJO_INIT_SELECTOR: felt252 = selector!("dojo_init"); + component!(path: Config, storage: config, event: ConfigEvent); #[abi(embed_v0)] @@ -204,6 +208,7 @@ mod world { writers: LegacyMap::<(felt252, ContractAddress), bool>, #[substorage(v0)] config: Config::Storage, + initialized_contract: LegacyMap::, } #[constructor] @@ -430,12 +435,16 @@ mod world { /// /// * `salt` - The salt use for contract deployment. /// * `class_hash` - The class hash of the contract. + /// * `init_calldata` - Calldata used to initialize the contract. /// /// # Returns /// /// * `ContractAddress` - The address of the newly deployed contract. fn deploy_contract( - ref self: ContractState, salt: felt252, class_hash: ClassHash + ref self: ContractState, + salt: felt252, + class_hash: ClassHash, + init_calldata: Span, ) -> ContractAddress { let (contract_address, _) = deploy_syscall( self.contract_base.read(), salt, array![].span(), false @@ -444,6 +453,14 @@ mod world { let upgradeable_dispatcher = IUpgradeableDispatcher { contract_address }; upgradeable_dispatcher.upgrade(class_hash); + if self.initialized_contract.read(contract_address.into()) { + panic!("Contract has already been initialized"); + } else { + starknet::call_contract_syscall(contract_address, DOJO_INIT_SELECTOR, init_calldata) + .unwrap_syscall(); + self.initialized_contract.write(contract_address.into(), true); + } + self.owners.write((contract_address.into(), get_caller_address()), true); self.deployed_contracts.write(contract_address.into(), class_hash.into()); @@ -796,7 +813,7 @@ mod world { } /// Write values to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the object key. @@ -829,7 +846,7 @@ mod world { } /// Write fixed layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -844,7 +861,7 @@ mod world { } /// Write array layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -894,7 +911,7 @@ mod world { // data: Array, // pending_word: felt252, // pending_word_len: usize, - // } + // } // // That means, the length of data to write from 'values' is: // 1 + len(data) + 1 + 1 = len(data) + 3 @@ -914,7 +931,7 @@ mod world { } /// Write struct layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -944,7 +961,7 @@ mod world { } /// Write tuple layout model record to the world storage. - /// + /// /// # Arguments /// * `model` - the model selector. /// * `key` - the model record key. @@ -1018,7 +1035,7 @@ mod world { // data: Array, // pending_word: felt252, // pending_word_len: usize, - // } + // } // // So, just set the 3 first values to 0 (len(data), pending_world and pending_word_len) @@ -1185,7 +1202,7 @@ mod world { // data: Array, // pending_word: felt252, // pending_word_len: usize, - // } + // } // // So, read the length of data and compute the full size to read diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/world_test.cairo index 7cf10a7010..5106cba9a4 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/world_test.cairo @@ -819,6 +819,7 @@ fn test_program_hash_event_emit() { Option::Some(ProgramHashUpdate { program_hash: 98758347158781475198374598718743 }) ); } + #[test] #[available_gas(6000000)] fn test_facts_registry_event_emit() { @@ -833,6 +834,29 @@ fn test_facts_registry_event_emit() { Option::Some(FactsRegistryUpdate { address: contract_address_const::<0x12>() }) ); } + +#[starknet::interface] +trait IDojoInit { + fn dojo_init(self: @ContractState) -> felt252; +} + +#[dojo::contract] +mod test_contract {} + +#[test] +#[available_gas(6000000)] +#[should_panic(expected: ('Only world can init', 'ENTRYPOINT_FAILED'))] +fn test_can_call_init() { + let world = deploy_world(); + let address = world + .deploy_contract( + 'salt1', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); + + let dojo_init = IDojoInitDispatcher { contract_address: address }; + dojo_init.dojo_init(); +} + #[test] fn test_set_entity_with_fixed_layout() { let world = deploy_world(); diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index 570d7606cf..fac9667ba0 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -17,6 +17,7 @@ use dojo_types::system::Dependency; use crate::plugin::{DojoAuxData, SystemAuxData, DOJO_CONTRACT_ATTR}; const ALLOW_REF_SELF_ARG: &str = "allow_ref_self"; +const DOJO_INIT_FN: &str = "dojo_init"; pub struct DojoContract { diagnostics: Vec, @@ -36,6 +37,7 @@ impl DojoContract { DojoContract { diagnostics: vec![], dependencies: HashMap::new(), do_allow_ref_self }; let mut has_event = false; let mut has_storage = false; + let mut has_init = false; if let MaybeModuleBody::Some(body) = module_ast.body(db) { let mut body_nodes: Vec<_> = body @@ -60,12 +62,44 @@ impl DojoContract { if trait_path.contains("") { return system.rewrite_impl(db, impl_ast.clone()); } + } else if let ast::ModuleItem::FreeFunction(fn_ast) = el { + let fn_decl = fn_ast.declaration(db); + let fn_name = fn_decl.name(db).text(db); + + if fn_name == DOJO_INIT_FN { + has_init = true; + return system.handle_init_fn(db, fn_ast); + } } vec![RewriteNode::Copied(el.as_syntax_node())] }) .collect(); + if !has_init { + let node = RewriteNode::interpolate_patched( + " + #[starknet::interface] + trait IDojoInit { + fn $init_name$(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn $init_name$(self: @ContractState) { + assert(starknet::get_caller_address() == \ + self.world().contract_address, 'Only world can init'); + } + } + ", + &UnorderedHashMap::from([( + "init_name".to_string(), + RewriteNode::Text(DOJO_INIT_FN.to_string()), + )]), + ); + body_nodes.append(&mut vec![node]); + } + if !has_event { body_nodes.append(&mut system.create_event()) } @@ -84,8 +118,8 @@ impl DojoContract { use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; use dojo::world::IDojoResourceProvider; - - + + component!(path: dojo::components::upgradeable::upgradeable, storage: \ upgradeable, event: UpgradeableEvent); @@ -140,6 +174,55 @@ impl DojoContract { PluginResult::default() } + fn handle_init_fn( + &mut self, + db: &dyn SyntaxGroup, + fn_ast: &ast::FunctionWithBody, + ) -> Vec { + let fn_decl = fn_ast.declaration(db); + let fn_name = fn_decl.name(db).text(db); + + let (params_str, _, world_removed) = self.rewrite_parameters( + db, + fn_decl.signature(db).parameters(db), + fn_ast.stable_ptr().untyped(), + ); + + let mut world_read = ""; + if world_removed { + world_read = "let world = self.world_dispatcher.read();"; + } + + let body = fn_ast.body(db).as_syntax_node().get_text(db); + + let node = RewriteNode::interpolate_patched( + " + #[starknet::interface] + trait IDojoInit { + fn $name$($params_str$); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn $name$($params_str$) { + $world_read$ + assert(starknet::get_caller_address() == self.world().contract_address, \ + 'Only world can init'); + $body$ + } + } + ", + &UnorderedHashMap::from([ + ("name".to_string(), RewriteNode::Text(fn_name.to_string())), + ("params_str".to_string(), RewriteNode::Text(params_str)), + ("body".to_string(), RewriteNode::Text(body)), + ("world_read".to_string(), RewriteNode::Text(world_read.to_string())), + ]), + ); + + vec![node] + } + pub fn merge_event( &mut self, db: &dyn SyntaxGroup, diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json index d800e7d191..63207ddec9 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json @@ -205,6 +205,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml index a62805594e..d253e1bd66 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml @@ -6,4 +6,5 @@ abi = "manifests/dev/abis/base/contracts/compiler_cairo_cairo_24_cairo_v240.json reads = [] writes = [] computed = [] +init_calldata = [] name = "compiler_cairo::cairo_24::cairo_v240" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml index e4f5304c0d..4ac01d6fdb 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml @@ -6,4 +6,5 @@ abi = "manifests/dev/abis/base/contracts/compiler_cairo_cairo_26_cairo_v260.json reads = [] writes = [] computed = [] +init_calldata = [] name = "compiler_cairo::cairo_26::cairo_v260" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml index 5a021e2793..efc6f0ca39 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index 0be64f4c6e..fdd7d28419 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -514,9 +514,9 @@ impl MacroPlugin for BuiltinDojoPlugin { DOJO_INTERFACE_ATTR.to_string(), DOJO_CONTRACT_ATTR.to_string(), DOJO_EVENT_ATTR.to_string(), + DOJO_MODEL_ATTR.to_string(), "key".to_string(), "computed".to_string(), - DOJO_MODEL_ATTR.to_string(), ] } } diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index 7b55dc83b5..c23d1a35a0 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -202,6 +202,26 @@ mod MyNominalContract { } } +#[dojo::contract] +mod init_test { + fn dojo_init( + world: IWorldDispatcher, + actions_address: ContractAddress, + actions_class: ClassHash, + value: u8 + ) { + emit!( + world, + ContractInitialized { + contract_address: actions_address, contract_class: actions_class, value + } + ); + } +} + +#[dojo::contract] +mod no_init_test {} + //! > generated_cairo_code #[starknet::contract] mod spawn { @@ -407,6 +427,16 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:44:5 #[storage] @@ -452,6 +482,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:1:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:11:1 #[dojo::contract] @@ -487,6 +522,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:11:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:18:1 #[dojo::contract] @@ -522,6 +562,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:18:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:28:1 #[dojo::contract] @@ -557,6 +602,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:28:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:54:1 #[dojo::contract] @@ -617,6 +667,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:54:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:93:1 #[dojo::contract(allow_ref_self)] @@ -657,6 +712,11 @@ error: Unsupported attribute. #[dojo::contract(allow_ref_self)] ^*******************************^ +error: Unsupported attribute. + --> test_src/lib.cairo:93:1 +#[dojo::contract(allow_ref_self)] +^*******************************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:126:1 #[dojo::contract] @@ -697,6 +757,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:126:1 +#[dojo::contract] +^***************^ + error: Unknown inline item macro: 'component'. --> test_src/lib.cairo:162:1 #[dojo::contract] @@ -737,6 +802,91 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unsupported attribute. + --> test_src/lib.cairo:162:1 +#[dojo::contract] +^***************^ + +error: Unknown inline item macro: 'component'. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:199:1 +#[dojo::contract] +^***************^ + +error: Unknown inline item macro: 'component'. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:216:1 +#[dojo::contract] +^***************^ + //! > expanded_cairo_code #[starknet::component] @@ -788,6 +938,18 @@ trait IAllowedRefSelf { return (); } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -833,6 +995,18 @@ impl EventDrop of core::traits::Drop::; value } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -881,6 +1055,18 @@ impl EventDrop of core::traits::Drop::; return (); } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -935,6 +1121,18 @@ impl EventDrop of core::traits::Drop::; address: ContractAddress, } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[storage] struct Storage { world_dispatcher: IWorldDispatcher, @@ -990,8 +1188,20 @@ impl TestEventDrop of core::traits::Drop::; testcomponent1_event: testcomponent1::Event, testcomponent2_event: testcomponent2::Event } -impl EventDrop of core::traits::Drop::; + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } +impl EventDrop of core::traits::Drop::; + } #[starknet::interface] @@ -1037,6 +1247,18 @@ impl EventDrop of core::traits::Drop::; fn spawn(ref self: ContractState) {} } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -1138,6 +1360,18 @@ self: @ContractState, world: IWorldDispatcher, vec: Vec2, another_wo } } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -1215,6 +1449,18 @@ let world = self.world_dispatcher.read(); } } + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -1234,3 +1480,123 @@ impl ActionDrop of core::traits::Drop::; impl EventDrop of core::traits::Drop::; } + + #[starknet::contract] + mod init_test { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::world::IDojoResourceProvider; + + #[abi(embed_v0)] + impl DojoResourceProviderImpl of IDojoResourceProvider { + fn dojo_resource(self: @ContractState) -> felt252 { + 'init_test' + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; + + + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) { + let world = self.world_dispatcher.read(); + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + { + emit!( + world, + ContractInitialized { + contract_address: actions_address, contract_class: actions_class, value + } + ); + } + + } + } + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, + } + + #[storage] + struct Storage { + world_dispatcher: IWorldDispatcher, + #[substorage(v0)] + upgradeable: dojo::components::upgradeable::upgradeable::Storage, + } +impl EventDrop of core::traits::Drop::; + + } + + #[starknet::contract] + mod no_init_test { + use dojo::world; + use dojo::world::IWorldDispatcher; + use dojo::world::IWorldDispatcherTrait; + use dojo::world::IWorldProvider; + use dojo::world::IDojoResourceProvider; + + #[abi(embed_v0)] + impl DojoResourceProviderImpl of IDojoResourceProvider { + fn dojo_resource(self: @ContractState) -> felt252 { + 'no_init_test' + } + } + + #[abi(embed_v0)] + impl WorldProviderImpl of IWorldProvider { + fn world(self: @ContractState) -> IWorldDispatcher { + self.world_dispatcher.read() + } + } + + #[abi(embed_v0)] + impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; + + + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState); + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState) { + assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); + } + } + + #[event] + #[derive(Drop, starknet::Event)] + enum Event { + UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, + } + + #[storage] + struct Storage { + world_dispatcher: IWorldDispatcher, + #[substorage(v0)] + upgradeable: dojo::components::upgradeable::upgradeable::Storage, + } +impl EventDrop of core::traits::Drop::; + + } diff --git a/crates/dojo-test-utils/src/compiler.rs b/crates/dojo-test-utils/src/compiler.rs index c5c3e5a7f1..b8d30c5775 100644 --- a/crates/dojo-test-utils/src/compiler.rs +++ b/crates/dojo-test-utils/src/compiler.rs @@ -58,7 +58,8 @@ pub fn copy_build_project_temp( let temp_project_path = temp_project_dir.join("Scarb").with_extension("toml").to_string(); let dojo_core_path = Utf8PathBuf::from(dojo_core_path); - let ignore_dirs = ["manifests", "target"]; + // we don't ignore `manifests` because `overylays` are required for successful migration + let ignore_dirs = ["target"]; copy_project_temp(&source_project_dir, &temp_project_dir, &dojo_core_path, &ignore_dirs) .unwrap(); diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index fbf52d5e1c..7ad6f25843 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -15,12 +15,20 @@ pub fn prepare_migration( // In testing, profile name is always dev. let profile_name = "dev"; - let manifest = BaseManifest::load_from_path( + let mut manifest = BaseManifest::load_from_path( &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); - let world = WorldDiff::compute(manifest, None); + let overlay_manifest = OverlayManifest::load_from_path( + &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), + ) + .unwrap(); + + manifest.merge(overlay_manifest); + + let mut world = WorldDiff::compute(manifest, None); + world.update_order().unwrap(); prepare_for_migration(None, felt!("0x12345"), &target_dir, world) } @@ -46,7 +54,8 @@ pub fn prepare_migration_with_world_and_seed( manifest.merge(overlay_manifest); - let world = WorldDiff::compute(manifest, None); + let mut world = WorldDiff::compute(manifest, None); + world.update_order().unwrap(); let seed = cairo_short_string_to_felt(seed).unwrap(); prepare_for_migration(world_address, seed, &target_dir, world) diff --git a/crates/dojo-world/Cargo.toml b/crates/dojo-world/Cargo.toml index afc946495a..8504077caa 100644 --- a/crates/dojo-world/Cargo.toml +++ b/crates/dojo-world/Cargo.toml @@ -23,6 +23,7 @@ smol_str.workspace = true starknet-crypto.workspace = true starknet.workspace = true thiserror.workspace = true +topological-sort.workspace = true tracing.workspace = true cainome.workspace = true diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index 7e23eee81f..e2958635f1 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -211,6 +211,10 @@ abigen!( { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index 3c5afe8886..b96f25476b 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -1,14 +1,14 @@ use std::time::Duration; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; +use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::compiler; use katana_runner::KatanaRunner; use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::FieldElement; use super::{WorldContract, WorldContractReader}; -use crate::manifest::BaseManifest; +use crate::manifest::{BaseManifest, OverlayManifest}; use crate::migration::strategy::prepare_for_migration; use crate::migration::world::WorldDiff; use crate::migration::{Declarable, Deployable, TxnConfig}; @@ -40,20 +40,31 @@ pub async fn deploy_world( // Dev profile is used by default for testing: let profile_name = "dev"; - let manifest = BaseManifest::load_from_path( + let mut manifest = BaseManifest::load_from_path( &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); - let world = WorldDiff::compute(manifest.clone(), None); + + let overlay_manifest = OverlayManifest::load_from_path( + &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), + ) + .unwrap(); + + manifest.merge(overlay_manifest); + + let mut world = WorldDiff::compute(manifest.clone(), None); + world.update_order().unwrap(); + let account = sequencer.account(0); - let strategy = prepare_for_migration( + let mut strategy = prepare_for_migration( None, FieldElement::from_hex_be("0x12345").unwrap(), target_dir, world, ) .unwrap(); + strategy.resolve_variable(strategy.world_address().unwrap()).unwrap(); let base_class_hash = strategy.base.unwrap().declare(&account, &TxnConfig::default()).await.unwrap().class_hash; @@ -104,6 +115,7 @@ pub async fn deploy_world( base_class_hash, &account, &TxnConfig::default(), + &contract.diff.init_calldata, ) .await .unwrap(); diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index 33f09297b6..bc92e1a4f8 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -2,7 +2,7 @@ use std::io::Write; use cainome::cairo_serde::{ByteArray, CairoSerde}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; +use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::compiler; use dojo_test_utils::rpc::MockJsonRpcTransport; use katana_runner::KatanaRunner; @@ -13,7 +13,9 @@ use starknet::core::types::{EmittedEvent, FieldElement}; use starknet::macros::{felt, selector}; use starknet::providers::jsonrpc::{JsonRpcClient, JsonRpcMethod}; -use super::{parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel}; +use super::{ + parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel, OverlayManifest, +}; use crate::contracts::world::test::deploy_world; use crate::manifest::{parse_models_events, AbstractManifestError, DeploymentManifest, Manifest}; use crate::migration::world::WorldDiff; @@ -382,20 +384,27 @@ fn fetch_remote_manifest() { .tokio_handle() .block_on(async { deploy_world(&runner, &temp_project_dir, &artifacts_path).await }); - let local_manifest = BaseManifest::load_from_path( + let mut local_manifest = BaseManifest::load_from_path( &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); + let overlay_manifest = OverlayManifest::load_from_path( + &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), + ) + .unwrap(); + + local_manifest.merge(overlay_manifest); + let remote_manifest = config.tokio_handle().block_on(async { DeploymentManifest::load_from_remote(provider, world_address).await.unwrap() }); - assert_eq!(local_manifest.models.len(), 5); - assert_eq!(local_manifest.contracts.len(), 1); + assert_eq!(local_manifest.models.len(), 6); + assert_eq!(local_manifest.contracts.len(), 2); - assert_eq!(remote_manifest.models.len(), 5); - assert_eq!(remote_manifest.contracts.len(), 1); + assert_eq!(remote_manifest.models.len(), 6); + assert_eq!(remote_manifest.contracts.len(), 2); // compute diff from local and remote manifest diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 04fc8624aa..d3aa32877a 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -579,6 +579,9 @@ impl ManifestMethods for DojoContract { if let Some(writes) = old.writes { self.writes = writes; } + if let Some(init_calldata) = old.init_calldata { + self.init_calldata = init_calldata; + } } } diff --git a/crates/dojo-world/src/manifest/types.rs b/crates/dojo-world/src/manifest/types.rs index afc6f13406..dbbee2fd58 100644 --- a/crates/dojo-world/src/manifest/types.rs +++ b/crates/dojo-world/src/manifest/types.rs @@ -94,9 +94,14 @@ pub struct DojoContract { #[serde_as(as = "UfeHex")] pub base_class_hash: FieldElement, pub abi: Option, + #[serde(default)] pub reads: Vec, + #[serde(default)] pub writes: Vec, + #[serde(default)] pub computed: Vec, + #[serde(default)] + pub init_calldata: Vec, } /// Represents a declaration of a model. @@ -152,6 +157,7 @@ pub struct OverlayDojoContract { pub original_class_hash: Option, pub reads: Option>, pub writes: Option>, + pub init_calldata: Option>, } #[serde_as] diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 1245313aa9..eeaf797188 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -148,7 +148,7 @@ async fn get_full_dojo_metadata_from_workspace() { assert!( env.world_address .unwrap() - .eq("0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281") + .eq("0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962") ); assert!(env.keystore_path.is_none()); @@ -175,6 +175,7 @@ async fn get_full_dojo_metadata_from_workspace() { let artifacts = get_artifacts_from_manifest(&manifest_dir); + dbg!(&artifacts); for (abi_subdir, name) in artifacts { let artifact = dojo_metadata.artifacts.get(&name); assert!(artifact.is_some(), "bad artifact for {}", name); @@ -224,6 +225,9 @@ fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, Strin // Some models are inside actions, we need a better way to gather those. let name = name.replace("_actions_", "::actions::"); let name = name.replace("::actions_", "::actions::"); + + let name = name.replace("_others_", "::others::"); + let name = name.replace("::others_", "::others::"); artifacts.push(("models".to_string(), name)); } @@ -231,6 +235,7 @@ fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, Strin for entry in fs::read_dir(contracts_dir).unwrap().flatten() { let name = entry.path().file_stem().unwrap().to_string_lossy().to_string(); let name = name.replace("_actions_", "::actions::"); + let name = name.replace("_others_", "::others::"); artifacts.push(("contracts".to_string(), name)); } diff --git a/crates/dojo-world/src/migration/class.rs b/crates/dojo-world/src/migration/class.rs index 7f2376694f..e5b29f16d9 100644 --- a/crates/dojo-world/src/migration/class.rs +++ b/crates/dojo-world/src/migration/class.rs @@ -38,7 +38,7 @@ impl Display for ClassDiff { } } -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] pub struct ClassMigration { pub diff: ClassDiff, pub artifact_path: PathBuf, diff --git a/crates/dojo-world/src/migration/contract.rs b/crates/dojo-world/src/migration/contract.rs index 166fbfbed8..59e6c929f9 100644 --- a/crates/dojo-world/src/migration/contract.rs +++ b/crates/dojo-world/src/migration/contract.rs @@ -16,6 +16,7 @@ pub struct ContractDiff { pub original_class_hash: FieldElement, pub base_class_hash: FieldElement, pub remote_class_hash: Option, + pub init_calldata: Vec, } impl StateDiff for ContractDiff { @@ -44,7 +45,7 @@ impl Display for ContractDiff { } // Represents a contract that needs to be migrated to the remote state -#[derive(Debug, Default)] +#[derive(Debug, Default, Clone)] pub struct ContractMigration { pub salt: FieldElement, pub diff: ContractDiff, diff --git a/crates/dojo-world/src/migration/mod.rs b/crates/dojo-world/src/migration/mod.rs index eb83aa4b62..4f6b306bad 100644 --- a/crates/dojo-world/src/migration/mod.rs +++ b/crates/dojo-world/src/migration/mod.rs @@ -1,5 +1,6 @@ use std::fs::File; use std::path::PathBuf; +use std::str::FromStr; use std::sync::Arc; use anyhow::{anyhow, Result}; @@ -72,6 +73,8 @@ pub enum MigrationError { WaitingError(#[from] TransactionWaitingError), #[error(transparent)] ArtifactError(#[from] anyhow::Error), + #[error("Bad init calldata.")] + BadInitCalldata, } /// Represents the type of migration that should be performed. @@ -172,6 +175,7 @@ pub trait Deployable: Declarable + Sync { base_class_hash: FieldElement, account: &SingleOwnerAccount, txn_config: &TxnConfig, + calldata: &[String], ) -> Result as Account>::SignError>> where P: Provider + Sync + Send, @@ -203,11 +207,18 @@ pub trait Deployable: Declarable + Sync { } } - Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => Call { - calldata: vec![self.salt(), class_hash], - selector: selector!("deploy_contract"), - to: world_address, - }, + Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => { + let init_calldata: Vec = calldata + .iter() + .map(|s| FieldElement::from_str(s)) + .collect::, _>>() + .map_err(|_| MigrationError::BadInitCalldata)?; + + let mut calldata = + vec![self.salt(), class_hash, FieldElement::from(calldata.len())]; + calldata.extend(init_calldata); + Call { calldata, selector: selector!("deploy_contract"), to: world_address } + } Ok(_) => { return Err(MigrationError::ContractAlreadyDeployed(contract_address)); diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index 8dddb832b0..2a1ce96155 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -13,7 +13,7 @@ use super::contract::{ContractDiff, ContractMigration}; use super::world::WorldDiff; use super::MigrationType; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct MigrationStrategy { pub world_address: Option, pub world: Option, @@ -59,6 +59,31 @@ impl MigrationStrategy { MigrationItemsInfo { new, update } } + + pub fn resolve_variable(&mut self, world_address: FieldElement) -> Result<()> { + let contracts_clone = self.contracts.clone(); + for contract in self.contracts.iter_mut() { + for field in contract.diff.init_calldata.iter_mut() { + if let Some(dependency) = field.strip_prefix("$contract_address:") { + let dependency_contract = + contracts_clone.iter().find(|c| c.diff.name == dependency).unwrap(); + let contract_address = get_contract_address( + generate_salt(&dependency_contract.diff.name), + dependency_contract.diff.base_class_hash, + &[], + world_address, + ); + *field = contract_address.to_string(); + } else if let Some(dependency) = field.strip_prefix("$class_hash:") { + let dependency_contract = + contracts_clone.iter().find(|c| c.diff.name == dependency).unwrap(); + *field = dependency_contract.diff.local_class_hash.to_string(); + } + } + } + + Ok(()) + } } /// construct migration strategy diff --git a/crates/dojo-world/src/migration/world.rs b/crates/dojo-world/src/migration/world.rs index 7fdad6e43d..27adf6c69a 100644 --- a/crates/dojo-world/src/migration/world.rs +++ b/crates/dojo-world/src/migration/world.rs @@ -1,7 +1,11 @@ use std::fmt::Display; +use std::mem; +use std::str::FromStr; +use anyhow::{bail, Result}; use convert_case::{Case, Casing}; use starknet_crypto::FieldElement; +use topological_sort::TopologicalSort; use super::class::ClassDiff; use super::contract::ContractDiff; @@ -74,6 +78,7 @@ impl WorldDiff { .find(|r| r.inner.class_hash() == contract.inner.class_hash()) .map(|r| *r.inner.class_hash()) }), + init_calldata: contract.inner.init_calldata.clone(), } }) .collect::>(); @@ -91,6 +96,7 @@ impl WorldDiff { original_class_hash: *local.world.inner.original_class_hash(), base_class_hash: *local.base.inner.class_hash(), remote_class_hash: remote.map(|m| *m.world.inner.class_hash()), + init_calldata: vec![], }; WorldDiff { world, base, contracts, models } @@ -107,6 +113,63 @@ impl WorldDiff { count += self.contracts.iter().filter(|s| !s.is_same()).count(); count } + + pub fn update_order(&mut self) -> Result<()> { + let mut ts = TopologicalSort::<&str>::new(); + + // make the dependency graph by reading the constructor_calldata + for contract in self.contracts.iter() { + let curr_name: &str = &contract.name; + ts.insert(curr_name); + + for field in &contract.init_calldata { + if let Some(dependency) = field.strip_prefix("$contract_address:") { + ts.add_dependency(dependency, curr_name); + } else if let Some(dependency) = field.strip_prefix("$class_hash:") { + ts.add_dependency(dependency, curr_name); + } else { + // verify its a field element + match FieldElement::from_str(field) { + Ok(_) => continue, + Err(e) => bail!(format!( + "Expected init_calldata element to be a special variable (i.e. \ + starting with $contract_address or $class_hash) or be a \ + FieldElement. Failed with error: {e:?}" + )), + } + } + } + } + + let mut calculated_order = vec![]; + + while !ts.is_empty() { + let mut values = ts.pop_all(); + // if `ts` is not empty and `pop_all` returns an empty vector it means there is a cyclic + // dependency see: https://docs.rs/topological-sort/latest/topological_sort/struct.TopologicalSort.html#method.pop_all + if values.is_empty() { + bail!("Cyclic dependency detected in `init_calldata`"); + } + + values.sort(); + calculated_order.extend(values); + } + + let mut new_contracts = vec![]; + + for c_name in calculated_order { + let contract = match self.contracts.iter().find(|c| c.name == c_name) { + Some(c) => c, + None => bail!("Unidentified contract found in `init_calldata`"), + }; + + new_contracts.push(contract.clone()); + } + + mem::swap(&mut self.contracts, &mut new_contracts); + + Ok(()) + } } impl Display for WorldDiff { diff --git a/crates/dojo-world/src/migration/world_test.rs b/crates/dojo-world/src/migration/world_test.rs index be50a4044c..e84e1b2cec 100644 --- a/crates/dojo-world/src/migration/world_test.rs +++ b/crates/dojo-world/src/migration/world_test.rs @@ -105,3 +105,70 @@ fn diff_when_local_and_remote_are_different() { assert!(diff.models.iter().any(|m| m.name == "dojo_mock::models::model_2")); assert!(diff.contracts.iter().any(|c| c.name == "dojo_mock::contracts::my_contract")); } + +#[test] +fn updating_order_as_expected() { + let init_calldata = vec![ + ("c4", vec!["$contract_address:c1", "0x0"]), + ("c3", vec!["0x0"]), + ("c5", vec!["$contract_address:c4", "0x0"]), + ("c7", vec!["$contract_address:c4", "0x0"]), + ("c2", vec!["0x0"]), + ("c6", vec!["$contract_address:c4", "$contract_address:c3", "0x0"]), + ("c1", vec!["0x0"]), + ]; + + let mut contracts = vec![]; + for calldata in init_calldata { + contracts.push(ContractDiff { + init_calldata: calldata.1.iter().map(|c| c.to_string()).collect(), + name: calldata.0.to_string(), + ..Default::default() + }); + } + + let mut diff = WorldDiff { + world: ContractDiff::default(), + base: ClassDiff::default(), + contracts, + models: vec![], + }; + + diff.update_order().unwrap(); + + let expected_order = ["c1", "c2", "c3", "c4", "c5", "c6", "c7"]; + for (i, contract) in diff.contracts.iter().enumerate() { + assert_eq!(contract.name, expected_order[i]); + } +} + +#[test] +fn updating_order_when_cyclic_dependency_fail() { + let init_calldata = vec![ + ("c4", vec!["$contract_address:c1", "$contract_address:c6", "0x0"]), + ("c3", vec!["0x0"]), + ("c5", vec!["$contract_address:c4", "0x0"]), + ("c7", vec!["$contract_address:c4", "0x0"]), + ("c2", vec!["0x0"]), + ("c6", vec!["$contract_address:c4", "$contract_address:c3", "0x0"]), + ("c1", vec!["0x0"]), + ]; + + let mut contracts = vec![]; + for calldata in init_calldata { + contracts.push(ContractDiff { + init_calldata: calldata.1.iter().map(|c| c.to_string()).collect(), + name: calldata.0.to_string(), + ..Default::default() + }); + } + + let mut diff = WorldDiff { + world: ContractDiff::default(), + base: ClassDiff::default(), + contracts, + models: vec![], + }; + + assert!(diff.update_order().is_err_and(|e| e.to_string().contains("Cyclic"))); +} diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 70a9eb1c74..044479a5d6 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -494,6 +494,7 @@ where contract.diff.base_class_hash, migrator, txn_config, + &contract.diff.init_calldata, ) .await { @@ -541,7 +542,10 @@ where } Err(e) => { ui.verbose(format!("{e:?}")); - return Err(anyhow!("Failed to migrate {name}: {e}")); + return Err(anyhow!( + "Failed to migrate {name}: {e}. Please also verify init calldata is valid, if \ + any." + )); } } } diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index e998b0fa36..85f58dfa44 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -83,7 +83,9 @@ where // Calculate diff between local and remote World manifests. ui.print_step(2, "🧰", "Evaluating Worlds diff..."); - let diff = WorldDiff::compute(local_manifest.clone(), remote_manifest.clone()); + let mut diff = WorldDiff::compute(local_manifest.clone(), remote_manifest.clone()); + diff.update_order()?; + let total_diffs = diff.count_diffs(); ui.print_sub(format!("Total diffs found: {total_diffs}")); @@ -94,6 +96,7 @@ where let mut strategy = prepare_migration(&target_dir, diff, name, world_address, &ui)?; let world_address = strategy.world_address().expect("world address must exist"); + strategy.resolve_variable(world_address)?; if dry_run { print_strategy(&ui, account.provider(), &strategy, world_address).await; diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 45047fe345..708724a4c8 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -217,7 +217,8 @@ async fn migrate_with_auto_authorize() { let config = setup::load_config(); let ws = setup::setup_ws(&config); - let migration = setup::setup_migration(&config).unwrap(); + let mut migration = setup::setup_migration(&config).unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); let manifest_base = config.manifest_path().parent().unwrap(); let mut manifest = diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 1b9d0ea9f6..7cc52b506f 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -68,7 +68,8 @@ async fn test_load_from_remote() { let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); + let mut migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); let sequencer = TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; @@ -114,7 +115,7 @@ async fn test_load_from_remote() { let _block_timestamp = 1710754478_u64; let models = sqlx::query("SELECT * FROM models").fetch_all(&pool).await.unwrap(); - assert_eq!(models.len(), 5); + assert_eq!(models.len(), 6); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'Position'", diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 9c9a871280..4776659558 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -36,7 +36,12 @@ async fn test_entities_queries() { sqlx::migrate!("../migrations").run(&pool).await.unwrap(); let base_path = "../../../examples/spawn-and-move"; let target_path = format!("{}/target/dev", base_path); - let migration = prepare_migration(base_path.into(), target_path.into()).unwrap(); + + let mut migration = prepare_migration(base_path.into(), target_path.into()).unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); + + dbg!(&migration); + let sequencer = TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; let provider = Arc::new(JsonRpcClient::new(HttpTransport::new(sequencer.url()))); diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml index 5a021e2793..efc6f0ca39 100644 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 87e2185eb9..93a78fbbd3 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -25,4 +25,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281" +world_address = "0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962" diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json index 1e068262bb..21aed968a7 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json @@ -210,6 +210,24 @@ } ] }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, { "type": "impl", "name": "UpgradableImpl", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json index d800e7d191..63207ddec9 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json @@ -205,6 +205,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json index 1e068262bb..21aed968a7 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -210,6 +210,24 @@ } ] }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, { "type": "impl", "name": "UpgradableImpl", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json index d800e7d191..63207ddec9 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json @@ -205,6 +205,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index 1d97364950..17294cff0a 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,9 +1,10 @@ kind = "DojoContract" -class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" -original_class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" +class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" +original_class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] writes = [] computed = [] +init_calldata = [] name = "dojo_examples::actions::actions" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..0526bc5473 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml index 5a021e2793..efc6f0ca39 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..f267d02139 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" +original_class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" +abi = "manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 727658b2bc..90c10bfbc0 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0", - "original_class_hash": "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0", + "class_hash": "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e", + "original_class_hash": "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e", "abi": [ { "type": "impl", @@ -210,6 +210,10 @@ { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" } ], "outputs": [ @@ -951,8 +955,8 @@ ] } ], - "address": "0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281", - "transaction_hash": "0x703e38b6957635cccc0f9ddddd43356025f260de7f3593523157838e4443281", + "address": "0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962", + "transaction_hash": "0xa32990a5203fc3c67ba905f65a0161fa5435d8c28aa1e889cc09b551f431d3", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -971,9 +975,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x21d87b58131a6879752e3b658d658fe3a80a42d85228ba8aec5220c4a5c364c", - "class_hash": "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b", - "original_class_hash": "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b", + "address": "0xa0db53af8c89cbaab909bb34635262ffe36bbd414184e830eabfa6b592a17d", + "class_hash": "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5", + "original_class_hash": "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1187,6 +1191,24 @@ } ] }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, { "type": "impl", "name": "UpgradableImpl", @@ -1253,7 +1275,170 @@ "Position" ], "computed": [], + "init_calldata": [], "name": "dojo_examples::actions::actions" + }, + { + "kind": "DojoContract", + "address": "0x482b931a82a26a4d8501ff051b1c8e2c125b79c954dc5d5106988749129c9d3", + "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "computed": [], + "init_calldata": [ + "$contract_address:dojo_examples::actions::actions", + "$class_hash:dojo_examples::actions::actions", + "10" + ], + "name": "dojo_examples::others::others" } ], "models": [ @@ -3294,6 +3479,396 @@ } ], "name": "dojo_examples::models::position" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "contract_address", + "type": "ContractAddress", + "key": true + }, + { + "name": "contract_class", + "type": "ClassHash", + "key": false + }, + { + "name": "value", + "type": "u8", + "key": false + } + ], + "class_hash": "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5", + "original_class_hash": "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::others::others::contract_initialized" } ] } \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index e3324ca12e..330a9fac1d 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" -original_class_hash = "0x64728e0c0713811c751930f8d3292d683c23f107c89b0a101425d9e80adb1c0" +class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x1c958955aedbc7b8e2f051767d3369168e88bc5074b0f39e5f8cd2539138281" -transaction_hash = "0x703e38b6957635cccc0f9ddddd43356025f260de7f3593523157838e4443281" +address = "0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962" +transaction_hash = "0xa32990a5203fc3c67ba905f65a0161fa5435d8c28aa1e889cc09b551f431d3" block_number = 3 seed = "dojo_examples" name = "dojo::world::world" @@ -21,9 +21,9 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" -address = "0x21d87b58131a6879752e3b658d658fe3a80a42d85228ba8aec5220c4a5c364c" -class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" -original_class_hash = "0x5b617d120767e91d40621dd939b092f48975a8fa1c5236ac68f97a4ffaf45b" +address = "0xa0db53af8c89cbaab909bb34635262ffe36bbd414184e830eabfa6b592a17d" +class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" +original_class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] @@ -32,8 +32,26 @@ writes = [ "Position", ] computed = [] +init_calldata = [] name = "dojo_examples::actions::actions" +[[contracts]] +kind = "DojoContract" +address = "0x482b931a82a26a4d8501ff051b1c8e2c125b79c954dc5d5106988749129c9d3" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [ + "$contract_address:dojo_examples::actions::actions", + "$class_hash:dojo_examples::actions::actions", + "10", +] +name = "dojo_examples::others::others" + [[models]] kind = "DojoModel" class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" @@ -133,3 +151,25 @@ key = true name = "vec" type = "Vec2" key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" +original_class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" +abi = "manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[models.members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[models.members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[models.members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml index b18cfcaedb..a8e2fd4c2d 100644 --- a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml @@ -2,3 +2,5 @@ computed = [ ] name = "dojo_examples::actions::actions" reads = [ ] writes = [ "Moves", "Position" ] +init_calldata = [] + diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..b74df0c8fe --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml @@ -0,0 +1,5 @@ +reads = [] +writes = [] +computed = [] +init_calldata = ["$contract_address:dojo_examples::actions::actions", "$class_hash:dojo_examples::actions::actions", "10"] +name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 6b9156343b..65dc16c55c 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -123,7 +123,7 @@ mod tests { // deploy systems contract let contract_address = world - .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap()); + .deploy_contract('salt', actions::TEST_CLASS_HASH.try_into().unwrap(), array![].span()); let actions_system = IActionsDispatcher { contract_address }; // System calls diff --git a/examples/spawn-and-move/src/lib.cairo b/examples/spawn-and-move/src/lib.cairo index e3149f1627..44309e5fca 100644 --- a/examples/spawn-and-move/src/lib.cairo +++ b/examples/spawn-and-move/src/lib.cairo @@ -1,3 +1,4 @@ mod actions; mod models; mod utils; +mod others; diff --git a/examples/spawn-and-move/src/others.cairo b/examples/spawn-and-move/src/others.cairo new file mode 100644 index 0000000000..0f27d036a8 --- /dev/null +++ b/examples/spawn-and-move/src/others.cairo @@ -0,0 +1,31 @@ +#[dojo::contract] +mod others { + use starknet::{ContractAddress, ClassHash, get_caller_address}; + use dojo_examples::models::{Position, Moves, Direction, Vec2}; + use dojo_examples::utils::next_position; + + #[derive(Copy, Drop, Serde)] + #[dojo::event] + #[dojo::model] + struct ContractInitialized { + #[key] + contract_address: ContractAddress, + contract_class: ClassHash, + value: u8, + } + + + fn dojo_init( + world: IWorldDispatcher, + actions_address: ContractAddress, + actions_class: ClassHash, + value: u8 + ) { + emit!( + world, + ContractInitialized { + contract_address: actions_address, contract_class: actions_class, value + } + ); + } +} From 6153192f2388013d17433aa1a5dc8dabab26a357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Baranx?= Date: Wed, 29 May 2024 19:05:38 +0800 Subject: [PATCH 02/88] Sozo model layout and commands (#2002) --- .github/workflows/ci.yml | 4 +- Cargo.lock | 1 + bin/sozo/src/commands/model.rs | 36 ++ crates/dojo-core/src/base_test.cairo | 2 +- .../dojo-core/src/database/introspect.cairo | 18 +- .../src/database/introspect_test.cairo | 154 ++++- crates/dojo-core/src/world.cairo | 35 +- crates/dojo-lang/src/introspect/layout.rs | 137 ++-- crates/dojo-lang/src/introspect/mod.rs | 31 +- crates/dojo-lang/src/introspect/size.rs | 98 ++- crates/dojo-lang/src/introspect/utils.rs | 14 - .../manifests/dev/base/dojo_world_world.toml | 4 +- .../dojo-lang/src/plugin_test_data/introspect | 563 ++++++++--------- crates/dojo-lang/src/plugin_test_data/model | 32 +- crates/dojo-types/src/schema.rs | 2 +- crates/dojo-world/src/contracts/model_test.rs | 2 +- crates/dojo-world/src/metadata_test.rs | 7 +- crates/sozo/ops/src/model.rs | 585 +++++++++++++++++- crates/torii/core/Cargo.toml | 1 + crates/torii/core/src/sql_test.rs | 13 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- dojoup/dojoup | 2 +- examples/spawn-and-move/Scarb.toml | 2 +- .../dojo_examples_actions_actions.toml | 4 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- .../dojo_examples_actions_actions_moved.toml | 4 +- .../dojo_examples_models_emote_message.toml | 4 +- .../models/dojo_examples_models_moves.toml | 4 +- .../dojo_examples_models_player_config.toml | 4 +- .../models/dojo_examples_models_position.toml | 4 +- .../manifests/dev/manifest.json | 36 +- .../manifests/dev/manifest.toml | 36 +- examples/spawn-and-move/src/models.cairo | 10 +- 33 files changed, 1286 insertions(+), 571 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25b08d52fd..93377d7076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ env: jobs: test: - runs-on: ubuntu-latest-16-cores + runs-on: ubuntu-latest-32-cores container: image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 steps: @@ -20,7 +20,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: | cargo build -r --bin katana - KATANA_RUNNER_BIN=$(pwd)/target/release/katana cargo llvm-cov nextest --no-report --all-features --workspace --exclude katana --build-jobs 10 + KATANA_RUNNER_BIN=$(pwd)/target/release/katana cargo llvm-cov nextest --no-report --all-features --workspace --exclude katana --build-jobs 20 cargo llvm-cov nextest --no-report -p katana # TODO(kariy): uncomment this line when `sir` feature support Cairo 2.6.3 # cargo llvm-cov nextest --no-report -p katana --no-default-features --features sir diff --git a/Cargo.lock b/Cargo.lock index e021fa153f..094618803f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13436,6 +13436,7 @@ dependencies = [ "futures-channel", "futures-util", "hex", + "katana-runner", "lazy_static", "log", "once_cell", diff --git a/bin/sozo/src/commands/model.rs b/bin/sozo/src/commands/model.rs index d927b24578..c14297034a 100644 --- a/bin/sozo/src/commands/model.rs +++ b/bin/sozo/src/commands/model.rs @@ -41,6 +41,37 @@ pub enum ModelCommand { starknet: StarknetOptions, }, + #[command(about = "Displays the model's layout into dojo storage.\n +The Dojo storage system uses the poseidon_hash function to compute +hashes, called 'hash' in the following documentation. + + How storage locations are computed ? + + model key = hash(model_keys) + + fixed layout key = parent_key + struct layout field key = hash(parent_key, field_selector) + tuple layout item key = hash(parent_key, item_index) + enum layout + variant key = parent_key + data key = hash(parent_key, variant_index) + array layout + length key = parent_key + item key = hash(parent_key, item_index) + byte array layout = parent_key + + final storage location = hash('dojo_storage', model_selector, record_key)")] + Layout { + #[arg(help = "The name of the model")] + name: String, + + #[command(flatten)] + world: WorldOptions, + + #[command(flatten)] + starknet: StarknetOptions, + }, + #[command(about = "Retrieve the schema for a model")] Schema { #[arg(help = "The name of the model")] @@ -92,6 +123,11 @@ impl ModelArgs { let provider = starknet.provider(env_metadata.as_ref()).unwrap(); model::model_contract_address(name, world_address, provider).await } + ModelCommand::Layout { name, starknet, world } => { + let world_address = world.address(env_metadata.as_ref()).unwrap(); + let provider = starknet.provider(env_metadata.as_ref()).unwrap(); + model::model_layout(name, world_address, provider).await + } ModelCommand::Schema { name, to_json, starknet, world } => { let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index f52aea79f4..1e3f533b08 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -160,7 +160,7 @@ mod invalid_model { fn selector(self: @ContractState) -> felt252 { // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x3dc3b5d2f73350ccda67b655bfae01e747c5db6e6f570743ee2867649da2a73 + 0x15f0ffa36184d74ead97aa501b09aed53ee7236e364997a0c21879194340ab6 } fn name(self: @ContractState) -> ByteArray { diff --git a/crates/dojo-core/src/database/introspect.cairo b/crates/dojo-core/src/database/introspect.cairo index a7d2fed3a4..d3ad4e6962 100644 --- a/crates/dojo-core/src/database/introspect.cairo +++ b/crates/dojo-core/src/database/introspect.cairo @@ -16,7 +16,7 @@ enum Layout { ByteArray, // there is one layout per variant. // the `selector` field identifies the variant - // the `layout` field defines the full variant layout (variant value + optional variant data) + // the `layout` defines the variant data (could be empty for variant without data). Enum: Span, } @@ -203,18 +203,10 @@ impl Introspect_option> of Introspect> { fn layout() -> Layout { Layout::Enum( array![ - FieldLayout { - // Some - selector: 0, - layout: Layout::Tuple( - array![Layout::Fixed(array![8].span()), Introspect::::layout()].span() - ) - }, - FieldLayout { - // None - selector: 1, - layout: Layout::Tuple(array![Layout::Fixed(array![8].span())].span()) - }, + FieldLayout { // Some + selector: 0, layout: Introspect::::layout() }, + FieldLayout { // None + selector: 1, layout: Layout::Fixed(array![].span()) }, ] .span() ) diff --git a/crates/dojo-core/src/database/introspect_test.cairo b/crates/dojo-core/src/database/introspect_test.cairo index 95a993e770..c62d9561bc 100644 --- a/crates/dojo-core/src/database/introspect_test.cairo +++ b/crates/dojo-core/src/database/introspect_test.cairo @@ -35,6 +35,24 @@ struct WithNestedArrayInTuple { arr: (u8, (u16, Array, u256), u32) } +#[derive(Drop, IntrospectPacked)] +struct Vec3 { + x: u32, + y: u32, + z: u32 +} + +#[derive(IntrospectPacked)] +struct Translation { + from: Vec3, + to: Vec3 +} + +#[derive(Drop, IntrospectPacked)] +struct StructInnerNotPacked { + x: Base +} + #[derive(Drop, Introspect)] enum EnumNoData { One, @@ -43,12 +61,45 @@ enum EnumNoData { } #[derive(Drop, Introspect)] -enum EnumWithData { +enum EnumWithSameData { + One: u256, + Two: u256, + Three: u256 +} + +#[derive(Drop, Introspect)] +enum EnumWithSameTupleData { + One: (u256, u32), + Two: (u256, u32), + Three: (u256, u32) +} + +#[derive(Drop, Introspect)] +enum EnumWithVariousData { One: u32, Two: (u8, u16), Three: Array, } + +#[derive(Drop, IntrospectPacked)] +enum EnumPacked { + A: u32, + B: u32, +} + +#[derive(Drop, IntrospectPacked)] +enum EnumInnerPacked { + A: (EnumPacked, Vec3), + B: (EnumPacked, Vec3), +} + +#[derive(Drop, IntrospectPacked)] +enum EnumInnerNotPacked { + A: (EnumPacked, Base), + B: (EnumPacked, Base), +} + #[derive(Drop, Introspect)] struct StructWithOption { x: Option @@ -82,10 +133,8 @@ fn _enum(values: Array>) -> Layout { let v = *values.at(i); match v { - Option::Some(v) => { - items.append(field(i.into(), tuple(array![fixed(array![8]), v]))); - }, - Option::None => { items.append(field(i.into(), fixed(array![8]))) } + Option::Some(v) => { items.append(field(i.into(), v)); }, + Option::None => { items.append(field(i.into(), fixed(array![]))) } } i += 1; @@ -144,9 +193,25 @@ fn test_size_with_nested_array_in_tuple() { #[test] fn test_size_of_enum_without_variant_data() { let size = Introspect::::size(); - assert!(size.is_none()); + assert!(size.is_some()); + assert!(size.unwrap() == 1); +} + +#[test] +fn test_size_of_enum_with_same_variant_data() { + let size = Introspect::::size(); + assert!(size.is_some()); + assert!(size.unwrap() == 3); } +#[test] +fn test_size_of_enum_with_same_tuple_variant_data() { + let size = Introspect::::size(); + assert!(size.is_some()); + assert!(size.unwrap() == 4); +} + + #[test] fn test_size_of_struct_with_option() { let size = Introspect::::size(); @@ -155,49 +220,39 @@ fn test_size_of_struct_with_option() { #[test] fn test_size_of_enum_with_variant_data() { - let size = Introspect::::size(); + let size = Introspect::::size(); assert!(size.is_none()); } #[test] fn test_layout_of_enum_without_variant_data() { let layout = Introspect::::layout(); - let expected = Layout::Enum( - array![ - // One - field(0, tuple(array![fixed(array![8])])), - // Two - field(1, tuple(array![fixed(array![8])])), - // Three - field(2, tuple(array![fixed(array![8])])), - ] - .span() - ); + let expected = _enum(array![ // One + Option::None, // Two + Option::None, // Three + Option::None,]); assert!(layout == expected); } #[test] fn test_layout_of_enum_with_variant_data() { - let layout = Introspect::::layout(); - let expected = Layout::Enum( + let layout = Introspect::::layout(); + let expected = _enum( array![ // One - field(0, tuple(array![fixed(array![8]), fixed(array![32]),])), + Option::Some(fixed(array![32])), // Two - field( - 1, - tuple(array![fixed(array![8]), tuple(array![fixed(array![8]), fixed(array![16]),])]) - ), + Option::Some(tuple(array![fixed(array![8]), fixed(array![16])])), // Three - field(2, tuple(array![fixed(array![8]), arr(fixed(array![128])),])), + Option::Some(arr(fixed(array![128]))), ] - .span() ); assert!(layout == expected); } +#[test] fn test_layout_of_struct_with_option() { let layout = Introspect::::layout(); let expected = Layout::Struct( @@ -207,3 +262,48 @@ fn test_layout_of_struct_with_option() { assert!(layout == expected); } + +#[test] +fn test_layout_of_packed_struct() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![32, 32, 32].span()); + + assert!(layout == expected); +} + +#[test] +fn test_layout_of_inner_packed_struct() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![32, 32, 32, 32, 32, 32].span()); + + assert!(layout == expected); +} + +#[test] +#[should_panic(expected: ("A packed model layout must contain Fixed layouts only.",))] +fn test_layout_of_not_packed_inner_struct() { + let _ = Introspect::::layout(); +} + + +#[test] +fn test_layout_of_packed_enum() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![8, 32].span()); + + assert!(layout == expected); +} + +#[test] +fn test_layout_of_inner_packed_enum() { + let layout = Introspect::::layout(); + let expected = Layout::Fixed(array![8, 8, 32, 32, 32, 32].span()); + + assert!(layout == expected); +} + +#[test] +#[should_panic(expected: ("A packed model layout must contain Fixed layouts only.",))] +fn test_layout_of_not_packed_inner_enum() { + let _ = Introspect::::layout(); +} diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index 6517a21d21..b01adc0d36 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -1001,9 +1001,17 @@ mod world { let variant = *values.at(offset); assert(variant.into() < 256_u256, 'invalid variant value'); + // and write it + database::set(model, key, values, offset, array![251].span()); + offset += 1; + // find the corresponding layout and then write the full variant + let variant_data_key = Self::_field_key(key, variant); + match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_write_layout(model, key, values, ref offset, layout), + Option::Some(layout) => Self::_write_layout( + model, variant_data_key, values, ref offset, layout + ), Option::None => panic!("Unable to find the variant layout") }; } @@ -1104,16 +1112,21 @@ mod world { } fn _delete_enum_layout(model: felt252, key: felt252, variant_layouts: Span) { - // read the variant value first which is the first stored felt252 + // read the variant value let res = database::get(model, key, array![251].span()); assert(res.len() == 1, 'internal database error'); let variant = *res.at(0); assert(variant.into() < 256_u256, 'invalid variant value'); + // reset the variant value + database::delete(model, key, array![251].span()); + // find the corresponding layout and the delete the full variant + let variant_data_key = Self::_field_key(key, variant); + match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_delete_layout(model, key, layout), + Option::Some(layout) => Self::_delete_layout(model, variant_data_key, layout), Option::None => panic!("Unable to find the variant layout") }; } @@ -1277,18 +1290,22 @@ mod world { ref read_data: Array, variant_layouts: Span ) { - // read the variant value first, which is the first element of the tuple - // (because an enum is stored as a tuple). - let variant_key = Self::_field_key(key, 0); - let res = database::get(model, variant_key, array![8].span()); + // read the variant value first + let res = database::get(model, key, array![8].span()); assert(res.len() == 1, 'internal database error'); let variant = *res.at(0); assert(variant.into() < 256_u256, 'invalid variant value'); - // find the corresponding layout and the read the full variant + read_data.append(variant); + + // find the corresponding layout and the read the variant data + let variant_data_key = Self::_field_key(key, variant); + match Self::_find_variant_layout(variant, variant_layouts) { - Option::Some(layout) => Self::_read_layout(model, key, ref read_data, layout), + Option::Some(layout) => Self::_read_layout( + model, variant_data_key, ref read_data, layout + ), Option::None => panic!("Unable to find the variant layout") }; } diff --git a/crates/dojo-lang/src/introspect/layout.rs b/crates/dojo-lang/src/introspect/layout.rs index 0b7e43386d..216b00678c 100644 --- a/crates/dojo-lang/src/introspect/layout.rs +++ b/crates/dojo-lang/src/introspect/layout.rs @@ -56,7 +56,9 @@ pub fn build_variant_layouts( let selector = format!("{i}"); let variant_layout = match v.type_clause(db) { - OptionTypeClause::Empty(_) => "".to_string(), + OptionTypeClause::Empty(_) => { + "dojo::database::introspect::Layout::Fixed(array![].span())".to_string() + } OptionTypeClause::TypeClause(type_clause) => { get_layout_from_type_clause(db, diagnostics, &type_clause) } @@ -65,12 +67,7 @@ pub fn build_variant_layouts( format!( "dojo::database::introspect::FieldLayout {{ selector: {selector}, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - {variant_layout} - ].span() - ) + layout: {variant_layout} }}" ) }) @@ -183,12 +180,16 @@ pub fn build_item_layout_from_type( } } +pub fn is_custom_layout(layout: &str) -> bool { + layout.starts_with("dojo::database::introspect::Introspect::") +} + pub fn build_packed_struct_layout( db: &dyn SyntaxGroup, diagnostics: &mut Vec, struct_ast: &ItemStruct, ) -> String { - struct_ast + let layouts = struct_ast .members(db) .elements(db) .iter() @@ -199,8 +200,64 @@ pub fn build_packed_struct_layout( Some(get_packed_field_layout_from_type_clause(db, diagnostics, &m.type_clause(db))) }) + .flatten() + .collect::>(); + + if layouts.iter().any(|v| is_custom_layout(v.as_str())) { + generate_cairo_code_for_fixed_layout_with_custom_types(&layouts) + } else { + format!( + "dojo::database::introspect::Layout::Fixed( + array![ + {} + ].span() + )", + layouts.join(",") + ) + } +} + +pub fn generate_cairo_code_for_fixed_layout_with_custom_types(layouts: &[String]) -> String { + let layouts_repr = layouts + .iter() + .map(|l| { + if is_custom_layout(l) { + l.to_string() + } else { + format!("dojo::database::introspect::Layout::Fixed(array![{l}].span())") + } + }) .collect::>() - .join(",") + .join(",\n"); + + format!( + "let mut layouts = array![ + {layouts_repr} + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop {{ + match ArrayTrait::pop_front(ref layouts) {{ + Option::Some(mut layout) => {{ + match layout {{ + dojo::database::introspect::Layout::Fixed(mut l) => {{ + loop {{ + match SpanTrait::pop_front(ref l) {{ + Option::Some(x) => merged_layout.append(*x), + Option::None(_) => {{ break; }} + }}; + }}; + }}, + _ => panic!(\"A packed model layout must contain Fixed layouts only.\"), + }}; + }}, + Option::None(_) => {{ break; }} + }}; + }}; + + dojo::database::introspect::Layout::Fixed(merged_layout.span()) + ", + ) } // @@ -209,23 +266,36 @@ pub fn build_packed_enum_layout( diagnostics: &mut Vec, enum_ast: &ItemEnum, ) -> String { - let variant_layouts = enum_ast - .variants(db) - .elements(db) - .iter() - .map(|v| match v.type_clause(db) { - OptionTypeClause::Empty(_) => "".to_string(), + // to be packable, all variants data must have the same size. + // as this point has already been checked before calling `build_packed_enum_layout`, + // just use the first variant to generate the fixed layout. + let elements = enum_ast.variants(db).elements(db); + let mut variant_layout = if elements.is_empty() { + vec![] + } else { + match elements.first().unwrap().type_clause(db) { + OptionTypeClause::Empty(_) => vec![], OptionTypeClause::TypeClause(type_clause) => { get_packed_field_layout_from_type_clause(db, diagnostics, &type_clause) } - }) - .collect::>(); + } + }; - if variant_layouts.is_empty() { - return "8".to_string(); - } + // don't forget the store the variant value + variant_layout.insert(0, "8".to_string()); - format!("8,{}", variant_layouts[0]) + if variant_layout.iter().any(|v| is_custom_layout(v.as_str())) { + generate_cairo_code_for_fixed_layout_with_custom_types(&variant_layout) + } else { + format!( + "dojo::database::introspect::Layout::Fixed( + array![ + {} + ].span() + )", + variant_layout.join(",") + ) + } } // @@ -233,7 +303,7 @@ pub fn get_packed_field_layout_from_type_clause( db: &dyn SyntaxGroup, diagnostics: &mut Vec, type_clause: &TypeClause, -) -> String { +) -> Vec { match type_clause.ty(db) { Expr::Path(path) => { let path_type = path.as_syntax_node().get_text(db); @@ -253,7 +323,7 @@ pub fn get_packed_field_layout_from_type_clause( message: "Unexpected expression for variant data type.".to_string(), severity: Severity::Error, }); - "ERROR".to_string() + vec!["ERROR".to_string()] } } } @@ -263,28 +333,26 @@ pub fn get_packed_item_layout_from_type( diagnostics: &mut Vec, diagnostic_item: ids::SyntaxStablePtrId, item_type: &str, -) -> String { +) -> Vec { if is_array(item_type) || is_byte_array(item_type) { diagnostics.push(PluginDiagnostic { stable_ptr: diagnostic_item, message: "Array field cannot be packed.".into(), severity: Severity::Error, }); - "ERROR".to_string() + vec!["ERROR".to_string()] } else if is_tuple(item_type) { get_packed_tuple_layout_from_type(diagnostics, diagnostic_item, item_type) } else { let primitives = primitive_type_introspection(); if let Some(p) = primitives.get(item_type) { - p.1.iter().map(|x| x.to_string()).collect::>().join(",") + vec![p.1.iter().map(|x| x.to_string()).collect::>().join(",")] } else { - diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "For now, field with custom type cannot be packed".into(), - severity: Severity::Error, - }); - "ERROR".to_string() + // as we cannot verify that an enum/struct custom type is packable, + // we suppose it is and let the user verify this. + // If it's not the case, the Dojo model layout function will panic. + vec![format!("dojo::database::introspect::Introspect::<{}>::layout()", item_type)] } } } @@ -294,10 +362,9 @@ pub fn get_packed_tuple_layout_from_type( diagnostics: &mut Vec, diagnostic_item: ids::SyntaxStablePtrId, item_type: &str, -) -> String { +) -> Vec { get_tuple_item_types(item_type) .iter() - .map(|x| get_packed_item_layout_from_type(diagnostics, diagnostic_item, x)) + .flat_map(|x| get_packed_item_layout_from_type(diagnostics, diagnostic_item, x)) .collect::>() - .join(",") } diff --git a/crates/dojo-lang/src/introspect/mod.rs b/crates/dojo-lang/src/introspect/mod.rs index fb788af004..856c3477e0 100644 --- a/crates/dojo-lang/src/introspect/mod.rs +++ b/crates/dojo-lang/src/introspect/mod.rs @@ -21,18 +21,11 @@ pub fn handle_introspect_struct( packed: bool, ) -> RewriteNode { let struct_name = struct_ast.name(db).text(db).into(); - let struct_size = size::compute_struct_layout_size(db, &struct_ast); + let struct_size = size::compute_struct_layout_size(db, &struct_ast, packed); let ty = ty::build_struct_ty(db, &struct_name, &struct_ast); let layout = if packed { - format!( - "dojo::database::introspect::Layout::Fixed( - array![ - {} - ].span() - )", - layout::build_packed_struct_layout(db, diagnostics, &struct_ast) - ) + layout::build_packed_struct_layout(db, diagnostics, &struct_ast) } else { format!( "dojo::database::introspect::Layout::Struct( @@ -57,24 +50,15 @@ pub fn handle_introspect_enum( packed: bool, ) -> RewriteNode { let enum_name = enum_ast.name(db).text(db).into(); - let identical_variants = utils::are_enum_variants_identical(db, &enum_ast); - let enum_size = size::compute_enum_layout_size(db, &enum_ast, identical_variants); - let ty = ty::build_enum_ty(db, &enum_name, &enum_ast); + let variant_sizes = size::compute_enum_variant_sizes(db, &enum_ast); let layout = if packed { - if identical_variants { - format!( - "dojo::database::introspect::Layout::Fixed( - array![ - {} - ].span() - )", - layout::build_packed_enum_layout(db, diagnostics, &enum_ast) - ) + if size::is_enum_packable(&variant_sizes) { + layout::build_packed_enum_layout(db, diagnostics, &enum_ast) } else { diagnostics.push(PluginDiagnostic { stable_ptr: enum_ast.name(db).stable_ptr().0, - message: "To be packed, all variants must have exactly the same layout." + message: "To be packed, all variants must have fixed layout of same size." .to_string(), severity: Severity::Error, }); @@ -92,6 +76,8 @@ pub fn handle_introspect_enum( }; let (gen_types, gen_impls) = build_generic_types_and_impls(db, enum_ast.generic_params(db)); + let enum_size = size::compute_enum_layout_size(&variant_sizes, packed); + let ty = ty::build_enum_ty(db, &enum_name, &enum_ast); generate_introspect(&enum_name, &enum_size, &gen_types, gen_impls, &layout, &ty) } @@ -115,7 +101,6 @@ impl $name$Introspect<$generics$> of \ $size$ } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { $layout$ } diff --git a/crates/dojo-lang/src/introspect/size.rs b/crates/dojo-lang/src/introspect/size.rs index d2bd078eee..9c056897bf 100644 --- a/crates/dojo-lang/src/introspect/size.rs +++ b/crates/dojo-lang/src/introspect/size.rs @@ -7,7 +7,11 @@ use super::utils::{ get_tuple_item_types, is_array, is_byte_array, is_tuple, primitive_type_introspection, }; -pub fn compute_struct_layout_size(db: &dyn SyntaxGroup, struct_ast: &ItemStruct) -> String { +pub fn compute_struct_layout_size( + db: &dyn SyntaxGroup, + struct_ast: &ItemStruct, + is_packed: bool, +) -> String { let mut cumulated_sizes = 0; let mut is_dynamic_size = false; @@ -29,32 +33,61 @@ pub fn compute_struct_layout_size(db: &dyn SyntaxGroup, struct_ast: &ItemStruct) }) .flatten() .collect::>(); - build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size) + build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size, is_packed) } -pub fn compute_enum_layout_size( +pub fn compute_enum_variant_sizes( db: &dyn SyntaxGroup, enum_ast: &ItemEnum, - identical_variants: bool, +) -> Vec<(Vec, u32, bool)> { + enum_ast + .variants(db) + .elements(db) + .iter() + .map(|v| match v.type_clause(db) { + OptionTypeClause::Empty(_) => (vec![], 0, false), + OptionTypeClause::TypeClause(type_clause) => { + get_field_size_from_type_clause(db, &type_clause) + } + }) + .collect::>() +} + +pub fn is_enum_packable(variant_sizes: &[(Vec, u32, bool)]) -> bool { + if variant_sizes.is_empty() { + return true; + } + + let v0_sizes = variant_sizes[0].0.clone(); + let v0_fixed_size = variant_sizes[0].1; + + variant_sizes.iter().all(|vs| { + vs.0.len() == v0_sizes.len() + && vs.0.iter().zip(v0_sizes.iter()).all(|(a, b)| a == b) + && vs.1 == v0_fixed_size + && !vs.2 + }) +} + +pub fn compute_enum_layout_size( + variant_sizes: &[(Vec, u32, bool)], + is_packed: bool, ) -> String { + if variant_sizes.is_empty() { + return "Option::None".to_string(); + } + + let v0 = variant_sizes[0].clone(); + let identical_variants = + variant_sizes.iter().all(|vs| vs.0 == v0.0 && vs.1 == v0.1 && vs.2 == v0.2); + if identical_variants { - match enum_ast.variants(db).elements(db).first() { - Some(first_variant) => { - let (mut sizes, cumulated_sizes, is_dynamic_size) = - match first_variant.type_clause(db) { - OptionTypeClause::Empty(_) => (vec![], 0, false), - OptionTypeClause::TypeClause(type_clause) => { - get_field_size_from_type_clause(db, &type_clause) - } - }; - - // add 8 bits to store the variant identifier - sizes.insert(0, "8".to_string()); - - build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size) - } - None => "Option::None".to_string(), - } + let (mut sizes, mut cumulated_sizes, is_dynamic_size) = v0; + + // add one felt252 to store the variant identifier + cumulated_sizes += 1; + + build_size_function_body(&mut sizes, cumulated_sizes, is_dynamic_size, is_packed) } else { "Option::None".to_string() } @@ -64,6 +97,7 @@ pub fn build_size_function_body( sizes: &mut Vec, cumulated_sizes: u32, is_dynamic_size: bool, + is_packed: bool, ) -> String { if is_dynamic_size { return "Option::None".to_string(); @@ -77,16 +111,22 @@ pub fn build_size_function_body( 0 => "Option::None".to_string(), 1 => sizes[0].clone(), _ => { + let none_check = if is_packed { + "" + } else { + "if dojo::database::utils::any_none(@sizes) { + return Option::None; + }" + }; + format!( "let sizes : Array> = array![ - {} - ]; - - if dojo::database::utils::any_none(@sizes) {{ - return Option::None; - }} - Option::Some(dojo::database::utils::sum(sizes)) - ", + {} + ]; + + {none_check} + Option::Some(dojo::database::utils::sum(sizes)) + ", sizes.join(",\n") ) } diff --git a/crates/dojo-lang/src/introspect/utils.rs b/crates/dojo-lang/src/introspect/utils.rs index 6494e9f0fe..bf7be9964c 100644 --- a/crates/dojo-lang/src/introspect/utils.rs +++ b/crates/dojo-lang/src/introspect/utils.rs @@ -1,9 +1,5 @@ use std::collections::HashMap; -use cairo_lang_syntax::node::ast::ItemEnum; -use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::TypedSyntaxNode; - #[derive(Clone, Default)] pub struct TypeIntrospection(pub usize, pub Vec); @@ -94,16 +90,6 @@ pub fn get_tuple_item_types(ty: &str) -> Vec { items } -pub fn are_enum_variants_identical(db: &dyn SyntaxGroup, enum_ast: &ItemEnum) -> bool { - let variants = enum_ast - .variants(db) - .elements(db) - .iter() - .map(|v| v.as_syntax_node().get_text(db)) - .collect::>(); - variants.iter().all(|item| item == &variants[0]) -} - #[test] pub fn test_get_tuple_item_types() { pub fn assert_array(got: Vec, expected: Vec) { diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml index efc6f0ca39..2daf97b5e5 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" -original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/dojo-lang/src/plugin_test_data/introspect b/crates/dojo-lang/src/plugin_test_data/introspect index c10b97e019..3582f86aad 100644 --- a/crates/dojo-lang/src/plugin_test_data/introspect +++ b/crates/dojo-lang/src/plugin_test_data/introspect @@ -14,8 +14,8 @@ struct Vec2 { #[derive(Serde, Copy, Drop, Introspect)] enum PlainEnum { - Left: (), - Right: (), + Left, + Right, } #[derive(Serde, Copy, Drop, Introspect)] @@ -55,9 +55,9 @@ enum EnumWithComplexTuple { } #[derive(Serde, Copy, Drop, Introspect)] -enum EnumTupleOnePrimitive { - Left: (u16,), - Right: (u16,), +enum EnumWithPrimitive { + Left: u32, + Right: u32, } #[derive(Serde, Copy, Drop, Introspect)] @@ -220,7 +220,7 @@ struct StructNotPackable1 { } #[derive(IntrospectPacked)] -struct StructNotPackable2 { +struct StructPackableWithInnerPacked { x: u8, y: StructPacked1 } @@ -245,6 +245,13 @@ enum EnumPacked3 { b: u256, } + +#[derive(IntrospectPacked)] +enum EnumPackableWithInnerPacked { + a: StructPacked1, + b: StructPacked1, +} + #[derive(IntrospectPacked)] enum EnumNotPackable1 { a: u8, @@ -262,8 +269,8 @@ struct Vec2 { #[derive(Serde, Copy, Drop, Introspect)] enum PlainEnum { - Left: (), - Right: (), + Left, + Right, } #[derive(Serde, Copy, Drop, Introspect)] @@ -303,9 +310,9 @@ enum EnumWithComplexTuple { } #[derive(Serde, Copy, Drop, Introspect)] -enum EnumTupleOnePrimitive { - Left: (u16,), - Right: (u16,), +enum EnumWithPrimitive { + Left: u32, + Right: u32, } #[derive(Serde, Copy, Drop, Introspect)] @@ -468,7 +475,7 @@ struct StructNotPackable1 { } #[derive(IntrospectPacked)] -struct StructNotPackable2 { +struct StructPackableWithInnerPacked { x: u8, y: StructPacked1 } @@ -493,6 +500,13 @@ enum EnumPacked3 { b: u256, } + +#[derive(IntrospectPacked)] +enum EnumPackableWithInnerPacked { + a: StructPacked1, + b: StructPacked1, +} + #[derive(IntrospectPacked)] enum EnumNotPackable1 { a: u8, @@ -519,7 +533,6 @@ impl Vec2Introspect<> of dojo::database::introspect::Introspect> { Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -583,38 +596,19 @@ impl PlainEnumDrop of core::traits::Drop::; impl PlainEnumIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(1) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Layout::Fixed(array![].span()) }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Layout::Fixed(array![].span()) } ].span() ) @@ -627,16 +621,8 @@ dojo::database::introspect::FieldLayout { name: 'PlainEnum', attrs: array![].span(), children: array![ - ('Left', dojo::database::introspect::Ty::Tuple( - array![ - - ].span() - )), -('Right', dojo::database::introspect::Ty::Tuple( - array![ - - ].span() - )) + ('Left', dojo::database::introspect::Ty::Tuple(array![].span())), +('Right', dojo::database::introspect::Ty::Tuple(array![].span())) ].span() } @@ -667,30 +653,19 @@ impl EnumWithPrimitiveDrop of core::traits::Drop::; impl EnumWithPrimitiveIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -735,30 +710,28 @@ impl EnumWithStructDrop of core::traits::Drop::; impl EnumWithStructIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -806,27 +779,16 @@ impl EnumWithSimpleArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::>::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::>::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::>::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::>::layout() } ].span() ) @@ -882,27 +844,16 @@ impl EnumWithByteArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -947,40 +898,29 @@ impl EnumWithSimpleTupleDrop of core::traits::Drop::; impl EnumWithSimpleTupleIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(4) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) }, dojo::database::introspect::FieldLayout { selector: 1, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1035,40 +975,38 @@ impl EnumWithComplexTupleDrop of core::traits::Drop::; impl EnumWithComplexTupleIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) }, dojo::database::introspect::FieldLayout { selector: 1, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1099,62 +1037,43 @@ dojo::database::introspect::Introspect::::ty() ) } } -impl EnumTupleOnePrimitiveSerde of core::serde::Serde:: { - fn serialize(self: @EnumTupleOnePrimitive, ref output: core::array::Array) { +impl EnumWithPrimitiveSerde of core::serde::Serde:: { + fn serialize(self: @EnumWithPrimitive, ref output: core::array::Array) { match self { - EnumTupleOnePrimitive::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, - EnumTupleOnePrimitive::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithPrimitive::Left(x) => { core::serde::Serde::serialize(@0, ref output); core::serde::Serde::serialize(x, ref output); }, + EnumWithPrimitive::Right(x) => { core::serde::Serde::serialize(@1, ref output); core::serde::Serde::serialize(x, ref output); }, } } - fn deserialize(ref serialized: core::array::Span) -> core::option::Option { + fn deserialize(ref serialized: core::array::Span) -> core::option::Option { let idx: felt252 = core::serde::Serde::deserialize(ref serialized)?; core::option::Option::Some( match idx { - 0 => EnumTupleOnePrimitive::Left(core::serde::Serde::deserialize(ref serialized)?), - 1 => EnumTupleOnePrimitive::Right(core::serde::Serde::deserialize(ref serialized)?), + 0 => EnumWithPrimitive::Left(core::serde::Serde::deserialize(ref serialized)?), + 1 => EnumWithPrimitive::Right(core::serde::Serde::deserialize(ref serialized)?), _ => { return core::option::Option::None; } } ) } } -impl EnumTupleOnePrimitiveCopy of core::traits::Copy::; -impl EnumTupleOnePrimitiveDrop of core::traits::Drop::; +impl EnumWithPrimitiveCopy of core::traits::Copy::; +impl EnumWithPrimitiveDrop of core::traits::Drop::; -impl EnumTupleOnePrimitiveIntrospect<> of dojo::database::introspect::Introspect> { +impl EnumWithPrimitiveIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Introspect::::layout() - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Introspect::::layout() - ].span() - ) - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -1164,19 +1083,11 @@ dojo::database::introspect::FieldLayout { fn ty() -> dojo::database::introspect::Ty { dojo::database::introspect::Ty::Enum( dojo::database::introspect::Enum { - name: 'EnumTupleOnePrimitive', + name: 'EnumWithPrimitive', attrs: array![].span(), children: array![ - ('Left', dojo::database::introspect::Ty::Tuple( - array![ - dojo::database::introspect::Introspect::::ty() - ].span() - )), -('Right', dojo::database::introspect::Ty::Tuple( - array![ - dojo::database::introspect::Introspect::::ty() - ].span() - )) + ('Left', dojo::database::introspect::Introspect::::ty()), +('Right', dojo::database::introspect::Introspect::::ty()) ].span() } @@ -1207,30 +1118,28 @@ impl EnumCustomDrop of core::traits::Drop::; impl EnumCustomIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(1) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() } ].span() ) @@ -1275,42 +1184,41 @@ impl EnumTupleMixDrop of core::traits::Drop::; impl EnumTupleMixIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +dojo::database::introspect::Introspect::::size(), +Option::Some(2) + ]; + + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) }, dojo::database::introspect::FieldLayout { selector: 1, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1372,41 +1280,25 @@ impl EnumWithDifferentVariantDataIntrospect<> of dojo::database::introspect::Int Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - - ].span() - ) + layout: dojo::database::introspect::Layout::Fixed(array![].span()) }, dojo::database::introspect::FieldLayout { selector: 1, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::::layout() }, dojo::database::introspect::FieldLayout { selector: 2, layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Layout::Tuple( array![ dojo::database::introspect::Introspect::::layout(), dojo::database::introspect::Introspect::::layout() ].span() ) - ].span() - ) } ].span() ) @@ -1442,7 +1334,6 @@ impl StructWithPrimitivesIntrospect<> of dojo::database::introspect::Introspect< Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1493,18 +1384,17 @@ impl StructWithStructIntrospect<> of dojo::database::introspect::Introspect Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), Option::Some(1) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1557,7 +1447,6 @@ impl StructWithSimpleArrayIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1614,7 +1503,6 @@ impl StructWithByteArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1667,7 +1555,6 @@ impl StructWithComplexArrayIntrospect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1724,7 +1611,6 @@ impl StructWithSimpleTupleIntrospect<> of dojo::database::introspect::Introspect Option::Some(4) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1785,19 +1671,18 @@ impl StructWithComplexTupleIntrospect<> of dojo::database::introspect::Introspec #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), dojo::database::introspect::Introspect::::size(), Option::Some(2) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1862,7 +1747,6 @@ impl StructWithNestedArraysIntrospect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1933,19 +1817,18 @@ impl StructWithNestedTuplesIntrospect<> of dojo::database::introspect::Introspec #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), dojo::database::introspect::Introspect::::size(), Option::Some(3) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2028,7 +1911,6 @@ impl StructWithNestedTuplesAndByteArrayIntrospect<> of dojo::database::introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2111,7 +1993,6 @@ impl StructWithNestedEverythingIntrospect<> of dojo::database::introspect::Intro Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2244,7 +2125,6 @@ impl GenericStructIntrospect::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2293,7 +2173,6 @@ impl StructWithBadOptionIntrospect<> of dojo::database::introspect::Introspect>::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2347,29 +2226,23 @@ impl EnumWithBadOptionIntrospect<> of dojo::database::introspect::Introspect Option { let sizes : Array> = array![ - 8, -dojo::database::introspect::Introspect::>::size() - ]; + dojo::database::introspect::Introspect::>::size(), +Option::Some(1) + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ dojo::database::introspect::FieldLayout { selector: 0, - layout: dojo::database::introspect::Layout::Tuple( - array![ - dojo::database::introspect::Layout::Fixed(array![8].span()), - dojo::database::introspect::Introspect::>::layout() - ].span() - ) + layout: dojo::database::introspect::Introspect::>::layout() } ].span() ) @@ -2396,7 +2269,6 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ @@ -2426,7 +2298,6 @@ impl EnumIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2456,7 +2327,6 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspe Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2486,7 +2356,6 @@ impl StructIncompatibleAttrsIntrospect<> of dojo::database::introspect::Introspe Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2516,7 +2385,6 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introsp Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2546,7 +2414,6 @@ impl StructIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introsp Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2576,7 +2443,6 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Enum( array![ @@ -2606,7 +2472,6 @@ impl EnumIncompatibleAttrs2Introspect<> of dojo::database::introspect::Introspec Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2636,7 +2501,6 @@ impl StructPacked1Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2670,7 +2534,6 @@ impl StructPacked2Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2709,7 +2572,6 @@ impl StructPacked3Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2753,7 +2615,6 @@ impl StructNotPackable1Introspect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Fixed( array![ @@ -2790,35 +2651,54 @@ dojo::database::introspect::Member { } } -impl StructNotPackable2Introspect<> of dojo::database::introspect::Introspect> { +impl StructPackableWithInnerPackedIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), Option::Some(1) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - dojo::database::introspect::Layout::Fixed( - array![ - 8,ERROR - ].span() - ) + let mut layouts = array![ + dojo::database::introspect::Layout::Fixed(array![8].span()), +dojo::database::introspect::Introspect::::layout() + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop { + match ArrayTrait::pop_front(ref layouts) { + Option::Some(mut layout) => { + match layout { + dojo::database::introspect::Layout::Fixed(mut l) => { + loop { + match SpanTrait::pop_front(ref l) { + Option::Some(x) => merged_layout.append(*x), + Option::None(_) => { break; } + }; + }; + }, + _ => panic!("A packed model layout must contain Fixed layouts only."), + }; + }, + Option::None(_) => { break; } + }; + }; + + dojo::database::introspect::Layout::Fixed(merged_layout.span()) + } #[inline(always)] fn ty() -> dojo::database::introspect::Ty { dojo::database::introspect::Ty::Struct( dojo::database::introspect::Struct { - name: 'StructNotPackable2', + name: 'StructPackableWithInnerPacked', attrs: array![].span(), children: array![ dojo::database::introspect::Member { @@ -2841,12 +2721,15 @@ dojo::database::introspect::Member { impl EnumPacked1Introspect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(1) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - ERROR + dojo::database::introspect::Layout::Fixed( + array![ + 8 + ].span() + ) } #[inline(always)] @@ -2869,12 +2752,15 @@ impl EnumPacked1Introspect<> of dojo::database::introspect::Introspect of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(2) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - ERROR + dojo::database::introspect::Layout::Fixed( + array![ + 8,8 + ].span() + ) } #[inline(always)] @@ -2897,12 +2783,15 @@ impl EnumPacked2Introspect<> of dojo::database::introspect::Introspect of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { - Option::None + Option::Some(3) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - ERROR + dojo::database::introspect::Layout::Fixed( + array![ + 8,128,128 + ].span() + ) } #[inline(always)] @@ -2926,13 +2815,71 @@ dojo::database::introspect::Introspect::::ty() } } +impl EnumPackableWithInnerPackedIntrospect<> of dojo::database::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + let sizes : Array> = array![ + dojo::database::introspect::Introspect::::size(), +Option::Some(1) + ]; + + + Option::Some(dojo::database::utils::sum(sizes)) + + } + + fn layout() -> dojo::database::introspect::Layout { + let mut layouts = array![ + dojo::database::introspect::Layout::Fixed(array![8].span()), +dojo::database::introspect::Introspect::::layout() + ]; + let mut merged_layout = ArrayTrait::::new(); + + loop { + match ArrayTrait::pop_front(ref layouts) { + Option::Some(mut layout) => { + match layout { + dojo::database::introspect::Layout::Fixed(mut l) => { + loop { + match SpanTrait::pop_front(ref l) { + Option::Some(x) => merged_layout.append(*x), + Option::None(_) => { break; } + }; + }; + }, + _ => panic!("A packed model layout must contain Fixed layouts only."), + }; + }, + Option::None(_) => { break; } + }; + }; + + dojo::database::introspect::Layout::Fixed(merged_layout.span()) + + } + + #[inline(always)] + fn ty() -> dojo::database::introspect::Ty { + dojo::database::introspect::Ty::Enum( + dojo::database::introspect::Enum { + name: 'EnumPackableWithInnerPacked', + attrs: array![].span(), + children: array![ + ('a', dojo::database::introspect::Introspect::::ty()), +('b', dojo::database::introspect::Introspect::::ty()) + + ].span() + } + ) + } +} + impl EnumNotPackable1Introspect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { ERROR } @@ -2989,27 +2936,7 @@ error: Array field cannot be packed. y: Array ^**********^ -error: For now, field with custom type cannot be packed - --> test_src/lib.cairo:219:6 - y: StructPacked1 - ^*************^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:223:6 -enum EnumPacked1 { - ^*********^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:230:6 -enum EnumPacked2 { - ^*********^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:237:6 -enum EnumPacked3 { - ^*********^ - -error: To be packed, all variants must have exactly the same layout. - --> test_src/lib.cairo:243:6 +error: To be packed, all variants must have fixed layout of same size. + --> test_src/lib.cairo:250:6 enum EnumNotPackable1 { ^**************^ diff --git a/crates/dojo-lang/src/plugin_test_data/model b/crates/dojo-lang/src/plugin_test_data/model index f644db0710..092bee2438 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -277,7 +277,6 @@ impl BadModelMultipleAttrIntrospect<> of dojo::database::introspect::Introspect< dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -319,7 +318,6 @@ impl BadModelMultipleVersionsIntrospect<> of dojo::database::introspect::Introsp dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -496,7 +494,6 @@ impl BadModelBadVersionTypeIntrospect<> of dojo::database::introspect::Introspec dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -673,7 +670,6 @@ impl BadModelNoVersionValueIntrospect<> of dojo::database::introspect::Introspec dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -850,7 +846,6 @@ impl BadModelUnexpectedArgWithValueIntrospect<> of dojo::database::introspect::I dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1027,7 +1022,6 @@ impl BadModelUnexpectedArgIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1204,7 +1198,6 @@ impl BadModelNotSupportedVersionIntrospect<> of dojo::database::introspect::Intr dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1381,7 +1374,6 @@ impl Modelv0Introspect<> of dojo::database::introspect::Introspect> { dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1558,7 +1550,6 @@ impl PositionIntrospect<> of dojo::database::introspect::Introspect> dojo::database::introspect::Introspect::::size() } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1735,7 +1726,6 @@ impl RolesIntrospect<> of dojo::database::introspect::Introspect> { Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -1912,7 +1902,6 @@ impl OnlyKeyModelIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2081,7 +2070,6 @@ impl U256KeyModelIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2250,7 +2238,6 @@ impl PlayerIntrospect<> of dojo::database::introspect::Introspect> { Option::Some(1) } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2432,7 +2419,6 @@ impl ModelWithSimpleArrayIntrospect<> of dojo::database::introspect::Introspect< Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2623,7 +2609,6 @@ impl ModelWithByteArrayIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -2810,7 +2795,6 @@ impl ModelWithComplexArrayIntrospect<> of dojo::database::introspect::Introspect Option::None } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -3001,7 +2985,6 @@ impl ModelWithTupleIntrospect<> of dojo::database::introspect::Introspect dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ @@ -3197,18 +3180,17 @@ impl ModelWithTupleNoPrimitivesIntrospect<> of dojo::database::introspect::Intro #[inline(always)] fn size() -> Option { let sizes : Array> = array![ - dojo::database::introspect::Introspect::::size(), + dojo::database::introspect::Introspect::::size(), Option::Some(3) - ]; + ]; - if dojo::database::utils::any_none(@sizes) { - return Option::None; - } - Option::Some(dojo::database::utils::sum(sizes)) - + if dojo::database::utils::any_none(@sizes) { + return Option::None; + } + Option::Some(dojo::database::utils::sum(sizes)) + } - #[inline(always)] fn layout() -> dojo::database::introspect::Layout { dojo::database::introspect::Layout::Struct( array![ diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs index e461dd8dfc..5b7a2615f3 100644 --- a/crates/dojo-types/src/schema.rs +++ b/crates/dojo-types/src/schema.rs @@ -250,7 +250,6 @@ impl std::fmt::Display for Ty { let str = self .iter() .filter_map(|ty| match ty { - Ty::Primitive(_) => None, Ty::Struct(s) => { let mut struct_str = format!("struct {} {{\n", s.name); for member in &s.children { @@ -272,6 +271,7 @@ impl std::fmt::Display for Ty { } Ty::Array(items_ty) => Some(format!("Array<{}>", items_ty[0].name())), Ty::ByteArray(_) => Some("ByteArray".to_string()), + _ => None, }) .collect::>() .join("\n\n"); diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 1b581b0e5e..f32a7b5943 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -65,7 +65,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x03c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58") + felt!("0x03ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868") ); let moves = world.model_reader("Moves").await.unwrap(); diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index eeaf797188..8da0b1af36 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -145,10 +145,9 @@ async fn get_full_dojo_metadata_from_workspace() { ); assert!(env.world_address.is_some()); - assert!( - env.world_address - .unwrap() - .eq("0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962") + assert_eq!( + env.world_address.unwrap(), + "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6" ); assert!(env.keystore_path.is_none()); diff --git a/crates/sozo/ops/src/model.rs b/crates/sozo/ops/src/model.rs index 21d206ab19..fd11cec2dd 100644 --- a/crates/sozo/ops/src/model.rs +++ b/crates/sozo/ops/src/model.rs @@ -1,10 +1,15 @@ use anyhow::Result; +use cainome::cairo_serde::{ByteArray, CairoSerde}; +use dojo_types::schema::Ty; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; +const INDENT: &str = " "; + pub async fn model_class_hash( name: String, world_address: FieldElement, @@ -35,6 +40,29 @@ pub async fn model_contract_address( Ok(()) } +pub async fn model_layout( + name: String, + world_address: FieldElement, + provider: JsonRpcClient, +) -> Result<()> { + let mut world_reader = WorldContractReader::new(world_address, &provider); + world_reader.set_block(BlockId::Tag(BlockTag::Pending)); + + let model = world_reader.model_reader(&name).await?; + let layout = match model.layout().await { + Ok(x) => x, + Err(_) => anyhow::bail!( + "[Incorrect layout]\nThe model is packed but contains at least one custom type field \ + which is not packed.\nPlease check your model to fix this." + ), + }; + let schema = model.schema().await?; + + deep_print_layout(&name, &layout, &schema); + + Ok(()) +} + pub async fn model_schema( name: String, world_address: FieldElement, @@ -50,7 +78,7 @@ pub async fn model_schema( if to_json { println!("{}", serde_json::to_string_pretty(&schema)?) } else { - println!("{schema}"); + deep_print_ty(schema); } Ok(()) @@ -66,9 +94,560 @@ pub async fn model_get( world_reader.set_block(BlockId::Tag(BlockTag::Pending)); let model = world_reader.model_reader(&name).await?; - let entity = model.entity(&keys).await?; + let schema = model.schema().await?; + let values = model.entity_storage(&keys).await?; - println!("{entity}"); + deep_print_record(&schema, &keys, &values); Ok(()) } + +#[derive(Clone, Debug)] +struct LayoutInfo { + layout_type: LayoutInfoType, + name: String, + fields: Vec, +} + +#[derive(Clone, Debug)] +enum LayoutInfoType { + Struct, + Enum, + Tuple, + Array, +} + +#[derive(Clone, Debug)] +struct FieldLayoutInfo { + selector: String, + name: String, + layout: String, +} + +fn format_fixed(layout: &[u8]) -> String { + format!("[{}]", layout.iter().map(|x| x.to_string()).collect::>().join(", ")) +} + +fn format_layout_ref(type_name: &str) -> String { + format!("layout({type_name})") +} + +fn format_selector(selector: String) -> String { + if selector.starts_with("0x") { format!("[{}]", selector) } else { selector } +} + +fn format_name(name: String) -> String { + if !name.is_empty() { format!(" {} ", name) } else { name } +} + +fn format_field(selector: String, name: String, layout: String) -> String { + let layout = if layout.eq("[]") { "".to_string() } else { format!(": {layout}") }; + + format!("{INDENT}{:<20}{:<18}{}", format_selector(selector), format_name(name), layout) +} + +fn format_field_layout( + layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, +) -> String { + match layout { + dojo_world::contracts::model::abigen::model::Layout::Fixed(x) => format_fixed(x), + dojo_world::contracts::model::abigen::model::Layout::ByteArray => { + "layout(ByteArray)".to_string() + } + _ => format_layout_ref(&get_name_from_schema(schema)), + } +} + +fn is_layout_in_list(list: &[LayoutInfo], name: &String) -> bool { + list.iter().any(|x| x.name.eq(name)) +} + +fn get_name_from_schema(schema: &dojo_types::schema::Ty) -> String { + match schema { + dojo_types::schema::Ty::Struct(s) => s.name.clone(), + dojo_types::schema::Ty::Enum(e) => e.name.clone(), + dojo_types::schema::Ty::Primitive(p) => match p { + dojo_types::primitive::Primitive::U8(_) => "u8".to_string(), + dojo_types::primitive::Primitive::U16(_) => "u16".to_string(), + dojo_types::primitive::Primitive::U32(_) => "u32".to_string(), + dojo_types::primitive::Primitive::U64(_) => "u64".to_string(), + dojo_types::primitive::Primitive::U128(_) => "u128".to_string(), + dojo_types::primitive::Primitive::U256(_) => "u256".to_string(), + dojo_types::primitive::Primitive::USize(_) => "usize".to_string(), + dojo_types::primitive::Primitive::Bool(_) => "bool".to_string(), + dojo_types::primitive::Primitive::Felt252(_) => "felt252".to_string(), + dojo_types::primitive::Primitive::ClassHash(_) => "ClassHash".to_string(), + dojo_types::primitive::Primitive::ContractAddress(_) => "ContractAddress".to_string(), + }, + dojo_types::schema::Ty::Tuple(t) => { + format!("({})", t.iter().map(get_name_from_schema).collect::>().join(", ")) + } + dojo_types::schema::Ty::Array(a) => format!("Array<{}>", get_name_from_schema(&a[0])), + _ => "".to_string(), + } +} + +fn get_printable_layout_list_from_struct( + field_layouts: &[dojo_world::contracts::model::abigen::model::FieldLayout], + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Struct(ss) = schema { + let name = get_name_from_schema(schema); + + // process main struct + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Struct, + name, + fields: field_layouts + .iter() + .zip(ss.children.iter().filter(|x| !x.key)) + .map(|(l, m)| FieldLayoutInfo { + selector: format!("{:#x}", l.selector), + name: m.name.clone(), + layout: format_field_layout(&l.layout, &m.ty), + }) + .collect::>(), + }); + } + + // process members + for (member_layout, member) in + field_layouts.iter().zip(ss.children.iter().filter(|x| !x.key)) + { + get_printable_layout_list(&member_layout.layout, &member.ty, layout_list); + } + }; +} + +fn get_printable_layout_list_from_enum( + field_layouts: &[dojo_world::contracts::model::abigen::model::FieldLayout], + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Enum(se) = schema { + let name = get_name_from_schema(schema); + + // proces main enum + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Enum, + name, + fields: field_layouts + .iter() + .zip(se.options.iter()) + .map(|(l, o)| FieldLayoutInfo { + selector: format!("{:#x}", l.selector), + name: o.name.to_string(), + layout: format_field_layout(&l.layout, &o.ty), + }) + .collect::>(), + }); + } + + // process variants + for (variant_layout, variant) in field_layouts.iter().zip(se.options.iter()) { + get_printable_layout_list(&variant_layout.layout, &variant.ty, layout_list); + } + } +} + +fn get_printable_layout_list_from_tuple( + item_layouts: &[dojo_world::contracts::model::abigen::model::Layout], + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Tuple(st) = schema { + let name = get_name_from_schema(schema); + + // process tuple + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Tuple, + name, + fields: item_layouts + .iter() + .enumerate() + .zip(st.iter()) + .map(|((i, l), s)| FieldLayoutInfo { + selector: format!("{:#x}", i), + name: "".to_string(), + layout: format_field_layout(l, s), + }) + .collect::>(), + }); + } + + // process tuple items + for (item_layout, item_schema) in item_layouts.iter().zip(st.iter()) { + get_printable_layout_list(item_layout, item_schema, layout_list); + } + } +} + +fn get_printable_layout_list_from_array( + item_layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + if let dojo_types::schema::Ty::Array(sa) = schema { + let name = get_name_from_schema(schema); + + // process array + if !is_layout_in_list(layout_list, &name) { + layout_list.push(LayoutInfo { + layout_type: LayoutInfoType::Array, + name, + fields: vec![FieldLayoutInfo { + selector: "[ItemIndex]".to_string(), + name: "".to_string(), + layout: format_field_layout(item_layout, &sa[0]), + }], + }); + } + + // process array item + get_printable_layout_list(item_layout, &sa[0], layout_list); + } +} + +fn get_printable_layout_list( + root_layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, + layout_list: &mut Vec, +) { + match root_layout { + dojo_world::contracts::model::abigen::model::Layout::Struct(ls) => { + get_printable_layout_list_from_struct(ls, schema, layout_list); + } + dojo_world::contracts::model::abigen::model::Layout::Enum(le) => { + get_printable_layout_list_from_enum(le, schema, layout_list); + } + dojo_world::contracts::model::abigen::model::Layout::Tuple(lt) => { + get_printable_layout_list_from_tuple(lt, schema, layout_list); + } + dojo_world::contracts::model::abigen::model::Layout::Array(la) => { + get_printable_layout_list_from_array(&la[0], schema, layout_list); + } + _ => {} + }; +} + +fn print_layout_info(layout_info: LayoutInfo) { + let fields = layout_info + .fields + .into_iter() + .map(|f| format_field(f.selector, f.name, f.layout)) + .collect::>(); + let layout_title = match layout_info.layout_type { + LayoutInfoType::Struct => format!("Struct {} {{", layout_info.name), + + LayoutInfoType::Enum => { + format!("{:<42}: [251] (variant id)", format!("Enum {} {{", layout_info.name)) + } + LayoutInfoType::Tuple => format!("{} (", layout_info.name), + LayoutInfoType::Array => { + format!("{:<42}: [32] (length)", format!("{} (", layout_info.name)) + } + }; + let end_token = match layout_info.layout_type { + LayoutInfoType::Struct => '}', + LayoutInfoType::Enum => '}', + LayoutInfoType::Tuple => ')', + LayoutInfoType::Array => ')', + }; + + println!( + "{layout_title} +{} +{end_token}\n", + fields.join("\n") + ); +} + +// print the full Layout tree +fn deep_print_layout( + name: &String, + layout: &dojo_world::contracts::model::abigen::model::Layout, + schema: &dojo_types::schema::Ty, +) { + if let dojo_world::contracts::model::abigen::model::Layout::Fixed(lf) = layout { + println!("\n{} (packed)", name); + println!(" selector : {:#x}", get_selector_from_name(name).unwrap()); + println!(" layout : {}", format_fixed(lf)); + } else { + let mut layout_list = vec![]; + get_printable_layout_list(layout, schema, &mut layout_list); + + println!("\n{} selector: {:#x}\n", name, get_selector_from_name(name).unwrap()); + + for l in layout_list { + print_layout_info(l); + } + } +} + +fn _start_indent(level: usize, start_indent: bool) -> String { + if start_indent { INDENT.repeat(level) } else { "".to_string() } +} + +fn format_primitive( + p: &dojo_types::primitive::Primitive, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let mut _p = *p; + let _ = _p.deserialize(values); + + format!("{}{}", _start_indent(level, start_indent), _p.to_sql_value().unwrap()) +} + +fn format_byte_array(values: &mut Vec, level: usize, start_indent: bool) -> String { + let bytearray = ByteArray::cairo_deserialize(values, 0).unwrap(); + values.drain(0..ByteArray::cairo_serialized_size(&bytearray)); + + format!("{}{}", _start_indent(level, start_indent), ByteArray::to_string(&bytearray).unwrap()) +} + +fn format_field_value( + member: &dojo_types::schema::Member, + values: &mut Vec, + level: usize, +) -> String { + let field_repr = format_record_value(&member.ty, values, level, false); + format!("{}{:<16}: {field_repr}", INDENT.repeat(level), member.name) +} + +fn format_array( + item: &dojo_types::schema::Ty, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let length: u32 = values.remove(0).try_into().unwrap(); + let mut items = vec![]; + + for _ in 0..length { + items.push(format_record_value(item, values, level + 1, true)); + } + + format!( + "{}[\n{}\n{}]", + _start_indent(level, start_indent), + items.join(",\n"), + INDENT.repeat(level) + ) +} + +fn format_tuple( + items: &[dojo_types::schema::Ty], + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + if items.is_empty() { + return "".to_string(); + } + + let items_repr = items + .iter() + .map(|x| format_record_value(x, values, level + 1, true)) + .collect::>() + .join(",\n"); + + format!("{}(\n{}\n{})", _start_indent(level, start_indent), items_repr, INDENT.repeat(level)) +} + +fn format_struct( + schema: &dojo_types::schema::Struct, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let fields = schema + .children + .iter() + .map(|m| format_field_value(m, values, level + 1)) + .collect::>(); + + format!( + "{}{{\n{}\n{}}}", + _start_indent(level, start_indent), + fields.join(",\n"), + INDENT.repeat(level) + ) +} + +fn format_enum( + schema: &dojo_types::schema::Enum, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + let variant_index: u8 = values.remove(0).try_into().unwrap(); + let variant_index: usize = variant_index.into(); + let variant_name = format!("{}::{}", schema.name, schema.options[variant_index].name); + let variant_data = + format_record_value(&schema.options[variant_index].ty, values, level + 1, true); + + if variant_data.is_empty() { + format!("{}{variant_name}", _start_indent(level, start_indent),) + } else { + format!( + "{}{variant_name}(\n{}\n{})", + _start_indent(level, start_indent), + variant_data, + INDENT.repeat(level) + ) + } +} + +fn format_record_value( + schema: &dojo_types::schema::Ty, + values: &mut Vec, + level: usize, + start_indent: bool, +) -> String { + match schema { + dojo_types::schema::Ty::Primitive(p) => format_primitive(p, values, level, start_indent), + dojo_types::schema::Ty::ByteArray(_) => format_byte_array(values, level, start_indent), + dojo_types::schema::Ty::Struct(s) => format_struct(s, values, level, start_indent), + dojo_types::schema::Ty::Enum(e) => format_enum(e, values, level, start_indent), + dojo_types::schema::Ty::Array(a) => format_array(&a[0], values, level, start_indent), + dojo_types::schema::Ty::Tuple(t) => format_tuple(t, values, level, start_indent), + } +} + +// print the structured record values +fn deep_print_record( + schema: &dojo_types::schema::Ty, + keys: &[FieldElement], + values: &[FieldElement], +) { + let mut model_values = vec![]; + model_values.extend(keys); + model_values.extend(values); + + println!("{}", format_record_value(schema, &mut model_values, 0, true)); +} + +fn get_ty_repr(ty: &Ty) -> String { + match ty { + Ty::Primitive(p) => p.to_string(), + Ty::Struct(s) => s.name.clone(), + Ty::Enum(e) => e.name.clone(), + Ty::Tuple(items) => { + if items.is_empty() { + "".to_string() + } else { + format!("({},)", items.iter().map(get_ty_repr).collect::>().join(", ")) + } + } + Ty::Array(items) => format!("Array<{}>", get_ty_repr(&items[0])), + Ty::ByteArray(_) => "ByteArray".to_string(), + } +} + +// to verify if a Ty has already been processed (i.e is in the list), +// just compare their type representation. +fn is_ty_already_in_list(ty_list: &[Ty], ty: &Ty) -> bool { + let ty_repr = get_ty_repr(ty); + ty_list.iter().any(|t| get_ty_repr(t).eq(&ty_repr)) +} + +// parse the Ty tree from its root and extract Ty to print. +// (basically, structs and enums) +fn get_printable_ty_list(root_ty: &Ty, ty_list: &mut Vec) { + match root_ty { + Ty::Primitive(_) => {} + Ty::ByteArray(_) => {} + Ty::Struct(s) => { + if !is_ty_already_in_list(ty_list, root_ty) { + ty_list.push(root_ty.clone()); + } + + for member in &s.children { + if !is_ty_already_in_list(ty_list, &member.ty) { + get_printable_ty_list(&member.ty, ty_list); + } + } + } + Ty::Enum(e) => { + if !ty_list.contains(root_ty) { + ty_list.push(root_ty.clone()); + } + + for child in &e.options { + if !is_ty_already_in_list(ty_list, &child.ty) { + get_printable_ty_list(&child.ty, ty_list); + } + } + } + Ty::Tuple(tuple) => { + for item_ty in tuple { + if !is_ty_already_in_list(ty_list, item_ty) { + get_printable_ty_list(item_ty, ty_list); + } + } + } + Ty::Array(items_ty) => { + if !is_ty_already_in_list(ty_list, &items_ty[0]) { + get_printable_ty_list(&items_ty[0], ty_list) + } + } + }; +} + +pub fn format_ty_field(name: &String, ty: &Ty, is_key: bool) -> String { + let ty_repr = get_ty_repr(ty); + let ty_repr = if ty_repr.is_empty() { "".to_string() } else { format!(": {ty_repr}") }; + let key_repr = if is_key { " #[key]\n".to_string() } else { "".to_string() }; + + format! {"{key_repr} {name}{ty_repr}"} +} + +// print Ty representation if required. +// For example, there is no need to print any information about arrays or tuples +// as they are members of struct and their items will be printed. +pub fn print_ty(ty: &Ty) { + let ty_repr = match ty { + Ty::Struct(s) => { + let mut struct_str = format!("struct {} {{\n", s.name); + for member in &s.children { + struct_str.push_str(&format!( + "{},\n", + format_ty_field(&member.name, &member.ty, member.key) + )); + } + struct_str.push('}'); + Some(struct_str) + } + Ty::Enum(e) => { + let mut enum_str = format!("enum {} {{\n", e.name); + for child in &e.options { + enum_str + .push_str(&format!("{},\n", format_ty_field(&child.name, &child.ty, false))); + } + enum_str.push('}'); + Some(enum_str) + } + _ => None, + }; + + if let Some(ty_repr) = ty_repr { + println!("{}\n\n", ty_repr); + } +} + +// print the full Ty tree +pub fn deep_print_ty(root: Ty) { + let mut ty_list = vec![]; + get_printable_ty_list(&root, &mut ty_list); + + for ty in ty_list { + print_ty(&ty); + } +} diff --git a/crates/torii/core/Cargo.toml b/crates/torii/core/Cargo.toml index 6f99f9e213..cf1cb8cdd3 100644 --- a/crates/torii/core/Cargo.toml +++ b/crates/torii/core/Cargo.toml @@ -43,3 +43,4 @@ camino.workspace = true dojo-test-utils = { path = "../../dojo-test-utils" } scarb.workspace = true sozo = { path = "../../../bin/sozo" } +katana-runner.workspace = true diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 7cc52b506f..360e0a988c 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -3,12 +3,10 @@ use std::str::FromStr; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_test_utils::sequencer::{ - get_default_test_starknet_config, SequencerConfig, TestSequencer, -}; use dojo_world::contracts::world::WorldContractReader; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; +use katana_runner::KatanaRunner; use scarb::ops; use sozo_ops::migration::execute_strategy; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; @@ -71,14 +69,13 @@ async fn test_load_from_remote() { let mut migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); migration.resolve_variable(migration.world_address().unwrap()).unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; + let sequencer = KatanaRunner::new().expect("Failed to start runner."); let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); - let mut account = sequencer.account(); + let mut account = sequencer.account(0); account.set_block_id(BlockId::Tag(BlockTag::Pending)); let ws = ops::read_workspace(config.manifest_path(), &config) @@ -126,7 +123,7 @@ async fn test_load_from_remote() { assert_eq!(id, format!("{:#x}", get_selector_from_name("Position").unwrap())); assert_eq!(name, "Position"); - assert_eq!(packed_size, 0); + assert_eq!(packed_size, 1); assert_eq!(unpacked_size, 2); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( @@ -139,7 +136,7 @@ async fn test_load_from_remote() { assert_eq!(id, format!("{:#x}", get_selector_from_name("Moves").unwrap())); assert_eq!(name, "Moves"); assert_eq!(packed_size, 0); - assert_eq!(unpacked_size, 0); + assert_eq!(unpacked_size, 2); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'PlayerConfig'", diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml index efc6f0ca39..2daf97b5e5 100644 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" -original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/dojoup/dojoup b/dojoup/dojoup index 494a288576..bf9c0d999f 100755 --- a/dojoup/dojoup +++ b/dojoup/dojoup @@ -254,7 +254,7 @@ EOF } usage() { - cat 1>&2 <&2 <<'EOF' The installer for Dojo. Update or revert to a specific Dojo version with ease. diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 93a78fbbd3..99366ce45b 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -25,4 +25,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962" +world_address = "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index 17294cff0a..5f84fa6760 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" -original_class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" +class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" +original_class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml index efc6f0ca39..2daf97b5e5 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" -original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml index 1c55c2930f..a9e0f20f78 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" -original_class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" +class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" +original_class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" abi = "manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json" name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml index c408805a96..668a594127 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" -original_class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" +class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" +original_class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" abi = "manifests/dev/abis/base/models/dojo_examples_models_emote_message.json" name = "dojo_examples::models::emote_message" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml index 4b5c015a39..db94e2ff11 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" -original_class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" +class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" +original_class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" abi = "manifests/dev/abis/base/models/dojo_examples_models_moves.json" name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml index a285a51830..bbaa577a1c 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" -original_class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" +class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" +original_class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" abi = "manifests/dev/abis/base/models/dojo_examples_models_player_config.json" name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml index 88609b7a59..5bcac0ef22 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" -original_class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" +class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" +original_class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" abi = "manifests/dev/abis/base/models/dojo_examples_models_position.json" name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 90c10bfbc0..00db8977b0 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e", - "original_class_hash": "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e", + "class_hash": "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092", + "original_class_hash": "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092", "abi": [ { "type": "impl", @@ -955,8 +955,8 @@ ] } ], - "address": "0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962", - "transaction_hash": "0xa32990a5203fc3c67ba905f65a0161fa5435d8c28aa1e889cc09b551f431d3", + "address": "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6", + "transaction_hash": "0x4fb663d83b07373bf2844ef51acfb10d1e957a2fd6d573b7360ad64710df6cc", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -975,9 +975,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0xa0db53af8c89cbaab909bb34635262ffe36bbd414184e830eabfa6b592a17d", - "class_hash": "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5", - "original_class_hash": "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5", + "address": "0x43ec1c3a2195bc6adaa4134b7183cec4bae46f1388cb41c0fc808aba7e04b0", + "class_hash": "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add", + "original_class_hash": "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1280,7 +1280,7 @@ }, { "kind": "DojoContract", - "address": "0x482b931a82a26a4d8501ff051b1c8e2c125b79c954dc5d5106988749129c9d3", + "address": "0x55d1b3b80ddfd912e33a6cb331665dfc0b8f1738fcbe8d4c4191e27cd12f9c4", "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", @@ -1456,8 +1456,8 @@ "key": false } ], - "class_hash": "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4", - "original_class_hash": "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4", + "class_hash": "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187", + "original_class_hash": "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187", "abi": [ { "type": "impl", @@ -1863,8 +1863,8 @@ "key": false } ], - "class_hash": "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9", - "original_class_hash": "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9", + "class_hash": "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc", + "original_class_hash": "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc", "abi": [ { "type": "impl", @@ -2275,8 +2275,8 @@ "key": false } ], - "class_hash": "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563", - "original_class_hash": "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563", + "class_hash": "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684", + "original_class_hash": "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684", "abi": [ { "type": "impl", @@ -2696,8 +2696,8 @@ "key": false } ], - "class_hash": "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612", - "original_class_hash": "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612", + "class_hash": "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09", + "original_class_hash": "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09", "abi": [ { "type": "impl", @@ -3099,8 +3099,8 @@ "key": false } ], - "class_hash": "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58", - "original_class_hash": "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58", + "class_hash": "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868", + "original_class_hash": "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868", "abi": [ { "type": "impl", diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 330a9fac1d..66680bf397 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" -original_class_hash = "0x34aafe3ca8fd1aec61deea58541aefd0ec6647299939ad96e4cd3a79c47bb8e" +class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x29aea29955b6b0c0aabf92e265cd0bca14069575511ec9b6819ca2917277962" -transaction_hash = "0xa32990a5203fc3c67ba905f65a0161fa5435d8c28aa1e889cc09b551f431d3" +address = "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6" +transaction_hash = "0x4fb663d83b07373bf2844ef51acfb10d1e957a2fd6d573b7360ad64710df6cc" block_number = 3 seed = "dojo_examples" name = "dojo::world::world" @@ -21,9 +21,9 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" -address = "0xa0db53af8c89cbaab909bb34635262ffe36bbd414184e830eabfa6b592a17d" -class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" -original_class_hash = "0x44838b88a31f6cf954408395e5d4256d53640ca48a46658d08400ddf11790f5" +address = "0x43ec1c3a2195bc6adaa4134b7183cec4bae46f1388cb41c0fc808aba7e04b0" +class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" +original_class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] @@ -37,7 +37,7 @@ name = "dojo_examples::actions::actions" [[contracts]] kind = "DojoContract" -address = "0x482b931a82a26a4d8501ff051b1c8e2c125b79c954dc5d5106988749129c9d3" +address = "0x55d1b3b80ddfd912e33a6cb331665dfc0b8f1738fcbe8d4c4191e27cd12f9c4" class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" @@ -54,8 +54,8 @@ name = "dojo_examples::others::others" [[models]] kind = "DojoModel" -class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" -original_class_hash = "0x5508ab47983d4842a780fe483cb9ba5d24ad4b8d0196f767cd5983398b9f4c4" +class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" +original_class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" abi = "manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json" name = "dojo_examples::actions::actions::moved" @@ -71,8 +71,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" -original_class_hash = "0x3c690e6a69960642e2e276299c04ee4eb57f8dabb0f59dc96b09faf39c82a9" +class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" +original_class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json" name = "dojo_examples::models::emote_message" @@ -88,8 +88,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" -original_class_hash = "0x6eeffc6c72945b6ef419d3c67ed377408437782fdc41fa7a52339cd30d6c563" +class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" +original_class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_moves.json" name = "dojo_examples::models::moves" @@ -110,8 +110,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" -original_class_hash = "0x74e835af876c9f95977537b91d60d656f6ff2a4a8b2bb8d47448f345980f612" +class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" +original_class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json" name = "dojo_examples::models::player_config" @@ -137,8 +137,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" -original_class_hash = "0x3c3632f38ab3ba550bd3c596e2af55002d43bc76b7b660a3a57b49795307c58" +class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" +original_class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_position.json" name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/src/models.cairo b/examples/spawn-and-move/src/models.cairo index 635b9c312f..e04859bdf4 100644 --- a/examples/spawn-and-move/src/models.cairo +++ b/examples/spawn-and-move/src/models.cairo @@ -47,13 +47,17 @@ struct Moves { last_direction: Direction } -#[derive(Copy, Drop, Serde, Introspect)] +#[derive(Copy, Drop, Serde, IntrospectPacked)] struct Vec2 { x: u32, y: u32 } -#[derive(Copy, Drop, Serde)] +// If `Vec2` wasn't packed, the `Position` would be invalid, +// and a runtime error would be thrown. +// Any field that is a custom type into a `IntrospectPacked` type +// must be packed. +#[derive(Copy, Drop, Serde, IntrospectPacked)] #[dojo::model] struct Position { #[key] @@ -61,6 +65,8 @@ struct Position { vec: Vec2, } +// Every field inside a model must derive `Introspect` or `IntrospectPacked`. +// `IntrospectPacked` can also be used into models that are only using `Introspect`. #[derive(Copy, Drop, Serde, Introspect)] struct PlayerItem { item_id: u32, From 61c6f399447d2bd01073f9e2a8b1d50f658b0d97 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Wed, 29 May 2024 08:41:31 -0400 Subject: [PATCH 03/88] feat(torii-core): multi dimensional array support (#1994) * feat(torii-core): multi dimensional array support * refactor: model data objects construction * feat: handle 2d+ arrays in graphql * fmt * clippy * fix: clippy * fmt --------- Co-authored-by: glihm --- crates/torii/core/src/sql.rs | 112 ++++++++++-------- crates/torii/graphql/src/object/entity.rs | 43 +++++-- crates/torii/graphql/src/object/model_data.rs | 86 ++++---------- crates/torii/graphql/src/query/mod.rs | 3 +- 4 files changed, 118 insertions(+), 126 deletions(-) diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 5060bc7e07..efe9190150 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -130,8 +130,8 @@ impl Sql { vec![model.name()], &mut model_idx, block_timestamp, - false, - false, + &mut 0, + &mut 0, ); self.query_queue.execute_all().await?; @@ -186,7 +186,7 @@ impl Sql { (&entity_id, false), &entity, block_timestamp, - None, + &vec![], ); self.query_queue.execute_all().await?; @@ -241,7 +241,7 @@ impl Sql { (&entity_id, true), &entity, block_timestamp, - None, + &vec![], ); self.query_queue.execute_all().await?; @@ -413,8 +413,8 @@ impl Sql { path: Vec, model_idx: &mut i64, block_timestamp: u64, - is_array: bool, - is_parent_array: bool, + array_idx: &mut usize, + parent_array_idx: &mut usize, ) { if let Ty::Enum(e) = model { if e.options.iter().all(|o| if let Ty::Tuple(t) = &o.ty { t.is_empty() } else { false }) @@ -428,8 +428,8 @@ impl Sql { model, *model_idx, block_timestamp, - is_array, - is_parent_array, + *array_idx, + *parent_array_idx, ); let mut build_member = |pathname: &str, member: &Ty| { @@ -447,9 +447,8 @@ impl Sql { path_clone, &mut (*model_idx + 1), block_timestamp, - // If the parent is an array, all children are also represented as table arrays - if let Ty::Array(_) = member { true } else { is_array }, - if let Ty::Array(_) = model { true } else { is_parent_array }, + &mut (*array_idx + if let Ty::Array(_) = member { 1 } else { 0 }), + &mut (*parent_array_idx + if let Ty::Array(_) = model { 1 } else { 0 }), ); }; @@ -486,12 +485,12 @@ impl Sql { entity_id: (&str, bool), entity: &Ty, block_timestamp: u64, - index: Option, + indexes: &Vec, ) { let (entity_id, is_event_message) = entity_id; let update_members = - |members: &[Member], query_queue: &mut QueryQueue, index: Option| { + |members: &[Member], query_queue: &mut QueryQueue, indexes: &Vec| { let table_id = path.join("$"); let mut columns = vec![ "id".to_string(), @@ -517,9 +516,9 @@ impl Sql { Argument::String(entity_id.to_string()), ]; - if let Some(idx) = index { - columns.push("idx".to_string()); - arguments.push(Argument::Int(idx)); + for (column_idx, idx) in indexes.iter().enumerate() { + columns.push(format!("idx_{}", column_idx)); + arguments.push(Argument::Int(*idx)); } for member in members.iter() { @@ -552,7 +551,7 @@ impl Sql { match entity { Ty::Struct(s) => { - update_members(&s.children, &mut self.query_queue, index); + update_members(&s.children, &mut self.query_queue, indexes); for member in s.children.iter() { let mut path_clone = path.clone(); @@ -563,7 +562,7 @@ impl Sql { (entity_id, is_event_message), &member.ty, block_timestamp, - index, + indexes, ); } } @@ -584,7 +583,7 @@ impl Sql { Member { name: option.name.clone(), ty: option.ty.clone(), key: false }, ], &mut self.query_queue, - index, + indexes, ); match &option.ty { @@ -599,7 +598,7 @@ impl Sql { (entity_id, is_event_message), &option.ty, block_timestamp, - index, + indexes, ); } } @@ -616,7 +615,7 @@ impl Sql { .collect::>() .as_slice(), &mut self.query_queue, - index, + indexes, ); for (idx, member) in t.iter().enumerate() { @@ -628,25 +627,34 @@ impl Sql { (entity_id, is_event_message), member, block_timestamp, - index, + indexes, ); } } Ty::Array(array) => { - // delete all previous array elements - self.query_queue.enqueue( - format!( - "DELETE FROM [{table_id}] WHERE entity_id = ?", - table_id = path.join("$") - ), - vec![Argument::String(entity_id.to_string())], - ); + // delete all previous array elements with the array indexes + let table_id = path.join("$"); + let mut query = + format!("DELETE FROM [{table_id}] WHERE entity_id = ? ", table_id = table_id); + for idx in 0..indexes.len() { + query.push_str(&format!("AND idx_{} = ? ", idx)); + } + + // flatten indexes with entity id + let mut arguments = vec![Argument::String(entity_id.to_string())]; + arguments.extend(indexes.iter().map(|idx| Argument::Int(*idx))); + self.query_queue.enqueue(query, arguments); + + // insert the new array elements for (idx, member) in array.iter().enumerate() { + let mut indexes = indexes.clone(); + indexes.push(idx as i64); + update_members( &[Member { name: "data".to_string(), ty: member.clone(), key: false }], &mut self.query_queue, - Some(idx as i64), + &indexes, ); let mut path_clone = path.clone(); @@ -657,7 +665,7 @@ impl Sql { (entity_id, is_event_message), member, block_timestamp, - Some(idx as i64), + &indexes, ); } } @@ -704,8 +712,8 @@ impl Sql { model: &Ty, model_idx: i64, block_timestamp: u64, - is_array: bool, - is_parent_array: bool, + array_idx: usize, + parent_array_idx: usize, ) { let table_id = path.join("$"); let mut indices = Vec::new(); @@ -715,8 +723,10 @@ impl Sql { entity_id TEXT, event_message_id TEXT, " ); - if is_array { - create_table_query.push_str("idx INTEGER NOT NULL, "); + if array_idx > 0 { + for i in 0..array_idx { + create_table_query.push_str(&format!("idx_{i} INTEGER NOT NULL, ", i = i)); + } } let mut build_member = |name: &str, ty: &Ty, options: &mut Option| { @@ -907,24 +917,26 @@ impl Sql { if path.len() > 1 { let parent_table_id = path[..path.len() - 1].join("$"); - if is_parent_array && path.len() > 2 { - create_table_query.push_str(&format!( - "FOREIGN KEY (id, idx) REFERENCES {parent_table_id} (id, idx) ON DELETE \ - CASCADE, " - )); - } else { - create_table_query.push_str(&format!( - "FOREIGN KEY (id) REFERENCES {parent_table_id} (id), ", - parent_table_id = parent_table_id - )); + create_table_query.push_str("FOREIGN KEY (id"); + for i in 0..parent_array_idx { + create_table_query.push_str(&format!(", idx_{i}", i = i)); } + create_table_query.push_str(&format!( + ") REFERENCES {parent_table_id} (id", + parent_table_id = parent_table_id + )); + for i in 0..parent_array_idx { + create_table_query.push_str(&format!(", idx_{i}", i = i)); + } + create_table_query.push_str(") ON DELETE CASCADE, "); }; - if is_array { - create_table_query.push_str("PRIMARY KEY (id, idx), "); - } else { - create_table_query.push_str("PRIMARY KEY (id), "); + create_table_query.push_str("PRIMARY KEY (id"); + for i in 0..array_idx { + create_table_query.push_str(&format!(", idx_{i}", i = i)); } + create_table_query.push_str("), "); + create_table_query.push_str("FOREIGN KEY (entity_id) REFERENCES entities(id), "); // create_table_query.push_str("FOREIGN KEY (event_id) REFERENCES events(id), "); create_table_query diff --git a/crates/torii/graphql/src/object/entity.rs b/crates/torii/graphql/src/object/entity.rs index c098f7b4d4..281f6bb356 100644 --- a/crates/torii/graphql/src/object/entity.rs +++ b/crates/torii/graphql/src/object/entity.rs @@ -143,8 +143,9 @@ fn model_union_field() -> Field { &mut conn, vec![name.clone()], &entity_id, - None, + &[], &type_mapping, + false, ) .await? { @@ -169,15 +170,16 @@ pub async fn model_data_recursive_query( conn: &mut PoolConnection, path_array: Vec, entity_id: &str, - idx: Option, + indexes: &[i64], type_mapping: &TypeMapping, + is_list: bool, ) -> sqlx::Result { // For nested types, we need to remove prefix in path array let namespace = format!("{}_", path_array[0]); let table_name = &path_array.join("$").replace(&namespace, ""); let mut query = format!("SELECT * FROM {} WHERE entity_id = '{}' ", table_name, entity_id); - if let Some(idx) = idx { - query.push_str(&format!("AND idx = {}", idx)); + for (column_idx, index) in indexes.iter().enumerate() { + query.push_str(&format!("AND idx_{} = {} ", column_idx, index)); } let rows = sqlx::query(&query).fetch_all(conn.as_mut()).await?; @@ -200,8 +202,15 @@ pub async fn model_data_recursive_query( conn, nested_path, entity_id, - if rows.len() > 1 { Some(idx as i64) } else { None }, + &if is_list { + let mut indexes = indexes.to_vec(); + indexes.push(idx as i64); + indexes + } else { + indexes.to_vec() + }, nested_mapping, + false, ) .await?; @@ -215,8 +224,15 @@ pub async fn model_data_recursive_query( nested_path, entity_id, // this might need to be changed to support 2d+ arrays - None, + &if is_list { + let mut indexes = indexes.to_vec(); + indexes.push(idx as i64); + indexes + } else { + indexes.to_vec() + }, &IndexMap::from([(Name::new("data"), *inner.clone())]), + true, ) .await? { @@ -226,10 +242,19 @@ pub async fn model_data_recursive_query( .iter() .map(|v| match v { Value::Object(map) => map.get(&Name::new("data")).unwrap().clone(), - _ => unreachable!(), + _ => unreachable!( + "Expected Value::Object for list \"data\" field, got {:?}", + v + ), }) .collect(), - _ => unreachable!(), + Value::Object(map) => map.get(&Name::new("data")).unwrap().clone(), + ty => { + unreachable!( + "Expected Value::List or Value::Object for list, got {:?}", + ty + ); + } }; nested_value_mapping.insert(Name::new(field_name), data); @@ -239,7 +264,7 @@ pub async fn model_data_recursive_query( nested_value_mappings.push(Value::Object(nested_value_mapping)); } - if nested_value_mappings.len() > 1 { + if is_list { value_mapping = Value::List(nested_value_mappings); } else { value_mapping = nested_value_mappings.pop().unwrap(); diff --git a/crates/torii/graphql/src/object/model_data.rs b/crates/torii/graphql/src/object/model_data.rs index 2f05d6e592..4b221f9146 100644 --- a/crates/torii/graphql/src/object/model_data.rs +++ b/crates/torii/graphql/src/object/model_data.rs @@ -1,5 +1,3 @@ -use std::ops::Deref; - use async_graphql::dynamic::{Enum, Field, FieldFuture, InputObject, Object, TypeRef}; use async_graphql::Value; use chrono::{DateTime, Utc}; @@ -67,9 +65,8 @@ impl BasicObject for ModelDataObject { fn objects(&self) -> Vec { let mut objects = data_objects_recursion( - self.type_name(), - self.type_mapping(), - vec![self.type_name().to_string()], + &TypeData::Nested((TypeRef::named(self.type_name()), self.type_mapping.clone())), + &vec![self.type_name().to_string()], ); // root object requires entity_field association @@ -142,71 +139,28 @@ impl ResolvableObject for ModelDataObject { } } -// fn data_objects_recursion(type_data: &TypeData, path_array: Vec) -> Vec { -// let mut objects: Vec = vec![]; -// match type_data { -// TypeData::Nested((nested_type, nested_mapping)) => { -// let mut nested_path = path_array.clone(); -// nested_path.push(nested_type.to_string()); -// let nested_objects = nested_mapping.iter().flat_map(|(field_name, type_data)| { -// let mut nested_path = nested_path.clone(); -// nested_path.push(field_name.to_string()); -// data_objects_recursion(type_data, nested_path) -// }); - -// objects.extend(nested_objects); -// objects.push(object(&nested_type.to_string(), nested_mapping, path_array)); -// } -// TypeData::List(inner) => { -// let mut nested_path = path_array.clone(); -// nested_path.push(inner.type_ref().to_string()); -// let nested_objects = data_objects_recursion(inner, nested_path); - -// objects.extend(nested_objects); -// } -// _ => {} -// } - -// objects -// } - -fn data_objects_recursion( - type_name: &str, - type_mapping: &TypeMapping, - path_array: Vec, -) -> Vec { - let mut objects: Vec = type_mapping - .iter() - .filter_map(|(field_name, type_data)| { - if let TypeData::Nested((nested_type, nested_mapping)) = type_data { +fn data_objects_recursion(type_data: &TypeData, path_array: &Vec) -> Vec { + let mut objects: Vec = vec![]; + + match type_data { + TypeData::Nested((nested_type, nested_mapping)) => { + let nested_objects = nested_mapping.iter().flat_map(|(field_name, type_data)| { let mut nested_path = path_array.clone(); nested_path.push(field_name.to_string()); - let nested_objects = - data_objects_recursion(&nested_type.to_string(), nested_mapping, nested_path); - - Some(nested_objects) - } else if let TypeData::List(inner) = type_data { - if let TypeData::Nested((nested_type, nested_mapping)) = inner.deref() { - let mut nested_path = path_array.clone(); - nested_path.push(inner.type_ref().to_string()); - let nested_objects = data_objects_recursion( - &nested_type.to_string(), - nested_mapping, - nested_path, - ); - - return Some(nested_objects); - } + data_objects_recursion(type_data, &nested_path) + }); - None - } else { - None - } - }) - .flatten() - .collect(); + objects.extend(nested_objects); + objects.push(object(&nested_type.to_string(), nested_mapping, path_array.clone())); + } + TypeData::List(inner) => { + let nested_objects = data_objects_recursion(inner, path_array); + + objects.extend(nested_objects); + } + _ => {} + } - objects.push(object(type_name, type_mapping, path_array)); objects } diff --git a/crates/torii/graphql/src/query/mod.rs b/crates/torii/graphql/src/query/mod.rs index b2f8f8a005..8a3f2f8a73 100644 --- a/crates/torii/graphql/src/query/mod.rs +++ b/crates/torii/graphql/src/query/mod.rs @@ -114,8 +114,9 @@ fn parse_nested_type(member: &ModelMember, nested_members: &[&ModelMember]) -> T && nested_member .id .split('$') + .take(nested_member.id.split('$').count() - 1) .collect::>() - .starts_with(&member.id.split('$').collect::>()) + .eq(&member.id.split('$').collect::>()) { // if the nested member is an Enum and the member is an Enum, we need to inject the // Enum type in order to have a "option" field in the nested Enum From d14bc1ca323cec101af09c3e4e804165d01047f9 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Wed, 29 May 2024 18:57:29 +0530 Subject: [PATCH 04/88] feat(sozo): in build stats add bytecode and class size of casm class (#2004) * feat(sozo): in build stats add bytecode and class size of casm class * skip non-dojo build files * sort by contract_name * fix lints * clean up types * consider file size of minified json not pretty printed json * make table compact * add message before table for context --- Cargo.lock | 1 + bin/sozo/src/commands/build.rs | 92 ++++++++++++++----- crates/sozo/ops/Cargo.toml | 1 + crates/sozo/ops/src/statistics.rs | 146 +++++++++++++++++++++--------- 4 files changed, 173 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 094618803f..c06643dc96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12052,6 +12052,7 @@ dependencies = [ "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "cairo-lang-test-plugin", "cairo-lang-test-runner", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index 06e7967ccc..d8112bb51f 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -9,6 +9,11 @@ use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; use sozo_ops::statistics::{get_contract_statistics_for_dir, ContractStatistics}; use tracing::trace; +const BYTECODE_SIZE_LABEL: &str = "Bytecode size [in felts]\n(Sierra, Casm)"; +const CONTRACT_CLASS_SIZE_LABEL: &str = "Contract Class size [in bytes]\n(Sierra, Casm)"; + +const CONTRACT_NAME_LABEL: &str = "Contract"; + #[derive(Debug, Args)] pub struct BuildArgs { #[arg(long)] @@ -61,7 +66,7 @@ impl BuildArgs { if self.stats { let target_dir = &compile_info.target_dir; - let contracts_statistics = get_contract_statistics_for_dir(target_dir) + let contracts_statistics = get_contract_statistics_for_dir(config.ui(), target_dir) .context("Error getting contracts stats")?; trace!( ?contracts_statistics, @@ -69,6 +74,22 @@ impl BuildArgs { "Read contract statistics for target directory." ); + let ui = config.ui(); + + ui.print( + "Bytecode: It is low-level code that constitutes smart contracts and is \ + represented by an array of felts.", + ); + ui.print("Bytecode size: It is number of felts in Bytecode."); + ui.print( + "Contract Class: It serve as the fundamental building blocks of smart contracts.", + ); + ui.print( + "Contract Class size: It denotes the file size of the minified JSON \ + representation of the contract class.", + ); + ui.print(" "); + let table = create_stats_table(contracts_statistics); table.printstd() } @@ -95,26 +116,40 @@ impl BuildArgs { } } -fn create_stats_table(contracts_statistics: Vec) -> Table { +fn create_stats_table(mut contracts_statistics: Vec) -> Table { let mut table = Table::new(); table.set_format(*FORMAT_NO_LINESEP_WITH_TITLE); // Add table headers table.set_titles(Row::new(vec![ - Cell::new_align("Contract", format::Alignment::CENTER), - Cell::new_align("Bytecode size (felts)", format::Alignment::CENTER), - Cell::new_align("Class size (bytes)", format::Alignment::CENTER), + Cell::new_align(CONTRACT_NAME_LABEL, format::Alignment::CENTER), + Cell::new_align(BYTECODE_SIZE_LABEL, format::Alignment::CENTER), + Cell::new_align(CONTRACT_CLASS_SIZE_LABEL, format::Alignment::CENTER), ])); + // sort contracts in alphabetical order + contracts_statistics.sort_by(|a, b| a.contract_name.cmp(&b.contract_name)); + for contract_stats in contracts_statistics { // Add table rows let contract_name = contract_stats.contract_name; - let number_felts = contract_stats.number_felts; - let file_size = contract_stats.file_size; + + let sierra_bytecode_size = contract_stats.sierra_bytecode_size; + let sierra_contract_class_size = contract_stats.sierra_contract_class_size; + + let casm_bytecode_size = contract_stats.casm_bytecode_size; + let casm_contract_class_size = contract_stats.casm_contract_class_size; + table.add_row(Row::new(vec![ Cell::new_align(&contract_name, format::Alignment::LEFT), - Cell::new_align(format!("{}", number_felts).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", file_size).as_str(), format::Alignment::RIGHT), + Cell::new_align( + format!("{}, {}", sierra_bytecode_size, casm_bytecode_size).as_str(), + format::Alignment::CENTER, + ), + Cell::new_align( + format!("{}, {}", sierra_contract_class_size, casm_contract_class_size).as_str(), + format::Alignment::CENTER, + ), ])); } @@ -129,7 +164,8 @@ mod tests { use prettytable::{format, Cell, Row, Table}; use sozo_ops::statistics::ContractStatistics; - use super::{create_stats_table, BuildArgs}; + use super::{create_stats_table, BuildArgs, *}; + use crate::commands::build::CONTRACT_NAME_LABEL; // Uncomment once bindings support arrays. #[test] @@ -156,42 +192,48 @@ mod tests { let contracts_statistics = vec![ ContractStatistics { contract_name: "Test1".to_string(), - number_felts: 33, - file_size: 33, + sierra_bytecode_size: 33, + sierra_contract_class_size: 33, + casm_bytecode_size: 66, + casm_contract_class_size: 66, }, ContractStatistics { contract_name: "Test2".to_string(), - number_felts: 43, - file_size: 24, + sierra_bytecode_size: 43, + sierra_contract_class_size: 24, + casm_bytecode_size: 86, + casm_contract_class_size: 48, }, ContractStatistics { contract_name: "Test3".to_string(), - number_felts: 36, - file_size: 12, + sierra_bytecode_size: 36, + sierra_contract_class_size: 12, + casm_bytecode_size: 72, + casm_contract_class_size: 24, }, ]; let mut expected_table = Table::new(); expected_table.set_format(*FORMAT_NO_LINESEP_WITH_TITLE); expected_table.set_titles(Row::new(vec![ - Cell::new_align("Contract", format::Alignment::CENTER), - Cell::new_align("Bytecode size (felts)", format::Alignment::CENTER), - Cell::new_align("Class size (bytes)", format::Alignment::CENTER), + Cell::new_align(CONTRACT_NAME_LABEL, format::Alignment::CENTER), + Cell::new_align(BYTECODE_SIZE_LABEL, format::Alignment::CENTER), + Cell::new_align(CONTRACT_CLASS_SIZE_LABEL, format::Alignment::CENTER), ])); expected_table.add_row(Row::new(vec![ Cell::new_align("Test1", format::Alignment::LEFT), - Cell::new_align(format!("{}", 33).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", 33).as_str(), format::Alignment::RIGHT), + Cell::new_align(format!("{}, {}", 33, 66).as_str(), format::Alignment::CENTER), + Cell::new_align(format!("{}, {}", 33, 66).as_str(), format::Alignment::CENTER), ])); expected_table.add_row(Row::new(vec![ Cell::new_align("Test2", format::Alignment::LEFT), - Cell::new_align(format!("{}", 43).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", 24).as_str(), format::Alignment::RIGHT), + Cell::new_align(format!("{}, {}", 43, 86).as_str(), format::Alignment::CENTER), + Cell::new_align(format!("{}, {}", 24, 48).as_str(), format::Alignment::CENTER), ])); expected_table.add_row(Row::new(vec![ Cell::new_align("Test3", format::Alignment::LEFT), - Cell::new_align(format!("{}", 36).as_str(), format::Alignment::RIGHT), - Cell::new_align(format!("{}", 12).as_str(), format::Alignment::RIGHT), + Cell::new_align(format!("{}, {}", 36, 72).as_str(), format::Alignment::CENTER), + Cell::new_align(format!("{}, {}", 12, 24).as_str(), format::Alignment::CENTER), ])); // Act diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index 78c10e0dd5..e4eded4705 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -16,6 +16,7 @@ cairo-lang-plugins.workspace = true cairo-lang-project.workspace = true cairo-lang-sierra-to-casm.workspace = true cairo-lang-sierra.workspace = true +cairo-lang-starknet-classes.workspace = true cairo-lang-starknet.workspace = true cairo-lang-test-plugin.workspace = true cairo-lang-test-runner.workspace = true diff --git a/crates/sozo/ops/src/statistics.rs b/crates/sozo/ops/src/statistics.rs index 81b77a15b7..b02a0dcbf8 100644 --- a/crates/sozo/ops/src/statistics.rs +++ b/crates/sozo/ops/src/statistics.rs @@ -1,45 +1,70 @@ use std::fs::{self, File}; -use std::io::{self, BufReader}; +use std::io::BufReader; use std::path::PathBuf; use anyhow::{Context, Result}; +use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; +use cairo_lang_starknet_classes::contract_class::ContractClass; use camino::Utf8PathBuf; -use starknet::core::types::contract::SierraClass; -use starknet::core::types::FlattenedSierraClass; +use scarb_ui::Ui; +use serde::Serialize; #[derive(Debug, PartialEq)] pub struct ContractStatistics { pub contract_name: String, - pub number_felts: u64, - pub file_size: u64, + + pub sierra_bytecode_size: u64, + pub sierra_contract_class_size: u64, + + pub casm_bytecode_size: u64, + pub casm_contract_class_size: u64, } -fn read_sierra_json_program(file: &File) -> Result { - let contract_artifact: SierraClass = serde_json::from_reader(BufReader::new(file))?; - let contract_artifact: FlattenedSierraClass = contract_artifact.flatten()?; +fn get_sierra_and_casm_class_from_file(file: &File) -> Result<(ContractClass, CasmContractClass)> { + let sierra_contract_class: ContractClass = serde_json::from_reader(BufReader::new(file))?; + let casm_contract_class: CasmContractClass = + CasmContractClass::from_contract_class(sierra_contract_class.clone(), false, usize::MAX)?; - Ok(contract_artifact) + Ok((sierra_contract_class, casm_contract_class)) } -fn get_sierra_byte_code_size(contract_artifact: FlattenedSierraClass) -> u64 { +fn get_sierra_byte_code_size(contract_artifact: ContractClass) -> u64 { contract_artifact.sierra_program.len() as u64 } -fn get_file_size(file: &File) -> Result { - file.metadata().map(|metadata| metadata.len()) +fn get_casm_byte_code_size(contract_artifact: CasmContractClass) -> u64 { + contract_artifact.bytecode.len() as u64 +} + +fn get_file_size_from_struct(t: &T) -> u64 +where + T: Serialize, +{ + serde_json::to_string(t).context("should be valid json").unwrap().len().try_into().unwrap() } fn get_contract_statistics_for_file( contract_name: String, - sierra_json_file: File, - contract_artifact: FlattenedSierraClass, + sierra_class: ContractClass, + casm_class: CasmContractClass, ) -> Result { - let file_size = get_file_size(&sierra_json_file).context("Error getting file size")?; - let number_felts = get_sierra_byte_code_size(contract_artifact); - Ok(ContractStatistics { file_size, contract_name, number_felts }) + let sierra_contract_class_size = get_file_size_from_struct(&sierra_class); + let sierra_bytecode_size = get_sierra_byte_code_size(sierra_class); + + let casm_contract_class_size = get_file_size_from_struct(&casm_class); + let casm_bytecode_size = get_casm_byte_code_size(casm_class); + + Ok(ContractStatistics { + contract_name, + sierra_bytecode_size, + sierra_contract_class_size, + casm_bytecode_size, + casm_contract_class_size, + }) } pub fn get_contract_statistics_for_dir( + ui: Ui, target_directory: &Utf8PathBuf, ) -> Result> { let mut contract_statistics = Vec::new(); @@ -55,19 +80,31 @@ pub fn get_contract_statistics_for_dir( let contract_name: String = path.file_stem().context("Error getting file name")?.to_string_lossy().to_string(); + // To ignore files like `contract.contract_class.json` or + // `contract.compiled_contract_class.json` + if contract_name.contains('.') { + continue; + } + let sierra_json_file: File = File::open(&path).context(format!("Error opening file: {}", path.to_string_lossy()))?; - let contract_artifact: FlattenedSierraClass = read_sierra_json_program(&sierra_json_file) - .context(format!( - "Error parsing Sierra class artifact: {}", - path.to_string_lossy() - ))?; + let (sierra_class, casm_class) = + match get_sierra_and_casm_class_from_file(&sierra_json_file) { + Ok(s) => s, + Err(e) => { + ui.verbose(format!("Unable to process file: {:?}\nWith error: {e:?}", &path)); + // skip any file which cannot be processed properly since there can be other + // file types in target folder for example casm contract + // class. + continue; + } + }; contract_statistics.push(get_contract_statistics_for_file( contract_name, - sierra_json_file, - contract_artifact, + sierra_class, + casm_class, )?); } Ok(contract_statistics) @@ -76,14 +113,18 @@ pub fn get_contract_statistics_for_dir( #[cfg(test)] mod tests { use std::fs::File; + use std::io::BufReader; use std::path::Path; + use cairo_lang_starknet_classes::contract_class::ContractClass; use camino::Utf8PathBuf; + use scarb_ui::Ui; use super::{ - get_contract_statistics_for_dir, get_contract_statistics_for_file, get_file_size, - get_sierra_byte_code_size, read_sierra_json_program, ContractStatistics, + get_contract_statistics_for_dir, get_contract_statistics_for_file, + get_sierra_and_casm_class_from_file, get_sierra_byte_code_size, ContractStatistics, }; + use crate::statistics::get_casm_byte_code_size; const TEST_SIERRA_JSON_CONTRACT: &str = "../../../bin/sozo/tests/test_data/compiled_contracts/test_contract.json"; @@ -94,16 +135,27 @@ mod tests { fn get_sierra_byte_code_size_returns_correct_size() { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open file: {}", err)); - let flattened_sierra_class = read_sierra_json_program(&sierra_json_file) - .unwrap_or_else(|err| panic!("Failed to read JSON program: {}", err)); - const EXPECTED_NUMBER_OF_FELTS: u64 = 2175; + let (flattened_sierra_class, casm_class) = + get_sierra_and_casm_class_from_file(&sierra_json_file) + .unwrap_or_else(|err| panic!("Failed to read JSON program: {}", err)); + + const SIERRA_EXPECTED_NUMBER_OF_FELTS: u64 = 2175; - let number_of_felts = get_sierra_byte_code_size(flattened_sierra_class); + let sierra_bytecode_size = get_sierra_byte_code_size(flattened_sierra_class); + let casm_bytecode_size = get_casm_byte_code_size(casm_class); + + const CASM_EXPECTED_NUMBER_OF_FELTS: u64 = 4412; + + assert_eq!( + sierra_bytecode_size, SIERRA_EXPECTED_NUMBER_OF_FELTS, + "[Sierra] Number of felts mismatch. Expected {}, got {}", + SIERRA_EXPECTED_NUMBER_OF_FELTS, sierra_bytecode_size + ); assert_eq!( - number_of_felts, EXPECTED_NUMBER_OF_FELTS, - "Number of felts mismatch. Expected {}, got {}", - EXPECTED_NUMBER_OF_FELTS, number_of_felts + casm_bytecode_size, CASM_EXPECTED_NUMBER_OF_FELTS, + "[Casm] Number of felts mismatch. Expected {}, got {}", + CASM_EXPECTED_NUMBER_OF_FELTS, casm_bytecode_size ); } @@ -111,21 +163,27 @@ mod tests { fn get_contract_statistics_for_file_returns_correct_statistics() { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open file: {}", err)); - let contract_artifact = read_sierra_json_program(&sierra_json_file) + + let (sierra_class, casm_class) = get_sierra_and_casm_class_from_file(&sierra_json_file) .unwrap_or_else(|err| panic!("Failed to read JSON program: {}", err)); + let filename = Path::new(TEST_SIERRA_JSON_CONTRACT) .file_stem() .expect("Error getting file name") .to_string_lossy() .to_string(); + let expected_contract_statistics: ContractStatistics = ContractStatistics { contract_name: String::from("test_contract"), - number_felts: 2175, - file_size: 114925, + sierra_bytecode_size: 2175, + sierra_contract_class_size: 106559, + + casm_bytecode_size: 4412, + casm_contract_class_size: 95806, }; let statistics = - get_contract_statistics_for_file(filename.clone(), sierra_json_file, contract_artifact) + get_contract_statistics_for_file(filename.clone(), sierra_class, casm_class) .expect("Error getting contract statistics for file"); assert_eq!(statistics, expected_contract_statistics); @@ -134,8 +192,9 @@ mod tests { #[test] fn get_contract_statistics_for_dir_returns_correct_statistics() { let target_dir = Utf8PathBuf::from(TEST_SIERRA_FOLDER_CONTRACTS); + let ui = Ui::new(scarb_ui::Verbosity::Normal, scarb_ui::OutputFormat::Text); - let contract_statistics = get_contract_statistics_for_dir(&target_dir) + let contract_statistics = get_contract_statistics_for_dir(ui, &target_dir) .unwrap_or_else(|_| panic!("Error getting contracts in dir {target_dir}")); assert_eq!(contract_statistics.len(), 1, "Mismatch number of contract statistics"); @@ -145,10 +204,13 @@ mod tests { fn get_file_size_returns_correct_size() { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open test file: {}", err)); - const EXPECTED_SIZE: u64 = 114925; + // file size of minified json + const EXPECTED_SIZE: u64 = 106559; - let file_size = get_file_size(&sierra_json_file) - .unwrap_or_else(|_| panic!("Error getting file size for test file")); + let sierra_contract_class: ContractClass = + serde_json::from_reader(BufReader::new(sierra_json_file)).unwrap(); + let file_size: u64 = + serde_json::to_string(&sierra_contract_class).unwrap().len().try_into().unwrap(); assert_eq!(file_size, EXPECTED_SIZE, "File size mismatch"); } @@ -159,7 +221,7 @@ mod tests { let sierra_json_file = File::open(TEST_SIERRA_JSON_CONTRACT) .unwrap_or_else(|err| panic!("Failed to open test file: {}", err)); - let result = read_sierra_json_program(&sierra_json_file); + let result = get_sierra_and_casm_class_from_file(&sierra_json_file); assert!(result.is_ok(), "Expected Ok result"); } From 8cfb0ba6d1398c5f77a5ea2fb07a8cd06489f874 Mon Sep 17 00:00:00 2001 From: notV4l <122404722+notV4l@users.noreply.github.com> Date: Wed, 29 May 2024 16:31:22 +0200 Subject: [PATCH 05/88] [dojo-core] use const array for pow2 (#1878) * use const array for pow2 * fix: fix world address and tests * fix: run scarb fmt * fix: add tx waiter to avoid test race condition --------- Co-authored-by: glihm --- crates/dojo-core/.tool-versions | 1 - crates/dojo-core/src/packing.cairo | 269 +++++++++++++++++- crates/dojo-core/src/packing_test.cairo | 15 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- crates/dojo-world/src/metadata_test.rs | 2 +- crates/katana/rpc/rpc/tests/torii.rs | 5 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- examples/spawn-and-move/Scarb.toml | 2 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- .../manifests/dev/manifest.json | 12 +- .../manifests/dev/manifest.toml | 12 +- 11 files changed, 305 insertions(+), 25 deletions(-) delete mode 100644 crates/dojo-core/.tool-versions diff --git a/crates/dojo-core/.tool-versions b/crates/dojo-core/.tool-versions deleted file mode 100644 index 21cfc80772..0000000000 --- a/crates/dojo-core/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -scarb 2.4.0 diff --git a/crates/dojo-core/src/packing.cairo b/crates/dojo-core/src/packing.cairo index 759700428b..22676d53ed 100644 --- a/crates/dojo-core/src/packing.cairo +++ b/crates/dojo-core/src/packing.cairo @@ -156,9 +156,274 @@ fn fpow(x: u256, n: u8) -> u256 { } fn shl(x: u256, n: u8) -> u256 { - x * fpow(2, n) + x * pow2_const(n) } fn shr(x: u256, n: u8) -> u256 { - x / fpow(2, n) + x / pow2_const(n) } + +fn pow2_const(n: u8) -> u256 { + *POW_2.span().at(n.into()) +} + +const POW_2: [ + u256 + ; 256] = [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256, + 512, + 1024, + 2048, + 4096, + 8192, + 16384, + 32768, + 65536, + 131072, + 262144, + 524288, + 1048576, + 2097152, + 4194304, + 8388608, + 16777216, + 33554432, + 67108864, + 134217728, + 268435456, + 536870912, + 1073741824, + 2147483648, + 4294967296, + 8589934592, + 17179869184, + 34359738368, + 68719476736, + 137438953472, + 274877906944, + 549755813888, + 1099511627776, + 2199023255552, + 4398046511104, + 8796093022208, + 17592186044416, + 35184372088832, + 70368744177664, + 140737488355328, + 281474976710656, + 562949953421312, + 1125899906842624, + 2251799813685248, + 4503599627370496, + 9007199254740992, + 18014398509481984, + 36028797018963968, + 72057594037927936, + 144115188075855872, + 288230376151711744, + 576460752303423488, + 1152921504606846976, + 2305843009213693952, + 4611686018427387904, + 9223372036854775808, + 18446744073709551616, + 36893488147419103232, + 73786976294838206464, + 147573952589676412928, + 295147905179352825856, + 590295810358705651712, + 1180591620717411303424, + 2361183241434822606848, + 4722366482869645213696, + 9444732965739290427392, + 18889465931478580854784, + 37778931862957161709568, + 75557863725914323419136, + 151115727451828646838272, + 302231454903657293676544, + 604462909807314587353088, + 1208925819614629174706176, + 2417851639229258349412352, + 4835703278458516698824704, + 9671406556917033397649408, + 19342813113834066795298816, + 38685626227668133590597632, + 77371252455336267181195264, + 154742504910672534362390528, + 309485009821345068724781056, + 618970019642690137449562112, + 1237940039285380274899124224, + 2475880078570760549798248448, + 4951760157141521099596496896, + 9903520314283042199192993792, + 19807040628566084398385987584, + 39614081257132168796771975168, + 79228162514264337593543950336, + 158456325028528675187087900672, + 316912650057057350374175801344, + 633825300114114700748351602688, + 1267650600228229401496703205376, + 2535301200456458802993406410752, + 5070602400912917605986812821504, + 10141204801825835211973625643008, + 20282409603651670423947251286016, + 40564819207303340847894502572032, + 81129638414606681695789005144064, + 162259276829213363391578010288128, + 324518553658426726783156020576256, + 649037107316853453566312041152512, + 1298074214633706907132624082305024, + 2596148429267413814265248164610048, + 5192296858534827628530496329220096, + 10384593717069655257060992658440192, + 20769187434139310514121985316880384, + 41538374868278621028243970633760768, + 83076749736557242056487941267521536, + 166153499473114484112975882535043072, + 332306998946228968225951765070086144, + 664613997892457936451903530140172288, + 1329227995784915872903807060280344576, + 2658455991569831745807614120560689152, + 5316911983139663491615228241121378304, + 10633823966279326983230456482242756608, + 21267647932558653966460912964485513216, + 42535295865117307932921825928971026432, + 85070591730234615865843651857942052864, + 170141183460469231731687303715884105728, + 340282366920938463463374607431768211456, + 680564733841876926926749214863536422912, + 1361129467683753853853498429727072845824, + 2722258935367507707706996859454145691648, + 5444517870735015415413993718908291383296, + 10889035741470030830827987437816582766592, + 21778071482940061661655974875633165533184, + 43556142965880123323311949751266331066368, + 87112285931760246646623899502532662132736, + 174224571863520493293247799005065324265472, + 348449143727040986586495598010130648530944, + 696898287454081973172991196020261297061888, + 1393796574908163946345982392040522594123776, + 2787593149816327892691964784081045188247552, + 5575186299632655785383929568162090376495104, + 11150372599265311570767859136324180752990208, + 22300745198530623141535718272648361505980416, + 44601490397061246283071436545296723011960832, + 89202980794122492566142873090593446023921664, + 178405961588244985132285746181186892047843328, + 356811923176489970264571492362373784095686656, + 713623846352979940529142984724747568191373312, + 1427247692705959881058285969449495136382746624, + 2854495385411919762116571938898990272765493248, + 5708990770823839524233143877797980545530986496, + 11417981541647679048466287755595961091061972992, + 22835963083295358096932575511191922182123945984, + 45671926166590716193865151022383844364247891968, + 91343852333181432387730302044767688728495783936, + 182687704666362864775460604089535377456991567872, + 365375409332725729550921208179070754913983135744, + 730750818665451459101842416358141509827966271488, + 1461501637330902918203684832716283019655932542976, + 2923003274661805836407369665432566039311865085952, + 5846006549323611672814739330865132078623730171904, + 11692013098647223345629478661730264157247460343808, + 23384026197294446691258957323460528314494920687616, + 46768052394588893382517914646921056628989841375232, + 93536104789177786765035829293842113257979682750464, + 187072209578355573530071658587684226515959365500928, + 374144419156711147060143317175368453031918731001856, + 748288838313422294120286634350736906063837462003712, + 1496577676626844588240573268701473812127674924007424, + 2993155353253689176481146537402947624255349848014848, + 5986310706507378352962293074805895248510699696029696, + 11972621413014756705924586149611790497021399392059392, + 23945242826029513411849172299223580994042798784118784, + 47890485652059026823698344598447161988085597568237568, + 95780971304118053647396689196894323976171195136475136, + 191561942608236107294793378393788647952342390272950272, + 383123885216472214589586756787577295904684780545900544, + 766247770432944429179173513575154591809369561091801088, + 1532495540865888858358347027150309183618739122183602176, + 3064991081731777716716694054300618367237478244367204352, + 6129982163463555433433388108601236734474956488734408704, + 12259964326927110866866776217202473468949912977468817408, + 24519928653854221733733552434404946937899825954937634816, + 49039857307708443467467104868809893875799651909875269632, + 98079714615416886934934209737619787751599303819750539264, + 196159429230833773869868419475239575503198607639501078528, + 392318858461667547739736838950479151006397215279002157056, + 784637716923335095479473677900958302012794430558004314112, + 1569275433846670190958947355801916604025588861116008628224, + 3138550867693340381917894711603833208051177722232017256448, + 6277101735386680763835789423207666416102355444464034512896, + 12554203470773361527671578846415332832204710888928069025792, + 25108406941546723055343157692830665664409421777856138051584, + 50216813883093446110686315385661331328818843555712276103168, + 100433627766186892221372630771322662657637687111424552206336, + 200867255532373784442745261542645325315275374222849104412672, + 401734511064747568885490523085290650630550748445698208825344, + 803469022129495137770981046170581301261101496891396417650688, + 1606938044258990275541962092341162602522202993782792835301376, + 3213876088517980551083924184682325205044405987565585670602752, + 6427752177035961102167848369364650410088811975131171341205504, + 12855504354071922204335696738729300820177623950262342682411008, + 25711008708143844408671393477458601640355247900524685364822016, + 51422017416287688817342786954917203280710495801049370729644032, + 102844034832575377634685573909834406561420991602098741459288064, + 205688069665150755269371147819668813122841983204197482918576128, + 411376139330301510538742295639337626245683966408394965837152256, + 822752278660603021077484591278675252491367932816789931674304512, + 1645504557321206042154969182557350504982735865633579863348609024, + 3291009114642412084309938365114701009965471731267159726697218048, + 6582018229284824168619876730229402019930943462534319453394436096, + 13164036458569648337239753460458804039861886925068638906788872192, + 26328072917139296674479506920917608079723773850137277813577744384, + 52656145834278593348959013841835216159447547700274555627155488768, + 105312291668557186697918027683670432318895095400549111254310977536, + 210624583337114373395836055367340864637790190801098222508621955072, + 421249166674228746791672110734681729275580381602196445017243910144, + 842498333348457493583344221469363458551160763204392890034487820288, + 1684996666696914987166688442938726917102321526408785780068975640576, + 3369993333393829974333376885877453834204643052817571560137951281152, + 6739986666787659948666753771754907668409286105635143120275902562304, + 13479973333575319897333507543509815336818572211270286240551805124608, + 26959946667150639794667015087019630673637144422540572481103610249216, + 53919893334301279589334030174039261347274288845081144962207220498432, + 107839786668602559178668060348078522694548577690162289924414440996864, + 215679573337205118357336120696157045389097155380324579848828881993728, + 431359146674410236714672241392314090778194310760649159697657763987456, + 862718293348820473429344482784628181556388621521298319395315527974912, + 1725436586697640946858688965569256363112777243042596638790631055949824, + 3450873173395281893717377931138512726225554486085193277581262111899648, + 6901746346790563787434755862277025452451108972170386555162524223799296, + 13803492693581127574869511724554050904902217944340773110325048447598592, + 27606985387162255149739023449108101809804435888681546220650096895197184, + 55213970774324510299478046898216203619608871777363092441300193790394368, + 110427941548649020598956093796432407239217743554726184882600387580788736, + 220855883097298041197912187592864814478435487109452369765200775161577472, + 441711766194596082395824375185729628956870974218904739530401550323154944, + 883423532389192164791648750371459257913741948437809479060803100646309888, + 1766847064778384329583297500742918515827483896875618958121606201292619776, + 3533694129556768659166595001485837031654967793751237916243212402585239552, + 7067388259113537318333190002971674063309935587502475832486424805170479104, + 14134776518227074636666380005943348126619871175004951664972849610340958208, + 28269553036454149273332760011886696253239742350009903329945699220681916416, + 56539106072908298546665520023773392506479484700019806659891398441363832832, + 113078212145816597093331040047546785012958969400039613319782796882727665664, + 226156424291633194186662080095093570025917938800079226639565593765455331328, + 452312848583266388373324160190187140051835877600158453279131187530910662656, + 904625697166532776746648320380374280103671755200316906558262375061821325312, + 1809251394333065553493296640760748560207343510400633813116524750123642650624, + 3618502788666131106986593281521497120414687020801267626233049500247285301248, + 7237005577332262213973186563042994240829374041602535252466099000494570602496, + 14474011154664524427946373126085988481658748083205070504932198000989141204992, + 28948022309329048855892746252171976963317496166410141009864396001978282409984, + 57896044618658097711785492504343953926634992332820282019728792003956564819968, +]; diff --git a/crates/dojo-core/src/packing_test.cairo b/crates/dojo-core/src/packing_test.cairo index 49aad1f3e8..58d340aff6 100644 --- a/crates/dojo-core/src/packing_test.cairo +++ b/crates/dojo-core/src/packing_test.cairo @@ -1,6 +1,8 @@ use array::{ArrayTrait, SpanTrait}; use starknet::{ClassHash, ContractAddress, Felt252TryIntoContractAddress, Felt252TryIntoClassHash}; -use dojo::packing::{shl, shr, fpow, pack, unpack, pack_inner, unpack_inner, calculate_packed_size}; +use dojo::packing::{ + shl, shr, fpow, pack, unpack, pack_inner, unpack_inner, calculate_packed_size, pow2_const +}; use integer::U256BitAnd; use option::OptionTrait; use debug::PrintTrait; @@ -18,6 +20,17 @@ fn test_bit_fpow() { ) } + +#[test] +fn test_bit_pow2_const() { + assert( + pow2_const( + 250 + ) == 1809251394333065553493296640760748560207343510400633813116524750123642650624_u256, + '' + ) +} + #[test] #[available_gas(9000000)] fn test_bit_shift() { diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml index 2daf97b5e5..b93ad67681 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" -original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 8da0b1af36..4eded54d96 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -147,7 +147,7 @@ async fn get_full_dojo_metadata_from_workspace() { assert!(env.world_address.is_some()); assert_eq!( env.world_address.unwrap(), - "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6" + "0x05134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369" ); assert!(env.keystore_path.is_none()); diff --git a/crates/katana/rpc/rpc/tests/torii.rs b/crates/katana/rpc/rpc/tests/torii.rs index a1afc99780..64f57da019 100644 --- a/crates/katana/rpc/rpc/tests/torii.rs +++ b/crates/katana/rpc/rpc/tests/torii.rs @@ -3,13 +3,14 @@ use std::sync::Arc; use std::time::Duration; use dojo_test_utils::sequencer::{get_default_test_starknet_config, TestSequencer}; +use dojo_world::utils::TransactionWaiter; use jsonrpsee::http_client::HttpClientBuilder; use katana_core::sequencer::SequencerConfig; use katana_rpc_api::dev::DevApiClient; use katana_rpc_api::starknet::StarknetApiClient; use katana_rpc_api::torii::ToriiApiClient; use katana_rpc_types::transaction::{TransactionsPage, TransactionsPageCursor}; -use starknet::accounts::{Account, Call}; +use starknet::accounts::{Account, Call, ConnectedAccount}; use starknet::core::types::{FieldElement, TransactionStatus}; use starknet::core::utils::get_selector_from_name; use tokio::time::sleep; @@ -90,6 +91,8 @@ async fn test_get_transactions() { let deploy_txn = account.execute(vec![deploy_call]); let deploy_txn_future = deploy_txn.send().await.unwrap(); + TransactionWaiter::new(deploy_txn_future.transaction_hash, &account.provider()).await.unwrap(); + // Should properly increment to new pending block let response: TransactionsPage = client .get_transactions(TransactionsPageCursor { diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml index 2daf97b5e5..b93ad67681 100644 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" -original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 99366ce45b..3bb8955a18 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -25,4 +25,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6" +world_address = "0x05134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml index 2daf97b5e5..b93ad67681 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" -original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 00db8977b0..f0c028b084 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092", - "original_class_hash": "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092", + "class_hash": "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28", + "original_class_hash": "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28", "abi": [ { "type": "impl", @@ -955,8 +955,8 @@ ] } ], - "address": "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6", - "transaction_hash": "0x4fb663d83b07373bf2844ef51acfb10d1e957a2fd6d573b7360ad64710df6cc", + "address": "0x5134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369", + "transaction_hash": "0x35473957a0f251eb91420957dfcacfe52c6b00c4f5ab5512bcb678b500abf", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -975,7 +975,7 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x43ec1c3a2195bc6adaa4134b7183cec4bae46f1388cb41c0fc808aba7e04b0", + "address": "0x6dee77ea677ba316b702ac7666b5f2eb7d12d3b93a450cf61371b1cb2b5a2a8", "class_hash": "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add", "original_class_hash": "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", @@ -1280,7 +1280,7 @@ }, { "kind": "DojoContract", - "address": "0x55d1b3b80ddfd912e33a6cb331665dfc0b8f1738fcbe8d4c4191e27cd12f9c4", + "address": "0x47bad9d0cd66bb0184ca7ebbc3b3067564e65aa5a3d3ffbf19ecbe9fb8fa1b4", "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 66680bf397..21a653ba34 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" -original_class_hash = "0x1fafbe78a4676c8998d2de2053bc2fba24aebbd4fb86f03ff6af87ad3314092" +class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x26a8d9f2ac0348182bea206d913908ef77e439416713592ebc85941a69048d6" -transaction_hash = "0x4fb663d83b07373bf2844ef51acfb10d1e957a2fd6d573b7360ad64710df6cc" +address = "0x5134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369" +transaction_hash = "0x35473957a0f251eb91420957dfcacfe52c6b00c4f5ab5512bcb678b500abf" block_number = 3 seed = "dojo_examples" name = "dojo::world::world" @@ -21,7 +21,7 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" -address = "0x43ec1c3a2195bc6adaa4134b7183cec4bae46f1388cb41c0fc808aba7e04b0" +address = "0x6dee77ea677ba316b702ac7666b5f2eb7d12d3b93a450cf61371b1cb2b5a2a8" class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" original_class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" @@ -37,7 +37,7 @@ name = "dojo_examples::actions::actions" [[contracts]] kind = "DojoContract" -address = "0x55d1b3b80ddfd912e33a6cb331665dfc0b8f1738fcbe8d4c4191e27cd12f9c4" +address = "0x47bad9d0cd66bb0184ca7ebbc3b3067564e65aa5a3d3ffbf19ecbe9fb8fa1b4" class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" From 0ab7d21d16dd0223bf5eae993a15cea362b15599 Mon Sep 17 00:00:00 2001 From: 0xevolve Date: Wed, 29 May 2024 16:57:35 +0200 Subject: [PATCH 06/88] feat: katana runner log path option (#2015) * feat(katana-runner): add log path option * fix: fmt --- crates/katana/runner/src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/katana/runner/src/lib.rs b/crates/katana/runner/src/lib.rs index 13a19fe771..3ad87a63ef 100644 --- a/crates/katana/runner/src/lib.rs +++ b/crates/katana/runner/src/lib.rs @@ -45,6 +45,8 @@ pub struct KatanaRunnerConfig { pub block_time: Option, /// The port to run the katana runner on, if None, a random free port is chosen. pub port: Option, + /// The path where to log info, if None, logs are stored in a temp dir. + pub log_path: Option, } impl Default for KatanaRunnerConfig { @@ -56,6 +58,7 @@ impl Default for KatanaRunnerConfig { port: None, program_name: None, run_name: None, + log_path: None, } } } @@ -102,14 +105,18 @@ impl KatanaRunner { let stdout = child.stdout.take().context("failed to take subprocess stdout")?; - let log_dir = TempDir::new().unwrap(); - let log_filename = PathBuf::from(format!( "katana-{}.log", config.run_name.clone().unwrap_or_else(|| port.to_string()) )); - let log_file_path = log_dir.join(log_filename); + let log_file_path = if let Some(log_path) = config.log_path { + log_path + } else { + let log_dir = TempDir::new().unwrap(); + log_dir.join(log_filename) + }; + let log_file_path_sent = log_file_path.clone(); let (sender, receiver) = mpsc::channel(); From 532ed956617f896bdd5bde50082ccb9f0451cea3 Mon Sep 17 00:00:00 2001 From: glihm Date: Wed, 29 May 2024 17:34:49 +0200 Subject: [PATCH 07/88] fix: scarb bump for LS (#2012) * chore: bump scarb and cairo-lang * fix: adjust to new scarb API * fix: ensure test-utils is correctly detected in other projects * fix: fix fmt * fix: impl missing upcast for ParserGroup * chore: cleanup LS dependencies * fix: add back the clap version argument * fix: update tests * fix: fix tests * ci: test with larger runner * chore: bump scarb to include tracing fix * fix: add workaround for cairo inference regression --- Cargo.lock | 1122 ++++++++++++----- Cargo.toml | 76 +- bin/dojo-language-server/Cargo.toml | 13 - bin/dojo-language-server/src/main.rs | 8 + bin/sozo/src/commands/test.rs | 8 +- bin/sozo/tests/register_test.rs | 29 +- crates/dojo-core/src/base_test.cairo | 2 +- crates/dojo-core/src/lib.cairo | 11 +- crates/dojo-core/src/world.cairo | 4 +- crates/dojo-lang/src/compiler.rs | 2 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- crates/dojo-lang/src/scarb_internal/mod.rs | 13 +- crates/dojo-lang/src/semantics/test_utils.rs | 7 +- crates/dojo-test-utils/src/compiler.rs | 4 +- crates/dojo-world/src/contracts/model_test.rs | 2 +- crates/dojo-world/src/contracts/world_test.rs | 7 +- crates/dojo-world/src/metadata_test.rs | 2 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- examples/spawn-and-move/Scarb.toml | 2 +- .../dojo_examples_actions_actions.toml | 4 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- .../dojo_examples_actions_actions_moved.toml | 4 +- .../dojo_examples_models_emote_message.toml | 4 +- .../models/dojo_examples_models_moves.toml | 4 +- .../dojo_examples_models_player_config.toml | 4 +- .../models/dojo_examples_models_position.toml | 4 +- ...es_others_others_contract_initialized.toml | 4 +- .../manifests/dev/manifest.json | 40 +- .../manifests/dev/manifest.toml | 40 +- 29 files changed, 986 insertions(+), 446 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c06643dc96..5ed743aa54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -915,8 +915,8 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd", - "zstd-safe", + "zstd 0.13.1", + "zstd-safe 7.1.0", ] [[package]] @@ -1538,7 +1538,7 @@ dependencies = [ "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-vm", + "cairo-vm 0.9.2", "derive_more", "indexmap 2.2.6", "itertools 0.10.5", @@ -1690,6 +1690,27 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "c-kzg" version = "1.0.2" @@ -1834,6 +1855,20 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-lang-casm" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d9c31baeb6b52586b5adc88f01e90f86389d63d94363c562de5c79352e545b" +dependencies = [ + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indoc 2.0.5", + "num-bigint", + "num-traits 0.2.19", + "parity-scale-codec", + "serde", +] + [[package]] name = "cairo-lang-casm" version = "2.6.3" @@ -1850,9 +1885,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -1860,6 +1895,29 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-lang-compiler" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7148cb2d72a3db24a6d2ef2b2602102cc5099cb9f6b913e5047fb009cb3a22a1" +dependencies = [ + "anyhow", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-project 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "salsa", + "smol_str", + "thiserror", +] + [[package]] name = "cairo-lang-compiler" version = "2.6.3" @@ -1885,26 +1943,35 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "salsa", "smol_str", "thiserror", ] +[[package]] +name = "cairo-lang-debug" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a761eb8e31ea65a2dd45f729c74f1770315f97124dad93d1f6853a10d460c6b" +dependencies = [ + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cairo-lang-debug" version = "2.6.3" @@ -1916,9 +1983,26 @@ dependencies = [ [[package]] name = "cairo-lang-debug" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +] + +[[package]] +name = "cairo-lang-defs" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d60bc5d72fe7a95ba34e041dcbdf1cf3bfccb87008a515514b74913fa8ff05" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "salsa", + "smol_str", ] [[package]] @@ -1940,19 +2024,31 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "salsa", "smol_str", ] +[[package]] +name = "cairo-lang-diagnostics" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356089e1b0a0ba9e115566191745613b3806a20259ad76764df82ab534d5412a" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", +] + [[package]] name = "cairo-lang-diagnostics" version = "2.6.3" @@ -1967,14 +2063,24 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", ] +[[package]] +name = "cairo-lang-eq-solver" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc43246cc2e5afd5a028bcdd63876ac3f8b1f4fb3ff785daaa0f0fbb51c9d906" +dependencies = [ + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "good_lp", +] + [[package]] name = "cairo-lang-eq-solver" version = "2.6.3" @@ -1987,12 +2093,26 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "good_lp", ] +[[package]] +name = "cairo-lang-filesystem" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bcb9a4a40e53fa099774bd08bbcc3430f51213cc7fb1b50c2e9d01155731798" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "path-clean", + "salsa", + "serde", + "smol_str", +] + [[package]] name = "cairo-lang-filesystem" version = "2.6.3" @@ -2009,10 +2129,10 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "path-clean", "salsa", "serde", @@ -2022,14 +2142,14 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "diffy", "ignore", "itertools 0.12.1", @@ -2042,22 +2162,22 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-formatter", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "salsa", "scarb-metadata 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", @@ -2069,6 +2189,31 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "cairo-lang-lowering" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba60e1e2477aa0f610ccf29189097d580464607c94b51741e1c18e64d6cee5f" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-proc-macros 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "id-arena", + "itertools 0.11.0", + "log", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-lowering" version = "2.6.3" @@ -2096,17 +2241,17 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "id-arena", "itertools 0.12.1", "log", @@ -2120,7 +2265,7 @@ dependencies = [ [[package]] name = "cairo-lang-macro" version = "0.0.1" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "cairo-lang-macro-attributes", "cairo-lang-macro-stable", @@ -2130,7 +2275,7 @@ dependencies = [ [[package]] name = "cairo-lang-macro-attributes" version = "0.0.1" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "quote", "scarb-stable-hash", @@ -2140,7 +2285,27 @@ dependencies = [ [[package]] name = "cairo-lang-macro-stable" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" + +[[package]] +name = "cairo-lang-parser" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f16ba1535e0cc5e79c2eff6592859bbdac03dc53d4dcdd26dbdbc04a77c3f5c" +dependencies = [ + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax-codegen 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "colored", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "salsa", + "smol_str", + "unescaper", +] [[package]] name = "cairo-lang-parser" @@ -2164,13 +2329,13 @@ dependencies = [ [[package]] name = "cairo-lang-parser" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax-codegen 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax-codegen 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "colored", "itertools 0.12.1", "num-bigint", @@ -2180,6 +2345,25 @@ dependencies = [ "unescaper", ] +[[package]] +name = "cairo-lang-plugins" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81c8cf6e0ee3d6b19429cc1663738b22f1ecea7d51bf7452e8e1086f08798baf" +dependencies = [ + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indent", + "indoc 2.0.5", + "itertools 0.11.0", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-plugins" version = "2.6.3" @@ -2201,14 +2385,14 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indent", "indoc 2.0.5", "itertools 0.12.1", @@ -2216,6 +2400,17 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-proc-macros" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67f9da66325ce7ed6c002360f26106fe79deb9f8a2fca30abdbb8d388da7bb46" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote", + "syn 2.0.64", +] + [[package]] name = "cairo-lang-proc-macros" version = "2.6.3" @@ -2229,13 +2424,27 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "quote", "syn 2.0.64", ] +[[package]] +name = "cairo-lang-project" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e198af1ab3d05c7fb8b6a9a7a2e9bce245a6c855df5f770b751d29874a23b152" +dependencies = [ + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "smol_str", + "thiserror", + "toml 0.8.13", +] + [[package]] name = "cairo-lang-project" version = "2.6.3" @@ -2252,10 +2461,10 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "serde", "smol_str", "thiserror", @@ -2281,7 +2490,7 @@ dependencies = [ "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-vm", + "cairo-vm 0.9.2", "itertools 0.11.0", "keccak", "num-bigint", @@ -2295,22 +2504,21 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "ark-ff 0.4.2", "ark-secp256k1", "ark-secp256r1", - "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-vm", + "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-vm 1.0.0-rc3", "itertools 0.12.1", "keccak", "num-bigint", @@ -2320,9 +2528,35 @@ dependencies = [ "sha2 0.10.8", "smol_str", "starknet-crypto 0.6.2", + "starknet-types-core 0.1.2", "thiserror", ] +[[package]] +name = "cairo-lang-semantic" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7df81521c2125e3e95b683cc99374db1aebd7ddb317c5ca3dd92a235a9eb13" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-plugins 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-proc-macros 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "id-arena", + "indoc 2.0.5", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-semantic" version = "2.6.3" @@ -2350,18 +2584,18 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-utils", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "id-arena", "indoc 2.0.5", "itertools 0.12.1", @@ -2373,6 +2607,32 @@ dependencies = [ "toml 0.8.13", ] +[[package]] +name = "cairo-lang-sierra" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07da3ca1434c62a7cc7cd77d2941ef47a1c23b37325781b59407b78d8c61d863" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "const-fnv1a-hash", + "convert_case 0.6.0", + "derivative", + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "num-bigint", + "num-traits 0.2.19", + "regex", + "salsa", + "serde", + "serde_json", + "sha3", + "smol_str", + "thiserror", +] + [[package]] name = "cairo-lang-sierra" version = "2.6.3" @@ -2401,11 +2661,10 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "const-fnv1a-hash", "convert_case 0.6.0", "derivative", @@ -2420,6 +2679,22 @@ dependencies = [ "serde_json", "sha3", "smol_str", + "starknet-types-core 0.1.2", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-ap-change" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122c9055eb609a511178e3dce577de061819fd4c4c6b7452804557f76ca43bbf" +dependencies = [ + "cairo-lang-eq-solver 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "num-traits 0.2.19", "thiserror", ] @@ -2440,18 +2715,33 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-gas" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf049d9aea65c6e38da219a3700c72f78795d11449d9adcec28047ef8d63bd23" +dependencies = [ + "cairo-lang-eq-solver 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "num-traits 0.2.19", + "thiserror", +] + [[package]] name = "cairo-lang-sierra-gas" version = "2.6.3" @@ -2469,18 +2759,41 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-generator" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1d75e0830279ca1bd0189e3326720d6e081225f7d81ed060bbd22c6b37e980" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-sierra-generator" version = "2.6.3" @@ -2506,18 +2819,18 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +dependencies = [ + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "itertools 0.12.1", "num-traits 0.2.19", "once_cell", @@ -2527,6 +2840,27 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-sierra-to-casm" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3c3be88c8562fbf93b0803c186e7282f6daad93576c07f61b04a591fde468f" +dependencies = [ + "assert_matches", + "cairo-felt", + "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-ap-change 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-gas 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "indoc 2.0.5", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "thiserror", +] + [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" @@ -2550,23 +2884,33 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "assert_matches", - "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-gas 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-gas 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", + "starknet-types-core 0.1.2", "thiserror", ] +[[package]] +name = "cairo-lang-sierra-type-size" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38da6f98c6b16945c89d2ae351c82d636ed38d3e6eb02f7c8679e3e03a63988" +dependencies = [ + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cairo-lang-sierra-type-size" version = "2.6.3" @@ -2579,10 +2923,41 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +] + +[[package]] +name = "cairo-lang-starknet" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9ffa8b3b8c47138c36b1907cebb5047dfc4de29ec10ece5bd6d6853243ec50" +dependencies = [ + "anyhow", + "cairo-felt", + "cairo-lang-compiler 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-plugins 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "const_format", + "indent", + "indoc 2.0.5", + "itertools 0.11.0", + "once_cell", + "serde", + "serde_json", + "smol_str", + "thiserror", ] [[package]] @@ -2618,22 +2993,21 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "const_format", "indent", "indoc 2.0.5", @@ -2642,6 +3016,32 @@ dependencies = [ "serde", "serde_json", "smol_str", + "starknet-types-core 0.1.2", + "thiserror", +] + +[[package]] +name = "cairo-lang-starknet-classes" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c64ae2bb00173e3a88760128bf72de356fa80eb19fa47602479063648b4003" +dependencies = [ + "cairo-felt", + "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-to-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "convert_case 0.6.0", + "itertools 0.11.0", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "once_cell", + "serde", + "serde_json", + "sha3", + "smol_str", + "starknet-crypto 0.6.2", "thiserror", ] @@ -2672,13 +3072,12 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "convert_case 0.6.0", "itertools 0.12.1", "num-bigint", @@ -2690,9 +3089,26 @@ dependencies = [ "sha3", "smol_str", "starknet-crypto 0.6.2", + "starknet-types-core 0.1.2", "thiserror", ] +[[package]] +name = "cairo-lang-syntax" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8262c426a57e1e5ec297db24278464841500613445e2cb1c43d5f71ad91ee8d6" +dependencies = [ + "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint", + "num-traits 0.2.19", + "salsa", + "smol_str", + "unescaper", +] + [[package]] name = "cairo-lang-syntax" version = "2.6.3" @@ -2711,11 +3127,11 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "num-bigint", "num-traits 0.2.19", "salsa", @@ -2723,6 +3139,16 @@ dependencies = [ "unescaper", ] +[[package]] +name = "cairo-lang-syntax-codegen" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e2d692eae4bb4179a4a1148fd5eb738a91653d86750c813658ffad4a99fa97" +dependencies = [ + "genco", + "xshell", +] + [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.3" @@ -2735,7 +3161,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "genco", "xshell", @@ -2744,64 +3170,79 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "serde", + "starknet-types-core 0.1.2", ] [[package]] name = "cairo-lang-test-runner" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "colored", "itertools 0.12.1", "num-traits 0.2.19", "rayon", + "starknet-types-core 0.1.2", ] [[package]] name = "cairo-lang-test-utils" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "cairo-lang-formatter", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "colored", "log", "pretty_assertions", ] +[[package]] +name = "cairo-lang-utils" +version = "2.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf733a7cdc4166d0baf0ed8a98d9ada827daee6653b37d9326e334e53481c6d3" +dependencies = [ + "hashbrown 0.14.5", + "indexmap 2.2.6", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", + "schemars", + "serde", +] + [[package]] name = "cairo-lang-utils" version = "2.6.3" @@ -2820,7 +3261,7 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5#290f51f554c978180ca9d91177423305959cbed5" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "env_logger 0.11.3", "hashbrown 0.14.5", @@ -2882,6 +3323,36 @@ dependencies = [ "thiserror-no-std", ] +[[package]] +name = "cairo-vm" +version = "1.0.0-rc3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0fa4c74b86c0f17b58ced4fdab5c1da0a41fb12725ad7601e12bb27d8d90435" +dependencies = [ + "anyhow", + "bincode 2.0.0-rc.3", + "bitvec", + "generic-array", + "hashbrown 0.14.5", + "hex", + "keccak", + "lazy_static", + "nom", + "num-bigint", + "num-integer", + "num-prime", + "num-traits 0.2.19", + "rand", + "serde", + "serde_json", + "sha2 0.10.8", + "sha3", + "starknet-crypto 0.6.2", + "starknet-types-core 0.1.2", + "thiserror-no-std", + "zip", +] + [[package]] name = "camino" version = "1.1.7" @@ -3393,6 +3864,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "convert_case" version = "0.4.0" @@ -3478,7 +3955,7 @@ dependencies = [ [[package]] name = "create-output-dir" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "anyhow", "core-foundation", @@ -4087,24 +4564,24 @@ name = "dojo-lang" version = "0.7.0-alpha.4" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-formatter", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", "cairo-lang-test-utils", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "convert_case 0.6.0", "directories", @@ -4137,22 +4614,9 @@ dependencies = [ name = "dojo-language-server" version = "0.7.0-alpha.4" dependencies = [ - "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "cairo-lang-language-server", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", "clap", "dojo-lang", - "log", - "salsa", - "smol_str", - "tokio", - "tower-lsp", ] [[package]] @@ -4180,10 +4644,10 @@ dependencies = [ "anyhow", "assert_fs", "async-trait", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "dojo-lang", "dojo-world", @@ -4232,10 +4696,10 @@ dependencies = [ "assert_matches", "async-trait", "cainome", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "convert_case 0.6.0", "dojo-lang", @@ -4266,8 +4730,8 @@ dependencies = [ name = "dojo-world-abigen" version = "0.7.0-alpha.4" dependencies = [ - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "scarb", "scarb-ui", @@ -7341,7 +7805,7 @@ dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-vm", + "cairo-vm 0.9.2", ] [[package]] @@ -7378,9 +7842,9 @@ dependencies = [ "anyhow", "assert_matches", "async-trait", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-vm", + "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-starknet 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-vm 0.9.2", "convert_case 0.6.0", "derive_more", "dojo-metrics", @@ -7415,8 +7879,8 @@ name = "katana-db" version = "0.7.0-alpha.4" dependencies = [ "anyhow", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-vm", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-vm 0.9.2", "criterion", "katana-primitives", "page_size", @@ -7516,8 +7980,8 @@ version = "0.7.0-alpha.4" dependencies = [ "anyhow", "assert_matches", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "dojo-metrics", "dojo-test-utils", "dojo-world", @@ -7709,12 +8173,34 @@ dependencies = [ "regex-automata 0.4.6", ] +[[package]] +name = "lambdaworks-crypto" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb5d4f22241504f7c7b8d2c3a7d7835d7c07117f10bff2a7d96a9ef6ef217c3" +dependencies = [ + "lambdaworks-math 0.7.0", + "serde", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "lambdaworks-math" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ee7dcab3968c71896b8ee4dc829147acc918cffe897af6265b1894527fe3add" +[[package]] +name = "lambdaworks-math" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358e172628e713b80a530a59654154bfc45783a6ed70ea284839800cebdf8f97" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -9427,6 +9913,17 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -9464,6 +9961,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", + "hmac", + "password-hash", + "sha2 0.10.8", ] [[package]] @@ -11181,7 +11681,7 @@ dependencies = [ "async-trait", "cairo-felt", "cairo-proof-parser", - "cairo-vm", + "cairo-vm 0.9.2", "celestia-rpc", "celestia-types", "convert_case 0.6.0", @@ -11205,7 +11705,7 @@ dependencies = [ "serde_with", "starknet", "starknet-crypto 0.6.2", - "starknet-types-core", + "starknet-types-core 0.0.9", "starknet_api", "thiserror", "tokio", @@ -11246,25 +11746,25 @@ dependencies = [ [[package]] name = "scarb" version = "2.6.3" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "anyhow", "async-trait", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-formatter", "cairo-lang-macro", "cairo-lang-macro-stable", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", "create-output-dir", @@ -11289,7 +11789,7 @@ dependencies = [ "redb", "reqwest 0.11.27", "scarb-build-metadata", - "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92)", + "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43)", "scarb-stable-hash", "scarb-ui", "semver 1.0.23", @@ -11314,13 +11814,13 @@ dependencies = [ "which 5.0.0", "windows-sys 0.52.0", "zip", - "zstd", + "zstd 0.13.1", ] [[package]] name = "scarb-build-metadata" version = "2.6.3" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "cargo_metadata", ] @@ -11341,7 +11841,7 @@ dependencies = [ [[package]] name = "scarb-metadata" version = "1.12.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "camino", "derive_builder", @@ -11354,7 +11854,7 @@ dependencies = [ [[package]] name = "scarb-stable-hash" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "data-encoding", "xxhash-rust", @@ -11363,14 +11863,14 @@ dependencies = [ [[package]] name = "scarb-ui" version = "0.1.5" -source = "git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92#e813dbab8f0ec606b5846827ad65951ef8bd6b92" +source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "anyhow", "camino", "clap", "console", "indicatif", - "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=e813dbab8f0ec606b5846827ad65951ef8bd6b92)", + "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43)", "serde", "serde_json", "tracing-core", @@ -11986,17 +12486,17 @@ dependencies = [ "async-trait", "bigdecimal 0.4.3", "cainome", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", "cairo-lang-test-runner", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", "clap-verbosity-flag", @@ -12044,18 +12544,18 @@ dependencies = [ "assert_fs", "async-trait", "cainome", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", "cairo-lang-test-runner", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", "clap-verbosity-flag", @@ -12558,7 +13058,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d53160556d1f23425100f42b3230df747ea05763efee685a2cd939dfb640701" dependencies = [ "bitvec", - "lambdaworks-math", + "lambdaworks-math 0.5.0", + "lazy_static", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "serde", +] + +[[package]] +name = "starknet-types-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4098ac4ad57621cc7ec133b80fe72814d2cc4bee63ca8e7be4450ba6f42a07e8" +dependencies = [ + "lambdaworks-crypto", + "lambdaworks-math 0.7.0", "lazy_static", "num-bigint", "num-integer", @@ -12572,7 +13087,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "365ec5c0662466f299762bd012012da30e9a28319000cfade372b8787111f202" dependencies = [ - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=290f51f554c978180ca9d91177423305959cbed5)", + "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more", "hex", "indexmap 2.2.6", @@ -15151,10 +15666,27 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ + "aes", "byteorder", + "bzip2", + "constant_time_eq", "crc32fast", "crossbeam-utils", "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", ] [[package]] @@ -15163,7 +15695,17 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ - "zstd-safe", + "zstd-safe 7.1.0", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3fefe8f63b..743d01ddd2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,28 +110,28 @@ async-trait = "0.1.77" auto_impl = "1.2.0" base64 = "0.21.2" bytes = "1.6" -cairo-lang-compiler = "=2.6.3" -cairo-lang-debug = "=2.6.3" -cairo-lang-defs = "=2.6.3" -cairo-lang-diagnostics = "=2.6.3" -cairo-lang-filesystem = "=2.6.3" -cairo-lang-formatter = "=2.6.3" -cairo-lang-language-server = "=2.6.3" -cairo-lang-lowering = "=2.6.3" -cairo-lang-parser = "=2.6.3" -cairo-lang-plugins = { version = "=2.6.3", features = [ "testing" ] } -cairo-lang-project = "=2.6.3" -cairo-lang-semantic = { version = "=2.6.3", features = [ "testing" ] } -cairo-lang-sierra = "=2.6.3" -cairo-lang-sierra-generator = "=2.6.3" -cairo-lang-sierra-to-casm = "=2.6.3" -cairo-lang-starknet = "=2.6.3" -cairo-lang-starknet-classes = "=2.6.3" -cairo-lang-syntax = "=2.6.3" -cairo-lang-test-plugin = "=2.6.3" -cairo-lang-test-runner = "=2.6.3" -cairo-lang-test-utils = "=2.6.3" -cairo-lang-utils = "=2.6.3" +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] } +cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } cairo-proof-parser = { git = "https://github.com/cartridge-gg/cairo-proof-parser", tag = "v0.3.0" } cairo-vm = "0.9.2" camino = { version = "1.1.2", features = [ "serde1" ] } @@ -165,8 +165,8 @@ regex = "1.10.3" reqwest = { version = "0.12", features = [ "blocking", "rustls-tls" ], default-features = false } rpassword = "7.2.0" salsa = "0.16.1" -scarb = { git = "https://github.com/software-mansion/scarb", rev = "e813dbab8f0ec606b5846827ad65951ef8bd6b92" } -scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "e813dbab8f0ec606b5846827ad65951ef8bd6b92" } +scarb = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } +scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } semver = "1.0.5" serde = { version = "1.0", features = [ "derive" ] } serde_json = { version = "1.0", features = [ "arbitrary_precision" ] } @@ -227,31 +227,3 @@ alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e437 alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } - -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } - -# Runner -cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } -cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "290f51f554c978180ca9d91177423305959cbed5" } - diff --git a/bin/dojo-language-server/Cargo.toml b/bin/dojo-language-server/Cargo.toml index 62e08a7c9b..8dc16e26b0 100644 --- a/bin/dojo-language-server/Cargo.toml +++ b/bin/dojo-language-server/Cargo.toml @@ -6,19 +6,6 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow.workspace = true -cairo-lang-compiler.workspace = true -cairo-lang-filesystem.workspace = true cairo-lang-language-server.workspace = true -cairo-lang-plugins.workspace = true -cairo-lang-semantic.workspace = true -cairo-lang-starknet.workspace = true -cairo-lang-test-plugin.workspace = true -cairo-lang-utils.workspace = true clap.workspace = true dojo-lang.workspace = true -log.workspace = true -salsa.workspace = true -smol_str.workspace = true -tokio = { version = "1.18.2", features = [ "full", "sync" ] } -tower-lsp = "0.20.0" diff --git a/bin/dojo-language-server/src/main.rs b/bin/dojo-language-server/src/main.rs index 3c01cbc792..d6516351a2 100644 --- a/bin/dojo-language-server/src/main.rs +++ b/bin/dojo-language-server/src/main.rs @@ -1,7 +1,15 @@ use cairo_lang_language_server::Tricks; +use clap::Parser; use dojo_lang::plugin::dojo_plugin_suite; +/// Dojo Language Server +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args {} + fn main() { + let _args = Args::parse(); + let mut tricks = Tricks::default(); tricks.extra_plugin_suites = Some(&|| vec![dojo_plugin_suite()]); cairo_lang_language_server::start_with_tricks(tricks); diff --git a/bin/sozo/src/commands/test.rs b/bin/sozo/src/commands/test.rs index d89b1461ad..19f8279f18 100644 --- a/bin/sozo/src/commands/test.rs +++ b/bin/sozo/src/commands/test.rs @@ -85,7 +85,7 @@ impl TestArgs { continue; }; - let props: Props = unit.target().props()?; + let props: Props = unit.main_component().target_props()?; let db = build_root_database(&unit)?; if DiagnosticsReporter::stderr().allow_warnings().check(&db) { @@ -145,11 +145,13 @@ fn build_project_config(unit: &CairoCompilationUnit) -> Result { .components .iter() .filter(|model| !model.package.id.is_core()) - .map(|model| (model.cairo_package_name(), model.target.source_root().into())) + // NOTE: We're taking the first target of each compilation unit, which should always be the + // main package source root due to the order maintained by scarb. + .map(|model| (model.cairo_package_name(), model.targets[0].source_root().into())) .collect(); let corelib = - unit.core_package_component().map(|c| Directory::Real(c.target.source_root().into())); + unit.core_package_component().map(|c| Directory::Real(c.targets[0].source_root().into())); let crates_config = crates_config_for_compilation_unit(unit); diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index 607b4634bd..11053bd38f 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -1,11 +1,10 @@ mod utils; -use dojo_test_utils::compiler::build_test_config; +use camino::Utf8PathBuf; +use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_test_utils::sequencer::{ - get_default_test_starknet_config, SequencerConfig, TestSequencer, -}; use dojo_world::migration::TxnConfig; +use katana_runner::KatanaRunner; use scarb::ops; use sozo_ops::migration::execute_strategy; use starknet::accounts::Account; @@ -14,24 +13,28 @@ use utils::snapbox::get_snapbox; #[tokio::test(flavor = "multi_thread")] async fn reregister_models() { - let config = build_test_config("../../examples/spawn-and-move/Scarb.toml").unwrap(); + let source_project_dir = Utf8PathBuf::from("../../examples/spawn-and-move/"); + let dojo_core_path = Utf8PathBuf::from("../../crates/dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - let base_dir = "../../examples/spawn-and-move"; - let target_dir = format!("{}/target/dev", base_dir); - let migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); + let base = config.manifest_path().parent().unwrap(); + let target_dir = format!("{}/target/dev", base); + + let migration = prepare_migration(base.into(), target_dir.into()).unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; + let sequencer = KatanaRunner::new().expect("Failed to start runner."); - let mut account = sequencer.account(); + let mut account = sequencer.account(0); account.set_block_id(BlockId::Tag(BlockTag::Pending)); - execute_strategy(&ws, &migration, &account, TxnConfig::default()).await.unwrap(); + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); let world_address = &format!("0x{:x}", &migration.world_address().unwrap()); let account_address = &format!("0x{:x}", account.address()); - let private_key = &format!("0x{:x}", sequencer.raw_account().private_key); + let private_key = &format!("0x{:x}", sequencer.account_data(0).1.private_key); let rpc_url = &sequencer.url().to_string(); let moves_model = diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index 1e3f533b08..d3c974abd3 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -160,7 +160,7 @@ mod invalid_model { fn selector(self: @ContractState) -> felt252 { // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x15f0ffa36184d74ead97aa501b09aed53ee7236e364997a0c21879194340ab6 + 0x42503befcd7ad05718645aca9c5ddd83b53dca440f9239ce2dcf63018fba16 } fn name(self: @ContractState) -> ByteArray { diff --git a/crates/dojo-core/src/lib.cairo b/crates/dojo-core/src/lib.cairo index 2e66a3ac03..adbe199c73 100644 --- a/crates/dojo-core/src/lib.cairo +++ b/crates/dojo-core/src/lib.cairo @@ -14,7 +14,16 @@ mod world; #[cfg(test)] mod world_test; -#[cfg(test)] +// Since Scarb 2.6.0 there's an optimization that does not +// build tests for dependencies and it's not configurable. +// +// To expose correctly the test utils for a package using dojo-core, +// we need to it in the `lib` target or using the `#[cfg(target: "test")]` +// attribute. +// +// Since `test_utils` is using `TEST_CLASS_HASH` to factorize some deployment +// core, we place it under the test target manually. +#[cfg(target: "test")] mod test_utils; #[cfg(test)] diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index b01adc0d36..083c7b6c2b 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -400,7 +400,9 @@ mod world { } // If model is already registered, validate permission to update. - let (current_class_hash, current_address) = self.models.read(selector); + let model_data: (ClassHash, ContractAddress) = self.models.read(selector); + let (current_class_hash, current_address) = model_data; + if current_class_hash.is_non_zero() { assert(self.is_owner(caller, selector), Errors::OWNER_ONLY_UPDATE); prev_class_hash = current_class_hash; diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index b9fcaab338..653aab250e 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -90,7 +90,7 @@ impl Compiler for DojoCompiler { db: &mut RootDatabase, ws: &Workspace<'_>, ) -> Result<()> { - let props: Props = unit.target().props()?; + let props: Props = unit.main_component().target_props()?; let target_dir = unit.target_dir(ws); let sources_dir = target_dir.child(Utf8Path::new(SOURCES_DIR)); diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml index b93ad67681..f80ccef0d2 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" -original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/dojo-lang/src/scarb_internal/mod.rs b/crates/dojo-lang/src/scarb_internal/mod.rs index 15c56c7174..638c7a0d74 100644 --- a/crates/dojo-lang/src/scarb_internal/mod.rs +++ b/crates/dojo-lang/src/scarb_internal/mod.rs @@ -93,9 +93,10 @@ pub fn compile_workspace(config: &Config, opts: CompileOpts) -> Result>(); @@ -143,11 +144,15 @@ fn build_project_config(unit: &CairoCompilationUnit) -> Result { .components() .iter() .filter(|model| !model.package.id.is_core()) - .map(|model| (model.cairo_package_name(), model.target.source_root().into())) + // NOTE: We're taking the first target of each compilation unit, which should always be the + // main package source root due to the order maintained by scarb. + .map(|model| (model.cairo_package_name(), model.targets[0].source_root().into())) .collect(); let corelib = - unit.core_package_component().map(|c| Directory::Real(c.target.source_root().into())); + // NOTE: We're taking the first target of the corelib, which should always be the + // main package source root due to the order maintained by scarb. + unit.core_package_component().map(|c| Directory::Real(c.targets[0].source_root().into())); let content = ProjectConfigContent { crate_roots, diff --git a/crates/dojo-lang/src/semantics/test_utils.rs b/crates/dojo-lang/src/semantics/test_utils.rs index dc9db9a166..00e34b9b9b 100644 --- a/crates/dojo-lang/src/semantics/test_utils.rs +++ b/crates/dojo-lang/src/semantics/test_utils.rs @@ -12,7 +12,7 @@ use cairo_lang_filesystem::db::{ use cairo_lang_filesystem::ids::{ CrateId, CrateLongId, Directory, FileKind, FileLongId, VirtualFile, }; -use cairo_lang_parser::db::ParserDatabase; +use cairo_lang_parser::db::{ParserDatabase, ParserGroup}; use cairo_lang_semantic::db::{SemanticDatabase, SemanticGroup}; use cairo_lang_semantic::inline_macros::get_default_plugin_suite; use cairo_lang_semantic::items::functions::GenericFunctionId; @@ -100,6 +100,11 @@ impl Upcast for DojoSemanticDatabase { self } } +impl Upcast for DojoSemanticDatabase { + fn upcast(&self) -> &(dyn ParserGroup + 'static) { + self + } +} pub struct WithStringDiagnostics { value: T, diff --git a/crates/dojo-test-utils/src/compiler.rs b/crates/dojo-test-utils/src/compiler.rs index b8d30c5775..a48ef13435 100644 --- a/crates/dojo-test-utils/src/compiler.rs +++ b/crates/dojo-test-utils/src/compiler.rs @@ -195,7 +195,9 @@ pub fn corelib() -> PathBuf { let compilation_units = ops::generate_compilation_units(&resolve, &features_opts, &ws).unwrap(); if let CompilationUnit::Cairo(unit) = &compilation_units[0] { - unit.core_package_component().expect("should have component").target.source_root().into() + unit.core_package_component().expect("should have component").targets[0] + .source_root() + .into() } else { panic!("should have cairo compilation unit") } diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index f32a7b5943..178e9b6495 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -65,7 +65,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x03ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868") + felt!("0x027942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff") ); let moves = world.model_reader("Moves").await.unwrap(); diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index b96f25476b..3b856c1f46 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -5,7 +5,7 @@ use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::compiler; use katana_runner::KatanaRunner; use starknet::accounts::{Account, ConnectedAccount}; -use starknet::core::types::FieldElement; +use starknet::core::types::{BlockId, BlockTag, FieldElement}; use super::{WorldContract, WorldContractReader}; use crate::manifest::{BaseManifest, OverlayManifest}; @@ -24,8 +24,11 @@ async fn test_world_contract_reader() { let manifest_dir = config.manifest_path().parent().unwrap(); let target_dir = manifest_dir.join("target").join("dev"); - let account = runner.account(0); + let mut account = runner.account(0); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + let provider = account.provider(); + let world_address = deploy_world(&runner, &manifest_dir.to_path_buf(), &target_dir.to_path_buf()).await; diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 4eded54d96..6a5938d2f2 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -147,7 +147,7 @@ async fn get_full_dojo_metadata_from_workspace() { assert!(env.world_address.is_some()); assert_eq!( env.world_address.unwrap(), - "0x05134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369" + "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309" ); assert!(env.keystore_path.is_none()); diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml index b93ad67681..f80ccef0d2 100644 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" -original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 3bb8955a18..8a1e9613e9 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -25,4 +25,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x05134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369" +world_address = "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index 5f84fa6760..09f30e5dfa 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" -original_class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" +class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml index b93ad67681..f80ccef0d2 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" -original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml index a9e0f20f78..8b79f5c317 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" -original_class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" abi = "manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json" name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml index 668a594127..3dfeddaf7b 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" -original_class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" +class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" +original_class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" abi = "manifests/dev/abis/base/models/dojo_examples_models_emote_message.json" name = "dojo_examples::models::emote_message" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml index db94e2ff11..6241643aa4 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" -original_class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" abi = "manifests/dev/abis/base/models/dojo_examples_models_moves.json" name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml index bbaa577a1c..459eb9ebdb 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" -original_class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" abi = "manifests/dev/abis/base/models/dojo_examples_models_player_config.json" name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml index 5bcac0ef22..d29abaa4e0 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" -original_class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" abi = "manifests/dev/abis/base/models/dojo_examples_models_position.json" name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml index f267d02139..e4b4f0fdc3 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" -original_class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" abi = "manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json" name = "dojo_examples::others::others::contract_initialized" diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index f0c028b084..404bf0f8b6 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28", - "original_class_hash": "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28", + "class_hash": "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f", + "original_class_hash": "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f", "abi": [ { "type": "impl", @@ -955,8 +955,8 @@ ] } ], - "address": "0x5134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369", - "transaction_hash": "0x35473957a0f251eb91420957dfcacfe52c6b00c4f5ab5512bcb678b500abf", + "address": "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309", + "transaction_hash": "0x7106054ad5c4ccfcd5e512d286ce7cadc5ddc21b8cf058e4daab09743bace76", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -975,9 +975,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x6dee77ea677ba316b702ac7666b5f2eb7d12d3b93a450cf61371b1cb2b5a2a8", - "class_hash": "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add", - "original_class_hash": "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add", + "address": "0x263f89fc2bdf121a3bdcc9af35eb6b3d5c078f9bcc257e9f5627af81a7607fd", + "class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", + "original_class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1280,7 +1280,7 @@ }, { "kind": "DojoContract", - "address": "0x47bad9d0cd66bb0184ca7ebbc3b3067564e65aa5a3d3ffbf19ecbe9fb8fa1b4", + "address": "0x2dc27292cc94aa40e4d2d327e511ce02e96f40ca3c41d1f9938860a1a4aee9f", "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", @@ -1456,8 +1456,8 @@ "key": false } ], - "class_hash": "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187", - "original_class_hash": "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187", + "class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "original_class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", "abi": [ { "type": "impl", @@ -1863,8 +1863,8 @@ "key": false } ], - "class_hash": "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc", - "original_class_hash": "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc", + "class_hash": "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5", + "original_class_hash": "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5", "abi": [ { "type": "impl", @@ -2275,8 +2275,8 @@ "key": false } ], - "class_hash": "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684", - "original_class_hash": "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684", + "class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "original_class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", "abi": [ { "type": "impl", @@ -2696,8 +2696,8 @@ "key": false } ], - "class_hash": "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09", - "original_class_hash": "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09", + "class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "original_class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", "abi": [ { "type": "impl", @@ -3099,8 +3099,8 @@ "key": false } ], - "class_hash": "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868", - "original_class_hash": "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868", + "class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "original_class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", "abi": [ { "type": "impl", @@ -3499,8 +3499,8 @@ "key": false } ], - "class_hash": "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5", - "original_class_hash": "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5", + "class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "original_class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", "abi": [ { "type": "impl", diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 21a653ba34..ccc078a545 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" -original_class_hash = "0x49f5416d0fb6e6ec76a4f55bfd0addad9ab8a3c864d882012a0a2060d8e8a28" +class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x5134532e5d24c8264e61bb6bbe5c06031d462b8b7bdd15b5554e77e2a97c369" -transaction_hash = "0x35473957a0f251eb91420957dfcacfe52c6b00c4f5ab5512bcb678b500abf" +address = "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309" +transaction_hash = "0x7106054ad5c4ccfcd5e512d286ce7cadc5ddc21b8cf058e4daab09743bace76" block_number = 3 seed = "dojo_examples" name = "dojo::world::world" @@ -21,9 +21,9 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" -address = "0x6dee77ea677ba316b702ac7666b5f2eb7d12d3b93a450cf61371b1cb2b5a2a8" -class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" -original_class_hash = "0xfe09a42928890d712af285559b4452ebbc448428dfa91179bfee66715a2add" +address = "0x263f89fc2bdf121a3bdcc9af35eb6b3d5c078f9bcc257e9f5627af81a7607fd" +class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] @@ -37,7 +37,7 @@ name = "dojo_examples::actions::actions" [[contracts]] kind = "DojoContract" -address = "0x47bad9d0cd66bb0184ca7ebbc3b3067564e65aa5a3d3ffbf19ecbe9fb8fa1b4" +address = "0x2dc27292cc94aa40e4d2d327e511ce02e96f40ca3c41d1f9938860a1a4aee9f" class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" @@ -54,8 +54,8 @@ name = "dojo_examples::others::others" [[models]] kind = "DojoModel" -class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" -original_class_hash = "0x6f85952ceeb7783fb265a4b2d235db48e7a36357bbce7a56997ca5798c95187" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" abi = "manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json" name = "dojo_examples::actions::actions::moved" @@ -71,8 +71,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" -original_class_hash = "0x3e8f99f02409b7bc3dfffba58ee3807e3fb3513a2dcac1b0bd1f1118ea79ecc" +class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" +original_class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json" name = "dojo_examples::models::emote_message" @@ -88,8 +88,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" -original_class_hash = "0x402d1ee5171aac681d16fa8c248a0498678082152e0f4c416776a71fc270684" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_moves.json" name = "dojo_examples::models::moves" @@ -110,8 +110,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" -original_class_hash = "0x596f2ea7f78e3828f6daa798a271ef0a98741967afa40e680c2d80879be7d09" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json" name = "dojo_examples::models::player_config" @@ -137,8 +137,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" -original_class_hash = "0x3ab26e88be7885877f93964880ccb63a8acd8e58f941c48bef52f191fa79868" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" abi = "manifests/dev/abis/deployments/models/dojo_examples_models_position.json" name = "dojo_examples::models::position" @@ -154,8 +154,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" -original_class_hash = "0x6b54d690f4f43e3011fe05fabf3e5f1807b3a026430eb175534336e9a90d5a5" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" abi = "manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" name = "dojo_examples::others::others::contract_initialized" From 5af2bc695be959b724e5bb386169d950cd2d3d7a Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Wed, 29 May 2024 15:25:26 -0400 Subject: [PATCH 08/88] feat(dojo-bindgen): support new layout types (#1954) * feat: new types in unity bindgen * feat: add types support to typescript codegen too * feat: handle token directly to get type name * chore: correct type names * chore: update to correct tuple types * fmt * Update mod.rs * Update mod.rs * Update mod.rs * feat: add support for complex enums to unity bindgen * feat: support generic args in typescript * fmt * feat: newer tuple type for c# * feat: value type name in record field * feat: generic rust like enum for unity bindgen * refacotr: optional generic args for record * feat: add suppport for generic enums for typescript v2 * feat: update test & disable typescript * fix: update unity systsem bindgen to use new felt getter #2008 * chore: clippy * clean uop --- bin/sozo/src/commands/build.rs | 21 ++- .../src/plugins/typescript/mod.rs | 89 +++++++--- .../src/plugins/typescript_v2/mod.rs | 157 +++++++++++------- crates/dojo-bindgen/src/plugins/unity/mod.rs | 127 +++++++++----- .../src/test_data/mocks/dojo_examples.ts | 100 ++++++----- 5 files changed, 317 insertions(+), 177 deletions(-) diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index d8112bb51f..e278e693d0 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -16,10 +16,11 @@ const CONTRACT_NAME_LABEL: &str = "Contract"; #[derive(Debug, Args)] pub struct BuildArgs { - #[arg(long)] - #[arg(help = "Generate Typescript bindings.")] - pub typescript: bool, - + // Should we deprecate typescript bindings codegen? + // Disabled due to lack of support in dojo.js + // #[arg(long)] + // #[arg(help = "Generate Typescript bindings.")] + // pub typescript: bool, #[arg(long)] #[arg(help = "Generate Typescript bindings.")] pub typescript_v2: bool, @@ -52,9 +53,11 @@ impl BuildArgs { trace!(?compile_info, "Compiled workspace."); let mut builtin_plugins = vec![]; - if self.typescript { - builtin_plugins.push(BuiltinPlugins::Typescript); - } + + // Disable typescript for now. Due to lack of support and maintenance in dojo.js + // if self.typescript { + // builtin_plugins.push(BuiltinPlugins::Typescript); + // } if self.typescript_v2 { builtin_plugins.push(BuiltinPlugins::TypeScriptV2); @@ -177,9 +180,9 @@ mod tests { let build_args = BuildArgs { bindings_output: "generated".to_string(), - typescript: false, + // typescript: false, unity: true, - typescript_v2: false, + typescript_v2: true, stats: true, }; let result = build_args.run(&config); diff --git a/crates/dojo-bindgen/src/plugins/typescript/mod.rs b/crates/dojo-bindgen/src/plugins/typescript/mod.rs index de2f11bc91..9b00739fe8 100644 --- a/crates/dojo-bindgen/src/plugins/typescript/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript/mod.rs @@ -16,8 +16,8 @@ impl TypescriptPlugin { } // Maps cairo types to C#/Unity SDK defined types - fn map_type(type_name: &str) -> String { - match type_name { + fn map_type(token: &Token, generic_args: &Vec<(String, Token)>) -> String { + match token.type_name().as_str() { "bool" => "RecsType.Boolean".to_string(), "u8" => "RecsType.Number".to_string(), "u16" => "RecsType.Number".to_string(), @@ -30,8 +30,44 @@ impl TypescriptPlugin { "bytes31" => "RecsType.String".to_string(), "ClassHash" => "RecsType.BigInt".to_string(), "ContractAddress" => "RecsType.BigInt".to_string(), + "ByteArray" => "RecsType.String".to_string(), + "array" => { + if let Token::Array(array) = token { + format!("{}[]", TypescriptPlugin::map_type(&array.inner, generic_args)) + } else { + panic!("Invalid array token: {:?}", token); + } + } + "tuple" => { + if let Token::Tuple(tuple) = token { + let inners = tuple + .inners + .iter() + .map(|inner| TypescriptPlugin::map_type(inner, generic_args)) + .collect::>() + .join(", "); - _ => type_name.to_string(), + format!("[{}]", inners) + } else { + panic!("Invalid tuple token: {:?}", token); + } + } + "generic_arg" => { + if let Token::GenericArg(arg) = &token { + let arg_type = generic_args + .iter() + .find(|(name, _)| name == arg) + .unwrap_or_else(|| panic!("Generic arg not found: {}", arg)) + .1 + .clone(); + + TypescriptPlugin::map_type(&arg_type, generic_args) + } else { + panic!("Invalid generic arg token: {:?}", token); + } + } + + _ => token.type_name().to_string(), } } @@ -50,7 +86,7 @@ impl TypescriptPlugin { let mut fields = String::new(); for field in &token.inners { - let mapped = TypescriptPlugin::map_type(field.token.type_name().as_str()); + let mapped = TypescriptPlugin::map_type(&field.token, &token.generic_args); if mapped == field.token.type_name() { let token = handled_tokens .iter() @@ -93,24 +129,35 @@ export const {name}Definition = {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let fields = token - .inners - .iter() - .map(|field| format!("{},", field.name,)) - .collect::>() - .join("\n "); + let name = token.type_name(); - format!( + let mut result = format!( " // Type definition for `{}` enum -export enum {} {{ - {} -}} -", - token.type_path, - token.type_name(), - fields - ) +type {} = ", + token.type_path, name + ); + + let mut variants = Vec::new(); + + for field in &token.inners { + let field_type = + TypescriptPlugin::map_type(&field.token, &token.generic_args).replace("()", ""); + + let variant_definition = if field_type.is_empty() { + // No associated data + format!("{{ type: '{}'; }}", field.name) + } else { + // With associated data + format!("{{ type: '{}'; data: {}; }}", field.name, field_type) + }; + + variants.push(variant_definition); + } + + result += &variants.join(" | "); + + result } // Token should be a model @@ -123,7 +170,7 @@ export enum {} {{ .inners .iter() .map(|field| { - let mapped = TypescriptPlugin::map_type(field.token.type_name().as_str()); + let mapped = TypescriptPlugin::map_type(&field.token, &model.generic_args); if mapped == field.token.type_name() { custom_types.push(format!("\"{}\"", field.token.type_name())); @@ -258,7 +305,7 @@ export function defineContractComponents(world: World) { fn format_system(system: &Function, handled_tokens: &[Composite]) -> String { fn map_type(token: &Token) -> String { match token { - Token::CoreBasic(t) => TypescriptPlugin::map_type(&t.type_name()) + Token::CoreBasic(_) => TypescriptPlugin::map_type(token, &vec![]) .replace("RecsType.", "") // types should be lowercased .to_lowercase(), diff --git a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs index d894a340ad..7ae5d5b2a6 100644 --- a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::path::{Path, PathBuf}; use async_trait::async_trait; -use cainome::parser::tokens::{Composite, CompositeType, Function}; +use cainome::parser::tokens::{Composite, CompositeType, Function, Token}; use convert_case::Casing; use crate::error::BindgenResult; @@ -17,8 +17,8 @@ impl TypeScriptV2Plugin { } // Maps cairo types to TypeScript defined types - fn map_type(type_name: &str) -> String { - match type_name { + fn map_type(token: &Token) -> String { + match token.type_name().as_str() { "bool" => "boolean".to_string(), "u8" => "number".to_string(), "u16" => "number".to_string(), @@ -28,10 +28,57 @@ impl TypeScriptV2Plugin { "u256" => "bigint".to_string(), "usize" => "number".to_string(), "felt252" => "string".to_string(), + "bytes31" => "string".to_string(), "ClassHash" => "string".to_string(), "ContractAddress" => "string".to_string(), + "ByteArray" => "string".to_string(), + "array" => { + if let Token::Array(array) = token { + format!("{}[]", TypeScriptV2Plugin::map_type(&array.inner)) + } else { + panic!("Invalid array token: {:?}", token); + } + } + "tuple" => { + if let Token::Tuple(tuple) = token { + let inners = tuple + .inners + .iter() + .map(TypeScriptV2Plugin::map_type) + .collect::>() + .join(", "); + format!("[{}]", inners) + } else { + panic!("Invalid tuple token: {:?}", token); + } + } + "generic_arg" => { + if let Token::GenericArg(generic_arg) = &token { + generic_arg.clone() + } else { + panic!("Invalid generic_arg token: {:?}", token); + } + } + + _ => { + let mut type_name = token.type_name(); - _ => type_name.to_string(), + if let Token::Composite(composite) = token { + if !composite.generic_args.is_empty() { + type_name += &format!( + "<{}>", + composite + .generic_args + .iter() + .map(|(_, t)| TypeScriptV2Plugin::map_type(t)) + .collect::>() + .join(", ") + ) + } + } + + type_name + } } } @@ -116,36 +163,21 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ for model in models { let tokens = &model.tokens; - for token in &tokens.enums { - handled_tokens.push(token.to_composite().unwrap().to_owned()); - } for token in &tokens.structs { - handled_tokens.push(token.to_composite().unwrap().to_owned()); - } - - let mut structs = tokens.structs.to_owned(); - structs.sort_by(|a, b| { - if a.to_composite() - .unwrap() - .inners - .iter() - .any(|field| field.token.type_name() == b.type_name()) - { - std::cmp::Ordering::Greater - } else { - std::cmp::Ordering::Less + if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + continue; } - }); - for token in &structs { - out += TypeScriptV2Plugin::format_struct( - token.to_composite().unwrap(), - handled_tokens, - ) - .as_str(); + handled_tokens.push(token.to_composite().unwrap().to_owned()); + out += TypeScriptV2Plugin::format_struct(token.to_composite().unwrap()).as_str(); } for token in &tokens.enums { + if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + continue; + } + + handled_tokens.push(token.to_composite().unwrap().to_owned()); out += TypeScriptV2Plugin::format_enum(token.to_composite().unwrap()).as_str(); } @@ -417,24 +449,13 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ // Token should be a struct // This will be formatted into a TypeScript interface // using TypeScript defined types - fn format_struct(token: &Composite, handled_tokens: &[Composite]) -> String { + fn format_struct(token: &Composite) -> String { let mut native_fields: Vec = Vec::new(); for field in &token.inners { - let mapped = TypeScriptV2Plugin::map_type(field.token.type_name().as_str()); - if mapped == field.token.type_name() { - let token = handled_tokens - .iter() - .find(|t| t.type_name() == field.token.type_name()) - .unwrap_or_else(|| panic!("Token not found: {}", field.token.type_name())); - if token.r#type == CompositeType::Enum { - native_fields.push(format!("{}: {};", field.name, mapped)); - } else { - native_fields.push(format!("{}: {};", field.name, field.token.type_name())); - } - } else { - native_fields.push(format!("{}: {};", field.name, mapped)); - } + let mapped = TypeScriptV2Plugin::map_type(&field.token); + format!("{}: {};", field.name, mapped); + native_fields.push(format!("{}: {};", field.name, mapped)); } format!( @@ -454,24 +475,40 @@ export interface {name} {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let fields = token - .inners - .iter() - .map(|field| format!("{},", field.name,)) - .collect::>() - .join("\n "); + let mut name = token.type_name(); + if !token.generic_args.is_empty() { + name += &format!( + "<{}>", + token.generic_args.iter().map(|(n, _)| n.clone()).collect::>().join(", ") + ) + } - format!( + let mut result = format!( " // Type definition for `{}` enum -export enum {} {{ - {} -}} -", - token.type_path, - token.type_name(), - fields - ) +type {} = ", + token.type_path, name + ); + + let mut variants = Vec::new(); + + for field in &token.inners { + let field_type = TypeScriptV2Plugin::map_type(&field.token).replace("()", ""); + + let variant_definition = if field_type.is_empty() { + // No associated data + format!("{{ type: '{}'; }}", field.name) + } else { + // With associated data + format!("{{ type: '{}'; data: {}; }}", field.name, field_type) + }; + + variants.push(variant_definition); + } + + result += &variants.join(" | "); + + result } // Formats a system into a JS method used by the contract class @@ -485,10 +522,10 @@ export enum {} {{ format!( "{}: {}", arg.0, - if TypeScriptV2Plugin::map_type(&arg.1.type_name()) == arg.1.type_name() { + if TypeScriptV2Plugin::map_type(&arg.1) == arg.1.type_name() { arg.1.type_name() } else { - TypeScriptV2Plugin::map_type(&arg.1.type_name()) + TypeScriptV2Plugin::map_type(&arg.1) } ) }) diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index addee69930..2827519351 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -16,8 +16,8 @@ impl UnityPlugin { } // Maps cairo types to C#/Unity SDK defined types - fn map_type(type_name: &str) -> String { - match type_name { + fn map_type(token: &Token) -> String { + match token.type_name().as_str() { "u8" => "byte".to_string(), "u16" => "ushort".to_string(), "u32" => "uint".to_string(), @@ -29,8 +29,54 @@ impl UnityPlugin { "bytes31" => "string".to_string(), "ClassHash" => "FieldElement".to_string(), "ContractAddress" => "FieldElement".to_string(), + "ByteArray" => "string".to_string(), + "array" => { + if let Token::Array(array) = token { + format!("{}[]", UnityPlugin::map_type(&array.inner)) + } else { + panic!("Invalid array token: {:?}", token); + } + } + "tuple" => { + if let Token::Tuple(tuple) = token { + let inners = tuple + .inners + .iter() + .map(UnityPlugin::map_type) + .collect::>() + .join(", "); + format!("({})", inners) + } else { + panic!("Invalid tuple token: {:?}", token); + } + } + "generic_arg" => { + if let Token::GenericArg(g) = &token { + g.clone() + } else { + panic!("Invalid generic arg token: {:?}", token); + } + } + + _ => { + let mut type_name = token.type_name().to_string(); + + if let Token::Composite(composite) = token { + if !composite.generic_args.is_empty() { + type_name += &format!( + "<{}>", + composite + .generic_args + .iter() + .map(|(_, t)| UnityPlugin::map_type(t)) + .collect::>() + .join(", ") + ) + } + } - _ => type_name.to_string(), + type_name + } } } @@ -48,13 +94,7 @@ impl UnityPlugin { let fields = token .inners .iter() - .map(|field| { - format!( - "public {} {};", - UnityPlugin::map_type(field.token.clone().type_name().as_str()), - field.name - ) - }) + .map(|field| format!("public {} {};", UnityPlugin::map_type(&field.token), field.name)) .collect::>() .join("\n "); @@ -76,24 +116,35 @@ public struct {} {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let fields = token - .inners - .iter() - .map(|field| format!("{},", field.name,)) - .collect::>() - .join("\n "); + let mut name_with_generics = token.type_name(); + if !token.generic_args.is_empty() { + name_with_generics += &format!( + "<{}>", + token.generic_args.iter().map(|(n, _)| n.clone()).collect::>().join(", ") + ); + } - format!( + let mut result = format!( " // Type definition for `{}` enum -public enum {} {{ - {} -}} -", - token.type_path, - token.type_name(), - fields - ) +public abstract record {}() {{", + token.type_path, name_with_generics + ); + + for field in &token.inners { + let type_name = UnityPlugin::map_type(&field.token).replace(['(', ')'], ""); + + result += format!( + "\n public record {}({}) : {name_with_generics};", + field.name, + if type_name.is_empty() { type_name } else { format!("{} value", type_name) } + ) + .as_str(); + } + + result += "\n}\n"; + + result } // Token should be a model @@ -107,7 +158,7 @@ public enum {} {{ format!( "[ModelField(\"{}\")]\n public {} {};", field.name, - UnityPlugin::map_type(field.token.type_name().as_str()), + UnityPlugin::map_type(&field.token), field.name, ) }) @@ -183,19 +234,10 @@ public class {} : ModelInstance {{ // Handled tokens should be a list of all structs and enums used by the contract // Such as a set of referenced tokens from a model fn format_system(system: &Function, handled_tokens: &[Composite]) -> String { - fn map_type(token: &Token) -> String { - match token { - Token::CoreBasic(t) => UnityPlugin::map_type(&t.type_name()), - Token::Composite(t) => t.type_name().to_string(), - Token::Array(t) => format!("{}[]", map_type(&t.inner)), - _ => panic!("Unsupported token type: {:?}", token), - } - } - let args = system .inputs .iter() - .map(|arg| format!("{} {}", map_type(&arg.1), &arg.0)) + .map(|arg| format!("{} {}", UnityPlugin::map_type(&arg.1), &arg.0)) .collect::>() .join(", "); @@ -214,21 +256,18 @@ public class {} : ModelInstance {{ .inners .iter() .map(|field| { - format!( - "new FieldElement({}.{}).Inner()", - type_name, field.name - ) + format!("new FieldElement({}.{}).Inner", type_name, field.name) }) .collect::>() .join(",\n "), _ => { - format!("new FieldElement({}).Inner()", type_name) + format!("new FieldElement({}).Inner", type_name) } } } - None => match UnityPlugin::map_type(type_name).as_str() { - "FieldElement" => format!("{}.Inner()", type_name), - _ => format!("new FieldElement({}).Inner()", type_name), + None => match UnityPlugin::map_type(token).as_str() { + "FieldElement" => format!("{}.Inner", type_name), + _ => format!("new FieldElement({}).Inner", type_name), }, } }) diff --git a/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts b/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts index 0e807cd262..1c1c19c7bb 100644 --- a/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts +++ b/crates/dojo-bindgen/src/test_data/mocks/dojo_examples.ts @@ -1,4 +1,4 @@ -// Generated by dojo-bindgen on Wed, 17 Apr 2024 07:58:49 +0000. Do not modify this file manually. +// Generated by dojo-bindgen on Tue, 28 May 2024 15:30:47 +0000. Do not modify this file manually. import { Account } from "starknet"; import { Clause, @@ -14,22 +14,6 @@ import { createManifestFromJson, } from "@dojoengine/core"; -// Type definition for `dojo_examples::models::EmoteMessage` struct -export interface EmoteMessage { - identity: string; - emote: Emote; -} - -// Type definition for `dojo_examples::models::Emote` enum -export enum Emote { - None, - Happy, - Sad, - Angry, - Love, -} - - // Type definition for `dojo_examples::models::Vec2` struct export interface Vec2 { x: number; @@ -42,6 +26,15 @@ export interface Position { vec: Vec2; } +// Type definition for `core::byte_array::ByteArray` struct +export interface ByteArray { + data: string[]; + pending_word: string; + pending_word_len: number; +} + +// Type definition for `core::option::Option::` enum +type Option = { type: 'Some'; data: A; } | { type: 'None'; } // Type definition for `dojo_examples::actions::actions::Moved` struct export interface Moved { @@ -50,14 +43,7 @@ export interface Moved { } // Type definition for `dojo_examples::models::Direction` enum -export enum Direction { - None, - Left, - Right, - Up, - Down, -} - +type Direction = { type: 'None'; } | { type: 'Left'; } | { type: 'Right'; } | { type: 'Up'; } | { type: 'Down'; } // Type definition for `dojo_examples::models::Moves` struct export interface Moves { @@ -66,13 +52,28 @@ export interface Moves { last_direction: Direction; } -// Type definition for `dojo_examples::models::Direction` enum -export enum Direction { - None, - Left, - Right, - Up, - Down, + +// Type definition for `dojo_examples::models::EmoteMessage` struct +export interface EmoteMessage { + identity: string; + emote: Emote; +} + +// Type definition for `dojo_examples::models::Emote` enum +type Emote = { type: 'None'; } | { type: 'Happy'; } | { type: 'Sad'; } | { type: 'Angry'; } | { type: 'Love'; } + +// Type definition for `dojo_examples::models::PlayerItem` struct +export interface PlayerItem { + item_id: number; + quantity: number; +} + +// Type definition for `dojo_examples::models::PlayerConfig` struct +export interface PlayerConfig { + player: string; + name: string; + items: PlayerItem[]; + favorite_item: Option; } @@ -129,15 +130,6 @@ class ActionsCalls extends BaseCalls { } } - async dojoResource(): Promise { - try { - await this.execute("dojo_resource", []) - } catch (error) { - console.error("Error executing dojoResource:", error); - throw error; - } - } - async spawn(): Promise { try { await this.execute("spawn", []) @@ -155,20 +147,42 @@ class ActionsCalls extends BaseCalls { throw error; } } + + async setPlayerConfig(name: string): Promise { + try { + await this.execute("set_player_config", [props.name.data, + props.name.pending_word, + props.name.pending_word_len]) + } catch (error) { + console.error("Error executing setPlayerConfig:", error); + throw error; + } + } + + async dojoResource(): Promise { + try { + await this.execute("dojo_resource", []) + } catch (error) { + console.error("Error executing dojoResource:", error); + throw error; + } + } } type Query = Partial<{ - EmoteMessage: ModelClause; Position: ModelClause; Moved: ModelClause; Moves: ModelClause; + EmoteMessage: ModelClause; + PlayerConfig: ModelClause; }>; type ResultMapping = { - EmoteMessage: EmoteMessage; Position: Position; Moved: Moved; Moves: Moves; + EmoteMessage: EmoteMessage; + PlayerConfig: PlayerConfig; }; type QueryResult = { From 328004d65bbbf7692c26f030b75fa95b7947841d Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 29 May 2024 15:25:50 -0400 Subject: [PATCH 09/88] Prepare release: v0.7.0-alpha.5 (#2018) Co-authored-by: glihm --- Cargo.lock | 84 ++++++++++---------- Cargo.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ed743aa54..530db77742 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "clap", @@ -3764,7 +3764,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -4537,7 +4537,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "async-trait", "cainome", @@ -4553,15 +4553,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" [[package]] name = "dojo-lang" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -4612,7 +4612,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "cairo-lang-language-server", "clap", @@ -4621,7 +4621,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "hyper 0.14.28", @@ -4639,7 +4639,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "assert_fs", @@ -4673,7 +4673,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "cainome", "crypto-bigint", @@ -4689,7 +4689,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "assert_fs", @@ -4728,7 +4728,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7770,7 +7770,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-primitives", "anyhow", @@ -7797,7 +7797,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -7810,7 +7810,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "bytes", "katana-primitives", @@ -7818,7 +7818,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "proc-macro2", "quote", @@ -7828,7 +7828,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-contract", "alloy-network", @@ -7876,7 +7876,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7898,7 +7898,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-primitives", "anyhow", @@ -7925,7 +7925,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-primitives", "anyhow", @@ -7950,7 +7950,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-primitives", "anyhow", @@ -7976,7 +7976,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "assert_matches", @@ -8014,7 +8014,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8025,7 +8025,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-primitives", "anyhow", @@ -8046,7 +8046,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "katana-executor", @@ -8058,7 +8058,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "assert_fs", @@ -8077,7 +8077,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "futures", "rayon", @@ -11388,7 +11388,7 @@ checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "runner-macro" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "quote", "syn 2.0.64", @@ -11656,7 +11656,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "clap", @@ -11675,7 +11675,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-trait", @@ -11715,7 +11715,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "alloy-primitives", "anyhow", @@ -12479,7 +12479,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "assert_fs", @@ -12538,7 +12538,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "assert_fs", @@ -12593,7 +12593,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "starknet", @@ -13864,7 +13864,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-trait", @@ -13909,7 +13909,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "async-trait", "camino", @@ -13937,7 +13937,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-trait", @@ -13976,7 +13976,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-graphql", @@ -14017,7 +14017,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "bytes", "crypto-bigint", @@ -14060,7 +14060,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-trait", @@ -14095,7 +14095,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-trait", @@ -14418,7 +14418,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" [[package]] name = "ucd-trie" diff --git a/Cargo.toml b/Cargo.toml index 743d01ddd2..0675d09c79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" [profile.performance] codegen-units = 1 diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 3388fce369..3b7767c142 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.0-alpha.4" +version = "0.7.0-alpha.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 21fe88d67c9bc93adcf5252d730c6e04567636e3 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 29 May 2024 17:17:12 -0400 Subject: [PATCH 10/88] Update devcontainer image: v0.7.0-alpha.5 (#2019) Co-authored-by: glihm --- .devcontainer/devcontainer.json | 2 +- .github/workflows/bench.yml | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/release-dispatch.yml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2bc351e17b..176190883c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust { "name": "Rust", - "image": "ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4", + "image": "ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5", "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 41dc041da9..904d05fc3a 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93377d7076..85f421dbfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: test: runs-on: ubuntu-latest-32-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -33,7 +33,7 @@ jobs: ensure-wasm: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -67,7 +67,7 @@ jobs: dojo-core-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -76,7 +76,7 @@ jobs: dojo-spawn-and-move-example-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -85,7 +85,7 @@ jobs: dojo-world-bindings-check: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -94,7 +94,7 @@ jobs: clippy: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -103,7 +103,7 @@ jobs: fmt: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -112,7 +112,7 @@ jobs: docs: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index 7c86630132..944accd1ea 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -14,7 +14,7 @@ jobs: contents: write runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.4 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 env: VERSION: "" steps: From ce5602885d0ba34629d623e9c82747cb22408965 Mon Sep 17 00:00:00 2001 From: glihm Date: Fri, 31 May 2024 00:24:16 +0200 Subject: [PATCH 11/88] fix: reenable metadata upload test (#2022) --- crates/dojo-world/src/metadata_test.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 6a5938d2f2..64d93723c4 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -64,8 +64,6 @@ socials.x = "https://x.com/dojostarknet" assert_eq!(world.socials.unwrap().get("x"), Some(&"https://x.com/dojostarknet".to_string())); } -// TODO: remove ignore once IPFS node is running. -#[ignore] #[tokio::test] async fn world_metadata_hash_and_upload() { let meta = WorldMetadata { From d9c4f4f1e3112142c6f8b80c6e88190b5a90c19d Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 31 May 2024 09:40:01 -0400 Subject: [PATCH 12/88] feat(torii-grpc): finalize join sql query to support new layout (#2017) * feat: update join sql query to support new types * refactor: clean building slq query * refactor: further clean up mapping grpc rows to ty * feat: update grpc to use new map to row to ty * feat: add full_array_id column for array entities * feat: new column for full_array_id that has array indexes with entity ids * feat: fetching and filtering arrays rows * feat: complete tests & handling complex enums * chor: clippy * chore: clippy * fix: event messages edge case for no clause * fix: event messages table --- crates/torii/core/src/model.rs | 622 ++++++++++++++---- crates/torii/core/src/sql.rs | 14 + crates/torii/grpc/src/server/mod.rs | 142 ++-- .../grpc/src/server/subscriptions/entity.rs | 33 +- .../src/server/subscriptions/event_message.rs | 32 +- crates/torii/grpc/src/types/schema.rs | 51 +- 6 files changed, 691 insertions(+), 203 deletions(-) diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index 05790a3851..fff8ae6c53 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -1,3 +1,4 @@ +use std::collections::HashMap; use std::str::FromStr; use async_trait::async_trait; @@ -211,46 +212,118 @@ pub fn build_sql_query( model_schemas: &Vec, entities_table: &str, entity_relation_column: &str, -) -> Result { - fn parse_struct( + where_clause: Option<&str>, + where_clause_arrays: Option<&str>, +) -> Result<(String, HashMap), Error> { + fn parse_ty( path: &str, - schema: &Struct, + name: &str, + ty: &Ty, selections: &mut Vec, tables: &mut Vec, + arrays_queries: &mut HashMap, Vec)>, ) { - for child in &schema.children { - match &child.ty { - Ty::Struct(s) => { - let table_name = format!("{}${}", path, child.name); - parse_struct(&table_name, s, selections, tables); + match &ty { + Ty::Struct(s) => { + // struct can be the main entrypoint to our model schema + // so we dont format the table name if the path is empty + let table_name = + if path.is_empty() { s.name.clone() } else { format!("{}${}", path, name) }; + + for child in &s.children { + parse_ty( + &table_name, + &child.name, + &child.ty, + selections, + tables, + arrays_queries, + ); + } - tables.push(table_name); + tables.push(table_name); + } + Ty::Tuple(t) => { + let table_name = format!("{}${}", path, name); + for (i, child) in t.iter().enumerate() { + parse_ty( + &table_name, + &format!("_{}", i), + child, + selections, + tables, + arrays_queries, + ); + } + + tables.push(table_name); + } + Ty::Array(t) => { + let table_name = format!("{}${}", path, name); + + let mut array_selections = Vec::new(); + let mut array_tables = vec![table_name.clone()]; + + parse_ty( + &table_name, + "data", + &t[0], + &mut array_selections, + &mut array_tables, + arrays_queries, + ); + + arrays_queries.insert(table_name, (array_selections, array_tables)); + } + Ty::Enum(e) => { + let table_name = format!("{}${}", path, name); + + let mut is_typed = false; + for option in &e.options { + if let Ty::Tuple(t) = &option.ty { + if t.is_empty() { + continue; + } + } + + parse_ty( + &table_name, + &option.name, + &option.ty, + selections, + tables, + arrays_queries, + ); + is_typed = true; } - _ => { - // alias selected columns to avoid conflicts in `JOIN` - selections.push(format!( - "{}.external_{} AS \"{}.{}\"", - path, child.name, path, child.name - )); + + selections.push(format!("{}.external_{} AS \"{}.{}\"", path, name, path, name)); + if is_typed { + tables.push(table_name); } } + _ => { + // alias selected columns to avoid conflicts in `JOIN` + selections.push(format!("{}.external_{} AS \"{}.{}\"", path, name, path, name)); + } } } let mut global_selections = Vec::new(); - let mut global_tables = - model_schemas.iter().enumerate().map(|(_, schema)| schema.name()).collect::>(); + let mut global_tables = Vec::new(); + + let mut arrays_queries = HashMap::new(); for ty in model_schemas { let schema = ty.as_struct().expect("schema should be struct"); - let model_table = &schema.name; - let mut selections = Vec::new(); - let mut tables = Vec::new(); - - parse_struct(model_table, schema, &mut selections, &mut tables); - - global_selections.push(selections.join(", ")); - global_tables.extend(tables); + parse_ty( + "", + &schema.name, + ty, + &mut global_selections, + &mut global_tables, + &mut arrays_queries, + ); } // TODO: Fallback to subqueries, SQLite has a max limit of 64 on 'table 'JOIN' @@ -267,91 +340,188 @@ pub fn build_sql_query( .collect::>() .join(" "); - Ok(format!( + let mut formatted_arrays_queries: HashMap = arrays_queries + .into_iter() + .map(|(table, (selections, tables))| { + let mut selections_clause = selections.join(", "); + if !selections_clause.is_empty() { + selections_clause = format!(", {}", selections_clause); + } + + let join_clause = tables + .iter() + .enumerate() + .map(|(idx, table)| { + if idx == 0 { + format!( + " JOIN {table} ON {entities_table}.id = \ + {table}.{entity_relation_column}" + ) + } else { + format!( + " JOIN {table} ON {table}.full_array_id = {prev_table}.full_array_id", + prev_table = tables[idx - 1] + ) + } + }) + .collect::>() + .join(" "); + + ( + table, + format!( + "SELECT {entities_table}.id, {entities_table}.keys{selections_clause} FROM \ + {entities_table}{join_clause}", + ), + ) + }) + .collect(); + + let mut query = format!( "SELECT {entities_table}.id, {entities_table}.keys, {selections_clause} FROM \ {entities_table}{join_clause}" - )) + ); + + if let Some(where_clause) = where_clause { + query = format!("{} WHERE {}", query, where_clause); + } + + if let Some(where_clause_arrays) = where_clause_arrays { + for (_, formatted_query) in formatted_arrays_queries.iter_mut() { + *formatted_query = format!("{} WHERE {}", formatted_query, where_clause_arrays); + } + } + + Ok((query, formatted_arrays_queries)) } /// Populate the values of a Ty (schema) from SQLite row. -pub fn map_row_to_ty(path: &str, struct_ty: &mut Struct, row: &SqliteRow) -> Result<(), Error> { - for member in struct_ty.children.iter_mut() { - let column_name = format!("{}.{}", path, member.name); - match &mut member.ty { - Ty::Primitive(primitive) => { - match &primitive { - Primitive::Bool(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_bool(Some(value))?; - } - Primitive::USize(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_usize(Some(value))?; - } - Primitive::U8(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_u8(Some(value))?; - } - Primitive::U16(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_u16(Some(value))?; - } - Primitive::U32(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_u32(Some(value))?; - } - Primitive::U64(_) => { - let value = row.try_get::(&column_name)?; - let hex_str = value.trim_start_matches("0x"); - primitive.set_u64(Some( - u64::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, - ))?; - } - Primitive::U128(_) => { - let value = row.try_get::(&column_name)?; - let hex_str = value.trim_start_matches("0x"); - primitive.set_u128(Some( - u128::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, - ))?; - } - Primitive::U256(_) => { - let value = row.try_get::(&column_name)?; - let hex_str = value.trim_start_matches("0x"); - primitive.set_u256(Some(U256::from_be_hex(hex_str)))?; - } - Primitive::Felt252(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_felt252(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; - } - Primitive::ClassHash(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_contract_address(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; - } - Primitive::ContractAddress(_) => { - let value = row.try_get::(&column_name)?; - primitive.set_contract_address(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; - } - }; - } - Ty::Enum(enum_ty) => { - let value = row.try_get::(&column_name)?; - enum_ty.set_option(&value)?; +pub fn map_row_to_ty( + path: &str, + name: &str, + ty: &mut Ty, + // the row that contains non dynamic data for Ty + row: &SqliteRow, + // a hashmap where keys are the paths for the model + // arrays and values are the rows mapping to each element + // in the array + arrays_rows: &HashMap>, +) -> Result<(), Error> { + let column_name = format!("{}.{}", path, name); + match ty { + Ty::Primitive(primitive) => { + match &primitive { + Primitive::Bool(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_bool(Some(value))?; + } + Primitive::USize(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_usize(Some(value))?; + } + Primitive::U8(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_u8(Some(value))?; + } + Primitive::U16(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_u16(Some(value))?; + } + Primitive::U32(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_u32(Some(value))?; + } + Primitive::U64(_) => { + let value = row.try_get::(&column_name)?; + let hex_str = value.trim_start_matches("0x"); + primitive.set_u64(Some( + u64::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, + ))?; + } + Primitive::U128(_) => { + let value = row.try_get::(&column_name)?; + let hex_str = value.trim_start_matches("0x"); + primitive.set_u128(Some( + u128::from_str_radix(hex_str, 16).map_err(ParseError::ParseIntError)?, + ))?; + } + Primitive::U256(_) => { + let value = row.try_get::(&column_name)?; + let hex_str = value.trim_start_matches("0x"); + primitive.set_u256(Some(U256::from_be_hex(hex_str)))?; + } + Primitive::Felt252(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_felt252(Some( + FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + ))?; + } + Primitive::ClassHash(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_contract_address(Some( + FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + ))?; + } + Primitive::ContractAddress(_) => { + let value = row.try_get::(&column_name)?; + primitive.set_contract_address(Some( + FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + ))?; + } + }; + } + Ty::Enum(enum_ty) => { + let option = row.try_get::(&column_name)?; + enum_ty.set_option(&option)?; + + let path = [path, &name].join("$"); + for option in &mut enum_ty.options { + map_row_to_ty(&path, &option.name, &mut option.ty, row, arrays_rows)?; } - Ty::Struct(struct_ty) => { - let path = [path, &member.name].join("$"); - map_row_to_ty(&path, struct_ty, row)?; + } + Ty::Struct(struct_ty) => { + // struct can be the main entrypoint to our model schema + // so we dont format the table name if the path is empty + let path = + if path.is_empty() { struct_ty.name.clone() } else { [path, &name].join("$") }; + + for member in &mut struct_ty.children { + map_row_to_ty(&path, &member.name, &mut member.ty, row, arrays_rows)?; } - ty => { - unimplemented!("unimplemented type_enum: {ty}"); + } + Ty::Tuple(ty) => { + let path = [path, &name].join("$"); + + for (i, member) in ty.iter_mut().enumerate() { + map_row_to_ty(&path, &format!("_{}", i), member, row, arrays_rows)?; } - }; - } + } + Ty::Array(ty) => { + let path = [path, &name].join("$"); + // filter by entity id in case we have multiple entities + let rows = arrays_rows + .get(&path) + .expect("qed; rows should exist") + .iter() + .filter(|array_row| array_row.get::("id") == row.get::("id")) + .collect::>(); + + // map each row to the ty of the array + let tys = rows + .iter() + .map(|row| { + let mut ty = ty[0].clone(); + map_row_to_ty(&path, "data", &mut ty, row, arrays_rows).map(|_| ty) + }) + .collect::, _>>()?; + + *ty = tys; + } + Ty::ByteArray(bytearray) => { + let value = row.try_get::(&column_name)?; + *bytearray = value; + } + }; Ok(()) } @@ -386,9 +556,19 @@ mod tests { type_enum: "Primitive".into(), enum_options: None, }, + SqlModelMember { + id: "PlayerConfig".into(), + name: "name".into(), + r#type: "ByteArray".into(), + key: false, + model_idx: 0, + member_idx: 0, + type_enum: "ByteArray".into(), + enum_options: None, + }, ]; - let expected_ty = Ty::Struct(Struct { + let expected_position = Ty::Struct(Struct { name: "Position".into(), children: vec![ dojo_types::schema::Member { @@ -404,7 +584,17 @@ mod tests { ], }); - assert_eq!(parse_sql_model_members("Position", &model_members), expected_ty); + let expected_player_config = Ty::Struct(Struct { + name: "PlayerConfig".into(), + children: vec![dojo_types::schema::Member { + name: "name".into(), + key: false, + ty: Ty::ByteArray("".to_string()), + }], + }); + + assert_eq!(parse_sql_model_members("Position", &model_members), expected_position); + assert_eq!(parse_sql_model_members("PlayerConfig", &model_members), expected_player_config); } #[test] @@ -460,9 +650,79 @@ mod tests { type_enum: "Primitive".into(), enum_options: None, }, + SqlModelMember { + id: "PlayerConfig".into(), + name: "favorite_item".into(), + r#type: "Option".into(), + key: false, + model_idx: 0, + member_idx: 0, + type_enum: "Enum".into(), + enum_options: Some("None,Some".into()), + }, + SqlModelMember { + id: "PlayerConfig".into(), + name: "items".into(), + r#type: "Array".into(), + key: false, + model_idx: 0, + member_idx: 1, + type_enum: "Array".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$items".into(), + name: "data".into(), + r#type: "PlayerItem".into(), + key: false, + model_idx: 0, + member_idx: 1, + type_enum: "Struct".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$items$data".into(), + name: "item_id".into(), + r#type: "u32".into(), + key: false, + model_idx: 0, + member_idx: 0, + type_enum: "Primitive".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$items$data".into(), + name: "quantity".into(), + r#type: "u32".into(), + key: false, + model_idx: 0, + member_idx: 1, + type_enum: "Primitive".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$favorite_item".into(), + name: "Some".into(), + r#type: "u32".into(), + key: false, + model_idx: 1, + member_idx: 0, + type_enum: "Primitive".into(), + enum_options: None, + }, + SqlModelMember { + id: "PlayerConfig$favorite_item".into(), + name: "option".into(), + r#type: "Option".into(), + key: false, + model_idx: 1, + member_idx: 0, + type_enum: "Enum".into(), + enum_options: Some("None,Some".into()), + }, ]; - let expected_ty = Ty::Struct(Struct { + let expected_position = Ty::Struct(Struct { name: "Position".into(), children: vec![ dojo_types::schema::Member { @@ -497,7 +757,48 @@ mod tests { ], }); - assert_eq!(parse_sql_model_members("Position", &model_members), expected_ty); + let expected_player_config = Ty::Struct(Struct { + name: "PlayerConfig".into(), + children: vec![ + dojo_types::schema::Member { + name: "favorite_item".into(), + key: false, + ty: Ty::Enum(Enum { + name: "Option".into(), + option: None, + options: vec![ + EnumOption { name: "None".into(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".into(), + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + }), + }, + dojo_types::schema::Member { + name: "items".into(), + key: false, + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".into(), + children: vec![ + Member { + name: "item_id".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + Member { + name: "quantity".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + })]), + }, + ], + }); + + assert_eq!(parse_sql_model_members("Position", &model_members), expected_position); + assert_eq!(parse_sql_model_members("PlayerConfig", &model_members), expected_player_config); } #[test] @@ -536,18 +837,13 @@ mod tests { #[test] fn struct_ty_to_query() { - let ty = Ty::Struct(Struct { + let position = Ty::Struct(Struct { name: "Position".into(), children: vec![ dojo_types::schema::Member { - name: "name".into(), - key: false, - ty: Ty::Primitive("felt252".parse().unwrap()), - }, - dojo_types::schema::Member { - name: "age".into(), - key: false, - ty: Ty::Primitive("u8".parse().unwrap()), + name: "player".into(), + key: true, + ty: Ty::Primitive("ContractAddress".parse().unwrap()), }, dojo_types::schema::Member { name: "vec".into(), @@ -558,23 +854,105 @@ mod tests { Member { name: "x".into(), key: false, - ty: Ty::Primitive("u256".parse().unwrap()), + ty: Ty::Primitive("u32".parse().unwrap()), }, Member { name: "y".into(), key: false, - ty: Ty::Primitive("u256".parse().unwrap()), + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + }), + }, + dojo_types::schema::Member { + name: "test_everything".into(), + key: false, + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "TestEverything".into(), + children: vec![Member { + name: "data".into(), + key: false, + ty: Ty::Tuple(vec![ + Ty::Array(vec![Ty::Primitive("u32".parse().unwrap())]), + Ty::Array(vec![Ty::Array(vec![Ty::Tuple(vec![ + Ty::Primitive("u32".parse().unwrap()), + Ty::Struct(Struct { + name: "Vec2".into(), + children: vec![ + Member { + name: "x".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + Member { + name: "y".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + }), + ])])]), + ]), + }], + })]), + }, + ], + }); + + let player_config = Ty::Struct(Struct { + name: "PlayerConfig".into(), + children: vec![ + dojo_types::schema::Member { + name: "favorite_item".into(), + key: false, + ty: Ty::Enum(Enum { + name: "Option".into(), + option: None, + options: vec![ + EnumOption { name: "None".into(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".into(), + ty: Ty::Primitive("u32".parse().unwrap()), }, ], }), }, + dojo_types::schema::Member { + name: "items".into(), + key: false, + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".into(), + children: vec![ + Member { + name: "item_id".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + Member { + name: "quantity".into(), + key: false, + ty: Ty::Primitive("u32".parse().unwrap()), + }, + ], + })]), + }, ], }); - let query = build_sql_query(&vec![ty], "entities", "entity_id").unwrap(); - assert_eq!( - query, - r#"SELECT entities.id, entities.keys, Position.external_name AS "Position.name", Position.external_age AS "Position.age", Position$vec.external_x AS "Position$vec.x", Position$vec.external_y AS "Position$vec.y" FROM entities JOIN Position ON entities.id = Position.entity_id JOIN Position$vec ON entities.id = Position$vec.entity_id"# - ); + let query = + build_sql_query(&vec![position, player_config], "entities", "entity_id", None, None) + .unwrap(); + + let expected_query = + "SELECT entities.id, entities.keys, Position.external_player AS \"Position.player\", \ + Position$vec.external_x AS \"Position$vec.x\", Position$vec.external_y AS \ + \"Position$vec.y\", PlayerConfig$favorite_item.external_Some AS \ + \"PlayerConfig$favorite_item.Some\", PlayerConfig.external_favorite_item AS \ + \"PlayerConfig.favorite_item\" FROM entities JOIN Position$vec ON entities.id = \ + Position$vec.entity_id JOIN Position ON entities.id = Position.entity_id JOIN \ + PlayerConfig$favorite_item ON entities.id = PlayerConfig$favorite_item.entity_id \ + JOIN PlayerConfig ON entities.id = PlayerConfig.entity_id"; + // todo: completely tests arrays + assert_eq!(query.0, expected_query); } } diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index efe9190150..e0d89bf3b4 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -516,6 +516,16 @@ impl Sql { Argument::String(entity_id.to_string()), ]; + if !indexes.is_empty() { + columns.push("full_array_id".to_string()); + arguments.push(Argument::String( + std::iter::once(entity_id.to_string()) + .chain(indexes.iter().map(|i| i.to_string())) + .collect::>() + .join(FELT_DELIMITER), + )); + } + for (column_idx, idx) in indexes.iter().enumerate() { columns.push(format!("idx_{}", column_idx)); arguments.push(Argument::Int(*idx)); @@ -724,9 +734,13 @@ impl Sql { ); if array_idx > 0 { + // index columns for i in 0..array_idx { create_table_query.push_str(&format!("idx_{i} INTEGER NOT NULL, ", i = i)); } + + // full array id column + create_table_query.push_str("full_array_id TEXT NOT NULL UNIQUE, "); } let mut build_member = |name: &str, ty: &Ty, options: &mut Option| { diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index 3d0f8cbd81..15db131a30 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -4,6 +4,7 @@ pub mod subscriptions; #[cfg(test)] mod tests; +use std::collections::HashMap; use std::future::Future; use std::net::SocketAddr; use std::pin::Pin; @@ -45,9 +46,9 @@ pub(crate) static ENTITIES_TABLE: &str = "entities"; pub(crate) static ENTITIES_MODEL_RELATION_TABLE: &str = "entity_model"; pub(crate) static ENTITIES_ENTITY_RELATION_COLUMN: &str = "entity_id"; -pub(crate) static EVENTS_MESSAGES_TABLE: &str = "events_messages"; -pub(crate) static EVENTS_MESSAGES_MODEL_RELATION_TABLE: &str = "event_model"; -pub(crate) static EVENTS_MESSAGES_ENTITY_RELATION_COLUMN: &str = "event_message_id"; +pub(crate) static EVENT_MESSAGES_TABLE: &str = "event_messages"; +pub(crate) static EVENT_MESSAGES_MODEL_RELATION_TABLE: &str = "event_model"; +pub(crate) static EVENT_MESSAGES_ENTITY_RELATION_COLUMN: &str = "event_message_id"; #[derive(Clone)] pub struct DojoWorld { @@ -162,6 +163,22 @@ impl DojoWorld { .await } + async fn event_messages_all( + &self, + limit: u32, + offset: u32, + ) -> Result<(Vec, u32), Error> { + self.query_by_hashed_keys( + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, + None, + limit, + offset, + ) + .await + } + async fn events_all(&self, limit: u32, offset: u32) -> Result, Error> { let query = r#" SELECT keys, data, transaction_hash @@ -235,19 +252,31 @@ impl DojoWorld { let model_ids: Vec<&str> = models_str.split(',').collect(); let schemas = self.model_cache.schemas(model_ids).await?; - let entity_query = format!( - "{} WHERE {table}.id = ?", - build_sql_query(&schemas, table, entity_relation_column)? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table}.id = ?")), + Some(&format!("{table}.id = ?")), + )?; + let row = sqlx::query(&entity_query).bind(&entity_id).fetch_one(&self.pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(&entity_id).fetch_all(&self.pool).await?; + arrays_rows.insert(name, rows); + } let models = schemas - .iter() - .map(|s| { - let mut struct_ty = s.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&s.name(), &mut struct_ty, &row)?; - - Ok(struct_ty.try_into().unwrap()) + .into_iter() + .map(|mut s| { + map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; + + Ok(s.as_struct() + .expect("schema should be struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; @@ -317,21 +346,34 @@ impl DojoWorld { let schemas = self.model_cache.schemas(model_ids).await?; // query to filter with limit and offset - let entities_query = format!( - "{} WHERE {table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?", - build_sql_query(&schemas, table, entity_relation_column)? - ); + let (entities_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?")), + Some(&format!("{table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?")), + )?; let db_entities = sqlx::query(&entities_query) .bind(&keys_pattern) .bind(limit) .bind(offset) .fetch_all(&self.pool) .await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query) + .bind(&keys_pattern) + .bind(limit) + .bind(offset) + .fetch_all(&self.pool) + .await?; + arrays_rows.insert(name, rows); + } Ok(( db_entities .iter() - .map(|row| Self::map_row_to_entity(row, &schemas)) + .map(|row| Self::map_row_to_entity(row, &arrays_rows, &schemas)) .collect::, Error>>()?, total_count, )) @@ -424,16 +466,26 @@ impl DojoWorld { let table_name = member_clause.model; let column_name = format!("external_{}", member_clause.member); - let member_query = format!( - "{} WHERE {table_name}.{column_name} {comparison_operator} ?", - build_sql_query(&schemas, table, entity_relation_column)? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table_name}.{column_name} {comparison_operator} ?")), + None, + )?; let db_entities = - sqlx::query(&member_query).bind(comparison_value).fetch_all(&self.pool).await?; + sqlx::query(&entity_query).bind(comparison_value.clone()).fetch_all(&self.pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = + sqlx::query(&query).bind(comparison_value.clone()).fetch_all(&self.pool).await?; + arrays_rows.insert(name, rows); + } + let entities_collection = db_entities .iter() - .map(|row| Self::map_row_to_entity(row, &schemas)) + .map(|row| Self::map_row_to_entity(row, &arrays_rows, &schemas)) .collect::, Error>>()?; // Since there is not limit and offset, total_count is same as number of entities let total_count = entities_collection.len() as u32; @@ -604,7 +656,7 @@ impl DojoWorld { query: proto::types::Query, ) -> Result { let (entities, total_count) = match query.clause { - None => self.entities_all(query.limit, query.offset).await?, + None => self.event_messages_all(query.limit, query.offset).await?, Some(clause) => { let clause_type = clause.clause_type.ok_or(QueryError::MissingParam("clause_type".into()))?; @@ -616,9 +668,9 @@ impl DojoWorld { } self.query_by_hashed_keys( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, - EVENTS_MESSAGES_ENTITY_RELATION_COLUMN, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, Some(hashed_keys), query.limit, query.offset, @@ -635,9 +687,9 @@ impl DojoWorld { } self.query_by_keys( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, - EVENTS_MESSAGES_ENTITY_RELATION_COLUMN, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, keys, query.limit, query.offset, @@ -646,9 +698,9 @@ impl DojoWorld { } ClauseType::Member(member) => { self.query_by_member( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, - EVENTS_MESSAGES_ENTITY_RELATION_COLUMN, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_ENTITY_RELATION_COLUMN, member, query.limit, query.offset, @@ -657,8 +709,8 @@ impl DojoWorld { } ClauseType::Composite(composite) => { self.query_by_composite( - EVENTS_MESSAGES_TABLE, - EVENTS_MESSAGES_MODEL_RELATION_TABLE, + EVENT_MESSAGES_TABLE, + EVENT_MESSAGES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, composite, query.limit, @@ -684,16 +736,24 @@ impl DojoWorld { Ok(RetrieveEventsResponse { events }) } - fn map_row_to_entity(row: &SqliteRow, schemas: &[Ty]) -> Result { + fn map_row_to_entity( + row: &SqliteRow, + arrays_rows: &HashMap>, + schemas: &[Ty], + ) -> Result { let hashed_keys = FieldElement::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; let models = schemas .iter() .map(|schema| { - let mut struct_ty = schema.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&schema.name(), &mut struct_ty, row)?; - - Ok(struct_ty.try_into().unwrap()) + let mut schema = schema.to_owned(); + map_row_to_ty("", &schema.name(), &mut schema, row, arrays_rows)?; + Ok(schema + .as_struct() + .expect("schema should be struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index a92b88543d..1573b5c61f 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -102,20 +102,31 @@ impl Service { let model_ids: Vec<&str> = model_ids.split(',').collect(); let schemas = cache.schemas(model_ids).await?; - let entity_query = format!( - "{} WHERE entities.id = ?", - build_sql_query(&schemas, "entities", "entity_id")? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + "entities", + "entity_id", + Some("entities.id = ?"), + Some("entities.id = ?"), + )?; + let row = sqlx::query(&entity_query).bind(hashed_keys).fetch_one(&pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let row = sqlx::query(&query).bind(hashed_keys).fetch_all(&pool).await?; + arrays_rows.insert(name, row); + } let models = schemas - .iter() - .map(|s| { - let mut struct_ty = - s.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&s.name(), &mut struct_ty, &row)?; - - Ok(struct_ty.try_into().unwrap()) + .into_iter() + .map(|mut s| { + map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; + + Ok(s.as_struct() + .expect("schema should be a struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 76796e30de..736f88c0f9 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -101,20 +101,30 @@ impl Service { let model_ids: Vec<&str> = model_ids.split(',').collect(); let schemas = cache.schemas(model_ids).await?; - let entity_query = format!( - "{} WHERE event_messages.id = ?", - build_sql_query(&schemas, "event_messages", "event_message_id")? - ); + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + "event_messages", + "event_message_id", + Some("event_messages.id = ?"), + Some("event_messages.id = ?"), + )?; + let row = sqlx::query(&entity_query).bind(hashed_keys).fetch_one(&pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(hashed_keys).fetch_all(&pool).await?; + arrays_rows.insert(name, rows); + } let models = schemas - .iter() - .map(|s| { - let mut struct_ty = - s.as_struct().expect("schema should be struct").to_owned(); - map_row_to_ty(&s.name(), &mut struct_ty, &row)?; - - Ok(struct_ty.try_into().unwrap()) + .into_iter() + .map(|mut s| { + map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; + Ok(s.as_struct() + .expect("schema should be a struct") + .to_owned() + .try_into() + .unwrap()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/types/schema.rs b/crates/torii/grpc/src/types/schema.rs index c1007d6e48..36c0e926b3 100644 --- a/crates/torii/grpc/src/types/schema.rs +++ b/crates/torii/grpc/src/types/schema.rs @@ -64,7 +64,7 @@ impl TryFrom for proto::types::Ty { Ty::Primitive(primitive) => { Some(proto::types::ty::TyType::Primitive(primitive.try_into()?)) } - Ty::Enum(r#enum) => Some(proto::types::ty::TyType::Enum(r#enum.into())), + Ty::Enum(r#enum) => Some(proto::types::ty::TyType::Enum(r#enum.try_into()?)), Ty::Struct(r#struct) => Some(proto::types::ty::TyType::Struct(r#struct.try_into()?)), Ty::Tuple(tuple) => Some(proto::types::ty::TyType::Tuple(proto::types::Array { children: tuple @@ -107,35 +107,50 @@ impl TryFrom for proto::types::Member { } } -impl From for EnumOption { - fn from(option: proto::types::EnumOption) -> Self { - EnumOption { name: option.name, ty: Ty::Tuple(vec![]) } +impl TryFrom for EnumOption { + type Error = SchemaError; + fn try_from(option: proto::types::EnumOption) -> Result { + Ok(EnumOption { + name: option.name, + ty: option.ty.ok_or(SchemaError::MissingExpectedData)?.try_into()?, + }) } } -impl From for proto::types::EnumOption { - fn from(option: EnumOption) -> Self { - proto::types::EnumOption { name: option.name, ty: None } +impl TryFrom for proto::types::EnumOption { + type Error = SchemaError; + fn try_from(option: EnumOption) -> Result { + Ok(proto::types::EnumOption { name: option.name, ty: Some(option.ty.try_into()?) }) } } -impl From for Enum { - fn from(r#enum: proto::types::Enum) -> Self { - Enum { +impl TryFrom for Enum { + type Error = SchemaError; + fn try_from(r#enum: proto::types::Enum) -> Result { + Ok(Enum { name: r#enum.name.clone(), option: Some(r#enum.option as u8), - options: r#enum.options.into_iter().map(Into::into).collect::>(), - } + options: r#enum + .options + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + }) } } -impl From for proto::types::Enum { - fn from(r#enum: Enum) -> Self { - proto::types::Enum { +impl TryFrom for proto::types::Enum { + type Error = SchemaError; + fn try_from(r#enum: Enum) -> Result { + Ok(proto::types::Enum { name: r#enum.name, option: r#enum.option.expect("option value") as u32, - options: r#enum.options.into_iter().map(Into::into).collect::>(), - } + options: r#enum + .options + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + }) } } @@ -280,7 +295,7 @@ impl TryFrom for Ty { Ok(Ty::Primitive(primitive.try_into()?)) } proto::types::ty::TyType::Struct(r#struct) => Ok(Ty::Struct(r#struct.try_into()?)), - proto::types::ty::TyType::Enum(r#enum) => Ok(Ty::Enum(r#enum.into())), + proto::types::ty::TyType::Enum(r#enum) => Ok(Ty::Enum(r#enum.try_into()?)), proto::types::ty::TyType::Tuple(array) => Ok(Ty::Tuple( array.children.into_iter().map(TryInto::try_into).collect::, _>>()?, )), From 9e257131620f78d7339c326c9047a7f6bfab9617 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Wed, 5 Jun 2024 18:31:04 +0530 Subject: [PATCH 13/88] feat(sozo): make few argument global (#2029) * make profile arguments global * make offline flag global --- bin/sozo/src/args.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/sozo/src/args.rs b/bin/sozo/src/args.rs index ba11d6a5b1..928bc8a4b1 100644 --- a/bin/sozo/src/args.rs +++ b/bin/sozo/src/args.rs @@ -33,7 +33,7 @@ pub struct SozoArgs { #[arg(long)] #[arg(env = "SOZO_OFFLINE")] - #[arg(hide_short_help = true)] + #[arg(hide_short_help = true, global = true)] #[arg(help = "Run without accessing the network.")] pub offline: bool, @@ -70,15 +70,15 @@ impl SozoArgs { #[derive(Parser, Clone, Debug)] #[group(multiple = false)] pub struct ProfileSpec { - #[arg(short = 'P', long)] + #[arg(short = 'P', long, global = true)] #[arg(help = "Specify profile to use by name.")] pub profile: Option, - #[arg(long, hide_short_help = true)] + #[arg(long, hide_short_help = true, global = true)] #[arg(help = "Use release profile.")] pub release: bool, - #[arg(long, hide_short_help = true)] + #[arg(long, hide_short_help = true, global = true)] #[arg(help = "Use dev profile.")] pub dev: bool, } From 9ea6574d45770d24197ae44947d15068f2a01e2a Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:35:02 -0400 Subject: [PATCH 14/88] fix: metadata update use bytearray (#2031) * fix: metadataupdate use bytearray * chore: get rid of metadata update * fix: remove uri len * chore: clippy * feat: rework resource metadata to match artifacts format --------- Co-authored-by: glihm --- crates/dojo-world/src/metadata.rs | 59 +++++++++++++++++-- crates/dojo-world/src/metadata_test.rs | 13 ++-- crates/sozo/ops/src/migration/migrate.rs | 15 ++--- crates/sozo/ops/src/tests/migration.rs | 8 +-- .../core/src/processors/metadata_update.rs | 15 +---- 5 files changed, 75 insertions(+), 35 deletions(-) diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index 2d50f5fa70..c432d09186 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -109,17 +109,31 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { if let Ok(manifest) = BaseManifest::load_from_path(&manifest_dir.join(BASE_DIR)) { for model in manifest.models { let name = model.name.to_string(); - dojo_metadata.artifacts.insert( + dojo_metadata.resources_artifacts.insert( name.clone(), - build_artifact_from_name(&sources_dir, &abis_dir.join("models"), &name), + ResourceMetadata { + name: name.clone(), + artifacts: build_artifact_from_name( + &sources_dir, + &abis_dir.join("models"), + &name, + ), + }, ); } for contract in manifest.contracts { let name = contract.name.to_string(); - dojo_metadata.artifacts.insert( + dojo_metadata.resources_artifacts.insert( name.clone(), - build_artifact_from_name(&sources_dir, &abis_dir.join("contracts"), &name), + ResourceMetadata { + name: name.clone(), + artifacts: build_artifact_from_name( + &sources_dir, + &abis_dir.join("contracts"), + &name, + ), + }, ); } } @@ -135,12 +149,19 @@ pub struct ProjectMetadata { pub env: Option, } +/// Metadata for a user defined resource (models, contracts). +#[derive(Default, Serialize, Deserialize, Debug, Clone)] +pub struct ResourceMetadata { + pub name: String, + pub artifacts: ArtifactMetadata, +} + /// Metadata collected from the project configuration and the Dojo workspace #[derive(Default, Deserialize, Debug, Clone)] pub struct DojoMetadata { pub world: WorldMetadata, pub env: Option, - pub artifacts: HashMap, + pub resources_artifacts: HashMap, } #[derive(Debug)] @@ -342,6 +363,34 @@ impl ArtifactMetadata { } } +impl ResourceMetadata { + pub async fn upload(&self) -> Result { + let mut meta = self.clone(); + let client = + IpfsClient::from_str(IPFS_CLIENT_URL)?.with_credentials(IPFS_USERNAME, IPFS_PASSWORD); + + if let Some(Uri::File(abi)) = &self.artifacts.abi { + let abi_data = std::fs::read(abi)?; + let reader = Cursor::new(abi_data); + let response = client.add(reader).await?; + meta.artifacts.abi = Some(Uri::Ipfs(format!("ipfs://{}", response.hash))) + }; + + if let Some(Uri::File(source)) = &self.artifacts.source { + let source_data = std::fs::read(source)?; + let reader = Cursor::new(source_data); + let response = client.add(reader).await?; + meta.artifacts.source = Some(Uri::Ipfs(format!("ipfs://{}", response.hash))) + }; + + let serialized = json!(meta).to_string(); + let reader = Cursor::new(serialized); + let response = client.add(reader).await?; + + Ok(response.hash) + } +} + impl DojoMetadata { pub fn env(&self) -> Option<&Environment> { self.env.as_ref() diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 64d93723c4..412230164c 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -174,13 +174,18 @@ async fn get_full_dojo_metadata_from_workspace() { dbg!(&artifacts); for (abi_subdir, name) in artifacts { - let artifact = dojo_metadata.artifacts.get(&name); - assert!(artifact.is_some(), "bad artifact for {}", name); - let artifact = artifact.unwrap(); + let resource = dojo_metadata.resources_artifacts.get(&name); + assert!(resource.is_some(), "bad resource metadata for {}", name); + let resource = resource.unwrap(); let sanitized_name = name.replace("::", "_"); - check_artifact(artifact.clone(), sanitized_name, &abis_dir.join(abi_subdir), &sources_dir); + check_artifact( + resource.artifacts.clone(), + sanitized_name, + &abis_dir.join(abi_subdir), + &sources_dir, + ); } } diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 044479a5d6..831fd22c48 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -9,7 +9,7 @@ use dojo_world::manifest::{ AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, }; -use dojo_world::metadata::{dojo_metadata_from_workspace, ArtifactMetadata}; +use dojo_world::metadata::{dojo_metadata_from_workspace, ResourceMetadata}; use dojo_world::migration::class::ClassMigration; use dojo_world::migration::contract::ContractMigration; use dojo_world::migration::strategy::{generate_salt, prepare_for_migration, MigrationStrategy}; @@ -255,13 +255,12 @@ where /// on success. async fn upload_on_ipfs_and_create_resource( ui: &Ui, - element_name: String, resource_id: FieldElement, - artifact: ArtifactMetadata, + metadata: ResourceMetadata, ) -> Result { - match artifact.upload().await { + match metadata.upload().await { Ok(hash) => { - ui.print_sub(format!("{}: ipfs://{}", element_name, hash)); + ui.print_sub(format!("{}: ipfs://{}", metadata.name, hash)); create_resource_metadata(resource_id, hash) } Err(_) => Err(anyhow!("Failed to upload IPFS resource.")), @@ -330,10 +329,9 @@ where // models if !migration_output.models.is_empty() { for model_name in migration_output.models { - if let Some(m) = dojo_metadata.artifacts.get(&model_name) { + if let Some(m) = dojo_metadata.resources_artifacts.get(&model_name) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, - model_name.clone(), get_selector_from_name(&model_name).expect("ASCII model name"), m.clone(), )); @@ -346,10 +344,9 @@ where if !migrated_contracts.is_empty() { for contract in migrated_contracts { - if let Some(m) = dojo_metadata.artifacts.get(&contract.name) { + if let Some(m) = dojo_metadata.resources_artifacts.get(&contract.name) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, - contract.name.clone(), contract.contract_address, m.clone(), )); diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 708724a4c8..1f82982bf7 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -484,19 +484,19 @@ async fn check_artifact_metadata( ) { let resource = world_reader.metadata(&resource_id).call().await.unwrap(); - let expected_artifact = dojo_metadata.artifacts.get(element_name); + let expected_resource = dojo_metadata.resources_artifacts.get(element_name); assert!( - expected_artifact.is_some(), + expected_resource.is_some(), "Unable to find local artifact metadata for {}", element_name ); - let expected_artifact = expected_artifact.unwrap(); + let expected_resource = expected_resource.unwrap(); check_ipfs_metadata( client, element_name, &resource.metadata_uri.to_string().unwrap(), - expected_artifact, + &expected_resource.artifacts, ) .await; } diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index 07859743b2..ed2432f712 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -4,11 +4,11 @@ use anyhow::{Error, Result}; use async_trait::async_trait; use base64::engine::general_purpose; use base64::Engine as _; +use cainome::cairo_serde::{ByteArray, CairoSerde}; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::{Uri, WorldMetadata}; use reqwest::Client; use starknet::core::types::{Event, MaybePendingTransactionReceipt}; -use starknet::core::utils::parse_cairo_short_string; use starknet::providers::Provider; use starknet_crypto::FieldElement; use tokio_util::bytes::Bytes; @@ -58,18 +58,7 @@ where event: &Event, ) -> Result<(), Error> { let resource = &event.data[0]; - let uri_len: u8 = event.data[1].try_into().unwrap(); - - let uri_str = if uri_len > 0 { - event.data[2..=uri_len as usize + 1] - .iter() - .map(parse_cairo_short_string) - .collect::, _>>()? - .concat() - } else { - "".to_string() - }; - + let uri_str = ByteArray::cairo_deserialize(&event.data, 1)?.to_string()?; info!( target: LOG_TARGET, resource = %format!("{:#x}", resource), From 196732baef4386262003ef0df3fc7f9cbc4ccaf2 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:22:48 -0400 Subject: [PATCH 15/88] feat(torii-libp2p): support new layout types for SNIP-12 typed data (#2032) * feat(torii-libp2p): support new layout types * feat: handle u256 low high * feat: parse SNIP-12 compliant enum * feat: tests for new typed data * chore: move tests to tests.rs --- crates/torii/libp2p/src/server/mod.rs | 411 +++++++++++++++----------- crates/torii/libp2p/src/tests.rs | 257 +++++++++++++++- 2 files changed, 497 insertions(+), 171 deletions(-) diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index fa88af09cd..3562b5a46f 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -9,7 +9,7 @@ use std::{fs, io}; use chrono::Utc; use crypto_bigint::U256; use dojo_types::primitive::Primitive; -use dojo_types::schema::{Struct, Ty}; +use dojo_types::schema::Ty; use futures::StreamExt; use indexmap::IndexMap; use libp2p::core::multiaddr::Protocol; @@ -443,175 +443,174 @@ fn ty_keys(ty: &Ty) -> Result, Error> { } } -pub fn parse_ty_to_object(ty: &Ty) -> Result, Error> { - match ty { - Ty::Struct(struct_ty) => { - let mut object = IndexMap::new(); - for member in &struct_ty.children { - let mut member_object = IndexMap::new(); - member_object.insert("key".to_string(), PrimitiveType::Bool(member.key)); - member_object.insert( - "type".to_string(), - PrimitiveType::String(ty_to_string_type(&member.ty)), - ); - member_object.insert("value".to_string(), parse_ty_to_primitive(&member.ty)?); - object.insert(member.name.clone(), PrimitiveType::Object(member_object)); +pub fn parse_value_to_ty(value: &PrimitiveType, ty: &mut Ty) -> Result<(), Error> { + match value { + PrimitiveType::Object(object) => match ty { + Ty::Struct(struct_) => { + for (key, value) in object { + let member = + struct_.children.iter_mut().find(|member| member.name == *key).ok_or_else( + || Error::InvalidMessageError(format!("Member {} not found", key)), + )?; + + parse_value_to_ty(value, &mut member.ty)?; + } } - Ok(object) - } - _ => Err(Error::InvalidMessageError("Expected Struct type".to_string())), - } -} + // U256 is an object with two u128 fields + // low and high + Ty::Primitive(Primitive::U256(u256)) => { + let mut low = Ty::Primitive(Primitive::U128(None)); + let mut high = Ty::Primitive(Primitive::U128(None)); -pub fn ty_to_string_type(ty: &Ty) -> String { - match ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(_) => "u8".to_string(), - Primitive::U16(_) => "u16".to_string(), - Primitive::U32(_) => "u32".to_string(), - Primitive::USize(_) => "usize".to_string(), - Primitive::U64(_) => "u64".to_string(), - Primitive::U128(_) => "u128".to_string(), - Primitive::U256(_) => "u256".to_string(), - Primitive::Felt252(_) => "felt252".to_string(), - Primitive::ClassHash(_) => "class_hash".to_string(), - Primitive::ContractAddress(_) => "contract_address".to_string(), - Primitive::Bool(_) => "bool".to_string(), - }, - Ty::Struct(_) => "struct".to_string(), - Ty::Tuple(_) => "tuple".to_string(), - Ty::Array(_) => "array".to_string(), - Ty::ByteArray(_) => "bytearray".to_string(), - Ty::Enum(_) => "enum".to_string(), - } -} + // parse the low and high fields + parse_value_to_ty(&object["low"], &mut low)?; + parse_value_to_ty(&object["high"], &mut high)?; -pub fn parse_ty_to_primitive(ty: &Ty) -> Result { - match ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U16(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U32(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + let low = low.as_primitive().unwrap().as_u128().unwrap(); + let high = high.as_primitive().unwrap().as_u128().unwrap(); + + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_be_bytes()); + bytes[16..].copy_from_slice(&low.to_be_bytes()); + + *u256 = Some(U256::from_be_slice(&bytes)); } - Primitive::USize(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + // an enum is a SNIP-12 compliant object with a single key + // where the K is the variant name + // and the value is the variant value + Ty::Enum(enum_) => { + let (option_name, value) = object.first().ok_or_else(|| { + Error::InvalidMessageError("Enum variant not found".to_string()) + })?; + + enum_.options.iter_mut().for_each(|option| { + if option.name == *option_name { + parse_value_to_ty(value, &mut option.ty).unwrap(); + } + }); + + enum_.set_option(option_name).map_err(|e| { + Error::InvalidMessageError(format!("Failed to set enum option: {}", e)) + })?; } - Primitive::U64(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v).unwrap_or(0u64)))) + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid object type for {}", + ty.name() + ))); } - Primitive::U128(value) => Ok(PrimitiveType::String( - value.map(|v| v.to_string()).unwrap_or_else(|| "0".to_string()), - )), - Primitive::U256(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::Felt252(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::ClassHash(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::ContractAddress(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::Bool(value) => Ok(PrimitiveType::Bool(value.unwrap_or(false))), }, - _ => Err(Error::InvalidMessageError("Expected Primitive type".to_string())), - } -} - -pub fn parse_object_to_ty( - model: &mut Struct, - object: &IndexMap, -) -> Result<(), Error> { - for (field_name, value) in object { - let field = model.children.iter_mut().find(|m| m.name == *field_name).ok_or_else(|| { - Error::InvalidMessageError(format!("Field {} not found in model", field_name)) - })?; + PrimitiveType::Array(values) => match ty { + Ty::Array(array) => { + let inner_type = array[0].clone(); + + // clear the array, which contains the inner type + array.clear(); + + // parse each value to the inner type + for value in values { + let mut ty = inner_type.clone(); + parse_value_to_ty(value, &mut ty)?; + array.push(ty); + } + } + Ty::Tuple(tuple) => { + // our array values need to match the length of the tuple + if tuple.len() != values.len() { + return Err(Error::InvalidMessageError("Tuple length mismatch".to_string())); + } - match value { - PrimitiveType::Object(object) => { - parse_object_to_ty(model, object)?; + for (i, value) in tuple.iter_mut().enumerate() { + parse_value_to_ty(&values[i], value)?; + } } - PrimitiveType::Array(_) => { - // tuples not supported yet - unimplemented!() + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid array type for {}", + ty.name() + ))); } - PrimitiveType::Number(number) => match &mut field.ty { - Ty::Primitive(primitive) => match *primitive { - Primitive::U8(ref mut u8) => { - *u8 = Some(number.as_u64().unwrap() as u8); - } - Primitive::U16(ref mut u16) => { - *u16 = Some(number.as_u64().unwrap() as u16); - } - Primitive::U32(ref mut u32) => { - *u32 = Some(number.as_u64().unwrap() as u32); - } - Primitive::USize(ref mut usize) => { - *usize = Some(number.as_u64().unwrap() as u32); - } - Primitive::U64(ref mut u64) => { - *u64 = Some(number.as_u64().unwrap()); - } - _ => { - return Err(Error::InvalidMessageError("Invalid number type".to_string())); - } - }, - Ty::Enum(enum_) => { - enum_.option = Some(number.as_u64().unwrap() as u8); + }, + PrimitiveType::Number(number) => match ty { + Ty::Primitive(primitive) => match *primitive { + Primitive::U8(ref mut u8) => { + *u8 = Some(number.as_u64().unwrap() as u8); + } + Primitive::U16(ref mut u16) => { + *u16 = Some(number.as_u64().unwrap() as u16); + } + Primitive::U32(ref mut u32) => { + *u32 = Some(number.as_u64().unwrap() as u32); + } + Primitive::USize(ref mut usize) => { + *usize = Some(number.as_u64().unwrap() as u32); + } + Primitive::U64(ref mut u64) => { + *u64 = Some(number.as_u64().unwrap()); + } + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid number type for {}", + ty.name() + ))); } - _ => return Err(Error::InvalidMessageError("Invalid number type".to_string())), }, - PrimitiveType::Bool(boolean) => { - field.ty = Ty::Primitive(Primitive::Bool(Some(*boolean))); + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid number type for {}", + ty.name() + ))); } - PrimitiveType::String(string) => match &mut field.ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(v) => { - *v = Some(u8::from_str(string).unwrap()); - } - Primitive::U16(v) => { - *v = Some(u16::from_str(string).unwrap()); - } - Primitive::U32(v) => { - *v = Some(u32::from_str(string).unwrap()); - } - Primitive::USize(v) => { - *v = Some(u32::from_str(string).unwrap()); - } - Primitive::U64(v) => { - *v = Some(u64::from_str(string).unwrap()); - } - Primitive::U128(v) => { - *v = Some(u128::from_str(string).unwrap()); - } - Primitive::U256(v) => { - *v = Some(U256::from_be_hex(string)); - } - Primitive::Felt252(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); - } - Primitive::ClassHash(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); - } - Primitive::ContractAddress(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); - } - Primitive::Bool(v) => { - *v = Some(bool::from_str(string).unwrap()); - } - }, + }, + PrimitiveType::Bool(boolean) => { + *ty = Ty::Primitive(Primitive::Bool(Some(*boolean))); + } + PrimitiveType::String(string) => match ty { + Ty::Primitive(primitive) => match primitive { + Primitive::U8(v) => { + *v = Some(u8::from_str(string).unwrap()); + } + Primitive::U16(v) => { + *v = Some(u16::from_str(string).unwrap()); + } + Primitive::U32(v) => { + *v = Some(u32::from_str(string).unwrap()); + } + Primitive::USize(v) => { + *v = Some(u32::from_str(string).unwrap()); + } + Primitive::U64(v) => { + *v = Some(u64::from_str(string).unwrap()); + } + Primitive::U128(v) => { + *v = Some(u128::from_str(string).unwrap()); + } + Primitive::Felt252(v) => { + *v = Some(FieldElement::from_str(string).unwrap()); + } + Primitive::ClassHash(v) => { + *v = Some(FieldElement::from_str(string).unwrap()); + } + Primitive::ContractAddress(v) => { + *v = Some(FieldElement::from_str(string).unwrap()); + } + Primitive::Bool(v) => { + *v = Some(bool::from_str(string).unwrap()); + } _ => { - return Err(Error::InvalidMessageError("Invalid string type".to_string())); + return Err(Error::InvalidMessageError("Invalid primitive type".to_string())); } }, - } + Ty::ByteArray(s) => { + *s = string.clone(); + } + _ => { + return Err(Error::InvalidMessageError(format!( + "Invalid string type for {}", + ty.name() + ))); + } + }, } Ok(()) @@ -649,18 +648,8 @@ async fn validate_message( )) })?; - let ty_struct = if let Ty::Struct(ty_struct) = &mut ty { - ty_struct - } else { - return Err(Error::InvalidMessageError("Model is not a struct".to_string())); - }; - if let Some(object) = message.get(model_name) { - if let PrimitiveType::Object(object) = object { - parse_object_to_ty(ty_struct, object)? - } else { - return Err(Error::InvalidMessageError("Model is not a struct".to_string())); - } + parse_value_to_ty(object, &mut ty)?; } else { return Err(Error::InvalidMessageError("Model is missing".to_string())); }; @@ -703,14 +692,98 @@ fn read_or_create_certificate(path: &Path) -> anyhow::Result { Ok(cert) } +// Deprecated. These should be potentially removed. As Ty -> TypedData is now done +// on the SDKs side +pub fn parse_ty_to_object(ty: &Ty) -> Result, Error> { + match ty { + Ty::Struct(struct_ty) => { + let mut object = IndexMap::new(); + for member in &struct_ty.children { + let mut member_object = IndexMap::new(); + member_object.insert("key".to_string(), PrimitiveType::Bool(member.key)); + member_object.insert( + "type".to_string(), + PrimitiveType::String(ty_to_string_type(&member.ty)), + ); + member_object.insert("value".to_string(), parse_ty_to_primitive(&member.ty)?); + object.insert(member.name.clone(), PrimitiveType::Object(member_object)); + } + Ok(object) + } + _ => Err(Error::InvalidMessageError("Expected Struct type".to_string())), + } +} + +pub fn ty_to_string_type(ty: &Ty) -> String { + match ty { + Ty::Primitive(primitive) => match primitive { + Primitive::U8(_) => "u8".to_string(), + Primitive::U16(_) => "u16".to_string(), + Primitive::U32(_) => "u32".to_string(), + Primitive::USize(_) => "usize".to_string(), + Primitive::U64(_) => "u64".to_string(), + Primitive::U128(_) => "u128".to_string(), + Primitive::U256(_) => "u256".to_string(), + Primitive::Felt252(_) => "felt252".to_string(), + Primitive::ClassHash(_) => "class_hash".to_string(), + Primitive::ContractAddress(_) => "contract_address".to_string(), + Primitive::Bool(_) => "bool".to_string(), + }, + Ty::Struct(_) => "struct".to_string(), + Ty::Tuple(_) => "tuple".to_string(), + Ty::Array(_) => "array".to_string(), + Ty::ByteArray(_) => "bytearray".to_string(), + Ty::Enum(_) => "enum".to_string(), + } +} + +pub fn parse_ty_to_primitive(ty: &Ty) -> Result { + match ty { + Ty::Primitive(primitive) => match primitive { + Primitive::U8(value) => { + Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + } + Primitive::U16(value) => { + Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + } + Primitive::U32(value) => { + Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + } + Primitive::USize(value) => { + Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) + } + Primitive::U64(value) => { + Ok(PrimitiveType::Number(Number::from(value.map(|v| v).unwrap_or(0u64)))) + } + Primitive::U128(value) => Ok(PrimitiveType::String( + value.map(|v| v.to_string()).unwrap_or_else(|| "0".to_string()), + )), + Primitive::U256(value) => Ok(PrimitiveType::String( + value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), + )), + Primitive::Felt252(value) => Ok(PrimitiveType::String( + value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), + )), + Primitive::ClassHash(value) => Ok(PrimitiveType::String( + value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), + )), + Primitive::ContractAddress(value) => Ok(PrimitiveType::String( + value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), + )), + Primitive::Bool(value) => Ok(PrimitiveType::Bool(value.unwrap_or(false))), + }, + _ => Err(Error::InvalidMessageError("Expected Primitive type".to_string())), + } +} + #[cfg(test)] mod tests { use tempfile::tempdir; use super::*; - #[tokio::test] - async fn test_read_or_create_identity() { + #[test] + fn test_read_or_create_identity() { let dir = tempdir().unwrap(); let identity_path = dir.path().join("identity"); @@ -725,8 +798,8 @@ mod tests { dir.close().unwrap(); } - #[tokio::test] - async fn test_read_or_create_certificate() { + #[test] + fn test_read_or_create_certificate() { let dir = tempdir().unwrap(); let cert_path = dir.path().join("certificate"); diff --git a/crates/torii/libp2p/src/tests.rs b/crates/torii/libp2p/src/tests.rs index 5220333683..3d0e5581be 100644 --- a/crates/torii/libp2p/src/tests.rs +++ b/crates/torii/libp2p/src/tests.rs @@ -3,12 +3,267 @@ mod test { use std::error::Error; use crate::client::RelayClient; + use crate::server::parse_value_to_ty; + use crate::typed_data::PrimitiveType; #[cfg(target_arch = "wasm32")] wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); + use crypto_bigint::U256; + use dojo_types::primitive::Primitive; + use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; + use serde_json::Number; + use starknet_crypto::FieldElement; #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; + #[test] + fn test_parse_primitive_to_ty() { + // primitives + let mut ty = Ty::Primitive(Primitive::U8(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U8(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U16(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U16(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U32(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U32(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::USize(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::USize(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U64(None)); + let value = PrimitiveType::Number(Number::from(1u64)); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U64(Some(1)))); + + let mut ty = Ty::Primitive(Primitive::U128(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U128(Some(1)))); + + // test u256 with low high + let mut ty = Ty::Primitive(Primitive::U256(None)); + let value = PrimitiveType::Object( + vec![ + ("low".to_string(), PrimitiveType::String("1".to_string())), + ("high".to_string(), PrimitiveType::String("0".to_string())), + ] + .into_iter() + .collect(), + ); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::U256(Some(U256::ONE)))); + + let mut ty = Ty::Primitive(Primitive::Felt252(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::Felt252(Some(FieldElement::ONE)))); + + let mut ty = Ty::Primitive(Primitive::ClassHash(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::ClassHash(Some(FieldElement::ONE)))); + + let mut ty = Ty::Primitive(Primitive::ContractAddress(None)); + let value = PrimitiveType::String("1".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE)))); + + let mut ty = Ty::Primitive(Primitive::Bool(None)); + let value = PrimitiveType::Bool(true); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::Primitive(Primitive::Bool(Some(true)))); + + // bytearray + let mut ty = Ty::ByteArray("".to_string()); + let value = PrimitiveType::String("mimi".to_string()); + parse_value_to_ty(&value, &mut ty).unwrap(); + assert_eq!(ty, Ty::ByteArray("mimi".to_string())); + } + + #[test] + fn test_parse_complex_to_ty() { + let mut ty = Ty::Struct(Struct { + name: "PlayerConfig".to_string(), + children: vec![ + Member { + name: "player".to_string(), + ty: Ty::Primitive(Primitive::ContractAddress(None)), + key: true, + }, + Member { name: "name".to_string(), ty: Ty::ByteArray("".to_string()), key: false }, + Member { + name: "items".to_string(), + // array of PlayerItem struct + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + ], + })]), + key: false, + }, + // a favorite_item field with enum type Option + Member { + name: "favorite_item".to_string(), + ty: Ty::Enum(Enum { + name: "Option".to_string(), + option: None, + options: vec![ + EnumOption { name: "None".to_string(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".to_string(), + ty: Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(None)), + key: false, + }, + ], + }), + }, + ], + }), + key: false, + }, + ], + }); + + let value = PrimitiveType::Object( + vec![ + ("player".to_string(), PrimitiveType::String("1".to_string())), + ("name".to_string(), PrimitiveType::String("mimi".to_string())), + ( + "items".to_string(), + PrimitiveType::Array(vec![PrimitiveType::Object( + vec![ + ("item_id".to_string(), PrimitiveType::String("1".to_string())), + ("quantity".to_string(), PrimitiveType::Number(Number::from(1u64))), + ] + .into_iter() + .collect(), + )]), + ), + ( + "favorite_item".to_string(), + PrimitiveType::Object( + vec![( + "Some".to_string(), + PrimitiveType::Object( + vec![ + ("item_id".to_string(), PrimitiveType::String("1".to_string())), + ( + "quantity".to_string(), + PrimitiveType::Number(Number::from(1u64)), + ), + ] + .into_iter() + .collect(), + ), + )] + .into_iter() + .collect(), + ), + ), + ] + .into_iter() + .collect(), + ); + + parse_value_to_ty(&value, &mut ty).unwrap(); + + assert_eq!( + ty, + Ty::Struct(Struct { + name: "PlayerConfig".to_string(), + children: vec![ + Member { + name: "player".to_string(), + ty: Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE))), + key: true, + }, + Member { + name: "name".to_string(), + ty: Ty::ByteArray("mimi".to_string()), + key: false, + }, + Member { + name: "items".to_string(), + ty: Ty::Array(vec![Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + ], + })]), + key: false, + }, + Member { + name: "favorite_item".to_string(), + ty: Ty::Enum(Enum { + name: "Option".to_string(), + option: Some(1_u8), + options: vec![ + EnumOption { name: "None".to_string(), ty: Ty::Tuple(vec![]) }, + EnumOption { + name: "Some".to_string(), + ty: Ty::Struct(Struct { + name: "PlayerItem".to_string(), + children: vec![ + Member { + name: "item_id".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + Member { + name: "quantity".to_string(), + ty: Ty::Primitive(Primitive::U32(Some(1))), + key: false, + }, + ], + }), + }, + ] + }), + key: false, + }, + ], + }) + ); + } + // This tests subscribing to a topic and receiving a message #[cfg(not(target_arch = "wasm32"))] #[tokio::test] @@ -95,8 +350,6 @@ mod test { ), ); - println!("object ty: {:?}", parse_ty_to_object(&Ty::Struct(data)).unwrap()); - client .command_sender .publish(Message { From a636d23da43d0e9ae249cfdc4a0c8417e2a9dda1 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Mon, 10 Jun 2024 23:53:25 +0530 Subject: [PATCH 16/88] feat(sozo): add a subcommand to generate overlay files (#2025) * initial commit * add support for model overlays * clean up * add test for merge * separate out match statement * fix directory creation * fix: fix test typo + add comment on isolated variant test --------- Co-authored-by: glihm --- Cargo.lock | 1 + bin/sozo/src/commands/clean.rs | 2 +- bin/sozo/src/commands/dev.rs | 3 +- bin/sozo/src/commands/migrate.rs | 13 +- crates/benches/src/deployer.rs | 4 +- crates/dojo-lang/src/compiler.rs | 12 +- crates/dojo-test-utils/src/migration.rs | 3 +- crates/dojo-world/src/contracts/world_test.rs | 3 +- .../dojo-world/src/manifest/manifest_test.rs | 174 +++++++++++++++++- crates/dojo-world/src/manifest/mod.rs | 122 ++++++++++-- crates/dojo-world/src/manifest/types.rs | 3 +- crates/sozo/ops/Cargo.toml | 1 + crates/sozo/ops/src/events.rs | 6 +- crates/sozo/ops/src/migration/migrate.rs | 4 +- crates/sozo/ops/src/migration/mod.rs | 94 +++++++++- crates/sozo/ops/src/migration/utils.rs | 4 +- crates/sozo/ops/src/tests/migration.rs | 4 +- .../dojo_examples_actions_actions.toml | 6 +- .../dojo_examples_others_others.toml | 3 +- .../dev/overlays/dojo_base_base.toml | 1 + .../dev/overlays/dojo_world_world.toml | 1 + .../dojo_examples_actions_actions_moved.toml | 1 + .../dojo_examples_models_emote_message.toml | 1 + .../models/dojo_examples_models_moves.toml | 1 + .../dojo_examples_models_player_config.toml | 1 + .../models/dojo_examples_models_position.toml | 1 + ...es_others_others_contract_initialized.toml | 1 + 27 files changed, 408 insertions(+), 62 deletions(-) create mode 100644 examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml create mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml diff --git a/Cargo.lock b/Cargo.lock index 530db77742..d784dbbe5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12586,6 +12586,7 @@ dependencies = [ "starknet-crypto 0.6.2", "thiserror", "tokio", + "toml 0.8.13", "tracing", "tracing-log 0.1.4", "url", diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 06fcd0a142..7d02a03834 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -3,7 +3,7 @@ use std::fs; use anyhow::Result; use camino::Utf8PathBuf; use clap::Args; -use dojo_lang::compiler::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; +use dojo_world::manifest::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; use scarb::core::Config; use tracing::trace; diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index ae6f7aa55b..2ff6eef64a 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -8,9 +8,8 @@ use cairo_lang_compiler::db::RootDatabase; use cairo_lang_filesystem::db::{AsFilesGroupMut, FilesGroupEx, PrivRawFileContentQuery}; use cairo_lang_filesystem::ids::FileId; use clap::Args; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; use dojo_lang::scarb_internal::build_scarb_root_database; -use dojo_world::manifest::{BaseManifest, DeploymentManifest}; +use dojo_world::manifest::{BaseManifest, DeploymentManifest, BASE_DIR, MANIFESTS_DIR}; use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::TxnConfig; diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 9cbd421951..3acb7f25cb 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Context, Result}; use clap::{Args, Subcommand}; -use dojo_lang::compiler::MANIFESTS_DIR; +use dojo_world::manifest::MANIFESTS_DIR; use dojo_world::metadata::{dojo_metadata_from_workspace, Environment}; use dojo_world::migration::TxnConfig; use katana_rpc_api::starknet::RPC_SPEC_VERSION; @@ -50,6 +50,8 @@ pub enum MigrateCommand { #[command(flatten)] transaction: TransactionOptions, }, + #[command(about = "Generate overlays file.")] + GenerateOverlays, } impl MigrateArgs { @@ -57,6 +59,13 @@ impl MigrateArgs { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + // This variant is tested before the match on `self.command` to avoid + // having the need to spin up a Katana to generate the files. + if let MigrateCommand::GenerateOverlays = self.command { + trace!("Generating overlays."); + return migration::generate_overlays(&ws); + } + let env_metadata = if config.manifest_path().exists() { dojo_metadata_from_workspace(&ws).env().cloned() } else { @@ -81,6 +90,7 @@ impl MigrateArgs { match self.command { MigrateCommand::Plan => config.tokio_handle().block_on(async { + trace!(name, "Planning migration."); migration::migrate( &ws, world_address, @@ -99,6 +109,7 @@ impl MigrateArgs { migration::migrate(&ws, world_address, rpc_url, account, &name, false, txn_config) .await }), + _ => unreachable!("other case handled above."), } } } diff --git a/crates/benches/src/deployer.rs b/crates/benches/src/deployer.rs index abb0251c07..2a3aa0e08c 100644 --- a/crates/benches/src/deployer.rs +++ b/crates/benches/src/deployer.rs @@ -3,9 +3,9 @@ use std::path::PathBuf; use anyhow::{anyhow, bail, Context, Ok, Result}; use clap::Parser; -use dojo_lang::compiler::{DojoCompiler, DEPLOYMENTS_DIR, MANIFESTS_DIR}; +use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; -use dojo_world::manifest::DeploymentManifest; +use dojo_world::manifest::{DeploymentManifest, DEPLOYMENTS_DIR, MANIFESTS_DIR}; use futures::executor::block_on; use katana_runner::KatanaRunner; use scarb::compiler::CompilerRepository; diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index 653aab250e..e21edfe2bb 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -21,7 +21,8 @@ use camino::{Utf8Path, Utf8PathBuf}; use convert_case::{Case, Casing}; use dojo_world::manifest::{ AbiFormat, Class, ComputedValueEntrypoint, DojoContract, DojoModel, Manifest, ManifestMethods, - BASE_CONTRACT_NAME, WORLD_CONTRACT_NAME, + ABIS_DIR, BASE_CONTRACT_NAME, BASE_DIR, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, + WORLD_CONTRACT_NAME, }; use itertools::Itertools; use scarb::compiler::helpers::{build_compiler_config, collect_main_crate_ids}; @@ -40,15 +41,6 @@ use crate::semantics::utils::find_module_rw; const CAIRO_PATH_SEPARATOR: &str = "::"; -pub const MANIFESTS_DIR: &str = "manifests"; -pub const BASE_DIR: &str = "base"; -pub const OVERLAYS_DIR: &str = "overlays"; -pub const DEPLOYMENTS_DIR: &str = "deployments"; -pub const ABIS_DIR: &str = "abis"; - -pub const CONTRACTS_DIR: &str = "contracts"; -pub const MODELS_DIR: &str = "models"; - pub const SOURCES_DIR: &str = "src"; pub(crate) const LOG_TARGET: &str = "dojo_lang::compiler"; diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index 7ad6f25843..e8a576f341 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -1,7 +1,6 @@ use anyhow::Result; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; -use dojo_world::manifest::{BaseManifest, OverlayManifest}; +use dojo_world::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_world::migration::strategy::{prepare_for_migration, MigrationStrategy}; use dojo_world::migration::world::WorldDiff; use katana_primitives::FieldElement; diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index 3b856c1f46..c011d573fb 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -1,14 +1,13 @@ use std::time::Duration; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::compiler; use katana_runner::KatanaRunner; use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag, FieldElement}; use super::{WorldContract, WorldContractReader}; -use crate::manifest::{BaseManifest, OverlayManifest}; +use crate::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use crate::migration::strategy::prepare_for_migration; use crate::migration::world::WorldDiff; use crate::migration::{Declarable, Deployable, TxnConfig}; diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index bc92e1a4f8..a003fc0e23 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -2,7 +2,6 @@ use std::io::Write; use cainome::cairo_serde::{ByteArray, CairoSerde}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::compiler; use dojo_test_utils::rpc::MockJsonRpcTransport; use katana_runner::KatanaRunner; @@ -14,10 +13,14 @@ use starknet::macros::{felt, selector}; use starknet::providers::jsonrpc::{JsonRpcClient, JsonRpcMethod}; use super::{ - parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel, OverlayManifest, + parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel, OverlayDojoContract, + OverlayManifest, }; use crate::contracts::world::test::deploy_world; -use crate::manifest::{parse_models_events, AbstractManifestError, DeploymentManifest, Manifest}; +use crate::manifest::{ + parse_models_events, AbstractManifestError, DeploymentManifest, Manifest, OverlayClass, + OverlayDojoModel, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, +}; use crate::migration::world::WorldDiff; #[tokio::test] @@ -473,3 +476,168 @@ fn test_abi_format_load_abi_string() -> Result<(), Box> { Ok(()) } + +#[test] +fn overlay_merge_for_contract_and_model_work_as_expected() { + let other = OverlayManifest { + contracts: vec![ + OverlayDojoContract { name: "othercontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "othercontract2".into(), ..Default::default() }, + OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + ], + models: vec![ + OverlayDojoModel { name: "othermodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "othermodel2".into(), ..Default::default() }, + OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + ], + ..Default::default() + }; + + let mut current = OverlayManifest { + contracts: vec![ + OverlayDojoContract { name: "currentcontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "currentcontract2".into(), ..Default::default() }, + OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + ], + models: vec![ + OverlayDojoModel { name: "currentmodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "currentmodel2".into(), ..Default::default() }, + OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + ], + ..Default::default() + }; + + let expected = OverlayManifest { + contracts: vec![ + OverlayDojoContract { name: "currentcontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "currentcontract2".into(), ..Default::default() }, + OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + OverlayDojoContract { name: "othercontract1".into(), ..Default::default() }, + OverlayDojoContract { name: "othercontract2".into(), ..Default::default() }, + ], + models: vec![ + OverlayDojoModel { name: "currentmodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "currentmodel2".into(), ..Default::default() }, + OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + OverlayDojoModel { name: "othermodel1".into(), ..Default::default() }, + OverlayDojoModel { name: "othermodel2".into(), ..Default::default() }, + ], + ..Default::default() + }; + + current.merge(other); + + assert_eq!(current, expected); +} + +#[test] +fn overlay_merge_for_world_work_as_expected() { + // when other.world is none and current.world is some + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + current.merge(other); + + assert_eq!(current, expected); + + // when other.world is some and current.world is none + let other = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { + world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.world is some and current.world is some + let other = OverlayManifest { + world: Some(OverlayClass { name: "worldother".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { + world: Some(OverlayClass { name: "worldcurrent".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + world: Some(OverlayClass { name: "worldcurrent".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.world is none and current.world is none + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { ..Default::default() }; + + current.merge(other); + assert_eq!(current, expected); +} + +#[test] +fn overlay_merge_for_base_work_as_expected() { + // when other.base is none and current.base is some + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + current.merge(other); + + assert_eq!(current, expected); + + // when other.base is some and current.base is none + let other = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { + base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.base is some and current.base is some + let other = OverlayManifest { + base: Some(OverlayClass { name: "baseother".into(), ..Default::default() }), + ..Default::default() + }; + let mut current = OverlayManifest { + base: Some(OverlayClass { name: "basecurrent".into(), ..Default::default() }), + ..Default::default() + }; + let expected = OverlayManifest { + base: Some(OverlayClass { name: "basecurrent".into(), ..Default::default() }), + ..Default::default() + }; + + current.merge(other); + assert_eq!(current, expected); + + // when other.base is none and current.base is none + let other = OverlayManifest { ..Default::default() }; + let mut current = OverlayManifest { ..Default::default() }; + let expected = OverlayManifest { ..Default::default() }; + + current.merge(other); + assert_eq!(current, expected); +} diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index d3aa32877a..5391761e49 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -39,6 +39,15 @@ pub const BASE_CONTRACT_NAME: &str = "dojo::base::base"; pub const RESOURCE_METADATA_CONTRACT_NAME: &str = "dojo::resource_metadata::resource_metadata"; pub const RESOURCE_METADATA_MODEL_NAME: &str = "0x5265736f757263654d65746164617461"; +pub const MANIFESTS_DIR: &str = "manifests"; +pub const BASE_DIR: &str = "base"; +pub const OVERLAYS_DIR: &str = "overlays"; +pub const DEPLOYMENTS_DIR: &str = "deployments"; +pub const ABIS_DIR: &str = "abis"; + +pub const CONTRACTS_DIR: &str = "contracts"; +pub const MODELS_DIR: &str = "models"; + #[derive(Error, Debug)] pub enum AbstractManifestError { #[error("Remote World not found.")] @@ -56,7 +65,9 @@ pub enum AbstractManifestError { #[error(transparent)] Model(#[from] ModelError), #[error(transparent)] - TOML(#[from] toml::de::Error), + TomlDe(#[from] toml::de::Error), + #[error(transparent)] + TomlSer(#[from] toml::ser::Error), #[error(transparent)] IO(#[from] io::Error), #[error("Abi couldn't be loaded from path: {0}")] @@ -93,8 +104,8 @@ impl From for DeploymentManifest { impl BaseManifest { /// Load the manifest from a file at the given path. pub fn load_from_path(path: &Utf8PathBuf) -> Result { - let contract_dir = path.join("contracts"); - let model_dir = path.join("models"); + let contract_dir = path.join(CONTRACTS_DIR); + let model_dir = path.join(MODELS_DIR); let world: Manifest = toml::from_str(&fs::read_to_string( path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"), @@ -136,6 +147,8 @@ impl BaseManifest { impl OverlayManifest { pub fn load_from_path(path: &Utf8PathBuf) -> Result { + fs::create_dir_all(path)?; + let mut world: Option = None; let world_path = path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); @@ -151,15 +164,72 @@ impl OverlayManifest { base = Some(toml::from_str(&fs::read_to_string(base_path)?)?); } - let contract_dir = path.join("contracts"); - + let contract_dir = path.join(CONTRACTS_DIR); let contracts = if contract_dir.exists() { overlay_elements_from_path::(&contract_dir)? } else { vec![] }; - Ok(Self { world, base, contracts }) + let model_dir = path.join(MODELS_DIR); + let models = if model_dir.exists() { + overlay_elements_from_path::(&model_dir)? + } else { + vec![] + }; + + Ok(Self { world, base, contracts, models }) + } + + /// Writes `Self` to overlay manifests folder. + /// + /// - `world` and `base` manifest are written to root of the folder. + /// - `contracts` and `models` are written to their respective directories. + pub fn write_to_path_nested(&self, path: &Utf8PathBuf) -> Result<(), AbstractManifestError> { + fs::create_dir_all(path)?; + + if let Some(ref world) = self.world { + let world = toml::to_string(world)?; + let file_name = + path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + fs::write(file_name, world)?; + } + + if let Some(ref base) = self.base { + let base = toml::to_string(base)?; + let file_name = path.join(BASE_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + fs::write(file_name, base)?; + } + + overlay_dojo_contracts_to_path(&path.join(CONTRACTS_DIR), self.contracts.as_slice())?; + overlay_dojo_model_to_path(&path.join(MODELS_DIR), self.models.as_slice())?; + Ok(()) + } + + /// Add missing overlay items from `others` to `self`. + /// Note that this method don't override if certain item already exists in `self`. + pub fn merge(&mut self, other: OverlayManifest) { + if self.world.is_none() { + self.world = other.world; + } + + if self.base.is_none() { + self.base = other.base; + } + + for other_contract in other.contracts { + let found = self.contracts.iter().find(|c| c.name == other_contract.name); + if found.is_none() { + self.contracts.push(other_contract); + } + } + + for other_model in other.models { + let found = self.models.iter().find(|m| m.name == other_model.name); + if found.is_none() { + self.models.push(other_model); + } + } } } @@ -485,20 +555,6 @@ fn parse_models_events(events: Vec) -> Vec> { .collect() } -// fn elements_to_path(item_dir: &Utf8PathBuf, items: &Vec>) -> Result<()> -// where -// T: Serialize + ManifestMethods, -// { -// fs::create_dir_all(item_dir)?; -// for item in items { -// let item_toml = toml::to_string_pretty(&item)?; -// let item_name = item.name.split("::").last().unwrap(); -// fs::write(item_dir.join(item_name).with_extension("toml"), item_toml)?; -// } - -// Ok(()) -// } - fn elements_from_path(path: &Utf8PathBuf) -> Result>, AbstractManifestError> where T: DeserializeOwned + ManifestMethods, @@ -546,6 +602,32 @@ where Ok(elements) } +fn overlay_dojo_contracts_to_path( + path: &Utf8PathBuf, + elements: &[OverlayDojoContract], +) -> Result<(), AbstractManifestError> { + fs::create_dir_all(path)?; + + for element in elements { + let path = path.join(element.name.replace("::", "_")).with_extension("toml"); + fs::write(path, toml::to_string(&element)?)?; + } + Ok(()) +} + +fn overlay_dojo_model_to_path( + path: &Utf8PathBuf, + elements: &[OverlayDojoModel], +) -> Result<(), AbstractManifestError> { + fs::create_dir_all(path)?; + + for element in elements { + let path = path.join(element.name.replace("::", "_")).with_extension("toml"); + fs::write(path, toml::to_string(&element)?)?; + } + Ok(()) +} + impl ManifestMethods for DojoContract { type OverlayType = OverlayDojoContract; diff --git a/crates/dojo-world/src/manifest/types.rs b/crates/dojo-world/src/manifest/types.rs index dbbee2fd58..5eb3e67d0c 100644 --- a/crates/dojo-world/src/manifest/types.rs +++ b/crates/dojo-world/src/manifest/types.rs @@ -36,12 +36,13 @@ pub struct DeploymentManifest { pub models: Vec>, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Default, Clone, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] pub struct OverlayManifest { pub world: Option, pub base: Option, pub contracts: Vec, + pub models: Vec, } #[derive(Clone, Serialize, Deserialize, Debug)] diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index e4eded4705..f4144ae66b 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -50,6 +50,7 @@ tokio.workspace = true tracing-log = "0.1.3" tracing.workspace = true url.workspace = true +toml.workspace = true [dev-dependencies] assert_fs.workspace = true diff --git a/crates/sozo/ops/src/events.rs b/crates/sozo/ops/src/events.rs index c524fc2e96..73ae19d7fa 100644 --- a/crates/sozo/ops/src/events.rs +++ b/crates/sozo/ops/src/events.rs @@ -5,8 +5,7 @@ use anyhow::{anyhow, Result}; use cainome::parser::tokens::{CompositeInner, CompositeInnerKind, CoreBasic, Token}; use cainome::parser::AbiParser; use camino::Utf8PathBuf; -use dojo_lang::compiler::MANIFESTS_DIR; -use dojo_world::manifest::{AbiFormat, DeploymentManifest, ManifestMethods}; +use dojo_world::manifest::{AbiFormat, DeploymentManifest, ManifestMethods, MANIFESTS_DIR}; use starknet::core::types::{BlockId, EventFilter, FieldElement}; use starknet::core::utils::{parse_cairo_short_string, starknet_keccak}; use starknet::providers::jsonrpc::HttpTransport; @@ -249,8 +248,7 @@ fn process_inners( mod tests { use cainome::parser::tokens::{Array, Composite, CompositeInner, CompositeType}; use camino::Utf8Path; - use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR}; - use dojo_world::manifest::BaseManifest; + use dojo_world::manifest::{BaseManifest, BASE_DIR}; use starknet::core::types::EmittedEvent; use super::*; diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 831fd22c48..b6c194e5a4 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -2,12 +2,12 @@ use std::path::Path; use anyhow::{anyhow, bail, Context, Result}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{ABIS_DIR, BASE_DIR, DEPLOYMENTS_DIR, MANIFESTS_DIR}; use dojo_world::contracts::abi::world; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, - ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, + ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, BASE_DIR, + DEPLOYMENTS_DIR, MANIFESTS_DIR, }; use dojo_world::metadata::{dojo_metadata_from_workspace, ResourceMetadata}; use dojo_world::migration::class::ClassMigration; diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index 85f58dfa44..d7d45d4c49 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -1,8 +1,14 @@ use std::sync::Arc; +use std::{fs, io}; -use anyhow::{anyhow, Result}; -use dojo_lang::compiler::MANIFESTS_DIR; +use anyhow::{anyhow, Context, Result}; +use camino::Utf8PathBuf; use dojo_world::contracts::WorldContract; +use dojo_world::manifest::{ + DojoContract, DojoModel, Manifest, OverlayClass, OverlayDojoContract, OverlayDojoModel, + OverlayManifest, BASE_CONTRACT_NAME, BASE_DIR, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, + OVERLAYS_DIR, WORLD_CONTRACT_NAME, +}; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::{DeployOutput, TxnConfig, UpgradeOutput}; use scarb::core::Workspace; @@ -174,3 +180,87 @@ enum ContractDeploymentOutput { enum ContractUpgradeOutput { Output(UpgradeOutput), } + +pub fn generate_overlays(ws: &Workspace<'_>) -> Result<()> { + let profile_name = + ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); + + // its path to a file so `parent` should never return `None` + let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(profile_name); + + let base_manifests = profile_dir.join(BASE_DIR); + + let world = OverlayClass { name: WORLD_CONTRACT_NAME.into(), original_class_hash: None }; + let base = OverlayClass { name: BASE_CONTRACT_NAME.into(), original_class_hash: None }; + + // generate default OverlayManifest from base manifests + let contracts = overlay_dojo_contracts_from_path(&base_manifests.join(CONTRACTS_DIR)) + .with_context(|| "Failed to build default DojoContract Overlays from path.")?; + let models = overlay_model_from_path(&base_manifests.join(MODELS_DIR)) + .with_context(|| "Failed to build default DojoModel Overlays from path.")?; + + let default_overlay = + OverlayManifest { world: Some(world), base: Some(base), contracts, models }; + + let overlay_path = profile_dir.join(OVERLAYS_DIR); + + // read existing OverlayManifest from path + let mut overlay_manifest = OverlayManifest::load_from_path(&overlay_path) + .with_context(|| "Failed to load OverlayManifest from path.")?; + + // merge them to get OverlayManifest which contains all the contracts and models from base + // manifests + overlay_manifest.merge(default_overlay); + + overlay_manifest + .write_to_path_nested(&overlay_path) + .with_context(|| "Failed to write OverlayManifest to path.")?; + + Ok(()) +} + +fn overlay_dojo_contracts_from_path(path: &Utf8PathBuf) -> Result> { + let mut elements = vec![]; + + let entries = path + .read_dir()? + .map(|entry| entry.map(|e| e.path())) + .collect::, io::Error>>()?; + + for path in entries { + if path.is_file() { + let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; + + let overlay_manifest = + OverlayDojoContract { name: manifest.name, ..Default::default() }; + elements.push(overlay_manifest); + } else { + continue; + } + } + + Ok(elements) +} + +fn overlay_model_from_path(path: &Utf8PathBuf) -> Result> { + let mut elements = vec![]; + + let entries = path + .read_dir()? + .map(|entry| entry.map(|e| e.path())) + .collect::, io::Error>>()?; + + for path in entries { + if path.is_file() { + let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; + + let overlay_manifest = OverlayDojoModel { name: manifest.name, ..Default::default() }; + elements.push(overlay_manifest); + } else { + continue; + } + } + + Ok(elements) +} diff --git a/crates/sozo/ops/src/migration/utils.rs b/crates/sozo/ops/src/migration/utils.rs index d21e7c4c29..d85ffb6df8 100644 --- a/crates/sozo/ops/src/migration/utils.rs +++ b/crates/sozo/ops/src/migration/utils.rs @@ -1,8 +1,8 @@ use anyhow::{anyhow, Result}; use camino::Utf8PathBuf; -use dojo_lang::compiler::{BASE_DIR, OVERLAYS_DIR}; use dojo_world::manifest::{ - AbstractManifestError, BaseManifest, DeploymentManifest, OverlayManifest, + AbstractManifestError, BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, + OVERLAYS_DIR, }; use scarb_ui::Ui; use starknet::accounts::{ConnectedAccount, SingleOwnerAccount}; diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 1f82982bf7..006c9a731e 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -2,11 +2,11 @@ use std::str; use cainome::cairo_serde::ContractAddress; use camino::Utf8Path; -use dojo_lang::compiler::{BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_test_utils::migration::prepare_migration_with_world_and_seed; use dojo_world::contracts::{WorldContract, WorldContractReader}; use dojo_world::manifest::{ - BaseManifest, DeploymentManifest, OverlayManifest, WORLD_CONTRACT_NAME, + BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, + WORLD_CONTRACT_NAME, }; use dojo_world::metadata::{ dojo_metadata_from_workspace, ArtifactMetadata, DojoMetadata, Uri, WorldMetadata, diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml index a8e2fd4c2d..b21fc1adec 100644 --- a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,4 @@ -computed = [ ] name = "dojo_examples::actions::actions" -reads = [ ] -writes = [ "Moves", "Position" ] +reads = [] +writes = ["Moves", "Position"] init_calldata = [] - diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml index b74df0c8fe..129f942bd8 100644 --- a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml +++ b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml @@ -1,5 +1,4 @@ +name = "dojo_examples::others::others" reads = [] writes = [] -computed = [] init_calldata = ["$contract_address:dojo_examples::actions::actions", "$class_hash:dojo_examples::actions::actions", "10"] -name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml b/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml new file mode 100644 index 0000000000..f706470d45 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml @@ -0,0 +1 @@ +name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml new file mode 100644 index 0000000000..a3e686e3ef --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml @@ -0,0 +1 @@ +name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml new file mode 100644 index 0000000000..4958a7a15c --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml @@ -0,0 +1 @@ +name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml new file mode 100644 index 0000000000..d60162cc72 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::emote_message" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml new file mode 100644 index 0000000000..dc8784e746 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml new file mode 100644 index 0000000000..6af8240b36 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml new file mode 100644 index 0000000000..df38e71c32 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..f8f3053fe5 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1 @@ +name = "dojo_examples::others::others::contract_initialized" From 920500986855fdaf203471ac11900b15dcf6035f Mon Sep 17 00:00:00 2001 From: taikoon Date: Tue, 11 Jun 2024 03:47:58 +0800 Subject: [PATCH 17/88] update dead links (#2036) * update dead links * fix: correct link for dojoup info --------- Co-authored-by: glihm --- bin/sozo/README.md | 2 +- bin/torii/README.md | 2 +- crates/torii/README.md | 2 +- dojoup/README.md | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/sozo/README.md b/bin/sozo/README.md index c88c71a7e2..bb864ed5b3 100644 --- a/bin/sozo/README.md +++ b/bin/sozo/README.md @@ -4,7 +4,7 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/sozo/overview) +[Documentation](https://book.dojoengine.org/toolchain/sozo) Some parts of sozo were inspired by [starkli](https://github.com/xJonathanLEI/starkli) created by Jonathan LEI. It is licensed under Apache 2.0 / MIT License. diff --git a/bin/torii/README.md b/bin/torii/README.md index 635eb16da0..21ff59ea1a 100644 --- a/bin/torii/README.md +++ b/bin/torii/README.md @@ -4,4 +4,4 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/torii/overview) +[Documentation](https://book.dojoengine.org/toolchain/torii) diff --git a/crates/torii/README.md b/crates/torii/README.md index 635eb16da0..21ff59ea1a 100644 --- a/crates/torii/README.md +++ b/crates/torii/README.md @@ -4,4 +4,4 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/torii/overview) +[Documentation](https://book.dojoengine.org/toolchain/torii) diff --git a/dojoup/README.md b/dojoup/README.md index 277e12a1a1..714d5d7c58 100644 --- a/dojoup/README.md +++ b/dojoup/README.md @@ -4,4 +4,10 @@ curl -L https://install.dojoengine.org | bash ``` -[Documentation](https://book.dojoengine.org/toolchain/dojoup) +For more details, you can then issue the following command: + +```sh +dojoup --help +``` + +[Documentation](https://book.dojoengine.org/getting-started#getting-started) From d3c33517722fc0cf91eef3321591010a18bcafb9 Mon Sep 17 00:00:00 2001 From: Neo <128649481+neotheprogramist@users.noreply.github.com> Date: Tue, 11 Jun 2024 05:04:06 +0200 Subject: [PATCH 18/88] [saya] Scheduler (#1917) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * proof scheduler * cleared leftovers * feature fix * Deserialization and tests fix * uncommented apply diffs logic * genesis block fix * fetching last block * moved fetching to separate function * process_block no async * Adding traces and infos for async functions * made dojo core work with merger program * minor logs adjustments in saya * final world contract * preparation for http prover * proving example data by * serializing arguments * debug print * only one program in verifier * preparing args for prover * batch size arg * moved extraction of data from proof to separate module * minor cleanup * updated bin/scheduler * laziness fix and update prover sdk * half done * cairo 1 behind flag * added cairo 0 differ and merger * support for 2 programs in `upgrade_state` * end 2 end saya readme * data extraction from proof * saya working with cairo 0 * updated prover and readme * added a clause about keygen * updated port in readme * clippy and formatting * ignored heavy tests * moved readme to bin * updated stone prover image * made tests pass * removed unneeded files and fixed compilation * formatting after rebase * better fetch parallelization * fixed valid ignoring of not l1_handler * fixed most tests and made compiled programs one line * cairo import formatting * using recursive layout * changed docker images to latest * Update examples/spawn-and-move/Scarb.toml Co-authored-by: glihm * most of pr comments * keeping track of nonce to avoid sleep * rest of PR comments * made changes to fix the tests * formatting * fixed all the tests * final formatting * rebuilt artifacts * fix: typo in README * fixed duplicated proving state update * fix: remove cargo warning for dual license source * fix: reword some commands + fix options for saya * fix: update README * fix: ensure model get fails if no key is provided * fix: use --bin instead of -p --------- Co-authored-by: Mateusz Zając Co-authored-by: Mateusz Co-authored-by: Mateusz Zając <60236390+matzayonc@users.noreply.github.com> Co-authored-by: glihm --- Cargo.lock | 243 ++++++- Cargo.toml | 2 +- bin/saya/Cargo.toml | 4 + bin/saya/README.md | 159 ++++- bin/saya/programs/cairo0differ.json | 1 + bin/saya/programs/cairo0merger.json | 1 + bin/saya/src/args/mod.rs | 43 +- bin/saya/src/args/test_saya_config_file.json | 5 +- bin/saya/src/main.rs | 5 +- bin/saya/src/tests.rs | 408 ++++++++++++ bin/scheduler/Cargo.toml | 18 + bin/scheduler/README.md | 36 ++ bin/scheduler/src/main.rs | 78 +++ crates/dojo-core/src/base_test.cairo | 4 +- crates/dojo-core/src/config/component.cairo | 40 +- crates/dojo-core/src/config/interface.cairo | 6 +- crates/dojo-core/src/interfaces.cairo | 5 +- crates/dojo-core/src/world.cairo | 17 +- crates/dojo-core/src/world_test.cairo | 10 +- .../dev/abis/base/dojo_world_world.json | 54 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- crates/dojo-world/src/contracts/abi/world.rs | 54 +- crates/dojo-world/src/metadata_test.rs | 2 +- crates/saya/README.md | 9 - crates/saya/core/Cargo.toml | 5 +- crates/saya/core/src/dojo_os/mod.rs | 14 +- crates/saya/core/src/lib.rs | 225 +++++-- crates/saya/core/src/prover/client.rs | 38 +- crates/saya/core/src/prover/extract.rs | 98 +++ crates/saya/core/src/prover/loader.rs | 36 ++ crates/saya/core/src/prover/mod.rs | 31 +- crates/saya/core/src/prover/program_input.rs | 592 +++++++++++++++--- crates/saya/core/src/prover/scheduler.rs | 222 +++++++ crates/saya/core/src/prover/state_diff.rs | 59 -- crates/saya/core/src/prover/stone_image.rs | 55 +- crates/saya/core/src/verifier/mod.rs | 2 +- crates/saya/core/src/verifier/starknet.rs | 9 +- crates/sozo/ops/src/events.rs | 2 +- crates/sozo/ops/src/model.rs | 4 + .../manifests/dev/base/dojo_world_world.toml | 4 +- examples/spawn-and-move/Scarb.toml | 2 +- .../dev/abis/base/dojo_world_world.json | 54 +- .../abis/deployments/dojo_world_world.json | 54 +- .../manifests/dev/base/dojo_world_world.toml | 4 +- .../manifests/dev/manifest.json | 66 +- .../manifests/dev/manifest.toml | 12 +- 46 files changed, 2429 insertions(+), 367 deletions(-) create mode 100644 bin/saya/programs/cairo0differ.json create mode 100644 bin/saya/programs/cairo0merger.json create mode 100644 bin/saya/src/tests.rs create mode 100644 bin/scheduler/Cargo.toml create mode 100644 bin/scheduler/README.md create mode 100644 bin/scheduler/src/main.rs create mode 100644 crates/saya/core/src/prover/extract.rs create mode 100644 crates/saya/core/src/prover/loader.rs create mode 100644 crates/saya/core/src/prover/scheduler.rs diff --git a/Cargo.lock b/Cargo.lock index d784dbbe5e..96465fc1ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3762,6 +3762,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/neotheprogramist/http-prover?rev=05aa9dbb7fdd5618693cead978d4ab0eebbf8f80#05aa9dbb7fdd5618693cead978d4ab0eebbf8f80" +dependencies = [ + "ed25519-dalek", + "prefix-hex", + "serde", + "serde_json", + "serde_with 3.8.1", +] + [[package]] name = "common" version = "0.7.0-alpha.5" @@ -3885,6 +3897,34 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cookie" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cookie_store" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" +dependencies = [ + "cookie", + "idna 0.3.0", + "log", + "publicsuffix", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -4600,7 +4640,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "smol_str", "starknet", "test-log", @@ -4661,7 +4701,7 @@ dependencies = [ "scarb-ui", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "smol_str", "starknet", "thiserror", @@ -4712,7 +4752,7 @@ dependencies = [ "scarb", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "similar-asserts", "smol_str", "starknet", @@ -4784,6 +4824,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", + "serde", "signature", ] @@ -6457,6 +6498,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" @@ -6781,7 +6841,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -6804,6 +6864,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -6912,6 +6973,22 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.3" @@ -6967,6 +7044,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.4.0" @@ -7778,7 +7865,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common", + "common 0.7.0-alpha.5", "console", "dojo-metrics", "katana-core", @@ -7864,7 +7951,7 @@ dependencies = [ "reqwest 0.12.4", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet_api", "tempfile", @@ -7938,7 +8025,7 @@ dependencies = [ "rayon", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "similar-asserts", "starknet", "starknet-crypto 0.6.2", @@ -8001,7 +8088,7 @@ dependencies = [ "metrics", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet_api", "thiserror", @@ -8039,7 +8126,7 @@ dependencies = [ "rstest 0.18.2", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "thiserror", ] @@ -10351,6 +10438,15 @@ dependencies = [ "termtree", ] +[[package]] +name = "prefix-hex" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f1799f398371ad6957951ec446d3ff322d35c46d9db2e217b67e828b311c249" +dependencies = [ + "hex", +] + [[package]] name = "pretty_assertions" version = "1.4.0" @@ -10652,6 +10748,45 @@ dependencies = [ "prost 0.12.4", ] +[[package]] +name = "prover-sdk" +version = "0.1.0" +source = "git+https://github.com/neotheprogramist/http-prover?rev=05aa9dbb7fdd5618693cead978d4ab0eebbf8f80#05aa9dbb7fdd5618693cead978d4ab0eebbf8f80" +dependencies = [ + "bytes", + "common 0.1.0", + "ed25519-dalek", + "http 1.1.0", + "hyper-util", + "prefix-hex", + "rand", + "reqwest 0.12.4", + "reqwest_cookie_store", + "serde", + "serde_json", + "serde_with 3.8.1", + "thiserror", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "psl-types" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" + +[[package]] +name = "publicsuffix" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457" +dependencies = [ + "idna 0.3.0", + "psl-types", +] + [[package]] name = "quanta" version = "0.11.1" @@ -10992,12 +11127,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls 0.24.2", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -11036,19 +11171,25 @@ checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64 0.22.1", "bytes", + "cookie", + "cookie_store", + "encoding_rs", "futures-channel", "futures-core", "futures-util", + "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "http-body-util", "hyper 1.3.1", "hyper-rustls 0.26.0", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -11059,7 +11200,9 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", + "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls 0.25.0", "tower-service", "url", @@ -11070,6 +11213,18 @@ dependencies = [ "winreg 0.52.0", ] +[[package]] +name = "reqwest_cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ea5c6f30c19d766efe8d823c88f9abd1c56516648a0d4264ab2dc04cc19472" +dependencies = [ + "bytes", + "cookie_store", + "reqwest 0.12.4", + "url", +] + [[package]] name = "resolv-conf" version = "0.7.0" @@ -11659,6 +11814,7 @@ name = "saya" version = "0.7.0-alpha.5" dependencies = [ "anyhow", + "cairo-proof-parser", "clap", "clap_complete", "console", @@ -11667,6 +11823,7 @@ dependencies = [ "katana-rpc-api", "saya-core", "serde_json", + "starknet-crypto 0.6.2", "tokio", "tracing", "tracing-subscriber", @@ -11696,13 +11853,15 @@ dependencies = [ "katana-rpc-types", "lazy_static", "num-bigint", + "num-traits 0.2.19", "parking_lot 0.12.2", + "prover-sdk", "rand", "reqwest 0.12.4", "saya-provider", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet-crypto 0.6.2", "starknet-types-core 0.0.9", @@ -11734,7 +11893,7 @@ dependencies = [ "lazy_static", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet", "starknet_api", "thiserror", @@ -11885,6 +12044,20 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "scheduler" +version = "0.7.0-alpha.5" +dependencies = [ + "clap", + "clap_complete", + "katana-primitives", + "saya-core", + "serde", + "serde_json", + "tokio", + "url", +] + [[package]] name = "schemars" version = "0.8.19" @@ -12162,7 +12335,25 @@ dependencies = [ "indexmap 1.9.3", "serde", "serde_json", - "serde_with_macros", + "serde_with_macros 2.3.3", + "time", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros 3.8.1", "time", ] @@ -12178,6 +12369,18 @@ dependencies = [ "syn 2.0.64", ] +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling 0.20.9", + "proc-macro2", + "quote", + "syn 2.0.64", +] + [[package]] name = "serdect" version = "0.2.0" @@ -12579,7 +12782,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "smol_str", "snapbox", "starknet", @@ -12897,7 +13100,7 @@ checksum = "cb3b73d437b4d62241612d13fce612602de6684c149cccf696e76a20757e2156" dependencies = [ "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet-accounts", "starknet-core", "starknet-providers", @@ -12916,7 +13119,7 @@ dependencies = [ "serde", "serde_json", "serde_json_pythonic", - "serde_with", + "serde_with 2.3.3", "sha3", "starknet-crypto 0.6.2", "starknet-ff", @@ -13030,7 +13233,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "serde_with", + "serde_with 2.3.3", "starknet-core", "thiserror", "url", @@ -13758,7 +13961,7 @@ dependencies = [ "axum", "base64 0.21.7", "bytes", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", @@ -13873,7 +14076,7 @@ dependencies = [ "camino", "chrono", "clap", - "common", + "common 0.7.0-alpha.5", "ctrlc", "dojo-metrics", "dojo-types", diff --git a/Cargo.toml b/Cargo.toml index 0675d09c79..cec0e4cd65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "bin/dojo-language-server", "bin/katana", "bin/saya", + "bin/scheduler", "bin/sozo", "bin/torii", "crates/benches", @@ -189,7 +190,6 @@ tower-http = "0.4.4" tracing = "0.1.34" tracing-subscriber = { version = "0.3.16", features = [ "env-filter", "json" ] } url = { version = "2.4.0", features = [ "serde" ] } - rstest = "0.18.2" rstest_reuse = "0.6.0" diff --git a/bin/saya/Cargo.toml b/bin/saya/Cargo.toml index add58c0e63..1021bf1706 100644 --- a/bin/saya/Cargo.toml +++ b/bin/saya/Cargo.toml @@ -20,3 +20,7 @@ tokio.workspace = true tracing-subscriber.workspace = true tracing.workspace = true url.workspace = true + +[dev-dependencies] +cairo-proof-parser.workspace = true +starknet-crypto.workspace = true diff --git a/bin/saya/README.md b/bin/saya/README.md index acdc21d51f..913b6ad039 100644 --- a/bin/saya/README.md +++ b/bin/saya/README.md @@ -1,18 +1,21 @@ - # Saya Executable Documentation This documentation outlines the operation of the Saya executable, a CLI-based service designed to interact with blockchain components for state management and updates. Saya supports operations on Celestia nodes and integrates with Katana blocks to provide a streamlined blockchain interaction process. ## Key Features + - **Celestia Node Integration**: Allows publishing state updates to a Celestia node (WIP). - **Katana Block Fetching**: Saya can fetch blocks from Katana, aiding in local blockchain simulations and testing. ## Prerequisites + Ensure you have the following set up: + - Rust and Cargo installed on your system. - Access to Celestia and/or Katana node URLs if needed. ## Basic Usage Example + Below is a command-line example that demonstrates how to run the Saya executable with necessary parameters: ```bash @@ -21,38 +24,160 @@ cargo run --bin saya -- --rpc-url http://localhost:5050 --da-chain celestia --ce ## Detailed Workflow -### 1. Deploy a New World Contract -First, deploy a new smart contract using the Saya framework: -```bash -cargo run -r -p sozo -- build --manifest-path examples/spawn-and-move/Scarb.toml +1. Prepare fact registry contract + + Declare or use already declared `class-hash`: `0x7f6076572e04d7182a1c5c9f1f4c15aafcb069b1bfdb3de4d7c9e47c99deeb4`. + + Deploy or use already deployed `contract`: `0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb`. + + In the repository https://github.com/HerodotusDev/integrity run -cargo run -r -p sozo -- migrate apply --manifest-path examples/spawn-and-move/Scarb.toml --rpc-url <> --fee-estimate-multiplier 1000 --private-key <> --account-address <> --name saya-world-v1 +```bash + fact_registry/1-declare.sh # extract `class-hash` + fact_registry/1-deploy.sh # use at ``` -### 2. Initialize a Local Katana Instance -Start a local instance of Katana configured to work with the newly deployed contract: +2. Spawn world + +You must choose a world's name as you may deploy the exact same code as an other person trying this example. The world's name must fit into 31 characters. + +**IMPORTANT NOTE:** +At the moment until a bug is fixed, you must comment out the `world_address` that is present into the `examples/spawn-and-move/Scarb.toml` file to allow the use of the `--name` flag. + ```bash -cargo run -r -p katana -- -b 30000 --rpc-url <> --fork-block-number +cargo run -r --bin sozo -- \ + build \ + --manifest-path examples/spawn-and-move/Scarb.toml + +cargo run -r --bin sozo -- \ + migrate apply \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --name ``` +Once the migration is done, please take note of the address of the world as it will be re-used in the commands below. + +1. Set world configs -### 3. Launch the Saya Service -Execute the Saya process to interact with the blockchain network: ```bash -cargo run -r --bin saya -- --rpc-url http://localhost:5050 --registry 0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb --world <> --start-block <> +cargo run -r --bin sozo -- \ + execute set_differ_program_hash \ + -c 0xa73dd9546f9858577f9fdbe43fd629b6f12dc638652e11b6e29155f4c6328 \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --world \ + --wait + +cargo run -r --bin sozo -- \ + execute set_merger_program_hash \ + -c 0xc105cf2c69201005df3dad0050f5289c53d567d96df890f2142ad43a540334 \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --world \ + --wait + +cargo run -r --bin sozo -- \ + execute set_facts_registry \ + -c 0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --private-key \ + --account-address \ + --fee-estimate-multiplier 20 \ + --world \ + --wait ``` -Currently the Stone prover in use is optimized for AMD64. Hence, running it on a ARM64 machine will be relatively slow or even not compatible if emulation is now available. -If you can't run Saya on a AMD64 machine, you may choose to use the HTTP wrapper currently proposed by Visoft. +4. Start katana + +Start a local instance of Katana configured to work with the newly deployed contract. You should wait your world to be integrated into the latest block (and not the pending). +Once block in which the transaction that deploys the world is mined, you can start `katana` in forking mode. + ```bash -cargo run -r --bin saya -- --rpc-url http://localhost:5050 --prover-url http://prover.visoft.dev:3618/prove/state-diff-commitment --registry 0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb --world <> --start-block <> +cargo run -r --bin katana -- \ + --rpc-url \ + --fork-block-number ``` -### 4. Modify the World State Using `sozo` +5. Run transactions on `katana` + Finally, modify the state of the world using specific actions: + +```bash +cargo run -r --bin sozo -- execute dojo_examples::actions::actions spawn \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url http://localhost:5050 \ + --private-key \ + --account-address \ + --world \ + --wait +``` + +Before running `saya`, we can check the actual value for some models on Sepolia, to then see them updated by the proof being verified and the state of the world being updated. +In the `spawn-and-move` example, the `Position` model is used to store some data associated with the player, +being the contract address of the contract that called `spawn` (hence, your account address). +By default on Sepolia, it should be set like to unknown position, being like: + +```bash +cargo run -r --bin sozo -- model get Position \ + --manifest-path examples/spawn-and-move/Scarb.toml \ + --rpc-url \ + --world +``` +```json +// Expected on Sepolia as we've executed the transaction on the Katana shard. +{ + player : , + vec : { + x : 0, + y : 0 + } +} + +// Expected on Katana. +{ + player : , + vec : { + x : 10, + y : 10 + } +} +``` + +6. Run saya + +The could be `http://prover.visoft.dev:3618` if you have a registered key or a link to a self hosted instance of `https://github.com/neotheprogramist/http-prover`. +The is the private key produced by `keygen` installed with `cargo install --git https://github.com/neotheprogramist/http-prover keygen`. Pass the public key to server operator or the prover program. + +If you are on an `amd64` architecture, go ahead and run the `http-prover` locally to see how it works and run this whole pipeline locally. +If not (this includes Apple Silicon), some emulation will take place to run the prover on your machine, and this is very very slow. + +It's important that the `--start-block` of Saya is the first block produced by Katana as for now Katana is not fetching events from the forked network. + +**IMPORTANT NOTE:** +For now, please add your account address and account private key in `saya/core/src/dojo_os/mod.rs` as those parameters are still not exposed currently. As you are using `cargo run`, it will rebuild with your account configuration before running `saya`. + ```bash -cargo run -r -p sozo -- execute --rpc-url http://localhost:5050 --private-key <> --account-address <> --world <> dojo_examples::actions::actions spawn +cargo run -r --bin saya -- \ + --rpc-url http://localhost:5050 \ + --registry \ + --world \ + --url \ + --private-key \ + --start-block ``` After this command, Saya will pick up the blocks with transactions, generate the proof for the state transition, and send it to the base layer world contract. +Once the world on Sepolia is updated, you can issue again the `model get` command as seen before, and you should see the `katana` shard state reflected on Sepolia. + Ensure to replace placeholders (`<>`) with appropriate values for your configuration and environment. This documentation provides a comprehensive overview for developers and operators to effectively utilize the Saya service in blockchain applications. diff --git a/bin/saya/programs/cairo0differ.json b/bin/saya/programs/cairo0differ.json new file mode 100644 index 0000000000..0188ed1f08 --- /dev/null +++ b/bin/saya/programs/cairo0differ.json @@ -0,0 +1 @@ +{ "attributes": [], "builtins": [ "output", "pedersen", "range_check", "bitwise" ], "compiler_version": "0.13.1", "data": [ "0x40780017fff7fff", "0x4", "0x1104800180018000", "0xcc", "0x10780017fff7fff", "0x0", "0x400380007ffb7ffc", "0x400380017ffb7ffd", "0x482680017ffb8000", "0x3", "0x480280027ffb8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x8", "0x480a80047fff8000", "0x480a80057fff8000", "0x480a80067fff8000", "0x480a80077fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff1", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x4", "0x480a80007fff8000", "0x480a80017fff8000", "0x480a80027fff8000", "0x480a80037fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffcd", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbc", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffab", "0x480280027ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa8", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffef", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff97", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff86", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff75", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff64", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff53", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x4", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480280007ffc8000", "0x400280007ffb7fff", "0x482680017ffb8000", "0x1", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff3", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0xd", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff3d", "0x40137ffc7fff8000", "0x40137ffd7fff8001", "0x40137ffe7fff8002", "0x40137fff7fff8003", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff5d", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff7d", "0x40137ffe7fff8004", "0x40137fff7fff8005", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff9e", "0x40137ffe7fff8006", "0x40137fff7fff8007", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbc", "0x40137ffe7fff8008", "0x40137fff7fff8009", "0x480a7ffb7fff8000", "0x480a80007fff8000", "0x480a80017fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff20", "0x480a80027fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1d", "0x480a80037fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1a", "0x48127fdb7fff8000", "0x48127fdb7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff4d", "0x480a80047fff8000", "0x480a80057fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff6e", "0x480a80067fff8000", "0x480a80077fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff8c", "0x480a80087fff8000", "0x480a80097fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffaa", "0x400380007ffa8000", "0x400280017ffa7fff", "0x400380027ffa8001", "0x400380037ffa8002", "0x400380047ffa8003", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff10", "0x48127ff87fff8000", "0x480680017fff8000", "0x0", "0x48127ffc7fff8000", "0x48127ffc7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff0e", "0x40137ffe7fff800a", "0x400280057ffa7fff", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1d", "0x40137fff7fff800b", "0x40137ffe7fff800c", "0x400280067ffa7ffd", "0x482680017ffa8000", "0x7", "0x48127ffb7fff8000", "0x48127ffb7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa6", "0x400180007fff800b", "0x482480017fff8000", "0x1", "0x480a800c7fff8000", "0x480a800b7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff9f", "0x480a800a7fff8000", "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x208b7fff7fff7ffe" ], "debug_info": { "file_contents": { "": "__start__:\nap += main.Args.SIZE + main.ImplicitArgs.SIZE;\ncall main;\n\n__end__:\njmp rel 0;\n" }, "instruction_locations": { "0": { "accessible_scopes": [ "__main__" ], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 46, "end_line": 2, "input_file": { "filename": "" }, "start_col": 1, "start_line": 2 } }, "2": { "accessible_scopes": [ "__main__" ], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 4 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 3, "input_file": { "filename": "" }, "start_col": 1, "start_line": 3 } }, "4": { "accessible_scopes": [ "__main__" ], "flow_tracking_data": { "ap_tracking": { "group": 1, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 6, "input_file": { "filename": "" }, "start_col": 1, "start_line": 6 } }, "6": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 14, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 14 } }, "7": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 15, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 15 } }, "8": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 47, "end_line": 17, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 13, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 }, "While trying to retrieve the implicit argument 'hash_ptr' in:" ], "start_col": 12, "start_line": 13 }, "While expanding the reference 'hash_ptr' in:" ], "start_col": 20, "start_line": 17 } }, "10": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 1 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 33, "end_line": 16, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 20, "start_line": 18 }, "While expanding the reference 'result' in:" ], "start_col": 18, "start_line": 16 } }, "11": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 2 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 } }, "12": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 15, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 15 } }, "14": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [ { "location": { "end_col": 7, "end_line": 26, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 21 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 17, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 29, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 29 }, "While expanding the reference 'prev_state_root' in:" ], "start_col": 11, "start_line": 17 } }, "15": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 9 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 23, "end_line": 18, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 30, "input_file": { "filename": "src/differ.cairo" }, "start_col": 26, "start_line": 30 }, "While expanding the reference 'block_number' in:" ], "start_col": 11, "start_line": 18 } }, "16": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 10 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 21, "end_line": 19, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 31, "input_file": { "filename": "src/differ.cairo" }, "start_col": 24, "start_line": 31 }, "While expanding the reference 'block_hash' in:" ], "start_col": 11, "start_line": 19 } }, "17": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 11 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 22, "end_line": 20, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 32, "input_file": { "filename": "src/differ.cairo" }, "start_col": 25, "start_line": 32 }, "While expanding the reference 'config_hash' in:" ], "start_col": 11, "start_line": 20 } }, "18": { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 12 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 7, "end_line": 34, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 27 } }, "19": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 41, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 41 } }, "21": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [ { "location": { "end_col": 7, "end_line": 48, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 44 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 19, "end_line": 42, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 51, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 51 }, "While expanding the reference 'world_da' in:" ], "start_col": 11, "start_line": 42 } }, "22": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 3 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 23, "end_line": 43, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 52, "input_file": { "filename": "src/differ.cairo" }, "start_col": 22, "start_line": 52 }, "While expanding the reference 'world_da_len' in:" ], "start_col": 11, "start_line": 43 } }, "23": { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 4 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 7, "end_line": 53, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 50 } }, "24": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 59, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 59 } }, "26": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 56, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 51, "end_line": 56, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 60, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 60 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 56 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 56 } }, "27": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 57, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 60, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 60 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 57 } }, "28": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 26, "end_line": 60, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 60 } }, "29": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 18, "end_line": 62, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 62 } }, "31": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 56, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 64, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 64 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 56 } }, "32": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 57, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 65, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 65 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 57 } }, "33": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 27, "end_line": 63, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 65, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 65 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 63 } }, "34": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 3 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 66, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 64 } }, "36": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 7 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 30, "end_line": 69, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 69 } }, "38": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 8 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 38, "end_line": 70, "input_file": { "filename": "src/differ.cairo" }, "start_col": 22, "start_line": 70 } }, "40": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 9 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 71, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 67 } }, "42": { "accessible_scopes": [ "__main__", "__main__.hash_world_da_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 6, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 19, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 71, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 67 } }, "43": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 80, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 80 } }, "45": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [ { "location": { "end_col": 7, "end_line": 99, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 85 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 38, "end_line": 81, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 101, "input_file": { "filename": "src/differ.cairo" }, "start_col": 37, "start_line": 101 }, "While expanding the reference 'message_to_starknet_segment' in:" ], "start_col": 11, "start_line": 81 } }, "46": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 5 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 82, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 72, "end_line": 102, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 102 }, "While expanding the reference 'message_to_starknet_segment_len' in:" ], "start_col": 11, "start_line": 82 } }, "47": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 6 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 38, "end_line": 83, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 103, "input_file": { "filename": "src/differ.cairo" }, "start_col": 37, "start_line": 103 }, "While expanding the reference 'message_to_appchain_segment' in:" ], "start_col": 11, "start_line": 83 } }, "48": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 7 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 84, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 72, "end_line": 104, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 104 }, "While expanding the reference 'message_to_appchain_segment_len' in:" ], "start_col": 11, "start_line": 84 } }, "49": { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 8 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 7, "end_line": 105, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 100 } }, "50": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 114, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 114 } }, "52": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [ { "location": { "end_col": 7, "end_line": 129, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 117 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 24, "end_line": 115, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 40, "end_line": 130, "input_file": { "filename": "src/differ.cairo" }, "start_col": 27, "start_line": 130 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 11, "start_line": 115 } }, "53": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 3 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 28, "end_line": 116, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 77, "end_line": 130, "input_file": { "filename": "src/differ.cairo" }, "start_col": 60, "start_line": 130 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 11, "start_line": 116 } }, "54": { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 4 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 79, "end_line": 130, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 130 } }, "55": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 50, "end_line": 133, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 137, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 137 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 24, "start_line": 133 } }, "56": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 44, "end_line": 136, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 138, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 138 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 136 } }, "57": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 32, "end_line": 138, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 138 } }, "58": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 3 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 6, "end_line": 139, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 137 } }, "60": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_update" ], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 7 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 29, "__main__.hash_nonce_update.res": 30 } }, "hints": [], "inst": { "end_col": 22, "end_line": 140, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 140 } }, "61": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 7, "end_line": 146, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 146 } }, "63": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 143, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 143, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 147, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 147 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 143 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 143 } }, "64": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 144, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 147, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 147 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 144 } }, "65": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 26, "end_line": 147, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 147 } }, "66": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 18, "end_line": 149, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 149 } }, "68": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 143, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 61, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "start_col": 49, "start_line": 151 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 143 } }, "69": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 39, "end_line": 150, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 75, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "start_col": 63, "start_line": 151 }, "While expanding the reference 'nonce_update' in:" ], "start_col": 24, "start_line": 150 } }, "70": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 76, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 151 } }, "72": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 11 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 61, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 152, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 152 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 49, "start_line": 151 } }, "73": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 12 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 144, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 153, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 153 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 144 } }, "74": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 13 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 151, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 153, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 153 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 151 } }, "75": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 14 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 6, "end_line": 154, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 152 } }, "77": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 18 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 40, "end_line": 157, "input_file": { "filename": "src/differ.cairo" }, "start_col": 23, "start_line": 157 } }, "79": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 19 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 48, "end_line": 158, "input_file": { "filename": "src/differ.cairo" }, "start_col": 27, "start_line": 158 } }, "81": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 20 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 6, "end_line": 159, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 155 } }, "83": { "accessible_scopes": [ "__main__", "__main__.hash_nonce_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 11, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 40, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 7, "end_line": 159, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 155 } }, "84": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 169, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 169 } }, "86": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [ { "location": { "end_col": 7, "end_line": 189, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 172 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 170, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 190, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 190 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 11, "start_line": 170 } }, "87": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 3 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 30, "end_line": 171, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 85, "end_line": 190, "input_file": { "filename": "src/differ.cairo" }, "start_col": 66, "start_line": 190 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 11, "start_line": 171 } }, "88": { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 4 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 87, "end_line": 190, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 190 } }, "89": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 0 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 52, "end_line": 193, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 197, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 197 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 193 } }, "90": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 1 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 46, "end_line": 196, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 198, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 198 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 196 } }, "91": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 2 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 40, "end_line": 198, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 198 } }, "92": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 3 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 199, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 197 } }, "94": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 7 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 42, "end_line": 201, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 201 } }, "95": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 8 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 202, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 200 } }, "97": { "accessible_scopes": [ "__main__", "__main__.hash_storage_update" ], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 12 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 48, "__main__.hash_storage_update.res": 49, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 22, "end_line": 203, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 203 } }, "98": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 209, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 209 } }, "100": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 206, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 58, "end_line": 206, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 210, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 210 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 206 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 206 } }, "101": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 207, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 210, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 210 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 207 } }, "102": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 26, "end_line": 210, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 210 } }, "103": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 18, "end_line": 212, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 212 } }, "105": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 206, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "start_col": 51, "start_line": 214 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 206 } }, "106": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 43, "end_line": 213, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "start_col": 65, "start_line": 214 }, "While expanding the reference 'storage_update' in:" ], "start_col": 26, "start_line": 213 } }, "107": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 80, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 214 } }, "109": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 16 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 63, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 215, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 215 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 214 } }, "110": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 17 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 207, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 216, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 216 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 207 } }, "111": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 18 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 214, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 216, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 216 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 214 } }, "112": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 19 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 217, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 215 } }, "114": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 23 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 44, "end_line": 220, "input_file": { "filename": "src/differ.cairo" }, "start_col": 25, "start_line": 220 } }, "116": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 24 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 52, "end_line": 221, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 221 } }, "118": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 25 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 222, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 218 } }, "120": { "accessible_scopes": [ "__main__", "__main__.hash_storage_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 15, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 59, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 222, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 218 } }, "121": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 232, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 232 } }, "123": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [ { "location": { "end_col": 7, "end_line": 247, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 235 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 233, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 248, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 248 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 11, "start_line": 233 } }, "124": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 3 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 31, "end_line": 234, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 248, "input_file": { "filename": "src/differ.cairo" }, "start_col": 69, "start_line": 248 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 11, "start_line": 234 } }, "125": { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 4 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 91, "end_line": 248, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 248 } }, "126": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 0 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 53, "end_line": 251, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 255, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 255 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 27, "start_line": 251 } }, "127": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 1 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 47, "end_line": 254, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 256, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 256 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 254 } }, "128": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 2 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 40, "end_line": 256, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 256 } }, "129": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 3 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 6, "end_line": 257, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 255 } }, "131": { "accessible_scopes": [ "__main__", "__main__.hash_contract_update" ], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 7 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 65, "__main__.hash_contract_update.res": 66 } }, "hints": [], "inst": { "end_col": 22, "end_line": 258, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 258 } }, "132": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 7, "end_line": 264, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 264 } }, "134": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 261, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 261, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 265, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 265 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 261 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 261 } }, "135": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 262, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 265, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 265 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 262 } }, "136": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 26, "end_line": 265, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 265 } }, "137": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 18, "end_line": 267, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 267 } }, "139": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 261, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "start_col": 52, "start_line": 269 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 261 } }, "140": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 45, "end_line": 268, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 81, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "start_col": 66, "start_line": 269 }, "While expanding the reference 'contract_update' in:" ], "start_col": 27, "start_line": 268 } }, "141": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 82, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 269 } }, "143": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 11 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 64, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 270, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 270 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 52, "start_line": 269 } }, "144": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 12 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 262, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 271, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 271 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 262 } }, "145": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 13 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 269, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 271, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 271 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 269 } }, "146": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 14 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 6, "end_line": 272, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 270 } }, "148": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 18 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 46, "end_line": 275, "input_file": { "filename": "src/differ.cairo" }, "start_col": 26, "start_line": 275 } }, "150": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 19 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 54, "end_line": 276, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 276 } }, "152": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 20 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 6, "end_line": 277, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 273 } }, "154": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 19, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 76, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 7, "end_line": 277, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 273 } }, "155": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 286, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 286 } }, "157": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [ { "location": { "end_col": 7, "end_line": 301, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 289 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 287, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 302, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 302 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 11, "start_line": 287 } }, "158": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 3 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 31, "end_line": 288, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 302, "input_file": { "filename": "src/differ.cairo" }, "start_col": 69, "start_line": 302 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 11, "start_line": 288 } }, "159": { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 4 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 91, "end_line": 302, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 302 } }, "160": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 0 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 52, "end_line": 305, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 309, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 309 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 305 } }, "161": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 1 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 40, "end_line": 308, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 310, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 310 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 308 } }, "162": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 2 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 48, "end_line": 310, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 310 } }, "163": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 3 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 6, "end_line": 311, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 309 } }, "165": { "accessible_scopes": [ "__main__", "__main__.hash_declared_class" ], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 7 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 82, "__main__.hash_declared_class.res": 83 } }, "hints": [], "inst": { "end_col": 22, "end_line": 312, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 312 } }, "166": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 7, "end_line": 318, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 318 } }, "168": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 315, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 315, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 319, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 319 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 315 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 315 } }, "169": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 316, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 319, "input_file": { "filename": "src/differ.cairo" }, "start_col": 21, "start_line": 319 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 316 } }, "170": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 26, "end_line": 319, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 319 } }, "171": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 18, "end_line": 321, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 321 } }, "173": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 315, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "start_col": 51, "start_line": 323 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 315 } }, "174": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 44, "end_line": 322, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "start_col": 65, "start_line": 323 }, "While expanding the reference 'declared_class' in:" ], "start_col": 26, "start_line": 322 } }, "175": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 80, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "start_col": 18, "start_line": 323 } }, "177": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 11 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 63, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 324, "input_file": { "filename": "src/differ.cairo" }, "start_col": 32, "start_line": 324 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 323 } }, "178": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 12 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 316, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 325, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 325 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 316 } }, "179": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 13 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 323, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 325, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 325 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 323 } }, "180": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 14 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 6, "end_line": 326, "input_file": { "filename": "src/differ.cairo" }, "start_col": 17, "start_line": 324 } }, "182": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 18 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 46, "end_line": 329, "input_file": { "filename": "src/differ.cairo" }, "start_col": 26, "start_line": 329 } }, "184": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 19 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 54, "end_line": 330, "input_file": { "filename": "src/differ.cairo" }, "start_col": 30, "start_line": 330 } }, "186": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 20 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 6, "end_line": 331, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 327 } }, "188": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 23, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 93, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 7, "end_line": 331, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 327 } }, "189": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 7, "end_line": 335, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 335 } }, "191": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 36, "end_line": 334, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 334, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 336, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 336 }, "While trying to retrieve the implicit argument 'output_ptr' in:" ], "start_col": 19, "start_line": 334 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 19, "start_line": 334 } }, "192": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 19, "end_line": 336, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 336 } }, "193": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96 } }, "hints": [], "inst": { "end_col": 18, "end_line": 338, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 338 } }, "195": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 24, "end_line": 339, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 33, "end_line": 340, "input_file": { "filename": "src/differ.cairo" }, "start_col": 28, "start_line": 340 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 339 } }, "196": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 96, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 34, "end_line": 340, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 340 } }, "197": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 36, "end_line": 341, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 36, "start_line": 342 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 341 } }, "199": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 57, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 48, "start_line": 342 } }, "201": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 66, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 59, "start_line": 342 } }, "203": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 4 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 99, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 67, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 12, "start_line": 342 } }, "205": { "accessible_scopes": [ "__main__", "__main__.output_array" ], "flow_tracking_data": { "ap_tracking": { "group": 25, "offset": 0 }, "reference_ids": { "__main__.output_array.__temp0": 98, "__main__.output_array.array": 94, "__main__.output_array.len": 95, "__main__.output_array.output_ptr": 100, "__main__.output_array.value": 97 } }, "hints": [], "inst": { "end_col": 68, "end_line": 342, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 342 } }, "206": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 18, "end_line": 346, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 346 } }, "208": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 13 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 21, "end_line": 350, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 350 } }, "210": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "211": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "212": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "213": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 105, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 349, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 349 }, "While auto generating local variable for 'input_config'." ], "start_col": 9, "start_line": 349 } }, "214": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 27 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 28, "end_line": 354, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 354 } }, "216": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 33 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103 } }, "hints": [], "inst": { "end_col": 30, "end_line": 358, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 358 } }, "218": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 39 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 109, "__main__.main.storage_updates_len": 110 } }, "hints": [], "inst": { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 356 }, "While auto generating local variable for 'storage_updates'." ], "start_col": 9, "start_line": 356 } }, "219": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 39 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 110 } }, "hints": [], "inst": { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 357 }, "While auto generating local variable for 'storage_updates_len'." ], "start_col": 9, "start_line": 357 } }, "220": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 39 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 31, "end_line": 362, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 362 } }, "222": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 45 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 113, "__main__.main.contract_updates_len": 114, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 360 }, "While auto generating local variable for 'contract_updates'." ], "start_col": 9, "start_line": 360 } }, "223": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 45 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 114, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 361 }, "While auto generating local variable for 'contract_updates_len'." ], "start_col": 9, "start_line": 361 } }, "224": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 45 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 31, "end_line": 366, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 366 } }, "226": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 51 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 117, "__main__.main.declared_classes_len": 118, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 364 }, "While auto generating local variable for 'declared_classes'." ], "start_col": 9, "start_line": 364 } }, "227": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 51 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 118, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 365 }, "While auto generating local variable for 'declared_classes_len'." ], "start_col": 9, "start_line": 365 } }, "228": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 51 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 56, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 368, "input_file": { "filename": "src/differ.cairo" }, "start_col": 31, "start_line": 368 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 345 } }, "229": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 52 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 37, "end_line": 369, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 369 } }, "230": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 53 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 64, "end_line": 369, "input_file": { "filename": "src/differ.cairo" }, "start_col": 39, "start_line": 369 } }, "231": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 54 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 102, "__main__.main.range_check_ptr": 103, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 370, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 368 } }, "233": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 58 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 121, "__main__.main.range_check_ptr": 103, "__main__.main.res": 122, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 37, "end_line": 372, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 372 } }, "234": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 59 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 121, "__main__.main.range_check_ptr": 103, "__main__.main.res": 122, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 373, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 371 } }, "236": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 63 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 123, "__main__.main.range_check_ptr": 103, "__main__.main.res": 124, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 38, "end_line": 375, "input_file": { "filename": "src/differ.cairo" }, "start_col": 14, "start_line": 375 } }, "237": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 64 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 123, "__main__.main.range_check_ptr": 103, "__main__.main.res": 124, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 376, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 374 } }, "239": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 68 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 125, "__main__.main.range_check_ptr": 103, "__main__.main.res": 126, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 37, "end_line": 352, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 22, "end_line": 379, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 379 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 9, "start_line": 352 } }, "240": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 69 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 125, "__main__.main.range_check_ptr": 103, "__main__.main.res": 126, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 32, "end_line": 353, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 380, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 380 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 9, "start_line": 353 } }, "241": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 70 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 125, "__main__.main.range_check_ptr": 103, "__main__.main.res": 126, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 381, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 377 } }, "243": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 127, "__main__.main.range_check_ptr": 103, "__main__.main.res": 128, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 41, "end_line": 356, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 384, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 384 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 9, "start_line": 356 }, "While auto generating local variable for 'storage_updates'." ], "start_col": 9, "start_line": 356 } }, "244": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 127, "__main__.main.range_check_ptr": 103, "__main__.main.res": 128, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 357, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 385, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 385 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 9, "start_line": 357 }, "While auto generating local variable for 'storage_updates_len'." ], "start_col": 9, "start_line": 357 } }, "245": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 127, "__main__.main.range_check_ptr": 103, "__main__.main.res": 128, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 386, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 382 } }, "247": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 129, "__main__.main.range_check_ptr": 103, "__main__.main.res": 130, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 360, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 25, "end_line": 389, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 389 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 9, "start_line": 360 }, "While auto generating local variable for 'contract_updates'." ], "start_col": 9, "start_line": 360 } }, "248": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 129, "__main__.main.range_check_ptr": 103, "__main__.main.res": 130, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 361, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 29, "end_line": 390, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 390 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 9, "start_line": 361 }, "While auto generating local variable for 'contract_updates_len'." ], "start_col": 9, "start_line": 361 } }, "249": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 129, "__main__.main.range_check_ptr": 103, "__main__.main.res": 130, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 391, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 387 } }, "251": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 131, "__main__.main.range_check_ptr": 103, "__main__.main.res": 132, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 42, "end_line": 364, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 25, "end_line": 394, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 394 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 9, "start_line": 364 }, "While auto generating local variable for 'declared_classes'." ], "start_col": 9, "start_line": 364 } }, "252": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 131, "__main__.main.range_check_ptr": 103, "__main__.main.res": 132, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 35, "end_line": 365, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 29, "end_line": 395, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 395 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 9, "start_line": 365 }, "While auto generating local variable for 'declared_classes_len'." ], "start_col": 9, "start_line": 365 } }, "253": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 131, "__main__.main.range_check_ptr": 103, "__main__.main.res": 132, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 6, "end_line": 396, "input_file": { "filename": "src/differ.cairo" }, "start_col": 16, "start_line": 392 } }, "255": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 57, "end_line": 398, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 398 } }, "256": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 32, "end_line": 399, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 399 } }, "257": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 54, "end_line": 400, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 400 } }, "258": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 52, "end_line": 401, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 401 } }, "259": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 53, "end_line": 402, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 402 } }, "260": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112 } }, "hints": [], "inst": { "end_col": 63, "end_line": 404, "input_file": { "filename": "src/differ.cairo" }, "start_col": 49, "start_line": 404 } }, "262": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 6 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 68, "end_line": 392, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "start_col": 59, "start_line": 406 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 56, "start_line": 392 } }, "263": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 7 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 26, "end_line": 405, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 22, "end_line": 407, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 407 }, "While expanding the reference 'world_da_hash' in:" ], "start_col": 25, "start_line": 405 } }, "265": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 8 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 25, "end_line": 404, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 32, "end_line": 407, "input_file": { "filename": "src/differ.cairo" }, "start_col": 24, "start_line": 407 }, "While expanding the reference 'world_da' in:" ], "start_col": 10, "start_line": 404 } }, "266": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 9 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 45, "end_line": 404, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 407, "input_file": { "filename": "src/differ.cairo" }, "start_col": 34, "start_line": 407 }, "While expanding the reference 'world_da_len' in:" ], "start_col": 27, "start_line": 404 } }, "267": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 133, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 137, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 6, "end_line": 408, "input_file": { "filename": "src/differ.cairo" }, "start_col": 27, "start_line": 406 } }, "269": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 138, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "start_col": 59, "start_line": 406 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 406 } }, "270": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 101, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 42, "end_line": 410, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 410 } }, "271": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 23, "end_line": 419, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 419 } }, "273": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 144, "__main__.main.message_to_appchain_segment_len": 145, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 418 }, "While auto generating local variable for 'message_to_appchain_segment_len'." ], "start_col": 9, "start_line": 418 } }, "274": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 144, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "start_col": 9, "start_line": 417 }, "While auto generating local variable for 'message_to_appchain_segment'." ], "start_col": 9, "start_line": 417 } }, "275": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 60, "end_line": 421, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 421 } }, "276": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 10 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 36, "end_line": 422, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 423 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 422 } }, "278": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 11 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 43, "end_line": 415, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 423 }, "While expanding the reference 'message_to_starknet_segment' in:" ], "start_col": 9, "start_line": 415 } }, "279": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 12 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 46, "end_line": 416, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 101, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 70, "start_line": 423 }, "While expanding the reference 'message_to_starknet_segment_len' in:" ], "start_col": 9, "start_line": 416 } }, "280": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 13 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 148, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 102, "end_line": 423, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 423 } }, "282": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 149, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 60, "end_line": 424, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 424 } }, "283": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 36, "end_line": 425, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 29, "start_line": 426 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 425 } }, "285": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 43, "end_line": 417, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 41, "start_line": 426 }, "While expanding the reference 'message_to_appchain_segment' in:" ], "start_col": 9, "start_line": 417 }, "While auto generating local variable for 'message_to_appchain_segment'." ], "start_col": 9, "start_line": 417 } }, "286": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 418, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 101, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 70, "start_line": 426 }, "While expanding the reference 'message_to_appchain_segment_len' in:" ], "start_col": 9, "start_line": 418 }, "While auto generating local variable for 'message_to_appchain_segment_len'." ], "start_col": 9, "start_line": 418 } }, "287": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 3 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 150, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 102, "end_line": 426, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 426 } }, "289": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 406, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 345 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 59, "start_line": 406 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 406 } }, "290": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 1 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 79, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 }, "While trying to retrieve the implicit argument 'range_check_ptr' in:" ], "start_col": 58, "start_line": 345 }, "While expanding the reference 'range_check_ptr' in:" ], "start_col": 58, "start_line": 345 } }, "291": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 2 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 99, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 99, "end_line": 345, "input_file": { "filename": "src/differ.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 }, "While trying to retrieve the implicit argument 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 345 }, "While expanding the reference 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 345 } }, "292": { "accessible_scopes": [ "__main__", "__main__.main" ], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 3 }, "reference_ids": { "__main__.main.bitwise_ptr": 104, "__main__.main.contract_updates": 115, "__main__.main.contract_updates_len": 116, "__main__.main.declared_classes": 119, "__main__.main.declared_classes_len": 120, "__main__.main.input_config": 106, "__main__.main.message_to_appchain_segment": 147, "__main__.main.message_to_appchain_segment_len": 146, "__main__.main.message_to_starknet_segment": 142, "__main__.main.message_to_starknet_segment_len": 143, "__main__.main.nonce_updates": 107, "__main__.main.nonce_updates_len": 108, "__main__.main.output_ptr": 151, "__main__.main.pedersen_ptr": 140, "__main__.main.range_check_ptr": 103, "__main__.main.res": 134, "__main__.main.storage_updates": 111, "__main__.main.storage_updates_len": 112, "__main__.main.world_da": 135, "__main__.main.world_da_hash": 139, "__main__.main.world_da_len": 136 } }, "hints": [], "inst": { "end_col": 15, "end_line": 428, "input_file": { "filename": "src/differ.cairo" }, "start_col": 5, "start_line": 428 } } } }, "hints": { "14": [ { "accessible_scopes": [ "__main__", "__main__.get_hashes" ], "code": "ids.prev_state_root = int(program_input[\"prev_state_root\"])\nids.block_number = int(program_input[\"block_number\"])\nids.block_hash = int(program_input[\"block_hash\"])\nids.config_hash = int(program_input[\"config_hash\"])", "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } } } ], "21": [ { "accessible_scopes": [ "__main__", "__main__.get_world_da" ], "code": "world_da = [int(wd) for wd in program_input[\"world_da\"]]\nids.world_da = segments.gen_arg(world_da)\nids.world_da_len = len(world_da)", "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } } } ], "45": [ { "accessible_scopes": [ "__main__", "__main__.get_messages" ], "code": "message_to_starknet_segment = \\\n [int(x) for x in program_input[\"message_to_starknet_segment\"]]\nmessage_to_appchain_segment = \\\n[int(x) for x in program_input[\"message_to_appchain_segment\"]]\n\nids.message_to_starknet_segment = \\\n segments.gen_arg(message_to_starknet_segment)\nids.message_to_starknet_segment_len = \\\n len(message_to_starknet_segment)\nids.message_to_appchain_segment = \\\n segments.gen_arg(message_to_appchain_segment)\nids.message_to_appchain_segment_len = \\\n len(message_to_appchain_segment)", "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } } } ], "52": [ { "accessible_scopes": [ "__main__", "__main__.get_nonce_updates" ], "code": "program_input_nonce_updates = program_input[\"nonce_updates\"]\n\nnonce_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_nonce_updates.items()\n]\nids.nonce_updates = segments.gen_arg(nonce_updates)\nids.nonce_updates_len = len(nonce_updates)", "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } } } ], "86": [ { "accessible_scopes": [ "__main__", "__main__.get_storage_updates" ], "code": "program_input_storage_updates = program_input[\"storage_updates\"]\n\nstorage_updates = [\n (\n int(contract),\n int(key),\n int(value),\n )\n for \n contract, update in \n program_input_storage_updates.items() \n for \n key, value in update.items()\n]\nids.storage_updates = segments.gen_arg(storage_updates)\nids.storage_updates_len = len(storage_updates)", "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } } } ], "123": [ { "accessible_scopes": [ "__main__", "__main__.get_contract_updates" ], "code": "program_input_contract_updates = program_input[\"contract_updates\"]\n\ncontract_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_contract_updates.items()\n]\nids.contract_updates = segments.gen_arg(contract_updates)\nids.contract_updates_len = len(contract_updates)", "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } } } ], "157": [ { "accessible_scopes": [ "__main__", "__main__.get_declared_classes" ], "code": "program_input_declared_classes = program_input[\"declared_classes\"]\n\ndeclared_classes = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_declared_classes.items()\n]\nids.declared_classes = segments.gen_arg(declared_classes)\nids.declared_classes_len = len(declared_classes)", "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } } } ] }, "identifiers": { "__main__.ContractUpdate": { "full_name": "__main__.ContractUpdate", "members": { "class_hash": { "cairo_type": "felt", "offset": 1 }, "contract_address": { "cairo_type": "felt", "offset": 0 } }, "size": 2, "type": "struct" }, "__main__.DeclaredClass": { "full_name": "__main__.DeclaredClass", "members": { "class_hash": { "cairo_type": "felt", "offset": 0 }, "compiled_class_hash": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "__main__.InputConfig": { "full_name": "__main__.InputConfig", "members": { "block_hash": { "cairo_type": "felt", "offset": 2 }, "block_number": { "cairo_type": "felt", "offset": 1 }, "config_hash": { "cairo_type": "felt", "offset": 3 }, "prev_state_root": { "cairo_type": "felt", "offset": 0 } }, "size": 4, "type": "struct" }, "__main__.NonceUpdate": { "full_name": "__main__.NonceUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "nonce": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.StorageUpdate": { "full_name": "__main__.StorageUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "storage_key": { "cairo_type": "felt", "offset": 1 }, "storage_value": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.__end__": { "pc": 4, "type": "label" }, "__main__.__start__": { "pc": 0, "type": "label" }, "__main__.get_contract_updates": { "decorators": [], "pc": 121, "type": "function" }, "__main__.get_contract_updates.Args": { "full_name": "__main__.get_contract_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.ImplicitArgs": { "full_name": "__main__.get_contract_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.Return": { "cairo_type": "(contract_updates: __main__.ContractUpdate**, contract_updates_len: felt)", "type": "type_definition" }, "__main__.get_contract_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_contract_updates.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.get_contract_updates.contract_updates", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.get_contract_updates.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_contract_updates.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_declared_classes": { "decorators": [], "pc": 155, "type": "function" }, "__main__.get_declared_classes.Args": { "full_name": "__main__.get_declared_classes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.ImplicitArgs": { "full_name": "__main__.get_declared_classes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.Return": { "cairo_type": "(declared_classes: __main__.DeclaredClass**, declared_classes_len: felt)", "type": "type_definition" }, "__main__.get_declared_classes.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_declared_classes.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.get_declared_classes.declared_classes", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.get_declared_classes.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.get_declared_classes.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_hashes": { "decorators": [], "pc": 12, "type": "function" }, "__main__.get_hashes.Args": { "full_name": "__main__.get_hashes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.ImplicitArgs": { "full_name": "__main__.get_hashes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.Return": { "cairo_type": "(input_config: __main__.InputConfig)", "type": "type_definition" }, "__main__.get_hashes.SIZEOF_LOCALS": { "type": "const", "value": 8 }, "__main__.get_hashes.block_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.block_number": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_number", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.config_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.config_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.get_hashes.input_config", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.get_hashes.prev_state_root": { "cairo_type": "felt", "full_name": "__main__.get_hashes.prev_state_root", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" } ], "type": "reference" }, "__main__.get_messages": { "decorators": [], "pc": 43, "type": "function" }, "__main__.get_messages.Args": { "full_name": "__main__.get_messages.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.ImplicitArgs": { "full_name": "__main__.get_messages.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.Return": { "cairo_type": "(message_to_starknet_segment: felt*, message_to_starknet_segment_len: felt, message_to_appchain_segment: felt*, message_to_appchain_segment_len: felt)", "type": "type_definition" }, "__main__.get_messages.SIZEOF_LOCALS": { "type": "const", "value": 4 }, "__main__.get_messages.message_to_appchain_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_appchain_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_appchain_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_appchain_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_starknet_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_starknet_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_nonce_updates": { "decorators": [], "pc": 50, "type": "function" }, "__main__.get_nonce_updates.Args": { "full_name": "__main__.get_nonce_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.ImplicitArgs": { "full_name": "__main__.get_nonce_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.Return": { "cairo_type": "(nonce_updates: __main__.NonceUpdate**, nonce_updates_len: felt)", "type": "type_definition" }, "__main__.get_nonce_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_nonce_updates.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.get_nonce_updates.nonce_updates", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.get_nonce_updates.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_nonce_updates.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_storage_updates": { "decorators": [], "pc": 84, "type": "function" }, "__main__.get_storage_updates.Args": { "full_name": "__main__.get_storage_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.ImplicitArgs": { "full_name": "__main__.get_storage_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.Return": { "cairo_type": "(storage_updates: __main__.StorageUpdate**, storage_updates_len: felt)", "type": "type_definition" }, "__main__.get_storage_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_storage_updates.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.get_storage_updates.storage_updates", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.get_storage_updates.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_storage_updates.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_world_da": { "decorators": [], "pc": 19, "type": "function" }, "__main__.get_world_da.Args": { "full_name": "__main__.get_world_da.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.ImplicitArgs": { "full_name": "__main__.get_world_da.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.Return": { "cairo_type": "(world_da: felt*, world_da_len: felt)", "type": "type_definition" }, "__main__.get_world_da.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_world_da.world_da": { "cairo_type": "felt*", "full_name": "__main__.get_world_da.world_da", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_world_da.world_da_len": { "cairo_type": "felt", "full_name": "__main__.get_world_da.world_da_len", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.hash2": { "destination": "starkware.cairo.common.hash.hash2", "type": "alias" }, "__main__.hash_contract_update": { "decorators": [], "pc": 126, "type": "function" }, "__main__.hash_contract_update.Args": { "full_name": "__main__.hash_contract_update.Args", "members": { "contract_update": { "cairo_type": "__main__.ContractUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.ImplicitArgs": { "full_name": "__main__.hash_contract_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_update.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_update.contract_update", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_update.res", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop": { "decorators": [], "pc": 132, "type": "function" }, "__main__.hash_contract_updates_loop.Args": { "full_name": "__main__.hash_contract_updates_loop.Args", "members": { "contract_updates": { "cairo_type": "__main__.ContractUpdate**", "offset": 1 }, "contract_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_contract_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_contract_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_updates_loop.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_updates_loop.contract_update", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.hash_contract_updates_loop.contract_updates", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_class": { "decorators": [], "pc": 160, "type": "function" }, "__main__.hash_declared_class.Args": { "full_name": "__main__.hash_declared_class.Args", "members": { "declared_class": { "cairo_type": "__main__.DeclaredClass*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.ImplicitArgs": { "full_name": "__main__.hash_declared_class.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_class.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_class.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_class.declared_class", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_class.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_class.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_class.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_class.res", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop": { "decorators": [], "pc": 166, "type": "function" }, "__main__.hash_declared_classes_loop.Args": { "full_name": "__main__.hash_declared_classes_loop.Args", "members": { "declared_classes": { "cairo_type": "__main__.DeclaredClass**", "offset": 1 }, "declared_classes_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_declared_classes_loop.ImplicitArgs": { "full_name": "__main__.hash_declared_classes_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_classes_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_classes_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_classes_loop.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_classes_loop.declared_class", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.hash_declared_classes_loop.declared_classes", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.hash", "references": [ { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_classes_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.res", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_update": { "decorators": [], "pc": 55, "type": "function" }, "__main__.hash_nonce_update.Args": { "full_name": "__main__.hash_nonce_update.Args", "members": { "nonce_update": { "cairo_type": "__main__.NonceUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.ImplicitArgs": { "full_name": "__main__.hash_nonce_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_update.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_update.nonce_update", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_update.res", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop": { "decorators": [], "pc": 61, "type": "function" }, "__main__.hash_nonce_updates_loop.Args": { "full_name": "__main__.hash_nonce_updates_loop.Args", "members": { "nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "offset": 1 }, "nonce_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_nonce_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_nonce_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_updates_loop.nonce_update", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update": { "decorators": [], "pc": 89, "type": "function" }, "__main__.hash_storage_update.Args": { "full_name": "__main__.hash_storage_update.Args", "members": { "storage_update": { "cairo_type": "__main__.StorageUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.ImplicitArgs": { "full_name": "__main__.hash_storage_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_update.res", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_update.storage_update", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop": { "decorators": [], "pc": 98, "type": "function" }, "__main__.hash_storage_updates_loop.Args": { "full_name": "__main__.hash_storage_updates_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "storage_updates": { "cairo_type": "__main__.StorageUpdate**", "offset": 1 }, "storage_updates_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_storage_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_storage_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_updates_loop.storage_update", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.hash_storage_updates_loop.storage_updates", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop": { "decorators": [], "pc": 24, "type": "function" }, "__main__.hash_world_da_loop.Args": { "full_name": "__main__.hash_world_da_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "world_da": { "cairo_type": "felt*", "offset": 1 }, "world_da_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_world_da_loop.ImplicitArgs": { "full_name": "__main__.hash_world_da_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_world_da_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_world_da_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_world_da_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_world_da_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.res", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.value": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.value", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da": { "cairo_type": "felt*", "full_name": "__main__.hash_world_da_loop.world_da", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da_len": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.world_da_len", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.main": { "decorators": [], "pc": 206, "type": "function" }, "__main__.main.Args": { "full_name": "__main__.main.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.main.ImplicitArgs": { "full_name": "__main__.main.ImplicitArgs", "members": { "bitwise_ptr": { "cairo_type": "felt*", "offset": 3 }, "output_ptr": { "cairo_type": "felt*", "offset": 0 }, "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 1 }, "range_check_ptr": { "cairo_type": "felt", "offset": 2 } }, "size": 4, "type": "struct" }, "__main__.main.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.main.SIZEOF_LOCALS": { "type": "const", "value": 13 }, "__main__.main.bitwise_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.bitwise_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-3), felt**)]" } ], "type": "reference" }, "__main__.main.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.main.contract_updates", "references": [ { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 223, "value": "[cast(fp + 6, __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.main.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.main.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 224, "value": "[cast(fp + 7, felt*)]" } ], "type": "reference" }, "__main__.main.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.main.declared_classes", "references": [ { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 227, "value": "[cast(fp + 8, __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.main.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.main.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 228, "value": "[cast(fp + 9, felt*)]" } ], "type": "reference" }, "__main__.main.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.main.input_config", "references": [ { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 210, "value": "[cast(ap + (-4), __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 214, "value": "[cast(fp, __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.main.message_to_appchain_segment": { "cairo_type": "felt*", "full_name": "__main__.main.message_to_appchain_segment", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-2), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 275, "value": "[cast(fp + 12, felt**)]" } ], "type": "reference" }, "__main__.main.message_to_appchain_segment_len": { "cairo_type": "felt", "full_name": "__main__.main.message_to_appchain_segment_len", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 274, "value": "[cast(fp + 11, felt*)]" } ], "type": "reference" }, "__main__.main.message_to_starknet_segment": { "cairo_type": "felt*", "full_name": "__main__.main.message_to_starknet_segment", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-4), felt**)]" } ], "type": "reference" }, "__main__.main.message_to_starknet_segment_len": { "cairo_type": "felt", "full_name": "__main__.main.message_to_starknet_segment_len", "references": [ { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-3), felt*)]" } ], "type": "reference" }, "__main__.main.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.main.nonce_updates", "references": [ { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.main.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.main.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.output_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 260, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 263, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 270, "value": "cast([ap + (-1)] + 1, felt*)" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 276, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 271, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 276, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 282, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 283, "value": "cast([ap + (-1)] + 1, felt*)" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 289, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.main.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.main.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 223, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 50 }, "pc": 226, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 55 }, "pc": 229, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 233, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 237, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 241, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 245, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 259, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 270, "value": "[cast(fp + 10, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.main.range_check_ptr": { "cairo_type": "felt", "full_name": "__main__.main.range_check_ptr", "references": [ { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "__main__.main.res": { "cairo_type": "felt", "full_name": "__main__.main.res", "references": [ { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.main.storage_updates", "references": [ { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 219, "value": "[cast(fp + 4, __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.main.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.main.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 220, "value": "[cast(fp + 5, felt*)]" } ], "type": "reference" }, "__main__.main.world_da": { "cairo_type": "felt*", "full_name": "__main__.main.world_da", "references": [ { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-2), felt**)]" } ], "type": "reference" }, "__main__.main.world_da_hash": { "cairo_type": "felt", "full_name": "__main__.main.world_da_hash", "references": [ { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.world_da_len": { "cairo_type": "felt", "full_name": "__main__.main.world_da_len", "references": [ { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array": { "decorators": [], "pc": 189, "type": "function" }, "__main__.output_array.Args": { "full_name": "__main__.output_array.Args", "members": { "array": { "cairo_type": "felt*", "offset": 0 }, "len": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.output_array.ImplicitArgs": { "full_name": "__main__.output_array.ImplicitArgs", "members": { "output_ptr": { "cairo_type": "felt*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.output_array.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.output_array.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.output_array.__temp0": { "cairo_type": "felt", "full_name": "__main__.output_array.__temp0", "references": [ { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array.array": { "cairo_type": "felt*", "full_name": "__main__.output_array.array", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.output_array.len": { "cairo_type": "felt", "full_name": "__main__.output_array.len", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.output_array.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.output_array.output_ptr", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 197, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 25, "offset": 0 }, "pc": 205, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.output_array.value": { "cairo_type": "felt", "full_name": "__main__.output_array.value", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 195, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "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.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.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.hash.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "starkware.cairo.common.hash.hash2": { "decorators": [], "pc": 6, "type": "function" }, "starkware.cairo.common.hash.hash2.Args": { "full_name": "starkware.cairo.common.hash.hash2.Args", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.hash.hash2.ImplicitArgs": { "full_name": "starkware.cairo.common.hash.hash2.ImplicitArgs", "members": { "hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "starkware.cairo.common.hash.hash2.Return": { "cairo_type": "(result: felt)", "type": "type_definition" }, "starkware.cairo.common.hash.hash2.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "starkware.cairo.common.hash.hash2.hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "starkware.cairo.common.hash.hash2.hash_ptr", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.result": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.result", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.x": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.x", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.y": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.y", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "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.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" } }, "main_scope": "__main__", "prime": "0x800000000000011000000000000000000000000000000000000000000000001", "reference_manager": { "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 195, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 197, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 25, "offset": 0 }, "pc": 205, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 0 }, "pc": 206, "value": "[cast(fp + (-3), felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 210, "value": "[cast(ap + (-4), __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 26, "offset": 27 }, "pc": 214, "value": "[cast(fp, __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 33 }, "pc": 216, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 218, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 219, "value": "[cast(fp + 4, __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 39 }, "pc": 220, "value": "[cast(fp + 5, felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 222, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 223, "value": "[cast(fp + 6, __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 26, "offset": 45 }, "pc": 224, "value": "[cast(fp + 7, felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 226, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 227, "value": "[cast(fp + 8, __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 26, "offset": 51 }, "pc": 228, "value": "[cast(fp + 9, felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 58 }, "pc": 233, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 63 }, "pc": 236, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 26, "offset": 68 }, "pc": 239, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 29, "offset": 0 }, "pc": 251, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 255, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-2), felt**)]" }, { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 6 }, "pc": 262, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 269, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 270, "value": "[cast(fp + 10, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 271, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-4), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-3), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-2), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 273, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 274, "value": "[cast(fp + 11, felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 275, "value": "[cast(fp + 12, felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 10 }, "pc": 276, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 282, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 283, "value": "cast([ap + (-1)] + 1, felt*)" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 289, "value": "[cast(ap + (-1), felt**)]" } ] }} \ No newline at end of file diff --git a/bin/saya/programs/cairo0merger.json b/bin/saya/programs/cairo0merger.json new file mode 100644 index 0000000000..210139f64c --- /dev/null +++ b/bin/saya/programs/cairo0merger.json @@ -0,0 +1 @@ +{ "attributes": [], "builtins": ["output", "pedersen", "range_check", "bitwise"], "compiler_version": "0.13.1", "data": [ "0x40780017fff7fff", "0x4", "0x1104800180018000", "0x10e", "0x10780017fff7fff", "0x0", "0x400380007ffb7ffc", "0x400380017ffb7ffd", "0x482680017ffb8000", "0x3", "0x480280027ffb8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x8", "0x480a80047fff8000", "0x480a80057fff8000", "0x480a80067fff8000", "0x480a80077fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe5", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff1", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x4", "0x480a80007fff8000", "0x480a80017fff8000", "0x480a80027fff8000", "0x480a80037fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffcd", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffbc", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffab", "0x480280027ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa8", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffef", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff97", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff86", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff75", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x480a7ffc7fff8000", "0x480280007ffd8000", "0x480280017ffd8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff64", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x5", "0x480a7ffa7fff8000", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480a7ffa7fff8000", "0x480280007ffc8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff2", "0x48127ffe7fff8000", "0x480a7ffb7fff8000", "0x48127ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff53", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffed", "0x208b7fff7fff7ffe", "0x20780017fff7ffb", "0xb", "0x482a7ffb7ffa8000", "0x400180007fff7ffc", "0x482680017ffb8000", "0x1", "0x48327fff7ffa8000", "0x400180007fff7ffd", "0x480680017fff8000", "0x0", "0x208b7fff7fff7ffe", "0x480280007ffa8000", "0x48287ffc80007fff", "0x20680017fff7fff", "0x6", "0x400380017ffa7ffd", "0x480680017fff8000", "0x1", "0x208b7fff7fff7ffe", "0x482680017ffa8000", "0x2", "0x482680017ffb8000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffff", "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffe8", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x2", "0x480a80007fff8000", "0x480a80017fff8000", "0x208b7fff7fff7ffe", "0x20780017fff7ffd", "0x4", "0x480a7ffb7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x0", "0x480280007ffc8000", "0x400280007ffb7fff", "0x482680017ffb8000", "0x1", "0x482680017ffc8000", "0x1", "0x482680017ffd8000", "0x800000000000011000000000000000000000000000000000000000000000000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffff3", "0x208b7fff7fff7ffe", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff1e", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff42", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff62", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff85", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffa5", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff33", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff19", "0x48127fd47fff8000", "0x48127fd47fff8000", "0x48127fd47fff8000", "0x48127fd47fff8000", "0x48127fd97fff8000", "0x48127fd77fff8000", "0x48127fdd7fff8000", "0x48127fdb7fff8000", "0x48127fe17fff8000", "0x48127fdf7fff8000", "0x48127fe57fff8000", "0x48127fe37fff8000", "0x48127fea7fff8000", "0x48127fea7fff8000", "0x48127fea7fff8000", "0x48127fea7fff8000", "0x48127fee7fff8000", "0x48127fee7fff8000", "0x208b7fff7fff7ffe", "0x40780017fff7fff", "0x25", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffde", "0x40137fee7fff8000", "0x40137fef7fff8001", "0x40137ff07fff8002", "0x40137ff17fff8003", "0x40137ff27fff8004", "0x40137ff37fff8005", "0x40137ff47fff8006", "0x40137ff57fff8007", "0x40137ff67fff8008", "0x40137ff77fff8009", "0x40137ff87fff800a", "0x40137ff97fff800b", "0x40137ffa7fff800c", "0x40137ffb7fff800d", "0x40137ffc7fff800e", "0x40137ffd7fff800f", "0x40137ffe7fff8010", "0x40137fff7fff8011", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffffca", "0x40137fee7fff8012", "0x40137fef7fff8013", "0x40137ff07fff8014", "0x40137ff17fff8015", "0x40137ff27fff8016", "0x40137ff37fff8017", "0x40137ff47fff8018", "0x40137ff57fff8019", "0x40137ff67fff801a", "0x40137ff77fff801b", "0x40137ff87fff801c", "0x40137ff97fff801d", "0x40137ffa7fff801e", "0x40137ffb7fff801f", "0x40137ffc7fff8020", "0x40137ffd7fff8021", "0x40137ffe7fff8022", "0x40137fff7fff8023", "0x400380007ffa8000", "0x480680017fff8000", "0x0", "0x400280017ffa7fff", "0x400380027ffa8013", "0x400380037ffa8014", "0x400380047ffa8003", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff99", "0x480a7ffb7fff8000", "0x480680017fff8000", "0x0", "0x48127ffc7fff8000", "0x48127ffc7fff8000", "0x1104800180018000", "0x800000000000010fffffffffffffffffffffffffffffffffffffffffffffed1", "0x40137ffe7fff8024", "0x400280057ffa7fff", "0x482a801f800d8000", "0x400280067ffa7fff", "0x482680017ffa8000", "0x7", "0x480a800c7fff8000", "0x480a800d7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff8d", "0x480a801e7fff8000", "0x480a801f7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff89", "0x482a8021800f8000", "0x400080007ffe7fff", "0x482480017ffe8000", "0x1", "0x480a800e7fff8000", "0x480a800f7fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff81", "0x480a80207fff8000", "0x480a80217fff8000", "0x1104800180018000", "0x800000000000010ffffffffffffffffffffffffffffffffffffffffffffff7d", "0x480a80247fff8000", "0x480a7ffc7fff8000", "0x480a7ffd7fff8000", "0x208b7fff7fff7ffe" ], "debug_info": { "file_contents": { "": "__start__:\nap += main.Args.SIZE + main.ImplicitArgs.SIZE;\ncall main;\n\n__end__:\njmp rel 0;\n" }, "instruction_locations": { "0": { "accessible_scopes": ["__main__"], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 46, "end_line": 2, "input_file": { "filename": "" }, "start_col": 1, "start_line": 2 } }, "2": { "accessible_scopes": ["__main__"], "flow_tracking_data": { "ap_tracking": { "group": 0, "offset": 4 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 3, "input_file": { "filename": "" }, "start_col": 1, "start_line": 3 } }, "4": { "accessible_scopes": ["__main__"], "flow_tracking_data": { "ap_tracking": { "group": 1, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 10, "end_line": 6, "input_file": { "filename": "" }, "start_col": 1, "start_line": 6 } }, "6": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 14, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 14 } }, "7": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 2, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 19, "end_line": 15, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 15 } }, "8": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 0 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 47, "end_line": 17, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 13, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 }, "While trying to retrieve the implicit argument 'hash_ptr' in:" ], "start_col": 12, "start_line": 13 }, "While expanding the reference 'hash_ptr' in:" ], "start_col": 20, "start_line": 17 } }, "10": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 1 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 33, "end_line": 16, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 20, "start_line": 18 }, "While expanding the reference 'result' in:" ], "start_col": 18, "start_line": 16 } }, "11": { "accessible_scopes": [ "starkware.cairo.common.hash", "starkware.cairo.common.hash.hash2" ], "flow_tracking_data": { "ap_tracking": { "group": 2, "offset": 2 }, "reference_ids": { "starkware.cairo.common.hash.hash2.hash_ptr": 4, "starkware.cairo.common.hash.hash2.result": 3, "starkware.cairo.common.hash.hash2.x": 0, "starkware.cairo.common.hash.hash2.y": 1 } }, "hints": [], "inst": { "end_col": 28, "end_line": 18, "input_file": { "filename": "/home/mateo/code/dojo-os/.venv/lib/python3.9/site-packages/starkware/cairo/common/hash.cairo" }, "start_col": 5, "start_line": 18 } }, "12": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 15, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 15 } }, "14": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [ { "location": { "end_col": 7, "end_line": 26, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 21 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 17, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 29, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 29 }, "While expanding the reference 'prev_state_root' in:" ], "start_col": 11, "start_line": 17 } }, "15": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 9 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 23, "end_line": 18, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 30, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 30 }, "While expanding the reference 'block_number' in:" ], "start_col": 11, "start_line": 18 } }, "16": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 10 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 21, "end_line": 19, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 34, "end_line": 31, "input_file": { "filename": "src/merger.cairo" }, "start_col": 24, "start_line": 31 }, "While expanding the reference 'block_hash' in:" ], "start_col": 11, "start_line": 19 } }, "17": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 11 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 22, "end_line": 20, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 32, "input_file": { "filename": "src/merger.cairo" }, "start_col": 25, "start_line": 32 }, "While expanding the reference 'config_hash' in:" ], "start_col": 11, "start_line": 20 } }, "18": { "accessible_scopes": ["__main__", "__main__.get_hashes"], "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 12 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } }, "hints": [], "inst": { "end_col": 7, "end_line": 34, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 27 } }, "19": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 43, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 43 } }, "21": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [ { "location": { "end_col": 7, "end_line": 50, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 46 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 19, "end_line": 44, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 54, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 54 }, "While expanding the reference 'world_da' in:" ], "start_col": 11, "start_line": 44 } }, "22": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 3 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 23, "end_line": 45, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 55, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 55 }, "While expanding the reference 'world_da_len' in:" ], "start_col": 11, "start_line": 45 } }, "23": { "accessible_scopes": ["__main__", "__main__.get_world_da"], "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 4 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } }, "hints": [], "inst": { "end_col": 7, "end_line": 57, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 53 } }, "24": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 63, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 63 } }, "26": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 60, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 51, "end_line": 60, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 64, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 64 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 60 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 60 } }, "27": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 61, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 64, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 64 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 61 } }, "28": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 26, "end_line": 64, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 64 } }, "29": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 18, "end_line": 66, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 66 } }, "31": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 51, "end_line": 60, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 68, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 68 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 25, "start_line": 60 } }, "32": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 1 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 14, "end_line": 61, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 69, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 69 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 61 } }, "33": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 2 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 27, "end_line": 67, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 69, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 69 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 67 } }, "34": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 3 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 15, "__main__.hash_world_da_loop.res": 12, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 70, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 68 } }, "36": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 7 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 30, "end_line": 73, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 73 } }, "38": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 8 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 38, "end_line": 74, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 74 } }, "40": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 5, "offset": 9 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 17, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 6, "end_line": 75, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 71 } }, "42": { "accessible_scopes": ["__main__", "__main__.hash_world_da_loop"], "flow_tracking_data": { "ap_tracking": { "group": 6, "offset": 0 }, "reference_ids": { "__main__.hash_world_da_loop.pedersen_ptr": 19, "__main__.hash_world_da_loop.res": 18, "__main__.hash_world_da_loop.value": 16, "__main__.hash_world_da_loop.world_da": 13, "__main__.hash_world_da_loop.world_da_len": 14 } }, "hints": [], "inst": { "end_col": 7, "end_line": 75, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 71 } }, "43": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 86, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 86 } }, "45": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [ { "location": { "end_col": 7, "end_line": 105, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 91 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 38, "end_line": 87, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 107, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 107 }, "While expanding the reference 'message_to_starknet_segment' in:" ], "start_col": 11, "start_line": 87 } }, "46": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 5 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 88, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 76, "end_line": 108, "input_file": { "filename": "src/merger.cairo" }, "start_col": 45, "start_line": 108 }, "While expanding the reference 'message_to_starknet_segment_len' in:" ], "start_col": 11, "start_line": 88 } }, "47": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 6 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 38, "end_line": 89, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 68, "end_line": 109, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 109 }, "While expanding the reference 'message_to_appchain_segment' in:" ], "start_col": 11, "start_line": 89 } }, "48": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 7 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 42, "end_line": 90, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 76, "end_line": 110, "input_file": { "filename": "src/merger.cairo" }, "start_col": 45, "start_line": 110 }, "While expanding the reference 'message_to_appchain_segment_len' in:" ], "start_col": 11, "start_line": 90 } }, "49": { "accessible_scopes": ["__main__", "__main__.get_messages"], "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 8 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } }, "hints": [], "inst": { "end_col": 7, "end_line": 112, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 106 } }, "50": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 121, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 121 } }, "52": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [ { "location": { "end_col": 7, "end_line": 136, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 124 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 24, "end_line": 122, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 40, "end_line": 137, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 137 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 11, "start_line": 122 } }, "53": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 3 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 28, "end_line": 123, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 77, "end_line": 137, "input_file": { "filename": "src/merger.cairo" }, "start_col": 60, "start_line": 137 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 11, "start_line": 123 } }, "54": { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 4 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } }, "hints": [], "inst": { "end_col": 79, "end_line": 137, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 137 } }, "55": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 50, "end_line": 140, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 144, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 144 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 24, "start_line": 140 } }, "56": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 44, "end_line": 143, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 145, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 145 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 143 } }, "57": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 32, "end_line": 145, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 145 } }, "58": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 3 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 27, "__main__.hash_nonce_update.res": 28 } }, "hints": [], "inst": { "end_col": 6, "end_line": 146, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 144 } }, "60": { "accessible_scopes": ["__main__", "__main__.hash_nonce_update"], "flow_tracking_data": { "ap_tracking": { "group": 9, "offset": 7 }, "reference_ids": { "__main__.hash_nonce_update.nonce_update": 26, "__main__.hash_nonce_update.pedersen_ptr": 29, "__main__.hash_nonce_update.res": 30 } }, "hints": [], "inst": { "end_col": 22, "end_line": 147, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 147 } }, "61": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 7, "end_line": 153, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 153 } }, "63": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 150, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 150, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 154, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 154 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 150 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 150 } }, "64": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 151, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 154, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 154 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 151 } }, "65": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 26, "end_line": 154, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 154 } }, "66": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 18, "end_line": 156, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 156 } }, "68": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 56, "end_line": 150, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 61, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "start_col": 49, "start_line": 158 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 150 } }, "69": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 1 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 39, "end_line": 157, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 75, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "start_col": 63, "start_line": 158 }, "While expanding the reference 'nonce_update' in:" ], "start_col": 24, "start_line": 157 } }, "70": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 2 }, "reference_ids": { "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 34, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 76, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 158 } }, "72": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 11 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 61, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 159, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 159 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 49, "start_line": 158 } }, "73": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 12 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 151, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 160, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 160 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 151 } }, "74": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 13 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 14, "end_line": 158, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 160, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 160 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 158 } }, "75": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 14 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 36, "__main__.hash_nonce_updates_loop.res": 31 } }, "hints": [], "inst": { "end_col": 6, "end_line": 161, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 159 } }, "77": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 18 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 40, "end_line": 164, "input_file": { "filename": "src/merger.cairo" }, "start_col": 23, "start_line": 164 } }, "79": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 19 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 48, "end_line": 165, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 165 } }, "81": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 10, "offset": 20 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 38, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 6, "end_line": 166, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 162 } }, "83": { "accessible_scopes": ["__main__", "__main__.hash_nonce_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 11, "offset": 0 }, "reference_ids": { "__main__.hash_nonce_updates_loop.hash": 37, "__main__.hash_nonce_updates_loop.nonce_update": 35, "__main__.hash_nonce_updates_loop.nonce_updates": 32, "__main__.hash_nonce_updates_loop.nonce_updates_len": 33, "__main__.hash_nonce_updates_loop.pedersen_ptr": 40, "__main__.hash_nonce_updates_loop.res": 39 } }, "hints": [], "inst": { "end_col": 7, "end_line": 166, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 162 } }, "84": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 176, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 176 } }, "86": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [ { "location": { "end_col": 7, "end_line": 196, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 179 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 26, "end_line": 177, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 197, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 197 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 11, "start_line": 177 } }, "87": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 3 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 30, "end_line": 178, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 85, "end_line": 197, "input_file": { "filename": "src/merger.cairo" }, "start_col": 66, "start_line": 197 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 11, "start_line": 178 } }, "88": { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 4 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } }, "hints": [], "inst": { "end_col": 87, "end_line": 197, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 197 } }, "89": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 0 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 52, "end_line": 200, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 204, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 204 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 200 } }, "90": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 1 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 46, "end_line": 203, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 205, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 205 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 203 } }, "91": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 2 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 40, "end_line": 205, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 205 } }, "92": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 3 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 44, "__main__.hash_storage_update.res": 45, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 206, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 204 } }, "94": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 7 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 42, "end_line": 208, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 208 } }, "95": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 8 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 46, "__main__.hash_storage_update.res": 47, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 6, "end_line": 209, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 207 } }, "97": { "accessible_scopes": ["__main__", "__main__.hash_storage_update"], "flow_tracking_data": { "ap_tracking": { "group": 13, "offset": 12 }, "reference_ids": { "__main__.hash_storage_update.pedersen_ptr": 48, "__main__.hash_storage_update.res": 49, "__main__.hash_storage_update.storage_update": 43 } }, "hints": [], "inst": { "end_col": 22, "end_line": 210, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 210 } }, "98": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 216, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 216 } }, "100": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 213, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 58, "end_line": 213, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 217, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 217 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 213 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 213 } }, "101": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 214, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 217, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 217 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 214 } }, "102": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 26, "end_line": 217, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 217 } }, "103": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 18, "end_line": 219, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 219 } }, "105": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 58, "end_line": 213, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "start_col": 51, "start_line": 221 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 32, "start_line": 213 } }, "106": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 1 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 43, "end_line": 220, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "start_col": 65, "start_line": 221 }, "While expanding the reference 'storage_update' in:" ], "start_col": 26, "start_line": 220 } }, "107": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 2 }, "reference_ids": { "__main__.hash_storage_updates_loop.pedersen_ptr": 53, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 80, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 221 } }, "109": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 16 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 63, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 222, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 222 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 221 } }, "110": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 17 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 214, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 223, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 223 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 214 } }, "111": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 18 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 14, "end_line": 221, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 223, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 223 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 221 } }, "112": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 19 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 55, "__main__.hash_storage_updates_loop.res": 50, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 224, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 222 } }, "114": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 23 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 44, "end_line": 227, "input_file": { "filename": "src/merger.cairo" }, "start_col": 25, "start_line": 227 } }, "116": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 24 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 52, "end_line": 228, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 228 } }, "118": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 14, "offset": 25 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 57, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 6, "end_line": 229, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 225 } }, "120": { "accessible_scopes": ["__main__", "__main__.hash_storage_updates_loop"], "flow_tracking_data": { "ap_tracking": { "group": 15, "offset": 0 }, "reference_ids": { "__main__.hash_storage_updates_loop.hash": 56, "__main__.hash_storage_updates_loop.pedersen_ptr": 59, "__main__.hash_storage_updates_loop.res": 58, "__main__.hash_storage_updates_loop.storage_update": 54, "__main__.hash_storage_updates_loop.storage_updates": 51, "__main__.hash_storage_updates_loop.storage_updates_len": 52 } }, "hints": [], "inst": { "end_col": 7, "end_line": 229, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 225 } }, "121": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 239, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 239 } }, "123": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [ { "location": { "end_col": 7, "end_line": 254, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 242 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 240, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 255, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 255 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 11, "start_line": 240 } }, "124": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 3 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 31, "end_line": 241, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 255, "input_file": { "filename": "src/merger.cairo" }, "start_col": 69, "start_line": 255 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 11, "start_line": 241 } }, "125": { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 4 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } }, "hints": [], "inst": { "end_col": 91, "end_line": 255, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 255 } }, "126": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 0 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 53, "end_line": 258, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 262, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 262 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 27, "start_line": 258 } }, "127": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 1 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 47, "end_line": 261, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 263, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 263 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 261 } }, "128": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 2 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 40, "end_line": 263, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 263 } }, "129": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 3 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 63, "__main__.hash_contract_update.res": 64 } }, "hints": [], "inst": { "end_col": 6, "end_line": 264, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 262 } }, "131": { "accessible_scopes": ["__main__", "__main__.hash_contract_update"], "flow_tracking_data": { "ap_tracking": { "group": 17, "offset": 7 }, "reference_ids": { "__main__.hash_contract_update.contract_update": 62, "__main__.hash_contract_update.pedersen_ptr": 65, "__main__.hash_contract_update.res": 66 } }, "hints": [], "inst": { "end_col": 22, "end_line": 265, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 265 } }, "132": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 7, "end_line": 271, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 271 } }, "134": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 268, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 268, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 272, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 272 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 268 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 268 } }, "135": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 269, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 272, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 272 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 269 } }, "136": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 26, "end_line": 272, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 272 } }, "137": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 18, "end_line": 274, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 274 } }, "139": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 59, "end_line": 268, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 64, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "start_col": 52, "start_line": 276 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 268 } }, "140": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 1 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 45, "end_line": 275, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 81, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "start_col": 66, "start_line": 276 }, "While expanding the reference 'contract_update' in:" ], "start_col": 27, "start_line": 275 } }, "141": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 2 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.pedersen_ptr": 70, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 82, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 276 } }, "143": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 11 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 64, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 277, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 277 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 52, "start_line": 276 } }, "144": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 12 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 269, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 278, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 278 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 269 } }, "145": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 13 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 14, "end_line": 276, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 278, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 278 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 276 } }, "146": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 14 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 72, "__main__.hash_contract_updates_loop.res": 67 } }, "hints": [], "inst": { "end_col": 6, "end_line": 279, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 277 } }, "148": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 18 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 46, "end_line": 282, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 282 } }, "150": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 19 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 54, "end_line": 283, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 283 } }, "152": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 18, "offset": 20 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 74, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 6, "end_line": 284, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 280 } }, "154": { "accessible_scopes": [ "__main__", "__main__.hash_contract_updates_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 19, "offset": 0 }, "reference_ids": { "__main__.hash_contract_updates_loop.contract_update": 71, "__main__.hash_contract_updates_loop.contract_updates": 68, "__main__.hash_contract_updates_loop.contract_updates_len": 69, "__main__.hash_contract_updates_loop.hash": 73, "__main__.hash_contract_updates_loop.pedersen_ptr": 76, "__main__.hash_contract_updates_loop.res": 75 } }, "hints": [], "inst": { "end_col": 7, "end_line": 284, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 280 } }, "155": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 293, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 293 } }, "157": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [ { "location": { "end_col": 7, "end_line": 308, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 296 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 27, "end_line": 294, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 309, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 309 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 11, "start_line": 294 } }, "158": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 3 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 31, "end_line": 295, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 89, "end_line": 309, "input_file": { "filename": "src/merger.cairo" }, "start_col": 69, "start_line": 309 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 11, "start_line": 295 } }, "159": { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 4 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } }, "hints": [], "inst": { "end_col": 91, "end_line": 309, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 309 } }, "160": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 0 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 52, "end_line": 312, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 316, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 316 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 26, "start_line": 312 } }, "161": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 1 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 40, "end_line": 315, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 317, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 317 }, "While expanding the reference 'res' in:" ], "start_col": 15, "start_line": 315 } }, "162": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 2 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 48, "end_line": 317, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 317 } }, "163": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 3 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 80, "__main__.hash_declared_class.res": 81 } }, "hints": [], "inst": { "end_col": 6, "end_line": 318, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 316 } }, "165": { "accessible_scopes": ["__main__", "__main__.hash_declared_class"], "flow_tracking_data": { "ap_tracking": { "group": 21, "offset": 7 }, "reference_ids": { "__main__.hash_declared_class.declared_class": 79, "__main__.hash_declared_class.pedersen_ptr": 82, "__main__.hash_declared_class.res": 83 } }, "hints": [], "inst": { "end_col": 22, "end_line": 319, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 319 } }, "166": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 7, "end_line": 325, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 325 } }, "168": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 322, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 59, "end_line": 322, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 26, "end_line": 326, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 326 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 322 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 322 } }, "169": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 323, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 24, "end_line": 326, "input_file": { "filename": "src/merger.cairo" }, "start_col": 21, "start_line": 326 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 323 } }, "170": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 26, "end_line": 326, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 326 } }, "171": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 18, "end_line": 328, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 328 } }, "173": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 59, "end_line": 322, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 63, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "start_col": 51, "start_line": 330 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 33, "start_line": 322 } }, "174": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 1 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 44, "end_line": 329, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "start_col": 65, "start_line": 330 }, "While expanding the reference 'declared_class' in:" ], "start_col": 26, "start_line": 329 } }, "175": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 2 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.pedersen_ptr": 87, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 80, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "start_col": 18, "start_line": 330 } }, "177": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 11 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 63, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 331, "input_file": { "filename": "src/merger.cairo" }, "start_col": 32, "start_line": 331 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 51, "start_line": 330 } }, "178": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 12 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 323, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 12, "end_line": 332, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 332 }, "While expanding the reference 'res' in:" ], "start_col": 5, "start_line": 323 } }, "179": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 13 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 14, "end_line": 330, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 18, "end_line": 332, "input_file": { "filename": "src/merger.cairo" }, "start_col": 14, "start_line": 332 }, "While expanding the reference 'hash' in:" ], "start_col": 10, "start_line": 330 } }, "180": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 14 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 89, "__main__.hash_declared_classes_loop.res": 84 } }, "hints": [], "inst": { "end_col": 6, "end_line": 333, "input_file": { "filename": "src/merger.cairo" }, "start_col": 17, "start_line": 331 } }, "182": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 18 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 46, "end_line": 336, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 336 } }, "184": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 19 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 54, "end_line": 337, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 337 } }, "186": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 22, "offset": 20 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 91, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 6, "end_line": 338, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 334 } }, "188": { "accessible_scopes": [ "__main__", "__main__.hash_declared_classes_loop" ], "flow_tracking_data": { "ap_tracking": { "group": 23, "offset": 0 }, "reference_ids": { "__main__.hash_declared_classes_loop.declared_class": 88, "__main__.hash_declared_classes_loop.declared_classes": 85, "__main__.hash_declared_classes_loop.declared_classes_len": 86, "__main__.hash_declared_classes_loop.hash": 90, "__main__.hash_declared_classes_loop.pedersen_ptr": 93, "__main__.hash_declared_classes_loop.res": 92 } }, "hints": [], "inst": { "end_col": 7, "end_line": 338, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 334 } }, "189": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 7, "end_line": 343, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 343 } }, "191": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 26, "end_line": 344, "input_file": { "filename": "src/merger.cairo" }, "start_col": 16, "start_line": 344 } }, "192": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 33, "end_line": 344, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 344 } }, "193": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 27, "end_line": 345, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 345 } }, "195": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 28, "end_line": 345, "input_file": { "filename": "src/merger.cairo" }, "start_col": 16, "start_line": 345 } }, "196": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.__temp2": 100, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 37, "end_line": 345, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 345 } }, "197": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.__temp2": 100, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 27, "end_line": 346, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 346 } }, "199": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 4 }, "reference_ids": { "__main__.replace_or_append.__temp0": 98, "__main__.replace_or_append.__temp1": 99, "__main__.replace_or_append.__temp2": 100, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 29, "end_line": 346, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 346 } }, "200": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 17, "end_line": 349, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 349 } }, "201": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 1 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 24, "end_line": 349, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 349 } }, "202": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 7, "end_line": 349, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 349 } }, "204": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 25, "end_line": 350, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 350 } }, "205": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 27, "end_line": 351, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 351 } }, "207": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 29, "end_line": 351, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 351 } }, "208": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 2 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 39, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 354 } }, "210": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 3 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 48, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 354 } }, "212": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 4 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 58, "end_line": 342, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 53, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 50, "start_line": 354 }, "While expanding the reference 'key' in:" ], "start_col": 49, "start_line": 342 } }, "213": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 5 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 71, "end_line": 342, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 60, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 55, "start_line": 354 }, "While expanding the reference 'value' in:" ], "start_col": 60, "start_line": 342 } }, "214": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 24, "offset": 6 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 61, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 354 } }, "216": { "accessible_scopes": ["__main__", "__main__.replace_or_append"], "flow_tracking_data": { "ap_tracking": { "group": 25, "offset": 0 }, "reference_ids": { "__main__.replace_or_append.__temp3": 101, "__main__.replace_or_append.__temp4": 102, "__main__.replace_or_append.array": 94, "__main__.replace_or_append.key": 96, "__main__.replace_or_append.len": 95, "__main__.replace_or_append.value": 97 } }, "hints": [], "inst": { "end_col": 62, "end_line": 354, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 354 } }, "217": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 18, "end_line": 358, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 358 } }, "219": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 2 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } }, "hints": [ { "location": { "end_col": 7, "end_line": 389, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 361 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 17, "end_line": 359, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 28, "end_line": 392, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 392 }, "While expanding the reference 'merged' in:" ], "start_col": 11, "start_line": 359 } }, "220": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 3 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } }, "hints": [], "inst": { "end_col": 21, "end_line": 360, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 393, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 393 }, "While expanding the reference 'merged_len' in:" ], "start_col": 11, "start_line": 360 } }, "221": { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 4 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } }, "hints": [], "inst": { "end_col": 7, "end_line": 395, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 391 } }, "222": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 7, "end_line": 399, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 399 } }, "224": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 36, "end_line": 398, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 36, "end_line": 398, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 19, "end_line": 400, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 400 }, "While trying to retrieve the implicit argument 'output_ptr' in:" ], "start_col": 19, "start_line": 398 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 19, "start_line": 398 } }, "225": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 19, "end_line": 400, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 400 } }, "226": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107 } }, "hints": [], "inst": { "end_col": 18, "end_line": 402, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 402 } }, "228": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 0 }, "reference_ids": { "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 24, "end_line": 403, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 33, "end_line": 404, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 404 }, "While expanding the reference 'value' in:" ], "start_col": 17, "start_line": 403 } }, "229": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 107, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 34, "end_line": 404, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 404 } }, "230": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 1 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 36, "end_line": 405, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 36, "start_line": 406 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 405 } }, "232": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 2 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 57, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 48, "start_line": 406 } }, "234": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 3 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 66, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 59, "start_line": 406 } }, "236": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 27, "offset": 4 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 110, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 67, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 12, "start_line": 406 } }, "238": { "accessible_scopes": ["__main__", "__main__.output_array"], "flow_tracking_data": { "ap_tracking": { "group": 28, "offset": 0 }, "reference_ids": { "__main__.output_array.__temp5": 109, "__main__.output_array.array": 105, "__main__.output_array.len": 106, "__main__.output_array.output_ptr": 111, "__main__.output_array.value": 108 } }, "hints": [], "inst": { "end_col": 68, "end_line": 406, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 406 } }, "239": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 0 }, "reference_ids": {} }, "hints": [], "inst": { "end_col": 21, "end_line": 426, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 426 } }, "241": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 14 }, "reference_ids": { "__main__.get_input.input_config": 112 } }, "hints": [], "inst": { "end_col": 28, "end_line": 430, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 430 } }, "243": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 20 }, "reference_ids": { "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114 } }, "hints": [], "inst": { "end_col": 30, "end_line": 434, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 434 } }, "245": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 26 }, "reference_ids": { "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 31, "end_line": 438, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 438 } }, "247": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 32 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 31, "end_line": 442, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 442 } }, "249": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 38 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 51, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "start_col": 37, "start_line": 444 } }, "251": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 48 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116 } }, "hints": [], "inst": { "end_col": 50, "end_line": 445, "input_file": { "filename": "src/merger.cairo" }, "start_col": 36, "start_line": 445 } }, "253": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 54 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "254": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 55 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "255": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 56 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "256": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 57 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 425, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 38, "end_line": 448, "input_file": { "filename": "src/merger.cairo" }, "start_col": 26, "start_line": 448 }, "While expanding the reference 'input_config' in:" ], "start_col": 9, "start_line": 425 } }, "257": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 58 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 32, "end_line": 429, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 48, "end_line": 449, "input_file": { "filename": "src/merger.cairo" }, "start_col": 31, "start_line": 449 }, "While expanding the reference 'nonce_updates_len' in:" ], "start_col": 9, "start_line": 429 } }, "258": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 59 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 37, "end_line": 428, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 40, "end_line": 450, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 450 }, "While expanding the reference 'nonce_updates' in:" ], "start_col": 9, "start_line": 428 } }, "259": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 60 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 34, "end_line": 433, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 52, "end_line": 451, "input_file": { "filename": "src/merger.cairo" }, "start_col": 33, "start_line": 451 }, "While expanding the reference 'storage_updates_len' in:" ], "start_col": 9, "start_line": 433 } }, "260": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 61 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 41, "end_line": 432, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 44, "end_line": 452, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 452 }, "While expanding the reference 'storage_updates' in:" ], "start_col": 9, "start_line": 432 } }, "261": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 62 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 35, "end_line": 437, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 54, "end_line": 453, "input_file": { "filename": "src/merger.cairo" }, "start_col": 34, "start_line": 453 }, "While expanding the reference 'contract_updates_len' in:" ], "start_col": 9, "start_line": 437 } }, "262": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 63 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 43, "end_line": 436, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 454, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 454 }, "While expanding the reference 'contract_updates' in:" ], "start_col": 9, "start_line": 436 } }, "263": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 64 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 35, "end_line": 441, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 54, "end_line": 455, "input_file": { "filename": "src/merger.cairo" }, "start_col": 34, "start_line": 455 }, "While expanding the reference 'declared_classes_len' in:" ], "start_col": 9, "start_line": 441 } }, "264": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 65 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 42, "end_line": 440, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 46, "end_line": 456, "input_file": { "filename": "src/merger.cairo" }, "start_col": 30, "start_line": 456 }, "While expanding the reference 'declared_classes' in:" ], "start_col": 9, "start_line": 440 } }, "265": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 66 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "266": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 67 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "267": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 68 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "268": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 69 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 33, "end_line": 444, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 457, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 457 }, "While expanding the reference 'messages' in:" ], "start_col": 10, "start_line": 444 } }, "269": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 70 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 32, "end_line": 445, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 458, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 458 }, "While expanding the reference 'world_da' in:" ], "start_col": 10, "start_line": 445 } }, "270": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 71 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 32, "end_line": 445, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 30, "end_line": 458, "input_file": { "filename": "src/merger.cairo" }, "start_col": 22, "start_line": 458 }, "While expanding the reference 'world_da' in:" ], "start_col": 10, "start_line": 445 } }, "271": { "accessible_scopes": ["__main__", "__main__.get_input"], "flow_tracking_data": { "ap_tracking": { "group": 29, "offset": 72 }, "reference_ids": { "__main__.get_input.contract_updates": 117, "__main__.get_input.contract_updates_len": 118, "__main__.get_input.declared_classes": 119, "__main__.get_input.declared_classes_len": 120, "__main__.get_input.input_config": 112, "__main__.get_input.messages": 121, "__main__.get_input.nonce_updates": 113, "__main__.get_input.nonce_updates_len": 114, "__main__.get_input.storage_updates": 115, "__main__.get_input.storage_updates_len": 116, "__main__.get_input.world_da": 122 } }, "hints": [], "inst": { "end_col": 7, "end_line": 460, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 447 } }, "272": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 0 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 18, "end_line": 464, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 464 } }, "274": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 37 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [ { "location": { "end_col": 7, "end_line": 469, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 467 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 46, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 35, "start_line": 470 } }, "276": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "277": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "278": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "279": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "280": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "281": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "282": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "283": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "284": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "285": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "286": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "287": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "288": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "289": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "290": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "291": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "292": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "293": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 127, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 470, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 470 }, "While auto generating local variable for 'input_1'." ], "start_col": 10, "start_line": 470 } }, "294": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [ { "location": { "end_col": 7, "end_line": 474, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 472 }, "n_prefix_newlines": 1 } ], "inst": { "end_col": 46, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 35, "start_line": 475 } }, "296": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "297": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "298": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "299": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "300": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "301": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "302": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "303": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "304": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "305": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "306": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "307": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "308": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "309": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "310": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "311": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "312": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "313": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 129, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 31, "end_line": 475, "input_file": { "filename": "src/merger.cairo" }, "start_col": 10, "start_line": 475 }, "While auto generating local variable for 'input_2'." ], "start_col": 10, "start_line": 475 } }, "314": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 65, "end_line": 478, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 478 } }, "315": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 185 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 29, "end_line": 479, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 479 } }, "317": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 30, "end_line": 479, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 479 } }, "318": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 62, "end_line": 480, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 480 } }, "319": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 60, "end_line": 481, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 481 } }, "320": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 61, "end_line": 482, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 482 } }, "321": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 186 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } }, "hints": [], "inst": { "end_col": 58, "end_line": 486, "input_file": { "filename": "src/merger.cairo" }, "start_col": 43, "start_line": 486 } }, "323": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 192 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 56, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "start_col": 59, "start_line": 488 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 463 } }, "324": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 193 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 26, "end_line": 487, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 22, "end_line": 489, "input_file": { "filename": "src/merger.cairo" }, "start_col": 9, "start_line": 489 }, "While expanding the reference 'world_da_hash' in:" ], "start_col": 25, "start_line": 487 } }, "326": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 194 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 48, "end_line": 489, "input_file": { "filename": "src/merger.cairo" }, "start_col": 24, "start_line": 489 } }, "327": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 195 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 78, "end_line": 489, "input_file": { "filename": "src/merger.cairo" }, "start_col": 50, "start_line": 489 } }, "328": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 196 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 133 } }, "hints": [], "inst": { "end_col": 6, "end_line": 490, "input_file": { "filename": "src/merger.cairo" }, "start_col": 27, "start_line": 488 } }, "330": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 134, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "start_col": 59, "start_line": 488 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 488 } }, "331": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 42, "end_line": 491, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 491 } }, "332": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 137, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 127, "end_line": 496, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 496 } }, "333": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 137, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 128, "end_line": 496, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 496 } }, "334": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 36, "end_line": 497, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 498 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 497 } }, "336": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 498 } }, "337": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 3 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 498 } }, "338": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 31, "offset": 4 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 139, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 498, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 498 } }, "340": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 140, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 499, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 499 } }, "341": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 140, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 499, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 499 } }, "342": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 32, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 140, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 499, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 499 } }, "344": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 127, "end_line": 501, "input_file": { "filename": "src/merger.cairo" }, "start_col": 28, "start_line": 501 } }, "345": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 141, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 128, "end_line": 501, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 501 } }, "346": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 36, "end_line": 502, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 39, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 29, "start_line": 503 }, "While expanding the reference 'output_ptr' in:" ], "start_col": 22, "start_line": 502 } }, "348": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 503 } }, "349": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 3 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 503 } }, "350": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 33, "offset": 4 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 143, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 503, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 503 } }, "352": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 34, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 144, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 85, "end_line": 504, "input_file": { "filename": "src/merger.cairo" }, "start_col": 41, "start_line": 504 } }, "353": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 34, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 144, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 135, "end_line": 504, "input_file": { "filename": "src/merger.cairo" }, "start_col": 87, "start_line": 504 } }, "354": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 34, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 144, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 136, "end_line": 504, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 504 } }, "356": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 0 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 71, "end_line": 488, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 56, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 }, "While trying to retrieve the implicit argument 'pedersen_ptr' in:" ], "start_col": 30, "start_line": 463 }, "While expanding the reference 'pedersen_ptr' in:" ], "start_col": 59, "start_line": 488 }, "While auto generating local variable for 'pedersen_ptr'." ], "start_col": 59, "start_line": 488 } }, "357": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 1 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 79, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 79, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 }, "While trying to retrieve the implicit argument 'range_check_ptr' in:" ], "start_col": 58, "start_line": 463 }, "While expanding the reference 'range_check_ptr' in:" ], "start_col": 58, "start_line": 463 } }, "358": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 2 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 99, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 99, "end_line": 463, "input_file": { "filename": "src/merger.cairo" }, "parent_location": [ { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 }, "While trying to retrieve the implicit argument 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 463 }, "While expanding the reference 'bitwise_ptr' in:" ], "start_col": 81, "start_line": 463 } }, "359": { "accessible_scopes": ["__main__", "__main__.main"], "flow_tracking_data": { "ap_tracking": { "group": 35, "offset": 3 }, "reference_ids": { "__main__.main.__temp6": 131, "__main__.main.__temp7": 138, "__main__.main.__temp8": 142, "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.input_2": 130, "__main__.main.merged_world_da": 132, "__main__.main.output_ptr": 145, "__main__.main.pedersen_ptr": 136, "__main__.main.range_check_ptr": 125, "__main__.main.world_da_hash": 135 } }, "hints": [], "inst": { "end_col": 15, "end_line": 508, "input_file": { "filename": "src/merger.cairo" }, "start_col": 5, "start_line": 508 } } } }, "hints": { "14": [ { "accessible_scopes": ["__main__", "__main__.get_hashes"], "code": "ids.prev_state_root = int(prepared_program_input[\"prev_state_root\"])\nids.block_number = int(prepared_program_input[\"block_number\"])\nids.block_hash = int(prepared_program_input[\"block_hash\"])\nids.config_hash = int(prepared_program_input[\"config_hash\"])", "flow_tracking_data": { "ap_tracking": { "group": 3, "offset": 8 }, "reference_ids": { "__main__.get_hashes.block_hash": 8, "__main__.get_hashes.block_number": 7, "__main__.get_hashes.config_hash": 9, "__main__.get_hashes.input_config": 5, "__main__.get_hashes.prev_state_root": 6 } } } ], "21": [ { "accessible_scopes": ["__main__", "__main__.get_world_da"], "code": "world_da = [int(wd) for wd in prepared_program_input[\"world_da\"]]\nids.world_da = segments.gen_arg(world_da)\nids.world_da_len = len(world_da)", "flow_tracking_data": { "ap_tracking": { "group": 4, "offset": 2 }, "reference_ids": { "__main__.get_world_da.world_da": 10, "__main__.get_world_da.world_da_len": 11 } } } ], "45": [ { "accessible_scopes": ["__main__", "__main__.get_messages"], "code": "message_to_starknet_segment = \\\n [int(x) for x in prepared_program_input[\"message_to_starknet_segment\"]]\nmessage_to_appchain_segment = \\\n [int(x) for x in prepared_program_input[\"message_to_appchain_segment\"]]\n\nids.message_to_starknet_segment = \\\n segments.gen_arg(message_to_starknet_segment)\nids.message_to_starknet_segment_len = \\\n len(message_to_starknet_segment)\nids.message_to_appchain_segment = \\\n segments.gen_arg(message_to_appchain_segment)\nids.message_to_appchain_segment_len = \\\n len(message_to_appchain_segment)", "flow_tracking_data": { "ap_tracking": { "group": 7, "offset": 4 }, "reference_ids": { "__main__.get_messages.message_to_appchain_segment": 22, "__main__.get_messages.message_to_appchain_segment_len": 23, "__main__.get_messages.message_to_starknet_segment": 20, "__main__.get_messages.message_to_starknet_segment_len": 21 } } } ], "52": [ { "accessible_scopes": ["__main__", "__main__.get_nonce_updates"], "code": "program_input_nonce_updates = prepared_program_input[\"nonce_updates\"]\n\nnonce_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_nonce_updates.items()\n]\nids.nonce_updates = segments.gen_arg(nonce_updates)\nids.nonce_updates_len = len(nonce_updates)", "flow_tracking_data": { "ap_tracking": { "group": 8, "offset": 2 }, "reference_ids": { "__main__.get_nonce_updates.nonce_updates": 24, "__main__.get_nonce_updates.nonce_updates_len": 25 } } } ], "86": [ { "accessible_scopes": ["__main__", "__main__.get_storage_updates"], "code": "program_input_storage_updates = prepared_program_input[\"storage_updates\"]\n\nstorage_updates = [\n (\n int(contract),\n int(key),\n int(value),\n )\n for \n contract, update in \n program_input_storage_updates.items() \n for \n key, value in update.items()\n]\nids.storage_updates = segments.gen_arg(storage_updates)\nids.storage_updates_len = len(storage_updates)", "flow_tracking_data": { "ap_tracking": { "group": 12, "offset": 2 }, "reference_ids": { "__main__.get_storage_updates.storage_updates": 41, "__main__.get_storage_updates.storage_updates_len": 42 } } } ], "123": [ { "accessible_scopes": ["__main__", "__main__.get_contract_updates"], "code": "program_input_contract_updates = prepared_program_input[\"contract_updates\"]\n\ncontract_updates = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_contract_updates.items()\n]\nids.contract_updates = segments.gen_arg(contract_updates)\nids.contract_updates_len = len(contract_updates)", "flow_tracking_data": { "ap_tracking": { "group": 16, "offset": 2 }, "reference_ids": { "__main__.get_contract_updates.contract_updates": 60, "__main__.get_contract_updates.contract_updates_len": 61 } } } ], "157": [ { "accessible_scopes": ["__main__", "__main__.get_declared_classes"], "code": "program_input_declared_classes = prepared_program_input[\"declared_classes\"]\n\ndeclared_classes = [\n (\n int(key),\n int(value),\n )\n for key, value in program_input_declared_classes.items()\n]\nids.declared_classes = segments.gen_arg(declared_classes)\nids.declared_classes_len = len(declared_classes)", "flow_tracking_data": { "ap_tracking": { "group": 20, "offset": 2 }, "reference_ids": { "__main__.get_declared_classes.declared_classes": 77, "__main__.get_declared_classes.declared_classes_len": 78 } } } ], "219": [ { "accessible_scopes": ["__main__", "__main__.get_merged_da"], "code": "# Load da.\nda = program_input[\"earlier\"][\"world_da\"]\nupdates = program_input[\"later\"][\"world_da\"]\nids.merged = merged = segments.add()\n\n# Find value after updates.\nafter = {}\nfor i in range(0, len(da), 2):\n after[da[i]] = da[i + 1]\nfor i in range(0, len(updates), 2):\n after[updates[i]] = updates[i + 1]\n\n# Update the da array.\nincluded = {}\nfor i in range(0, len(da), 2):\n da[i+1] = after[da[i]]\n included[da[i]] = True\n\nfor i in range(0, len(updates), 2):\n if updates[i] not in included:\n da.append(updates[i])\n da.append(updates[i + 1])\n\n# Pass da to cairo.\nids.merged_len = len(da)\nfor i in range(0, len(da)):\n memory[merged + i] = int(da[i])", "flow_tracking_data": { "ap_tracking": { "group": 26, "offset": 2 }, "reference_ids": { "__main__.get_merged_da.merged": 103, "__main__.get_merged_da.merged_len": 104 } } } ], "274": [ { "accessible_scopes": ["__main__", "__main__.main"], "code": "prepared_program_input = program_input[\"earlier\"]", "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 37 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } } } ], "294": [ { "accessible_scopes": ["__main__", "__main__.main"], "code": "prepared_program_input = program_input[\"later\"]", "flow_tracking_data": { "ap_tracking": { "group": 30, "offset": 111 }, "reference_ids": { "__main__.main.bitwise_ptr": 126, "__main__.main.input_1": 128, "__main__.main.output_ptr": 123, "__main__.main.pedersen_ptr": 124, "__main__.main.range_check_ptr": 125 } } } ] }, "identifiers": { "__main__.ContractUpdate": { "full_name": "__main__.ContractUpdate", "members": { "class_hash": { "cairo_type": "felt", "offset": 1 }, "contract_address": { "cairo_type": "felt", "offset": 0 } }, "size": 2, "type": "struct" }, "__main__.DeclaredClass": { "full_name": "__main__.DeclaredClass", "members": { "class_hash": { "cairo_type": "felt", "offset": 0 }, "compiled_class_hash": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "__main__.InputConfig": { "full_name": "__main__.InputConfig", "members": { "block_hash": { "cairo_type": "felt", "offset": 2 }, "block_number": { "cairo_type": "felt", "offset": 1 }, "config_hash": { "cairo_type": "felt", "offset": 3 }, "prev_state_root": { "cairo_type": "felt", "offset": 0 } }, "size": 4, "type": "struct" }, "__main__.MassagesInput": { "full_name": "__main__.MassagesInput", "members": { "message_to_appchain_segment": { "cairo_type": "felt*", "offset": 2 }, "message_to_appchain_segment_len": { "cairo_type": "felt", "offset": 3 }, "message_to_starknet_segment": { "cairo_type": "felt*", "offset": 0 }, "message_to_starknet_segment_len": { "cairo_type": "felt", "offset": 1 } }, "size": 4, "type": "struct" }, "__main__.NonceUpdate": { "full_name": "__main__.NonceUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "nonce": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.ProgramInput": { "full_name": "__main__.ProgramInput", "members": { "contract_updates": { "cairo_type": "__main__.ContractUpdate**", "offset": 9 }, "contract_updates_len": { "cairo_type": "felt", "offset": 8 }, "declared_classes": { "cairo_type": "__main__.DeclaredClass**", "offset": 11 }, "declared_classes_len": { "cairo_type": "felt", "offset": 10 }, "input_config": { "cairo_type": "__main__.InputConfig", "offset": 0 }, "messages": { "cairo_type": "__main__.MassagesInput", "offset": 12 }, "nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "offset": 5 }, "nonce_updates_len": { "cairo_type": "felt", "offset": 4 }, "storage_updates": { "cairo_type": "__main__.StorageUpdate**", "offset": 7 }, "storage_updates_len": { "cairo_type": "felt", "offset": 6 }, "world_da": { "cairo_type": "__main__.WorldDaInput", "offset": 16 } }, "size": 18, "type": "struct" }, "__main__.StorageUpdate": { "full_name": "__main__.StorageUpdate", "members": { "contract_address": { "cairo_type": "felt", "offset": 0 }, "storage_key": { "cairo_type": "felt", "offset": 1 }, "storage_value": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.WorldDaInput": { "full_name": "__main__.WorldDaInput", "members": { "world_da": { "cairo_type": "felt*", "offset": 0 }, "world_da_len": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.__end__": { "pc": 4, "type": "label" }, "__main__.__start__": { "pc": 0, "type": "label" }, "__main__.get_contract_updates": { "decorators": [], "pc": 121, "type": "function" }, "__main__.get_contract_updates.Args": { "full_name": "__main__.get_contract_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.ImplicitArgs": { "full_name": "__main__.get_contract_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_contract_updates.Return": { "cairo_type": "(contract_updates: __main__.ContractUpdate**, contract_updates_len: felt)", "type": "type_definition" }, "__main__.get_contract_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_contract_updates.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.get_contract_updates.contract_updates", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.get_contract_updates.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_contract_updates.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_declared_classes": { "decorators": [], "pc": 155, "type": "function" }, "__main__.get_declared_classes.Args": { "full_name": "__main__.get_declared_classes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.ImplicitArgs": { "full_name": "__main__.get_declared_classes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_declared_classes.Return": { "cairo_type": "(declared_classes: __main__.DeclaredClass**, declared_classes_len: felt)", "type": "type_definition" }, "__main__.get_declared_classes.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_declared_classes.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.get_declared_classes.declared_classes", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.get_declared_classes.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.get_declared_classes.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_hashes": { "decorators": [], "pc": 12, "type": "function" }, "__main__.get_hashes.Args": { "full_name": "__main__.get_hashes.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.ImplicitArgs": { "full_name": "__main__.get_hashes.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_hashes.Return": { "cairo_type": "(input_config: __main__.InputConfig)", "type": "type_definition" }, "__main__.get_hashes.SIZEOF_LOCALS": { "type": "const", "value": 8 }, "__main__.get_hashes.block_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.block_number": { "cairo_type": "felt", "full_name": "__main__.get_hashes.block_number", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.config_hash": { "cairo_type": "felt", "full_name": "__main__.get_hashes.config_hash", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" } ], "type": "reference" }, "__main__.get_hashes.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.get_hashes.input_config", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.get_hashes.prev_state_root": { "cairo_type": "felt", "full_name": "__main__.get_hashes.prev_state_root", "references": [ { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" } ], "type": "reference" }, "__main__.get_input": { "decorators": [], "pc": 239, "type": "function" }, "__main__.get_input.Args": { "full_name": "__main__.get_input.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_input.ImplicitArgs": { "full_name": "__main__.get_input.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_input.Return": { "cairo_type": "(res: __main__.ProgramInput)", "type": "type_definition" }, "__main__.get_input.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.get_input.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.get_input.contract_updates", "references": [ { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.get_input.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_input.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.get_input.declared_classes", "references": [ { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.get_input.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.get_input.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.input_config": { "cairo_type": "__main__.InputConfig", "full_name": "__main__.get_input.input_config", "references": [ { "ap_tracking_data": { "group": 29, "offset": 14 }, "pc": 241, "value": "[cast(ap + (-4), __main__.InputConfig*)]" } ], "type": "reference" }, "__main__.get_input.messages": { "cairo_type": "__main__.MassagesInput", "full_name": "__main__.get_input.messages", "references": [ { "ap_tracking_data": { "group": 29, "offset": 48 }, "pc": 251, "value": "[cast(ap + (-4), __main__.MassagesInput*)]" } ], "type": "reference" }, "__main__.get_input.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.get_input.nonce_updates", "references": [ { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.get_input.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_input.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.get_input.storage_updates", "references": [ { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.get_input.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_input.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.get_input.world_da": { "cairo_type": "__main__.WorldDaInput", "full_name": "__main__.get_input.world_da", "references": [ { "ap_tracking_data": { "group": 29, "offset": 54 }, "pc": 253, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" } ], "type": "reference" }, "__main__.get_merged_da": { "decorators": [], "pc": 217, "type": "function" }, "__main__.get_merged_da.Args": { "full_name": "__main__.get_merged_da.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_merged_da.ImplicitArgs": { "full_name": "__main__.get_merged_da.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_merged_da.Return": { "cairo_type": "(res: __main__.WorldDaInput)", "type": "type_definition" }, "__main__.get_merged_da.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_merged_da.merged": { "cairo_type": "felt*", "full_name": "__main__.get_merged_da.merged", "references": [ { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_merged_da.merged_len": { "cairo_type": "felt", "full_name": "__main__.get_merged_da.merged_len", "references": [ { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_messages": { "decorators": [], "pc": 43, "type": "function" }, "__main__.get_messages.Args": { "full_name": "__main__.get_messages.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.ImplicitArgs": { "full_name": "__main__.get_messages.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_messages.Return": { "cairo_type": "(__main__.MassagesInput,)", "type": "type_definition" }, "__main__.get_messages.SIZEOF_LOCALS": { "type": "const", "value": 4 }, "__main__.get_messages.message_to_appchain_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_appchain_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_appchain_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_appchain_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment": { "cairo_type": "felt*", "full_name": "__main__.get_messages.message_to_starknet_segment", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_messages.message_to_starknet_segment_len": { "cairo_type": "felt", "full_name": "__main__.get_messages.message_to_starknet_segment_len", "references": [ { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_nonce_updates": { "decorators": [], "pc": 50, "type": "function" }, "__main__.get_nonce_updates.Args": { "full_name": "__main__.get_nonce_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.ImplicitArgs": { "full_name": "__main__.get_nonce_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_nonce_updates.Return": { "cairo_type": "(nonce_updates: __main__.NonceUpdate**, nonce_updates_len: felt)", "type": "type_definition" }, "__main__.get_nonce_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_nonce_updates.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.get_nonce_updates.nonce_updates", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.get_nonce_updates.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_nonce_updates.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_storage_updates": { "decorators": [], "pc": 84, "type": "function" }, "__main__.get_storage_updates.Args": { "full_name": "__main__.get_storage_updates.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.ImplicitArgs": { "full_name": "__main__.get_storage_updates.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_storage_updates.Return": { "cairo_type": "(storage_updates: __main__.StorageUpdate**, storage_updates_len: felt)", "type": "type_definition" }, "__main__.get_storage_updates.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_storage_updates.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.get_storage_updates.storage_updates", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.get_storage_updates.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.get_storage_updates.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.get_world_da": { "decorators": [], "pc": 19, "type": "function" }, "__main__.get_world_da.Args": { "full_name": "__main__.get_world_da.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.ImplicitArgs": { "full_name": "__main__.get_world_da.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.get_world_da.Return": { "cairo_type": "(res: __main__.WorldDaInput)", "type": "type_definition" }, "__main__.get_world_da.SIZEOF_LOCALS": { "type": "const", "value": 2 }, "__main__.get_world_da.world_da": { "cairo_type": "felt*", "full_name": "__main__.get_world_da.world_da", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" } ], "type": "reference" }, "__main__.get_world_da.world_da_len": { "cairo_type": "felt", "full_name": "__main__.get_world_da.world_da_len", "references": [ { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" } ], "type": "reference" }, "__main__.hash2": { "destination": "starkware.cairo.common.hash.hash2", "type": "alias" }, "__main__.hash_contract_update": { "decorators": [], "pc": 126, "type": "function" }, "__main__.hash_contract_update.Args": { "full_name": "__main__.hash_contract_update.Args", "members": { "contract_update": { "cairo_type": "__main__.ContractUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.ImplicitArgs": { "full_name": "__main__.hash_contract_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_update.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_update.contract_update", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_update.res", "references": [ { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop": { "decorators": [], "pc": 132, "type": "function" }, "__main__.hash_contract_updates_loop.Args": { "full_name": "__main__.hash_contract_updates_loop.Args", "members": { "contract_updates": { "cairo_type": "__main__.ContractUpdate**", "offset": 1 }, "contract_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_contract_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_contract_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_contract_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_contract_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_contract_updates_loop.contract_update": { "cairo_type": "__main__.ContractUpdate*", "full_name": "__main__.hash_contract_updates_loop.contract_update", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates": { "cairo_type": "__main__.ContractUpdate**", "full_name": "__main__.hash_contract_updates_loop.contract_updates", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.contract_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.contract_updates_len", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_contract_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_contract_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_contract_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_class": { "decorators": [], "pc": 160, "type": "function" }, "__main__.hash_declared_class.Args": { "full_name": "__main__.hash_declared_class.Args", "members": { "declared_class": { "cairo_type": "__main__.DeclaredClass*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.ImplicitArgs": { "full_name": "__main__.hash_declared_class.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_class.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_class.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_class.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_class.declared_class", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_class.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_class.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_class.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_class.res", "references": [ { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop": { "decorators": [], "pc": 166, "type": "function" }, "__main__.hash_declared_classes_loop.Args": { "full_name": "__main__.hash_declared_classes_loop.Args", "members": { "declared_classes": { "cairo_type": "__main__.DeclaredClass**", "offset": 1 }, "declared_classes_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_declared_classes_loop.ImplicitArgs": { "full_name": "__main__.hash_declared_classes_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_declared_classes_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_declared_classes_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_declared_classes_loop.declared_class": { "cairo_type": "__main__.DeclaredClass*", "full_name": "__main__.hash_declared_classes_loop.declared_class", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes": { "cairo_type": "__main__.DeclaredClass**", "full_name": "__main__.hash_declared_classes_loop.declared_classes", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.declared_classes_len": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.declared_classes_len", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.hash", "references": [ { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_declared_classes_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_declared_classes_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_declared_classes_loop.res", "references": [ { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_update": { "decorators": [], "pc": 55, "type": "function" }, "__main__.hash_nonce_update.Args": { "full_name": "__main__.hash_nonce_update.Args", "members": { "nonce_update": { "cairo_type": "__main__.NonceUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.ImplicitArgs": { "full_name": "__main__.hash_nonce_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_update.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_update.nonce_update", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_update.res", "references": [ { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop": { "decorators": [], "pc": 61, "type": "function" }, "__main__.hash_nonce_updates_loop.Args": { "full_name": "__main__.hash_nonce_updates_loop.Args", "members": { "nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "offset": 1 }, "nonce_updates_len": { "cairo_type": "felt", "offset": 2 }, "res": { "cairo_type": "felt", "offset": 0 } }, "size": 3, "type": "struct" }, "__main__.hash_nonce_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_nonce_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_nonce_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_nonce_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_nonce_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_update": { "cairo_type": "__main__.NonceUpdate*", "full_name": "__main__.hash_nonce_updates_loop.nonce_update", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates": { "cairo_type": "__main__.NonceUpdate**", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.nonce_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.nonce_updates_len", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_nonce_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_nonce_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_nonce_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update": { "decorators": [], "pc": 89, "type": "function" }, "__main__.hash_storage_update.Args": { "full_name": "__main__.hash_storage_update.Args", "members": { "storage_update": { "cairo_type": "__main__.StorageUpdate*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.ImplicitArgs": { "full_name": "__main__.hash_storage_update.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_update.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_update.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_update.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_update.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_update.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_update.res", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_update.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_update.storage_update", "references": [ { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop": { "decorators": [], "pc": 98, "type": "function" }, "__main__.hash_storage_updates_loop.Args": { "full_name": "__main__.hash_storage_updates_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "storage_updates": { "cairo_type": "__main__.StorageUpdate**", "offset": 1 }, "storage_updates_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_storage_updates_loop.ImplicitArgs": { "full_name": "__main__.hash_storage_updates_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_storage_updates_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_storage_updates_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_storage_updates_loop.hash": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.hash", "references": [ { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_storage_updates_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.res", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_update": { "cairo_type": "__main__.StorageUpdate*", "full_name": "__main__.hash_storage_updates_loop.storage_update", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates": { "cairo_type": "__main__.StorageUpdate**", "full_name": "__main__.hash_storage_updates_loop.storage_updates", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" } ], "type": "reference" }, "__main__.hash_storage_updates_loop.storage_updates_len": { "cairo_type": "felt", "full_name": "__main__.hash_storage_updates_loop.storage_updates_len", "references": [ { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop": { "decorators": [], "pc": 24, "type": "function" }, "__main__.hash_world_da_loop.Args": { "full_name": "__main__.hash_world_da_loop.Args", "members": { "res": { "cairo_type": "felt", "offset": 0 }, "world_da": { "cairo_type": "felt*", "offset": 1 }, "world_da_len": { "cairo_type": "felt", "offset": 2 } }, "size": 3, "type": "struct" }, "__main__.hash_world_da_loop.ImplicitArgs": { "full_name": "__main__.hash_world_da_loop.ImplicitArgs", "members": { "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.hash_world_da_loop.Return": { "cairo_type": "(res: felt)", "type": "type_definition" }, "__main__.hash_world_da_loop.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.hash_world_da_loop.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.hash_world_da_loop.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.res": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.res", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.value": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.value", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da": { "cairo_type": "felt*", "full_name": "__main__.hash_world_da_loop.world_da", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.hash_world_da_loop.world_da_len": { "cairo_type": "felt", "full_name": "__main__.hash_world_da_loop.world_da_len", "references": [ { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.main": { "decorators": [], "pc": 272, "type": "function" }, "__main__.main.Args": { "full_name": "__main__.main.Args", "members": {}, "size": 0, "type": "struct" }, "__main__.main.ImplicitArgs": { "full_name": "__main__.main.ImplicitArgs", "members": { "bitwise_ptr": { "cairo_type": "felt*", "offset": 3 }, "output_ptr": { "cairo_type": "felt*", "offset": 0 }, "pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 1 }, "range_check_ptr": { "cairo_type": "felt", "offset": 2 } }, "size": 4, "type": "struct" }, "__main__.main.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.main.SIZEOF_LOCALS": { "type": "const", "value": 37 }, "__main__.main.__temp6": { "cairo_type": "felt", "full_name": "__main__.main.__temp6", "references": [ { "ap_tracking_data": { "group": 30, "offset": 186 }, "pc": 317, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.__temp7": { "cairo_type": "felt", "full_name": "__main__.main.__temp7", "references": [ { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 333, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.__temp8": { "cairo_type": "felt", "full_name": "__main__.main.__temp8", "references": [ { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 345, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.main.bitwise_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.bitwise_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-3), felt**)]" } ], "type": "reference" }, "__main__.main.input_1": { "cairo_type": "__main__.ProgramInput", "full_name": "__main__.main.input_1", "references": [ { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 276, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 294, "value": "[cast(fp, __main__.ProgramInput*)]" } ], "type": "reference" }, "__main__.main.input_2": { "cairo_type": "__main__.ProgramInput", "full_name": "__main__.main.input_2", "references": [ { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 296, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 314, "value": "[cast(fp + 18, __main__.ProgramInput*)]" } ], "type": "reference" }, "__main__.main.merged_world_da": { "cairo_type": "__main__.WorldDaInput", "full_name": "__main__.main.merged_world_da", "references": [ { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" } ], "type": "reference" }, "__main__.main.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.main.output_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 295, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 297, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 303, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 307, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 309, "value": "cast([ap + (-2)] + 1, felt*)" }, { "ap_tracking_data": { "group": 34, "offset": 0 }, "pc": 315, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 35, "offset": 0 }, "pc": 319, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 332, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 334, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 340, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 344, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 346, "value": "cast([ap + (-2)] + 1, felt*)" }, { "ap_tracking_data": { "group": 34, "offset": 0 }, "pc": 352, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 35, "offset": 0 }, "pc": 356, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.main.pedersen_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "__main__.main.pedersen_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 294, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 331, "value": "[cast(fp + 36, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" } ], "type": "reference" }, "__main__.main.range_check_ptr": { "cairo_type": "felt", "full_name": "__main__.main.range_check_ptr", "references": [ { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "__main__.main.world_da_hash": { "cairo_type": "felt", "full_name": "__main__.main.world_da_hash", "references": [ { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array": { "decorators": [], "pc": 222, "type": "function" }, "__main__.output_array.Args": { "full_name": "__main__.output_array.Args", "members": { "array": { "cairo_type": "felt*", "offset": 0 }, "len": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "__main__.output_array.ImplicitArgs": { "full_name": "__main__.output_array.ImplicitArgs", "members": { "output_ptr": { "cairo_type": "felt*", "offset": 0 } }, "size": 1, "type": "struct" }, "__main__.output_array.Return": { "cairo_type": "()", "type": "type_definition" }, "__main__.output_array.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.output_array.__temp5": { "cairo_type": "felt", "full_name": "__main__.output_array.__temp5", "references": [ { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 229, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.output_array.array": { "cairo_type": "felt*", "full_name": "__main__.output_array.array", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-4), felt**)]" } ], "type": "reference" }, "__main__.output_array.len": { "cairo_type": "felt", "full_name": "__main__.output_array.len", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "__main__.output_array.output_ptr": { "cairo_type": "felt*", "full_name": "__main__.output_array.output_ptr", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 230, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 238, "value": "[cast(ap + (-1), felt**)]" } ], "type": "reference" }, "__main__.output_array.value": { "cairo_type": "felt", "full_name": "__main__.output_array.value", "references": [ { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 228, "value": "[cast([fp + (-4)], felt*)]" } ], "type": "reference" }, "__main__.replace_or_append": { "decorators": [], "pc": 189, "type": "function" }, "__main__.replace_or_append.Args": { "full_name": "__main__.replace_or_append.Args", "members": { "array": { "cairo_type": "felt*", "offset": 0 }, "key": { "cairo_type": "felt", "offset": 2 }, "len": { "cairo_type": "felt", "offset": 1 }, "value": { "cairo_type": "felt", "offset": 3 } }, "size": 4, "type": "struct" }, "__main__.replace_or_append.ImplicitArgs": { "full_name": "__main__.replace_or_append.ImplicitArgs", "members": {}, "size": 0, "type": "struct" }, "__main__.replace_or_append.Return": { "cairo_type": "(replaced: felt)", "type": "type_definition" }, "__main__.replace_or_append.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "__main__.replace_or_append.__temp0": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp0", "references": [ { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 192, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp1": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp1", "references": [ { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 195, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp2": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp2", "references": [ { "ap_tracking_data": { "group": 24, "offset": 3 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp3": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp3", "references": [ { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 201, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.__temp4": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.__temp4", "references": [ { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 202, "value": "[cast(ap + (-1), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.array": { "cairo_type": "felt*", "full_name": "__main__.replace_or_append.array", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-6), felt**)]" } ], "type": "reference" }, "__main__.replace_or_append.key": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.key", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.len": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.len", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt*)]" } ], "type": "reference" }, "__main__.replace_or_append.value": { "cairo_type": "felt", "full_name": "__main__.replace_or_append.value", "references": [ { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "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.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.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.hash.HashBuiltin": { "destination": "starkware.cairo.common.cairo_builtins.HashBuiltin", "type": "alias" }, "starkware.cairo.common.hash.hash2": { "decorators": [], "pc": 6, "type": "function" }, "starkware.cairo.common.hash.hash2.Args": { "full_name": "starkware.cairo.common.hash.hash2.Args", "members": { "x": { "cairo_type": "felt", "offset": 0 }, "y": { "cairo_type": "felt", "offset": 1 } }, "size": 2, "type": "struct" }, "starkware.cairo.common.hash.hash2.ImplicitArgs": { "full_name": "starkware.cairo.common.hash.hash2.ImplicitArgs", "members": { "hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "offset": 0 } }, "size": 1, "type": "struct" }, "starkware.cairo.common.hash.hash2.Return": { "cairo_type": "(result: felt)", "type": "type_definition" }, "starkware.cairo.common.hash.hash2.SIZEOF_LOCALS": { "type": "const", "value": 0 }, "starkware.cairo.common.hash.hash2.hash_ptr": { "cairo_type": "starkware.cairo.common.cairo_builtins.HashBuiltin*", "full_name": "starkware.cairo.common.hash.hash2.hash_ptr", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.result": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.result", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.x": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.x", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" } ], "type": "reference" }, "starkware.cairo.common.hash.hash2.y": { "cairo_type": "felt", "full_name": "starkware.cairo.common.hash.hash2.y", "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" } ], "type": "reference" }, "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.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" } }, "main_scope": "__main__", "prime": "0x800000000000011000000000000000000000000000000000000000000000001", "reference_manager": { "references": [ { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 6, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "[cast([fp + (-5)] + 2, felt*)]" }, { "ap_tracking_data": { "group": 2, "offset": 0 }, "pc": 8, "value": "cast([fp + (-5)] + 3, starkware.cairo.common.cairo_builtins.HashBuiltin*)" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp, __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 4, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 5, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 6, felt*)]" }, { "ap_tracking_data": { "group": 3, "offset": 8 }, "pc": 14, "value": "[cast(fp + 7, felt*)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 4, "offset": 2 }, "pc": 21, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 24, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 0 }, "pc": 31, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 5, "offset": 7 }, "pc": 36, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 6, "offset": 0 }, "pc": 42, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 2, felt**)]" }, { "ap_tracking_data": { "group": 7, "offset": 4 }, "pc": 45, "value": "[cast(fp + 3, felt*)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp, __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 8, "offset": 2 }, "pc": 52, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-3), __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 0 }, "pc": 55, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 9, "offset": 7 }, "pc": 60, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-4), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 61, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 0 }, "pc": 68, "value": "[cast([fp + (-4)], __main__.NonceUpdate**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 11 }, "pc": 72, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 10, "offset": 18 }, "pc": 77, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 11, "offset": 0 }, "pc": 83, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp, __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 12, "offset": 2 }, "pc": 86, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-3), __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 0 }, "pc": 89, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 7 }, "pc": 94, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 13, "offset": 12 }, "pc": 97, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-4), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 98, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 0 }, "pc": 105, "value": "[cast([fp + (-4)], __main__.StorageUpdate**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 16 }, "pc": 109, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 14, "offset": 23 }, "pc": 114, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 15, "offset": 0 }, "pc": 120, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp, __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 16, "offset": 2 }, "pc": 123, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-3), __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 0 }, "pc": 126, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 17, "offset": 7 }, "pc": 131, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-4), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 132, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 0 }, "pc": 139, "value": "[cast([fp + (-4)], __main__.ContractUpdate**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 11 }, "pc": 143, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 18, "offset": 18 }, "pc": 148, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 19, "offset": 0 }, "pc": 154, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp, __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 20, "offset": 2 }, "pc": 157, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-3), __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast(fp + (-4), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 0 }, "pc": 160, "value": "[cast([fp + (-3)], felt*)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 21, "offset": 7 }, "pc": 165, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-4), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 166, "value": "[cast(fp + (-6), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 0 }, "pc": 173, "value": "[cast([fp + (-4)], __main__.DeclaredClass**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 11 }, "pc": 177, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 22, "offset": 18 }, "pc": 182, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 23, "offset": 0 }, "pc": 188, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-5), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 0 }, "pc": 189, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 192, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 195, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 3 }, "pc": 196, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 1 }, "pc": 201, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 24, "offset": 2 }, "pc": 202, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp, felt**)]" }, { "ap_tracking_data": { "group": 26, "offset": 2 }, "pc": 219, "value": "[cast(fp + 1, felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-4), felt**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-3), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 222, "value": "[cast(fp + (-5), felt**)]" }, { "ap_tracking_data": { "group": 27, "offset": 0 }, "pc": 228, "value": "[cast([fp + (-4)], felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 229, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 27, "offset": 1 }, "pc": 230, "value": "cast([fp + (-5)] + 1, felt*)" }, { "ap_tracking_data": { "group": 28, "offset": 0 }, "pc": 238, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 29, "offset": 14 }, "pc": 241, "value": "[cast(ap + (-4), __main__.InputConfig*)]" }, { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-2), __main__.NonceUpdate***)]" }, { "ap_tracking_data": { "group": 29, "offset": 20 }, "pc": 243, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-2), __main__.StorageUpdate***)]" }, { "ap_tracking_data": { "group": 29, "offset": 26 }, "pc": 245, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-2), __main__.ContractUpdate***)]" }, { "ap_tracking_data": { "group": 29, "offset": 32 }, "pc": 247, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-2), __main__.DeclaredClass***)]" }, { "ap_tracking_data": { "group": 29, "offset": 38 }, "pc": 249, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 29, "offset": 48 }, "pc": 251, "value": "[cast(ap + (-4), __main__.MassagesInput*)]" }, { "ap_tracking_data": { "group": 29, "offset": 54 }, "pc": 253, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-6), felt**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-5), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-4), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 0 }, "pc": 272, "value": "[cast(fp + (-3), felt**)]" }, { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 276, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 111 }, "pc": 294, "value": "[cast(fp, __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 296, "value": "[cast(ap + (-18), __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 185 }, "pc": 314, "value": "[cast(fp + 18, __main__.ProgramInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 186 }, "pc": 317, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "[cast(ap + (-2), __main__.WorldDaInput*)]" }, { "ap_tracking_data": { "group": 30, "offset": 192 }, "pc": 323, "value": "cast(0, felt)" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-2), starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 330, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 331, "value": "[cast(fp + 36, starkware.cairo.common.cairo_builtins.HashBuiltin**)]" }, { "ap_tracking_data": { "group": 31, "offset": 0 }, "pc": 332, "value": "cast([fp + (-6)] + 6, felt*)" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 333, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 31, "offset": 1 }, "pc": 334, "value": "cast([fp + (-6)] + 7, felt*)" }, { "ap_tracking_data": { "group": 32, "offset": 0 }, "pc": 340, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 0 }, "pc": 344, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 345, "value": "[cast(ap + (-1), felt*)]" }, { "ap_tracking_data": { "group": 33, "offset": 1 }, "pc": 346, "value": "cast([ap + (-2)] + 1, felt*)" }, { "ap_tracking_data": { "group": 34, "offset": 0 }, "pc": 352, "value": "[cast(ap + (-1), felt**)]" }, { "ap_tracking_data": { "group": 35, "offset": 0 }, "pc": 356, "value": "[cast(ap + (-1), felt**)]" } ] }} \ No newline at end of file diff --git a/bin/saya/src/args/mod.rs b/bin/saya/src/args/mod.rs index e9199126ae..7c40bd4935 100644 --- a/bin/saya/src/args/mod.rs +++ b/bin/saya/src/args/mod.rs @@ -6,7 +6,7 @@ use std::path::PathBuf; use clap::Parser; use saya_core::data_availability::celestia::CelestiaConfig; use saya_core::data_availability::DataAvailabilityConfig; -use saya_core::SayaConfig; +use saya_core::{ProverAccessKey, SayaConfig}; use tracing::Subscriber; use tracing_subscriber::{fmt, EnvFilter}; use url::Url; @@ -32,7 +32,19 @@ pub struct SayaArgs { #[arg(long)] #[arg(value_name = "PROVER URL")] #[arg(help = "The Prover URL for remote proving.")] - pub prover_url: Url, + pub url: Url, + + /// Specify the Prover Key. + #[arg(long)] + #[arg(value_name = "PROVER KEY")] + #[arg(help = "An authorized prover key for remote proving.")] + pub private_key: String, + + #[arg(long)] + #[arg(value_name = "STORE PROOFS")] + #[arg(help = "When enabled all proofs are saved as a file.")] + #[arg(default_value_t = false)] + pub store_proofs: bool, /// Enable JSON logging. #[arg(long)] @@ -50,6 +62,10 @@ pub struct SayaArgs { #[arg(short, long, default_value = "0")] pub start_block: u64, + #[arg(short, long, default_value = "1")] + #[arg(help = "The number of blocks to be merged into a single proof.")] + pub batch_size: usize, + #[command(flatten)] #[command(next_help_heading = "Data availability options")] pub data_availability: DataAvailabilityOptions, @@ -117,10 +133,17 @@ impl TryFrom for SayaConfig { None => None, }; + let prover_key = ProverAccessKey::from_hex_string(&args.private_key).map_err(|e| { + Box::new(std::io::Error::new(std::io::ErrorKind::InvalidInput, e.to_string())) + })?; + Ok(SayaConfig { katana_rpc: args.rpc_url, - prover_url: args.prover_url, + url: args.url, + private_key: prover_key, + store_proofs: args.store_proofs, start_block: args.start_block, + batch_size: args.batch_size, data_availability: da_config, world_address: args.proof.world_address, fact_registry_address: args.proof.fact_registry_address, @@ -145,9 +168,13 @@ mod tests { let args = SayaArgs { config_file: Some(config_file_path.clone()), rpc_url: Url::parse("http://localhost:5050").unwrap(), - prover_url: Url::parse("http://localhost:5050").unwrap(), + url: Url::parse("http://localhost:5050").unwrap(), + private_key: "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" + .into(), + store_proofs: true, json_log: false, start_block: 0, + batch_size: 4, data_availability: DataAvailabilityOptions { da_chain: None, celestia: CelestiaOptions { @@ -165,7 +192,13 @@ mod tests { let config: SayaConfig = args.try_into().unwrap(); assert_eq!(config.katana_rpc.as_str(), "http://localhost:5050/"); - assert_eq!(config.prover_url.as_str(), "http://localhost:1234/"); + assert_eq!(config.url.as_str(), "http://localhost:1234/"); + assert_eq!(config.batch_size, 4); + assert_eq!( + config.private_key.signing_key_as_hex_string(), + "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" + ); + assert!(!config.store_proofs); assert_eq!(config.start_block, 0); if let Some(DataAvailabilityConfig::Celestia(celestia_config)) = config.data_availability { assert_eq!(celestia_config.node_url.as_str(), "http://localhost:26657/"); diff --git a/bin/saya/src/args/test_saya_config_file.json b/bin/saya/src/args/test_saya_config_file.json index b3445089fd..478f88faf6 100644 --- a/bin/saya/src/args/test_saya_config_file.json +++ b/bin/saya/src/args/test_saya_config_file.json @@ -1,6 +1,9 @@ { "katana_rpc": "http://localhost:5050", - "prover_url": "http://localhost:1234", + "url": "http://localhost:1234", + "private_key": "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027", + "store_proofs": false, + "batch_size": 4, "world_address": "0x332b8ff41b1b026991fa9b7f0ec352909f8bc33416b65a80527edc988a9b082", "fact_registry_address": "0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb", "start_block": 0, diff --git a/bin/saya/src/main.rs b/bin/saya/src/main.rs index 9ed0796eb9..376a337b21 100644 --- a/bin/saya/src/main.rs +++ b/bin/saya/src/main.rs @@ -6,6 +6,9 @@ use tokio::signal::ctrl_c; mod args; +#[cfg(test)] +mod tests; + use args::SayaArgs; #[tokio::main] @@ -54,7 +57,7 @@ CONFIGURATION if let Some(da_config) = &config.data_availability { println!( r" -DATA AVAILBILITY +DATA AVAILABILITY ================== {da_config} ", diff --git a/bin/saya/src/tests.rs b/bin/saya/src/tests.rs new file mode 100644 index 0000000000..fbb9b4b727 --- /dev/null +++ b/bin/saya/src/tests.rs @@ -0,0 +1,408 @@ +use std::env; +use std::str::FromStr; +use std::sync::Arc; +use std::time::Duration; + +use cairo_proof_parser::output::extract_output; +use katana_primitives::contract::ContractAddress; +use katana_primitives::state::StateUpdates; +use saya_core::prover::extract::program_input_from_program_output; +use saya_core::prover::{ + prove_diff, HttpProverParams, MessageToAppchain, MessageToStarknet, ProgramInput, ProveProgram, + ProverIdentifier, ProvingState, Scheduler, +}; +use saya_core::ProverAccessKey; +use starknet_crypto::FieldElement; +use tokio::time::sleep; + +fn prover_identifier() -> ProverIdentifier { + let prover_key = env::var("PROVER_ACCESS_KEY").expect("PROVER_ACCESS_KEY not set."); + + ProverIdentifier::Http(Arc::new(HttpProverParams { + prover_url: "http://prover.visoft.dev:3618".parse().unwrap(), + prover_key: ProverAccessKey::from_hex_string(&prover_key) + .expect("Failed to parse prover key."), + })) +} + +fn sorted(mut v: Vec) -> Vec +where + E: std::cmp::Ord, +{ + v.sort(); + v +} + +#[ignore] +#[tokio::test] +async fn test_program_input_from_program_output() -> anyhow::Result<()> { + let mut input = ProgramInput { + prev_state_root: FieldElement::from_str("101").unwrap(), + block_number: 102, + block_hash: FieldElement::from_str("103").unwrap(), + config_hash: FieldElement::from_str("104").unwrap(), + message_to_starknet_segment: vec![ + MessageToStarknet { + from_address: ContractAddress::from(FieldElement::from_str("105").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("106").unwrap()), + payload: vec![FieldElement::from_str("107").unwrap()], + }, + MessageToStarknet { + from_address: ContractAddress::from(FieldElement::from_str("105").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("106").unwrap()), + payload: vec![FieldElement::from_str("107").unwrap()], + }, + ], + message_to_appchain_segment: vec![ + MessageToAppchain { + from_address: ContractAddress::from(FieldElement::from_str("108").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("109").unwrap()), + nonce: FieldElement::from_str("110").unwrap(), + selector: FieldElement::from_str("111").unwrap(), + payload: vec![FieldElement::from_str("112").unwrap()], + }, + MessageToAppchain { + from_address: ContractAddress::from(FieldElement::from_str("108").unwrap()), + to_address: ContractAddress::from(FieldElement::from_str("109").unwrap()), + nonce: FieldElement::from_str("110").unwrap(), + selector: FieldElement::from_str("111").unwrap(), + payload: vec![FieldElement::from_str("112").unwrap()], + }, + ], + state_updates: StateUpdates { + nonce_updates: { + let mut map = std::collections::HashMap::new(); + map.insert( + ContractAddress::from(FieldElement::from_str("1111").unwrap()), + FieldElement::from_str("22222").unwrap(), + ); + map + }, + storage_updates: vec![( + ContractAddress::from(FieldElement::from_str("333")?), + vec![(FieldElement::from_str("4444")?, FieldElement::from_str("555")?)] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + contract_updates: { + let mut map = std::collections::HashMap::new(); + map.insert( + ContractAddress::from(FieldElement::from_str("66666").unwrap()), + FieldElement::from_str("7777").unwrap(), + ); + map + }, + declared_classes: { + let mut map = std::collections::HashMap::new(); + map.insert( + FieldElement::from_str("88888").unwrap(), + FieldElement::from_str("99999").unwrap(), + ); + map + }, + }, + world_da: None, + }; + + input.fill_da(333u64.into()); + + let serialized_input = serde_json::to_string(&input).unwrap(); + let proof = + prove_diff(serialized_input, prover_identifier(), ProveProgram::Differ).await.unwrap(); + + let program_output_from_proof = extract_output(&proof).unwrap().program_output; + let program_input_from_proof = program_input_from_program_output( + program_output_from_proof, + input.clone().state_updates, + 333u64.into(), + ) + .unwrap(); + assert_eq!(input, program_input_from_proof); + Ok(()) +} + +#[ignore] +#[tokio::test] +async fn test_combine_proofs() { + let input1 = r#"{ + "prev_state_root": "101", + "block_number": 102, + "block_hash": "103", + "config_hash": "104", + "message_to_starknet_segment": [ + "105", + "106", + "1", + "107" + ], + "message_to_appchain_segment": [ + "108", + "109", + "110", + "111", + "1", + "112" + ], + "nonce_updates": { + "1111": "22222" + }, + "storage_updates": { + "333": { + "4444": "555" + } + }, + "contract_updates": { + "66666": "7777" + }, + "declared_classes": { + "88888": "99999" + }, + "world_da": [] + }"#; + let input2 = r#"{ + "prev_state_root": "201", + "block_number": 103, + "block_hash": "203", + "config_hash": "204", + "message_to_starknet_segment": [ + "205", + "206", + "1", + "207" + ], + "message_to_appchain_segment": [ + "208", + "209", + "210", + "211", + "1", + "207" + ], + "nonce_updates": { + "12334": "214354" + }, + "storage_updates": { + "333": { + "44536346444": "565474555" + } + }, + "contract_updates": { + "4356345": "775468977" + }, + "declared_classes": { + "88556753888": "9995764599" + }, + "world_da": [] + }"#; + let expected = r#"{ + "prev_state_root": "101", + "block_number": 103, + "block_hash": "203", + "config_hash": "104", + "message_to_starknet_segment": [ + "105", + "106", + "1", + "107", + "205", + "206", + "1", + "207" + ], + "message_to_appchain_segment": [ + "108", + "109", + "110", + "111", + "1", + "112", + "208", + "209", + "210", + "211", + "1", + "207" + ], + "nonce_updates": { + "12334": "214354", + "1111": "22222" + }, + "storage_updates": { + "333": { + "44536346444": "565474555", + "4444": "555" + } + }, + "contract_updates": { + "4356345": "775468977", + "66666": "7777" + }, + "declared_classes": { + "88556753888": "9995764599", + "88888": "99999" + }, + "world_da": [ + "4444", + "555", + "44536346444", + "565474555" + ] + }"#; + + let mut inputs = vec![input1, input2] + .into_iter() + .map(|s| serde_json::from_str::(s).unwrap()) + .collect::>(); + + let world = FieldElement::from_dec_str("333").unwrap(); + for input in &mut inputs { + input.fill_da(world) + } + + let mut scheduler = Scheduler::new(2, world, prover_identifier()); + scheduler.push_diff(inputs.remove(0)).unwrap(); + + sleep(Duration::from_millis(5)).await; + + assert!(!scheduler.is_full()); + assert_eq!(scheduler.query(102).await.unwrap(), ProvingState::Proving); + assert_eq!(scheduler.query(103).await.unwrap(), ProvingState::NotPushed); + + scheduler.push_diff(inputs.remove(0)).unwrap(); + sleep(Duration::from_millis(5)).await; + + assert!(scheduler.is_full()); + assert_eq!(scheduler.query(102).await.unwrap(), ProvingState::Proving); + assert_eq!(scheduler.query(103).await.unwrap(), ProvingState::Proving); + + let (_, output, block_range) = scheduler.proved().await.unwrap(); + let expected: ProgramInput = serde_json::from_str(expected).unwrap(); + assert_eq!(output, expected); + assert_eq!(block_range, (102, 103)); +} + +#[ignore] +#[tokio::test] +async fn test_4_combine_proofs() -> anyhow::Result<()> { + let world = FieldElement::from_dec_str("42")?; + + let input_1 = r#"{ + "prev_state_root": "101", + "block_number": 101, + "block_hash": "103", + "config_hash": "104", + "message_to_starknet_segment": ["105", "106", "1", "1"], + "message_to_appchain_segment": ["108", "109", "110", "111", "1", "112"], + "storage_updates": { + "42": { + "2010": "1200", + "2012": "1300" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + } + "#; + + let input_2 = r#"{ + "prev_state_root": "1011", + "block_number": 102, + "block_hash": "1033", + "config_hash": "104", + "message_to_starknet_segment": ["135", "136", "1", "1"], + "message_to_appchain_segment": ["158", "159", "150", "151", "1", "152"], + "storage_updates": { + "42": { + "2010": "1250", + "2032": "1300" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + }"#; + + let input_3 = r#"{ + "prev_state_root": "10111", + "block_number": 103, + "block_hash": "10333", + "config_hash": "104", + "message_to_starknet_segment": [], + "message_to_appchain_segment": [], + "storage_updates": { + "42": { + "2013": "2" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + }"#; + + let input_4 = r#"{ + "prev_state_root": "101111", + "block_number": 104, + "block_hash": "103333", + "config_hash": "104", + "message_to_starknet_segment": ["165", "166", "1", "1"], + "message_to_appchain_segment": ["168", "169", "160", "161", "1", "162"], + "storage_updates": { + "42": { + "2010": "1700" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {} + } + "#; + + let expected = r#"{ + "prev_state_root": "101", + "block_number": 104, + "block_hash": "103333", + "config_hash": "104", + "message_to_starknet_segment": ["105", "106", "1", "1", "135", "136", "1", "1", "165", "166", "1", "1"], + "message_to_appchain_segment": ["108", "109", "110", "111", "1", "112", "158", "159", "150", "151", "1", "152", "168", "169", "160", "161", "1", "162"], + "storage_updates": { + "42": { + "2010": "1700", + "2012": "1300", + "2032": "1300", + "2013": "2" + } + }, + "nonce_updates": {}, + "contract_updates": {}, + "declared_classes": {}, + "world_da": ["2010", "1700", "2012", "1300", "2032", "1300", "2013", "2"] + }"#; + + let inputs = vec![input_1, input_2, input_3, input_4] + .into_iter() + .map(|input| { + let mut input = serde_json::from_str::(input).unwrap(); + input.fill_da(world); + input + }) + .collect::>(); + + let expected = serde_json::from_str::(expected).unwrap(); + + let (_proof, output) = Scheduler::merge(inputs, world, prover_identifier()).await?; + assert_eq!(output.message_to_appchain_segment, expected.message_to_appchain_segment); + assert_eq!(output.message_to_starknet_segment, expected.message_to_starknet_segment); + + assert_eq!(sorted(output.world_da.unwrap()), sorted(expected.world_da.unwrap())); + assert_eq!(output.state_updates, expected.state_updates); + + assert_eq!(expected.prev_state_root, output.prev_state_root); + assert_eq!(expected.block_number, output.block_number); + assert_eq!(expected.block_hash, output.block_hash); + assert_eq!(expected.config_hash, output.config_hash); + + Ok(()) +} diff --git a/bin/scheduler/Cargo.toml b/bin/scheduler/Cargo.toml new file mode 100644 index 0000000000..2db9f60385 --- /dev/null +++ b/bin/scheduler/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "scheduler" +edition.workspace = true +license.workspace = true +repository.workspace = true +version.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +saya-core.workspace = true +katana-primitives.workspace = true +tokio.workspace = true +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +clap.workspace = true +clap_complete.workspace = true +url = "2.5.0" diff --git a/bin/scheduler/README.md b/bin/scheduler/README.md new file mode 100644 index 0000000000..baa673141b --- /dev/null +++ b/bin/scheduler/README.md @@ -0,0 +1,36 @@ +# `scheduler` + +```sh +cargo run --bin scheduler -- --world --key your_input.json your_input2.json ... your_input2^n +``` +## number of inputs have to be power of 2 +# input format example + +```json +{ + "prev_state_root":101, + "block_number":102, + "block_hash":103, + "config_hash":104, + "message_to_starknet_segment":[105,106,1,1], + "message_to_appchain_segment":[108,109,110,111,1,112], + "nonce_updates":{}, + "storage_updates":{ + "42": { + "2010": 1200, + "2012": 1300 + } + }, + "contract_updates":{}, + "declared_classes":{} +} +``` + +# output +## scheduler outputs map of proofs in result.json file +```json +{ + "proof1": proof, + "proof2": proof, +} +``` \ No newline at end of file diff --git a/bin/scheduler/src/main.rs b/bin/scheduler/src/main.rs new file mode 100644 index 0000000000..275b4036ed --- /dev/null +++ b/bin/scheduler/src/main.rs @@ -0,0 +1,78 @@ +use std::fs; +use std::sync::Arc; + +use clap::Parser; +use katana_primitives::FieldElement; +use saya_core::prover::{HttpProverParams, ProgramInput, ProverIdentifier, Scheduler}; +use saya_core::ProverAccessKey; +use serde::{Deserialize, Serialize}; +use serde_json::{Map, Value}; +use tokio::fs::File; +use tokio::io::AsyncWriteExt; + +#[derive(Parser, Debug, Serialize, Deserialize)] +#[clap(author, version, about, long_about = None)] +pub struct CliInput { + #[arg(short, long)] + pub world: FieldElement, + #[arg(short, long)] + pub key: String, + pub files: Vec, +} + +fn read_json_file(file_path: &str) -> Value { + let data = fs::read_to_string(file_path).expect("Unable to read file"); + serde_json::from_str(&data).expect("Unable to parse JSON") +} + +fn program_input_from_json(json_data: Value) -> ProgramInput { + serde_json::from_value(json_data).unwrap() +} + +async fn prove_to_json(result: Vec) { + let mut file = File::create("result.json").await.expect("Failed to create file"); + + let mut json_map = Map::new(); + for (index, elem) in result.iter().enumerate() { + let v: Value = serde_json::from_str(elem).expect("Failed to parse JSON"); + json_map.insert(format!("proof {}", index + 1), v); // Labels start from "proof 1", "proof 2", ... + } + + let serialized = serde_json::to_string_pretty(&json_map).expect("Failed to serialize result"); + + file.write_all(serialized.as_bytes()).await.expect("Failed to write to file"); +} + +// Entry point of the program with async main function to handle I/O operations. + +#[tokio::main] +async fn main() { + use url::Url; + let args = CliInput::parse(); // Parse CLI arguments. + if args.files.is_empty() { + eprintln!("No files provided"); + std::process::exit(1); + } + if !args.files.len().is_power_of_two() { + eprintln!("Only 2^n files are supported. Got {} files", args.files.len()); + std::process::exit(1); + } + + // Process each file, converting JSON data to ProgramInput. + let inputs: Vec = args + .files + .iter() + .map(|file| { + let json_data = read_json_file(file.to_str().unwrap()); + program_input_from_json(json_data) + }) + .collect(); + let prover_params = Arc::new(HttpProverParams { + prover_url: Url::parse("http://localhost:3000").unwrap(), + prover_key: ProverAccessKey::from_hex_string(&args.key).unwrap(), + }); + + let result = + Scheduler::merge(inputs, args.world, ProverIdentifier::Http(prover_params)).await.unwrap(); + prove_to_json(vec![result.0]).await; +} diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index d3c974abd3..a90d40b071 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -122,7 +122,7 @@ mod invalid_legacy_model { impl InvalidModelMetadata of super::IMetadataOnly { fn selector(self: @ContractState) -> felt252 { // Pre-computed address of a contract deployed through the world. - 0x742c3d09472a40914dedcbd609788fd547bde613d6c4d4c2f15d41f4e241f25 + 0x1b1edb46931b1a98d8c6ecf2703e8483ec1d85fb75b3e9c061eab383fc8f8f1 } fn name(self: @ContractState) -> ByteArray { @@ -160,7 +160,7 @@ mod invalid_model { fn selector(self: @ContractState) -> felt252 { // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x42503befcd7ad05718645aca9c5ddd83b53dca440f9239ce2dcf63018fba16 + 0x1b1edb46931b1a98d8c6ecf2703e8483ec1d85fb75b3e9c061eab383fc8f8f1 } fn name(self: @ContractState) -> ByteArray { diff --git a/crates/dojo-core/src/config/component.cairo b/crates/dojo-core/src/config/component.cairo index eea1cebc4d..ce77eb5b49 100644 --- a/crates/dojo-core/src/config/component.cairo +++ b/crates/dojo-core/src/config/component.cairo @@ -15,13 +15,19 @@ mod Config { #[event] #[derive(Drop, starknet::Event, Debug, PartialEq)] pub enum Event { - ProgramHashUpdate: ProgramHashUpdate, + DifferProgramHashUpdate: DifferProgramHashUpdate, + MergerProgramHashUpdate: MergerProgramHashUpdate, FactsRegistryUpdate: FactsRegistryUpdate } #[derive(Drop, starknet::Event, Debug, PartialEq)] - pub struct ProgramHashUpdate { - program_hash: felt252 + pub struct DifferProgramHashUpdate { + program_hash: felt252, + } + + #[derive(Drop, starknet::Event, Debug, PartialEq)] + pub struct MergerProgramHashUpdate { + program_hash: felt252, } #[derive(Drop, starknet::Event, Debug, PartialEq)] @@ -31,7 +37,8 @@ mod Config { #[storage] struct Storage { - program_hash: felt252, + differ_program_hash: felt252, + merger_program_hash: felt252, facts_registry: ContractAddress, owner: ContractAddress } @@ -45,19 +52,32 @@ mod Config { } } - #[embeddable_as(ConfigImpl)] impl Config< TContractState, +HasComponent > of IConfig> { - fn set_program_hash(ref self: ComponentState, program_hash: felt252) { + fn set_differ_program_hash( + ref self: ComponentState, program_hash: felt252 + ) { + assert(get_caller_address() == self.owner.read(), errors::INVALID_CALLER); + self.differ_program_hash.write(program_hash); + self.emit(DifferProgramHashUpdate { program_hash }); + } + + fn set_merger_program_hash( + ref self: ComponentState, program_hash: felt252 + ) { assert(get_caller_address() == self.owner.read(), errors::INVALID_CALLER); - self.program_hash.write(program_hash); - self.emit(ProgramHashUpdate { program_hash: program_hash }); + self.merger_program_hash.write(program_hash); + self.emit(MergerProgramHashUpdate { program_hash }); + } + + fn get_differ_program_hash(self: @ComponentState) -> felt252 { + self.differ_program_hash.read() } - fn get_program_hash(self: @ComponentState) -> felt252 { - self.program_hash.read() + fn get_merger_program_hash(self: @ComponentState) -> felt252 { + self.merger_program_hash.read() } fn set_facts_registry(ref self: ComponentState, address: ContractAddress) { diff --git a/crates/dojo-core/src/config/interface.cairo b/crates/dojo-core/src/config/interface.cairo index da3aa19150..de82abcdec 100644 --- a/crates/dojo-core/src/config/interface.cairo +++ b/crates/dojo-core/src/config/interface.cairo @@ -9,7 +9,8 @@ trait IConfig { /// /// * `program_hash` - The program hash. /// * `config_hash` - The program's config hash. - fn set_program_hash(ref self: T, program_hash: felt252); + fn set_differ_program_hash(ref self: T, program_hash: felt252); + fn set_merger_program_hash(ref self: T, program_hash: felt252); /// Gets the information of the program that generates the /// state transition trace (namely DojoOS). @@ -17,7 +18,8 @@ trait IConfig { /// # Returns /// /// The program hash and it's configuration hash. - fn get_program_hash(self: @T) -> felt252; + fn get_differ_program_hash(self: @T) -> felt252; + fn get_merger_program_hash(self: @T) -> felt252; /// Sets the facts registry contract address, which is already /// initialized with the verifier information. diff --git a/crates/dojo-core/src/interfaces.cairo b/crates/dojo-core/src/interfaces.cairo index 4b944d22b0..853305fc4f 100644 --- a/crates/dojo-core/src/interfaces.cairo +++ b/crates/dojo-core/src/interfaces.cairo @@ -21,7 +21,10 @@ struct ProgramOutput { #[starknet::interface] trait IUpgradeableState { fn upgrade_state( - ref self: TContractState, new_state: Span, program_output: ProgramOutput + ref self: TContractState, + new_state: Span, + program_output: ProgramOutput, + program_hash: felt252 ); } diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index 083c7b6c2b..e58610bdec 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -108,6 +108,7 @@ mod world { #[abi(embed_v0)] impl ConfigImpl = Config::ConfigImpl; + impl ConfigInternalImpl = Config::InternalImpl; #[event] #[derive(Drop, starknet::Event)] @@ -223,6 +224,8 @@ mod world { (resource_metadata::initial_class_hash(), resource_metadata::initial_address()) ); + self.config.initializer(creator); + EventEmitter::emit(ref self, WorldSpawned { address: get_contract_address(), creator }); } @@ -618,7 +621,10 @@ mod world { #[abi(embed_v0)] impl UpgradeableState of IUpgradeableState { fn upgrade_state( - ref self: ContractState, new_state: Span, program_output: ProgramOutput + ref self: ContractState, + new_state: Span, + program_output: ProgramOutput, + program_hash: felt252 ) { let mut da_hasher = PedersenImpl::new(0); let mut i = 0; @@ -633,11 +639,16 @@ mod world { let da_hash = da_hasher.finalize(); assert(da_hash == program_output.world_da_hash, 'wrong output hash'); + assert( + program_hash == self.config.get_differ_program_hash() + || program_hash == self.config.get_merger_program_hash(), + 'wrong program hash' + ); + let mut program_output_array = array![]; program_output.serialize(ref program_output_array); let program_output_hash = poseidon::poseidon_hash_span(program_output_array.span()); - let program_hash = self.config.get_program_hash(); let fact = poseidon::PoseidonImpl::new() .update(program_hash) .update(program_output_hash) @@ -657,7 +668,7 @@ mod world { 0, starknet::storage_address_from_base(base), *new_state.at(i).value ) .unwrap_syscall(); - i += 2; + i += 1; }; EventEmitter::emit(ref self, StateUpdated { da_hash: da_hash }); } diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/world_test.cairo index 5106cba9a4..4d8829410e 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/world_test.cairo @@ -17,7 +17,9 @@ use dojo::database::introspect::{Introspect, Layout, FieldLayout}; use dojo::database::MAX_ARRAY_LENGTH; use dojo::test_utils::{spawn_test_world, deploy_with_world_address, assert_array}; use dojo::benchmarks::{Character, end}; -use dojo::config::component::Config::{ProgramHashUpdate, FactsRegistryUpdate}; +use dojo::config::component::Config::{ + DifferProgramHashUpdate, MergerProgramHashUpdate, FactsRegistryUpdate +}; use dojo::model::Model; #[derive(Introspect, Copy, Drop, Serde)] @@ -807,16 +809,16 @@ fn drop_all_events(address: ContractAddress) { #[test] #[available_gas(6000000)] -fn test_program_hash_event_emit() { +fn test_differ_program_hash_event_emit() { let world = deploy_world(); drop_all_events(world.contract_address); let config = IConfigDispatcher { contract_address: world.contract_address }; - config.set_program_hash(program_hash: 98758347158781475198374598718743); + config.set_differ_program_hash(program_hash: 98758347158781475198374598718743); assert_eq!( starknet::testing::pop_log(world.contract_address), - Option::Some(ProgramHashUpdate { program_hash: 98758347158781475198374598718743 }) + Option::Some(DifferProgramHashUpdate { program_hash: 98758347158781475198374598718743 }) ); } diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json index 63207ddec9..c1a2447839 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json @@ -555,6 +555,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -573,7 +577,19 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", "inputs": [ { "name": "program_hash", @@ -585,7 +601,18 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -831,7 +858,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -859,8 +898,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml index f80ccef0d2..2555ec3eda 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" -original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index e2958635f1..4f9016025e 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -561,6 +561,10 @@ abigen!( { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -579,7 +583,19 @@ abigen!( "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", "inputs": [ { "name": "program_hash", @@ -591,7 +607,18 @@ abigen!( }, { "type": "function", - "name": "get_program_hash", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -837,7 +864,19 @@ abigen!( }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -865,8 +904,13 @@ abigen!( "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 412230164c..00da193bf8 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -145,7 +145,7 @@ async fn get_full_dojo_metadata_from_workspace() { assert!(env.world_address.is_some()); assert_eq!( env.world_address.unwrap(), - "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309" + "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" ); assert!(env.keystore_path.is_none()); diff --git a/crates/saya/README.md b/crates/saya/README.md index f33e6514e4..a291ec3ca2 100644 --- a/crates/saya/README.md +++ b/crates/saya/README.md @@ -69,15 +69,6 @@ However, papyrus and blockifier which we depend on are still in `-dev` version, - cairo-lang (we should support `2.5` now) - scarb (breaking changes between 2.4 and 2.5 to be addresses, not required to only build saya and SNOS) -## Local Testing - -```bash -cargo run -r -p katana # Start an appchain -cargo run -r -p sozo -- build --manifest-path examples/spawn-and-move/Scarb.toml -cargo run -r -p sozo -- migrate --manifest-path examples/spawn-and-move/Scarb.toml # Make some transactions -cargo run -r --bin saya -- --rpc-url http://localhost:5050 # Run Saya -``` - ## Additional documentation [Hackmd note](https://hackmd.io/@glihm/saya) diff --git a/crates/saya/core/Cargo.toml b/crates/saya/core/Cargo.toml index 246bd8253f..256d727638 100644 --- a/crates/saya/core/Cargo.toml +++ b/crates/saya/core/Cargo.toml @@ -19,7 +19,7 @@ async-trait.workspace = true cairo-proof-parser.workspace = true cairo-vm.workspace = true convert_case.workspace = true -dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] } +dojo-world = { workspace = true, features = [ "contracts", "manifest", "metadata", "migration" ] } flate2.workspace = true futures.workspace = true itertools.workspace = true @@ -45,3 +45,6 @@ celestia-types = "0.1.1" cairo-felt = "0.9.1" num-bigint = "0.4.4" +num-traits = "0.2.18" + +prover-sdk = { git = "https://github.com/neotheprogramist/http-prover", rev = "05aa9dbb7fdd5618693cead978d4ab0eebbf8f80" } diff --git a/crates/saya/core/src/dojo_os/mod.rs b/crates/saya/core/src/dojo_os/mod.rs index 824bfdda3b..bf479bc8d3 100644 --- a/crates/saya/core/src/dojo_os/mod.rs +++ b/crates/saya/core/src/dojo_os/mod.rs @@ -9,7 +9,7 @@ use std::time::Duration; -use anyhow::bail; +use anyhow::{bail, Context}; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use itertools::chain; @@ -52,13 +52,16 @@ pub async fn starknet_apply_diffs( world: FieldElement, new_state: Vec, program_output: Vec, + program_hash: FieldElement, + nonce: FieldElement, ) -> anyhow::Result { let calldata = chain![ - vec![FieldElement::from_dec_str(&(new_state.len() / 2).to_string()).unwrap()].into_iter(), + vec![FieldElement::from(new_state.len() as u64 / 2)].into_iter(), new_state.clone().into_iter(), - program_output.into_iter() + program_output.into_iter(), + vec![program_hash], ] - .collect::>(); + .collect(); let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; let tx = STARKNET_ACCOUNT @@ -67,9 +70,10 @@ pub async fn starknet_apply_diffs( selector: get_selector_from_name("upgrade_state").expect("invalid selector"), calldata, }]) + .nonce(nonce) .send_with_cfg(&txn_config) .await - .unwrap(); + .context("Failed to send `upgrade state` transaction.")?; let start_fetching = std::time::Instant::now(); let wait_for = Duration::from_secs(60); diff --git a/crates/saya/core/src/lib.rs b/crates/saya/core/src/lib.rs index dfd9883533..f3c98ef1de 100644 --- a/crates/saya/core/src/lib.rs +++ b/crates/saya/core/src/lib.rs @@ -1,28 +1,34 @@ //! Saya core library. +use std::ops::RangeInclusive; use std::sync::Arc; -use std::time::Duration; +use anyhow::Context; use cairo_proof_parser::output::{extract_output, ExtractOutputResult}; use cairo_proof_parser::parse; use cairo_proof_parser::program::{extract_program, ExtractProgramResult}; +use futures::future; use katana_primitives::block::{BlockNumber, FinalityStatus, SealedBlock, SealedBlockWithStatus}; +use katana_primitives::state::StateUpdatesWithDeclaredClasses; use katana_primitives::transaction::Tx; use katana_primitives::FieldElement; -use prover::ProverIdentifier; +use katana_rpc_types::trace::TxExecutionInfo; +use prover::{HttpProverParams, ProverIdentifier}; +pub use prover_sdk::ProverAccessKey; use saya_provider::rpc::JsonRpcProvider; use saya_provider::Provider as SayaProvider; use serde::{Deserialize, Serialize}; use starknet_crypto::poseidon_hash_many; -use tokio::time::sleep; +use tokio::fs::File; +use tokio::io::AsyncWriteExt; use tracing::{error, info, trace}; use url::Url; -use verifier::VerifierIdentifier; use crate::blockchain::Blockchain; use crate::data_availability::{DataAvailabilityClient, DataAvailabilityConfig}; use crate::error::SayaResult; -use crate::prover::{extract_messages, ProgramInput}; +use crate::prover::{extract_messages, ProgramInput, Scheduler}; +use crate::verifier::VerifierIdentifier; pub mod blockchain; pub mod data_availability; @@ -39,8 +45,11 @@ pub struct SayaConfig { #[serde(deserialize_with = "url_deserializer")] pub katana_rpc: Url, #[serde(deserialize_with = "url_deserializer")] - pub prover_url: Url, + pub url: Url, + pub private_key: ProverAccessKey, + pub store_proofs: bool, pub start_block: u64, + pub batch_size: usize, pub data_availability: Option, pub world_address: FieldElement, pub fact_registry_address: FieldElement, @@ -66,6 +75,14 @@ pub struct Saya { blockchain: Blockchain, } +struct FetchedBlockInfo { + block_number: BlockNumber, + block: SealedBlock, + prev_state_root: FieldElement, + state_updates: StateUpdatesWithDeclaredClasses, + exec_infos: Vec, +} + impl Saya { /// Initializes a new [`Saya`] instance from the given [`SayaConfig`]. /// @@ -99,7 +116,19 @@ impl Saya { let mut block = self.config.start_block.max(1); // Genesis block is not proven. We advance to block 1 let block_before_the_first = self.provider.fetch_block(block - 1).await; - let mut previous_block = block_before_the_first?; + let mut previous_block_state_root = block_before_the_first?.header.header.state_root; + + let prover_identifier = ProverIdentifier::Http(Arc::new(HttpProverParams { + prover_url: self.config.url.clone(), + prover_key: self.config.private_key.clone(), + })); + + // The structure responsible for proving. + let mut prove_scheduler = Scheduler::new( + self.config.batch_size, + self.config.world_address, + prover_identifier.clone(), + ); loop { let latest_block = match self.provider.block_number().await { @@ -117,48 +146,125 @@ impl Saya { continue; } - let fetched_block = self.provider.fetch_block(block).await?; + let (last_state_root, params) = + self.prefetch_blocks(block..=latest_block, previous_block_state_root).await?; + previous_block_state_root = last_state_root; + + // Updating the local state sequentially, as there is only one instance of + // `self.blockchain` This part does no actual proving, so should not be a + // problem + for p in params { + self.process_block(&mut prove_scheduler, block, p)?; + + if prove_scheduler.is_full() { + self.process_proven(prove_scheduler).await?; - self.process_block(block, (&fetched_block, previous_block)).await?; + prove_scheduler = Scheduler::new( + self.config.batch_size, + self.config.world_address, + prover_identifier.clone(), + ); + } - previous_block = fetched_block; - block += 1; + block += 1; + } } } + async fn prefetch_blocks( + &mut self, + block_numbers: RangeInclusive, + previous_block_state_root: FieldElement, + ) -> SayaResult<(FieldElement, Vec)> { + // Fetch all blocks from the current block to the latest block + let fetched_blocks = future::try_join_all( + block_numbers.clone().map(|block_number| self.provider.fetch_block(block_number)), + ) + .await?; + + // Shift the state roots to the right by one, as proof of each block is based on the + // previous state root + let mut state_roots = vec![previous_block_state_root]; + state_roots.extend(fetched_blocks.iter().map(|block| block.header.header.state_root)); + let previous_block_state_root = state_roots.pop().unwrap(); + + let mut state_updates_and_exec_info = vec![]; + + let (state_updates, da_state_updates): (Vec<_>, Vec<_>) = future::try_join_all( + block_numbers + .clone() + .map(|block_number| self.provider.fetch_state_updates(block_number)), + ) + .await? + .into_iter() + .unzip(); + let transactions_executions = future::try_join_all( + block_numbers + .clone() + .map(|block_number| self.provider.fetch_transactions_executions(block_number)), + ) + .await?; + + for da_state_update in da_state_updates { + if let Some(da) = &self.da_client { + // Publish state difference if DA client is available + da.publish_state_diff_felts(&da_state_update).await?; + } + } + + state_updates.into_iter().zip(transactions_executions.into_iter()).for_each( + |(state_updates, exec_info)| { + state_updates_and_exec_info.push((state_updates, exec_info)); + }, + ); + + // Prepare parameters + let params = fetched_blocks + .into_iter() + .zip(state_roots) + .zip(state_updates_and_exec_info) + .map(|((block, prev_state_root), (state_updates, exec_infos))| FetchedBlockInfo { + block_number: block.header.header.number, + block, + prev_state_root, + state_updates, + exec_infos, + }) + .collect::>(); + + trace!(target: LOG_TARGET, block_number = block_numbers.start(), to = block_numbers.end(), "Fetched blocks."); + + Ok((previous_block_state_root, params)) + } + /// Processes the given block number. /// /// # Summary /// - /// 1. Pulls state update to update local state accordingly. We may publish DA at this point. + /// 1. Update local state accordingly to pulled state. We may publish DA at this point. /// /// 2. Pulls all transactions and data required to generate the trace. /// /// 3. Computes facts for this state transition. We may optimistically register the facts. /// - /// 4. Computes the proof from the trace with a prover. - /// - /// 5. Registers the facts + the send the proof to verifier. Not all provers require this step - /// (a.k.a. SHARP). + /// 4. Starts computing the proof from the trace with a prover. /// /// # Arguments /// + /// * `prove_scheduler` - A parallel prove scheduler. /// * `block_number` - The block number. - async fn process_block( + /// * `block_info` - The block to process, along with the state roots of the previous block and + /// the genesis block. + fn process_block( &mut self, + prove_scheduler: &mut Scheduler, block_number: BlockNumber, - blocks: (&SealedBlock, SealedBlock), + block_info: FetchedBlockInfo, ) -> SayaResult<()> { trace!(target: LOG_TARGET, block_number = %block_number, "Processing block."); - let (block, prev_block) = blocks; - - let (state_updates, da_state_update) = - self.provider.fetch_state_updates(block_number).await?; - - if let Some(da) = &self.da_client { - da.publish_state_diff_felts(&da_state_update).await?; - } + let FetchedBlockInfo { block, prev_state_root, state_updates, exec_infos, block_number } = + block_info; let block = SealedBlockWithStatus { block: block.clone(), status: FinalityStatus::AcceptedOnL2 }; @@ -170,8 +276,6 @@ impl Saya { return Ok(()); } - let exec_infos = self.provider.fetch_transactions_executions(block_number).await?; - if exec_infos.is_empty() { trace!(target: LOG_TARGET, block_number, "Skipping empty block."); return Ok(()); @@ -191,50 +295,69 @@ impl Saya { let (message_to_starknet_segment, message_to_appchain_segment) = extract_messages(&exec_infos, &transactions); - let new_program_input = ProgramInput { - prev_state_root: prev_block.header.header.state_root, - block_number: FieldElement::from(block_number), + let mut state_diff_prover_input = ProgramInput { + prev_state_root, + block_number, block_hash: block.block.header.hash, config_hash: FieldElement::from(0u64), message_to_starknet_segment, message_to_appchain_segment, state_updates: state_updates_to_prove, + world_da: None, }; + state_diff_prover_input.fill_da(self.config.world_address); - let world_da = new_program_input.da_as_calldata(self.config.world_address); - let world_da_printable: Vec = world_da.iter().map(|x| x.to_string()).collect(); - trace!(target: LOG_TARGET, world_da = ?world_da_printable, "World DA computed."); + prove_scheduler.push_diff(state_diff_prover_input)?; - trace!(target: LOG_TARGET, "Proving block {block_number}."); - let proof = prover::prove( - new_program_input.serialize(self.config.world_address)?, - ProverIdentifier::Http(self.config.prover_url.clone()), - ) - .await?; - info!(target: LOG_TARGET, block_number, "Block proven."); + info!(target: LOG_TARGET, block_number, "Block processed."); + + Ok(()) + } + + /// Registers the facts + the send the proof to verifier. Not all provers require this step + /// (a.k.a. SHARP). + /// + /// # Arguments + /// + /// * `prove_scheduler` - A full parallel prove scheduler. + /// * `last_block` - The last block number in the `prove_scheduler`. + async fn process_proven(&self, prove_scheduler: Scheduler) -> SayaResult<()> { + // Prove each of the leaf nodes of the recursion tree and merge them into one + let (proof, state_diff, (_, last_block)) = + prove_scheduler.proved().await.context("Failed to prove.")?; + + if self.config.store_proofs { + let filename = format!("proof_{}.json", last_block); + let mut file = File::create(filename).await.context("Failed to create proof file.")?; + file.write_all(proof.as_bytes()).await.context("Failed to write proof.")?; + } let serialized_proof: Vec = parse(&proof)?.into(); + let world_da = state_diff.world_da.unwrap(); - trace!(target: LOG_TARGET, block_number, "Verifying block."); - let transaction_hash = verifier::verify( + trace!(target: LOG_TARGET, last_block, "Verifying block."); + let (transaction_hash, nonce_after) = verifier::verify( VerifierIdentifier::HerodotusStarknetSepolia(self.config.fact_registry_address), serialized_proof, ) .await?; - info!(target: LOG_TARGET, block_number, transaction_hash, "Block verified."); + info!(target: LOG_TARGET, last_block, transaction_hash, "Block verified."); let ExtractProgramResult { program: _, program_hash } = extract_program(&proof)?; let ExtractOutputResult { program_output, program_output_hash } = extract_output(&proof)?; let expected_fact = poseidon_hash_many(&[program_hash, program_output_hash]).to_string(); info!(target: LOG_TARGET, expected_fact, "Expected fact."); - sleep(Duration::from_millis(5000)).await; - - trace!(target: LOG_TARGET, block_number, "Applying diffs."); - let transaction_hash = - dojo_os::starknet_apply_diffs(self.config.world_address, world_da, program_output) - .await?; - info!(target: LOG_TARGET, block_number, transaction_hash, "Diffs applied."); + trace!(target: LOG_TARGET, last_block, "Applying diffs."); + let transaction_hash = dojo_os::starknet_apply_diffs( + self.config.world_address, + world_da, + program_output, + program_hash, + nonce_after + 1u64.into(), + ) + .await?; + info!(target: LOG_TARGET, last_block, transaction_hash, "Diffs applied."); Ok(()) } diff --git a/crates/saya/core/src/prover/client.rs b/crates/saya/core/src/prover/client.rs index 644b24e8a7..43f23b3a50 100644 --- a/crates/saya/core/src/prover/client.rs +++ b/crates/saya/core/src/prover/client.rs @@ -1,8 +1,36 @@ +use std::sync::Arc; + +use anyhow::Context; +use prover_sdk::{ProverSDK, ProverSdkErrors}; +use tokio::sync::OnceCell; +use tracing::trace; use url::Url; -pub async fn http_prove(prover_url: Url, input: String) -> anyhow::Result { - let client = reqwest::Client::new(); - let resp = client.post(prover_url).body(input).send().await?; - let result = resp.text().await?; - Ok(result) +use super::ProveProgram; +use crate::prover::loader::prepare_input_cairo0; +use crate::LOG_TARGET; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct HttpProverParams { + pub prover_url: Url, + pub prover_key: prover_sdk::ProverAccessKey, +} + +static ONCE: OnceCell> = OnceCell::const_new(); + +pub async fn http_prove( + prover_params: Arc, + input: String, + prove_program: ProveProgram, +) -> anyhow::Result { + let prover = ONCE + .get_or_init(|| async { + trace!(target: LOG_TARGET, "Proving with cairo0."); + ProverSDK::new(prover_params.prover_key.clone(), prover_params.prover_url.clone()).await + }) + .await; + let prover = prover.as_ref().map_err(|e| anyhow::anyhow!(e.to_string()))?; + + let input = prepare_input_cairo0(input, prove_program).await?; + prover.prove_cairo0(input).await.context("Failed to prove using the http prover") } diff --git a/crates/saya/core/src/prover/extract.rs b/crates/saya/core/src/prover/extract.rs new file mode 100644 index 0000000000..7ae3cf7bdd --- /dev/null +++ b/crates/saya/core/src/prover/extract.rs @@ -0,0 +1,98 @@ +use anyhow::anyhow; +use katana_primitives::contract::ContractAddress; +use katana_primitives::state::StateUpdates; +use katana_primitives::FieldElement; +use num_traits::ToPrimitive; + +use super::{MessageToAppchain, MessageToStarknet, ProgramInput}; + +pub fn program_input_from_program_output( + output: Vec, + state_updates: StateUpdates, + world: FieldElement, +) -> anyhow::Result { + let prev_state_root = output[0]; + let block_number = serde_json::from_str(&output[2].to_string()).unwrap(); + let block_hash = output[3]; + let config_hash = output[4]; + let mut decimal = output[6].clone().to_big_decimal(0); // Convert with no decimal places + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + + let message_to_starknet_segment = match num { + 0..=3 => Default::default(), + 4..=u64::MAX => get_message_to_starknet_segment(&output[7..7 + num as usize])?, + }; + + let index = 7 + num as usize; + decimal = output[index].clone().to_big_decimal(0); + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + let message_to_appchain_segment = match num { + 0..=4 => Default::default(), + 5..=u64::MAX => { + get_message_to_appchain_segment(&output[index + 1..index + 1 + num as usize])? + } + }; + + let mut input = ProgramInput { + prev_state_root, + block_number, + block_hash, + config_hash, + message_to_starknet_segment, + message_to_appchain_segment, + state_updates, + world_da: None, + }; + + input.fill_da(world); + Ok(input) +} + +fn get_message_to_starknet_segment( + output: &[FieldElement], +) -> anyhow::Result> { + let mut message_to_starknet_segment: Vec = vec![]; + let mut index = 0; + loop { + if index >= output.len() { + break; + } + let from_address = ContractAddress::from(output[index]); + let to_address = ContractAddress::from(output[index + 1]); + let decimal = output[index + 2].to_big_decimal(0); + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + let payload = output[index + 3..index + 3 + num as usize].to_vec(); + message_to_starknet_segment.push(MessageToStarknet { from_address, to_address, payload }); + index += 3 + num as usize; + } + Ok(message_to_starknet_segment) +} + +fn get_message_to_appchain_segment( + output: &[FieldElement], +) -> anyhow::Result> { + let mut message_to_appchain_segment: Vec = vec![]; + let mut index = 0; + loop { + if index >= output.len() { + break; + } + let from_address = ContractAddress::from(output[index]); + let to_address = ContractAddress::from(output[index + 1]); + let nonce = output[index + 2]; + let selector = output[index + 3]; + let decimal = output[index + 4].to_big_decimal(0); + let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; + let payload = output[index + 5..index + 5 + num as usize].to_vec(); + + message_to_appchain_segment.push(MessageToAppchain { + from_address, + to_address, + nonce, + selector, + payload, + }); + index += 5 + num as usize; + } + Ok(message_to_appchain_segment) +} diff --git a/crates/saya/core/src/prover/loader.rs b/crates/saya/core/src/prover/loader.rs new file mode 100644 index 0000000000..9ae585aef7 --- /dev/null +++ b/crates/saya/core/src/prover/loader.rs @@ -0,0 +1,36 @@ +use std::env; +use std::path::PathBuf; + +use prover_sdk::Cairo0ProverInput; +use serde_json::Value; +use tokio::fs::File; +use tokio::io::AsyncReadExt; + +use super::ProveProgram; + +pub async fn load_program(prove_program: ProveProgram) -> anyhow::Result { + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?); + let program_file = match prove_program { + ProveProgram::Differ => manifest_dir.join("programs/cairo0differ.json"), + ProveProgram::Merger => manifest_dir.join("programs/cairo0merger.json"), + }; + let mut program_file = File::open(program_file).await?; + + let mut data = String::new(); + program_file.read_to_string(&mut data).await?; + let json_value: Value = serde_json::from_str(&data)?; + + Ok(json_value) +} + +pub async fn prepare_input_cairo0( + arguments: String, + prove_program: ProveProgram, +) -> anyhow::Result { + let program = load_program(prove_program).await?; + + let program = serde_json::from_str(&serde_json::to_string(&program)?)?; + let program_input: Value = serde_json::from_str(&arguments)?; + + Ok(Cairo0ProverInput { program, program_input, layout: "recursive".into() }) +} diff --git a/crates/saya/core/src/prover/mod.rs b/crates/saya/core/src/prover/mod.rs index 1739881ef7..420cce9bde 100644 --- a/crates/saya/core/src/prover/mod.rs +++ b/crates/saya/core/src/prover/mod.rs @@ -2,39 +2,52 @@ //! //! The prover is in charge of generating a proof from the cairo execution trace. use std::str::FromStr; +use std::sync::Arc; use anyhow::bail; use async_trait::async_trait; mod client; +pub mod extract; +mod loader; mod program_input; +mod scheduler; pub mod state_diff; mod stone_image; mod vec252; +pub use client::HttpProverParams; pub use program_input::*; -use serde::{Deserialize, Serialize}; +pub use scheduler::*; pub use stone_image::*; -use url::Url; use self::client::http_prove; /// The prover used to generate the proof. -#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub enum ProverIdentifier { #[default] Stone, Sharp, Platinum, - Http(Url), + Http(Arc), } -pub async fn prove(input: String, prover: ProverIdentifier) -> anyhow::Result { +pub enum ProveProgram { + Differ, + Merger, +} + +pub async fn prove_diff( + input: String, + prover: ProverIdentifier, + program: ProveProgram, +) -> anyhow::Result { match prover { + ProverIdentifier::Http(params) => http_prove(params, input, program).await, + ProverIdentifier::Stone => prove_stone(input, program).await, ProverIdentifier::Sharp => todo!(), - ProverIdentifier::Stone => todo!(), ProverIdentifier::Platinum => todo!(), - ProverIdentifier::Http(prover_url) => http_prove(prover_url, input).await, } } @@ -44,10 +57,8 @@ pub trait ProverClient { fn identifier() -> ProverIdentifier; /// Generates the proof from the given trace. - /// At the moment prover is coupled with the program it proves. Because of this input should - /// correspond to the program. + /// The proven input has to be valid for the proving program. async fn prove(&self, input: String) -> anyhow::Result; - async fn local_verify(&self, proof: String) -> anyhow::Result<()>; } impl FromStr for ProverIdentifier { diff --git a/crates/saya/core/src/prover/program_input.rs b/crates/saya/core/src/prover/program_input.rs index 3bffdb6c9c..146f9ce111 100644 --- a/crates/saya/core/src/prover/program_input.rs +++ b/crates/saya/core/src/prover/program_input.rs @@ -1,22 +1,55 @@ +use std::str::FromStr; + +use anyhow::bail; use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; use katana_primitives::trace::{CallInfo, EntryPointType}; use katana_primitives::transaction::{L1HandlerTx, TxHash}; use katana_rpc_types::trace::TxExecutionInfo; +use serde::ser::{SerializeSeq, Serializer}; +use serde::{Deserialize, Deserializer, Serialize}; use starknet::core::types::FieldElement; -use super::state_diff::state_updates_to_json_like; - /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/snos_output.cairo#L19-L20 /// With the new state root computed by the prover. +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default)] pub struct ProgramInput { pub prev_state_root: FieldElement, - pub block_number: FieldElement, + pub block_number: u64, pub block_hash: FieldElement, pub config_hash: FieldElement, + #[serde(serialize_with = "MessageToStarknet::serialize_message_to_starknet")] + #[serde(deserialize_with = "MessageToStarknet::deserialize_message_to_starknet")] pub message_to_starknet_segment: Vec, + #[serde(serialize_with = "MessageToAppchain::serialize_message_to_appchain")] + #[serde(deserialize_with = "MessageToAppchain::deserialize_message_to_appchain")] pub message_to_appchain_segment: Vec, + #[serde(flatten)] pub state_updates: StateUpdates, + #[serde(serialize_with = "serialize_world_da")] + pub world_da: Option>, +} + +fn serialize_world_da( + element: &Option>, + serializer: S, +) -> Result +where + S: Serializer, +{ + if let Some(da) = element { + let mut seq = serializer.serialize_seq(Some(da.len()))?; + + for d in da { + let decimal = d.to_big_decimal(0); // Convert with no decimal places + let num = decimal.to_string(); + seq.serialize_element(&num)?; + } + + seq.end() + } else { + Err(serde::ser::Error::custom("Compute `world_da` first")) + } } fn get_messages_recursively(info: &CallInfo) -> Vec { @@ -43,7 +76,7 @@ fn get_messages_recursively(info: &CallInfo) -> Vec { pub fn extract_messages( exec_infos: &[TxExecutionInfo], - transactions: &[(TxHash, &L1HandlerTx)], + l1_transactions: &[(TxHash, &L1HandlerTx)], ) -> (Vec, Vec) { // extract messages to starknet (ie l2 -> l1) let message_to_starknet_segment = exec_infos @@ -57,8 +90,8 @@ pub fn extract_messages( // get the call infos from the trace and the corresponding tx hash let calls = exec_infos.iter().filter_map(|t| { let calls = t.trace.execute_call_info.as_ref()?; - let tx = transactions.iter().find(|tx| tx.0 == t.hash).expect("qed; tx must exist"); - Some((tx.1, calls)) + // Not present if not a l1 handler tx. + l1_transactions.iter().find(|tx| tx.0 == t.hash).map(|(_, tx)| (tx, calls)) }); // filter only the l1 handler tx @@ -80,49 +113,76 @@ pub fn extract_messages( } impl ProgramInput { - pub fn serialize(&self, world: FieldElement) -> anyhow::Result { - let message_to_starknet = self - .message_to_starknet_segment + /// Extracts the storage updates for the given world, and flattens them into a single vector + /// that represent the serialized DA. The length is not included as the array contains + /// serialiazed struct with two members: key and value. + /// TODO: migrate to cainome + simple rust vec for better devX in the future. + pub fn fill_da(&mut self, world: FieldElement) { + let updates = self + .state_updates + .storage_updates + .get(&ContractAddress::from(world)) + .unwrap_or(&std::collections::HashMap::new()) .iter() - .map(MessageToStarknet::serialize) - .collect::>>()? - .into_iter() - .flatten() - .map(|e| format!("{}", e)) - .collect::>() - .join(","); + .flat_map(|(k, v)| vec![*k, *v]) + .collect::>(); - let message_to_appchain = self - .message_to_appchain_segment - .iter() - .map(|m| m.serialize()) - .collect::>>()? - .into_iter() - .flatten() - .map(|e| format!("{}", e)) - .collect::>() - .join(","); + self.world_da = Some(updates); + } - let mut result = String::from('{'); - result.push_str(&format!(r#""prev_state_root":{},"#, self.prev_state_root)); - result.push_str(&format!(r#""block_number":{},"#, self.block_number)); - result.push_str(&format!(r#""block_hash":{},"#, self.block_hash)); - result.push_str(&format!(r#""config_hash":{},"#, self.config_hash)); + pub fn combine(mut self, latter: ProgramInput) -> anyhow::Result { + self.message_to_appchain_segment.extend(latter.message_to_appchain_segment); + self.message_to_starknet_segment.extend(latter.message_to_starknet_segment); - result.push_str(&format!(r#""message_to_starknet_segment":[{}],"#, message_to_starknet)); - result.push_str(&format!(r#""message_to_appchain_segment":[{}],"#, message_to_appchain)); + // the later state should overwrite the previous one. + latter.state_updates.contract_updates.into_iter().for_each(|(k, v)| { + self.state_updates.contract_updates.insert(k, v); + }); + latter.state_updates.declared_classes.into_iter().for_each(|(k, v)| { + self.state_updates.declared_classes.insert(k, v); + }); + latter.state_updates.nonce_updates.into_iter().for_each(|(k, v)| { + self.state_updates.nonce_updates.insert(k, v); + }); + latter.state_updates.storage_updates.into_iter().for_each(|(c, h)| { + h.into_iter().for_each(|(k, v)| { + self.state_updates.storage_updates.entry(c).or_default().insert(k, v); + }); + }); - result.push_str(&state_updates_to_json_like(&self.state_updates, world)); + if self.world_da.is_none() || latter.world_da.is_none() { + bail!("Both world_da must be present to combine them"); + } - result.push('}'); + let mut world_da = self.world_da.unwrap_or_default(); + for later in latter.world_da.unwrap_or_default().chunks(2) { + let mut replaced = false; + for earlier in world_da.chunks_mut(2) { + if later[0] == earlier[0] { + earlier[1] = later[1]; + replaced = true; + continue; + } + } - Ok(result) + if !replaced { + world_da.extend(later) + } + } + + // The block number is the one from the last block. + Ok(ProgramInput { + prev_state_root: self.prev_state_root, + block_number: latter.block_number, + block_hash: latter.block_hash, + config_hash: self.config_hash, + message_to_appchain_segment: self.message_to_appchain_segment, + message_to_starknet_segment: self.message_to_starknet_segment, + state_updates: self.state_updates, + world_da: Some(world_da), + }) } - /// Extracts the storage updates for the given world, and flattens them into a single vector - /// that represent the serialized DA. The length is not included as the array contains - /// serialiazed struct with two members: key and value. - /// TODO: migrate to cainome + simple rust vec for better devX in the future. pub fn da_as_calldata(&self, world: FieldElement) -> Vec { let updates = self .state_updates @@ -135,9 +195,80 @@ impl ProgramInput { updates } + + fn serialize_to_prover_args(&self) -> Vec { + let mut out = vec![ + self.prev_state_root, + FieldElement::from(self.block_number), + self.block_hash, + self.config_hash, + ]; + + out.push(FieldElement::from(self.state_updates.nonce_updates.len())); + for (k, v) in &self.state_updates.nonce_updates { + out.push(**k); + out.push(*v); + } + + out.push(FieldElement::from(self.state_updates.storage_updates.len())); + for (c, h) in &self.state_updates.storage_updates { + out.push(**c); + out.push(FieldElement::from(h.len())); + for (k, v) in h { + out.push(*k); + out.push(*v); + } + } + + out.push(FieldElement::from(self.state_updates.contract_updates.len())); + for (k, v) in &self.state_updates.contract_updates { + out.push(**k); + out.push(*v); + } + + out.push(FieldElement::from(self.state_updates.declared_classes.len())); + for (k, v) in &self.state_updates.declared_classes { + out.push(*k); + out.push(*v); + } + + let starknet_messages = self + .message_to_starknet_segment + .iter() + .flat_map(|m| m.serialize().unwrap()) + .collect::>(); + out.push(FieldElement::from(starknet_messages.len())); + out.extend(starknet_messages); + + let appchain_messages = self + .message_to_appchain_segment + .iter() + .flat_map(|m| m.serialize().unwrap()) + .collect::>(); + + out.push(FieldElement::from(appchain_messages.len())); + out.extend(appchain_messages); + + out.push(FieldElement::from(self.world_da.as_ref().unwrap().len() / 2)); + out.extend(self.world_da.as_ref().unwrap().iter().cloned()); + + out.push(FieldElement::from(0u64)); // Proofs + + out + } + + pub fn prepare_differ_args(inputs: Vec) -> String { + let serialized = + inputs.iter().flat_map(|input| input.serialize_to_prover_args()).collect::>(); + + let joined = serialized.iter().map(|f| f.to_big_decimal(0).to_string()).collect::>(); + + format!("[{} {}]", inputs.len(), joined.join(" ")) + } } /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/messaging/output_process.cairo#L16 +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default, PartialOrd, Ord)] pub struct MessageToStarknet { pub from_address: ContractAddress, pub to_address: ContractAddress, @@ -145,15 +276,88 @@ pub struct MessageToStarknet { } impl MessageToStarknet { + pub fn serialize_message_to_starknet( + messages: &[MessageToStarknet], + serializer: S, + ) -> Result + where + S: Serializer, + { + let mut seq = serializer.serialize_seq(Some(messages.len()))?; + for message in messages { + let serialized = message.serialize().unwrap(); + // Instead of adding serialized as an array, add each element individually + for field_element in serialized { + let decimal = field_element.to_big_decimal(0); // Assuming no decimal places for simplicity + let num = decimal.to_string(); + seq.serialize_element(&num)?; + } + } + seq.end() + } + pub fn serialize(&self) -> anyhow::Result> { let mut result = vec![*self.from_address, *self.to_address]; result.push(FieldElement::from(self.payload.len())); result.extend(self.payload.iter().cloned()); Ok(result) } + + fn deserialize_message_to_starknet<'de, D>( + deserializer: D, + ) -> Result, D::Error> + where + D: Deserializer<'de>, + { + struct MessageToStarknetVisitor; + + impl<'de> serde::de::Visitor<'de> for MessageToStarknetVisitor { + type Value = Vec; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("a flat list of integers for MessageToStarknet") + } + + fn visit_seq(self, mut seq: V) -> Result + where + V: serde::de::SeqAccess<'de>, + { + let mut messages = Vec::new(); + while let Some(from_address) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + let to_address = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let payload_length_str = seq.next_element::()?.unwrap_or_default(); + let payload_length: usize = payload_length_str.parse().unwrap_or_default(); + let mut payload = Vec::new(); + for _ in 0..payload_length { + if let Some(element) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + payload.push(element); + } + } + messages.push(MessageToStarknet { + from_address: ContractAddress::from(from_address), + to_address: ContractAddress::from(to_address), + payload, + }); + } + Ok(messages) + } + } + + deserializer.deserialize_seq(MessageToStarknetVisitor) + } } /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/messaging/output_process.cairo#L28 +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default, PartialOrd, Ord)] pub struct MessageToAppchain { pub from_address: ContractAddress, pub to_address: ContractAddress, @@ -163,27 +367,210 @@ pub struct MessageToAppchain { } impl MessageToAppchain { + pub fn serialize_message_to_appchain( + messages: &[MessageToAppchain], + serializer: S, + ) -> Result + where + S: Serializer, + { + let mut seq = serializer.serialize_seq(Some(messages.len()))?; + for message in messages { + let serialized = message.serialize().unwrap(); + for field_element in serialized { + let decimal = field_element.to_big_decimal(0); // Assuming no decimal places for simplicity + let num = decimal.to_string(); + seq.serialize_element(&num)?; + } + } + seq.end() + } + pub fn serialize(&self) -> anyhow::Result> { let mut result = vec![*self.from_address, *self.to_address, self.nonce, self.selector]; result.push(FieldElement::from(self.payload.len())); result.extend(self.payload.iter().cloned()); Ok(result) } + + fn deserialize_message_to_appchain<'de, D>( + deserializer: D, + ) -> Result, D::Error> + where + D: Deserializer<'de>, + { + struct MessageToAppchainVisitor; + + impl<'de> serde::de::Visitor<'de> for MessageToAppchainVisitor { + type Value = Vec; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("a flat list of integers for MessageToAppchain") + } + + fn visit_seq(self, mut seq: V) -> Result + where + V: serde::de::SeqAccess<'de>, + { + let mut messages = Vec::new(); + while let Some(from_address) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + let to_address = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let nonce = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let selector = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .unwrap_or_default(); + let payload_length_str = seq.next_element::()?.unwrap_or_default(); + let payload_length: usize = payload_length_str.parse().unwrap_or_default(); + let mut payload = Vec::new(); + for _ in 0..payload_length { + if let Some(element) = seq + .next_element::()? + .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + { + payload.push(element); + } + } + messages.push(MessageToAppchain { + from_address: ContractAddress::from(from_address), + to_address: ContractAddress::from(to_address), + nonce, + selector, + payload, + }); + } + Ok(messages) + } + } + + deserializer.deserialize_seq(MessageToAppchainVisitor) + } +} + +#[test] +fn test_deserialize_input() -> anyhow::Result<()> { + use std::str::FromStr; + + let input = r#"{ + "prev_state_root":"101", + "block_number":102, + "block_hash":"103", + "config_hash":"104", + "message_to_starknet_segment":["105","106","1","1"], + "message_to_appchain_segment":["108","109","110","111","1","112"], + "storage_updates":{ + "42": { + "2010": "1200", + "2012": "1300" + } + }, + "nonce_updates":{ + "1111": "22222", + "1116": "22223" + }, + "contract_updates":{ + "3": "437267489" + }, + "declared_classes":{ + "1234": "12345" + } + }"#; + + let mut expected = ProgramInput { + prev_state_root: FieldElement::from_str("101")?, + block_number: 102, + block_hash: FieldElement::from_str("103")?, + config_hash: FieldElement::from_str("104")?, + message_to_starknet_segment: vec![MessageToStarknet { + from_address: ContractAddress::from(FieldElement::from_str("105")?), + to_address: ContractAddress::from(FieldElement::from_str("106")?), + payload: vec![FieldElement::from_str("1")?], + }], + message_to_appchain_segment: vec![MessageToAppchain { + from_address: ContractAddress::from(FieldElement::from_str("108")?), + to_address: ContractAddress::from(FieldElement::from_str("109")?), + nonce: FieldElement::from_str("110")?, + selector: FieldElement::from_str("111")?, + payload: vec![FieldElement::from_str("112")?], + }], + state_updates: StateUpdates { + storage_updates: vec![( + ContractAddress::from(FieldElement::from_str("42")?), + vec![ + (FieldElement::from_str("2010")?, FieldElement::from_str("1200")?), + (FieldElement::from_str("2012")?, FieldElement::from_str("1300")?), + ] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + + nonce_updates: vec![ + ( + ContractAddress::from(FieldElement::from_str("1111")?), + FieldElement::from_str("22222")?, + ), + ( + ContractAddress::from(FieldElement::from_str("1116")?), + FieldElement::from_str("22223")?, + ), + ] + .into_iter() + .collect(), + + contract_updates: vec![( + ContractAddress::from(FieldElement::from_str("3")?), + FieldElement::from_str("437267489")?, + )] + .into_iter() + .collect(), + + declared_classes: vec![( + FieldElement::from_str("1234")?, + FieldElement::from_str("12345")?, + )] + .into_iter() + .collect(), + }, + world_da: None, + }; + let mut deserialized = serde_json::from_str::(input)?; + assert_eq!(expected, deserialized); + + deserialized.fill_da(FieldElement::from_str("42")?); + expected.world_da = Some(vec![ + FieldElement::from_str("2010")?, + FieldElement::from_str("1200")?, + FieldElement::from_str("2012")?, + FieldElement::from_str("1300")?, + ]); + + Ok(()) } #[test] -fn test_program_input() -> anyhow::Result<()> { +fn test_serialize_input() -> anyhow::Result<()> { use std::str::FromStr; let input = ProgramInput { prev_state_root: FieldElement::from_str("101")?, - block_number: FieldElement::from_str("102")?, + block_number: 102, block_hash: FieldElement::from_str("103")?, config_hash: FieldElement::from_str("104")?, message_to_starknet_segment: vec![MessageToStarknet { from_address: ContractAddress::from(FieldElement::from_str("105")?), to_address: ContractAddress::from(FieldElement::from_str("106")?), - payload: vec![FieldElement::from_str("107")?], + payload: vec![FieldElement::from_str("1")?], }], message_to_appchain_segment: vec![MessageToAppchain { from_address: ContractAddress::from(FieldElement::from_str("108")?), @@ -193,45 +580,100 @@ fn test_program_input() -> anyhow::Result<()> { payload: vec![FieldElement::from_str("112")?], }], state_updates: StateUpdates { - nonce_updates: std::collections::HashMap::new(), storage_updates: vec![( - ContractAddress::from(FieldElement::from_str("113")?), - vec![(FieldElement::from_str("114")?, FieldElement::from_str("115")?)] - .into_iter() - .collect(), + ContractAddress::from(FieldElement::from_str("42")?), + vec![ + (FieldElement::from_str("2010")?, FieldElement::from_str("1200")?), + (FieldElement::from_str("2012")?, FieldElement::from_str("1300")?), + ] + .into_iter() + .collect(), + )] + .into_iter() + .collect(), + + nonce_updates: vec![ + ( + ContractAddress::from(FieldElement::from_str("1111")?), + FieldElement::from_str("22222")?, + ), + ( + ContractAddress::from(FieldElement::from_str("1116")?), + FieldElement::from_str("22223")?, + ), + ] + .into_iter() + .collect(), + + contract_updates: vec![( + ContractAddress::from(FieldElement::from_str("3")?), + FieldElement::from_str("437267489")?, + )] + .into_iter() + .collect(), + + declared_classes: vec![( + FieldElement::from_str("1234")?, + FieldElement::from_str("12345")?, )] .into_iter() .collect(), - contract_updates: std::collections::HashMap::new(), - declared_classes: std::collections::HashMap::new(), }, + world_da: Some(vec![ + FieldElement::from_str("2010")?, + FieldElement::from_str("1200")?, + FieldElement::from_str("2012")?, + FieldElement::from_str("1300")?, + ]), }; - // Serialize with the DA. - let serialized_with_da = input.serialize(FieldElement::from_str("113")?).unwrap(); - println!("Serialized: {}", serialized_with_da); - pub const EXPECTED_WITH_DA: &str = r#"{ - "prev_state_root": 101, - "block_number": 102, - "block_hash": 103, - "config_hash": 104, - "message_to_starknet_segment": [105,106,1,107], - "message_to_appchain_segment": [108,109,110,111,1,112], - "nonce_updates": {}, - "storage_updates": {"113":{"114":115}}, - "contract_updates": {}, - "declared_classes": {}, - "world_da": [114, 115] - }"#; - - let expected = EXPECTED_WITH_DA.chars().filter(|c| !c.is_whitespace()).collect::(); - println!("{}", expected); - assert_eq!(serialized_with_da, expected); - - // Serialize just the DA as calldata. The length is not included, only the array of - // updates [key, value, key, value...]. - let da_calldata = input.da_as_calldata(FieldElement::from_str("113")?); - assert_eq!(da_calldata, vec![FieldElement::from_str("114")?, FieldElement::from_str("115")?]); + let serialized = serde_json::to_string::(&input.clone())?; + let deserialized = serde_json::from_str::(&serialized)?; + assert_eq!(input, deserialized); + + Ok(()) +} + +#[test] +fn test_serialize_to_prover_args() -> anyhow::Result<()> { + let input = r#"{ + "prev_state_root":"101", + "block_number":102, + "block_hash":"103", + "config_hash":"104", + "nonce_updates":{ + "1111": "22222" + }, + "storage_updates":{ + "333": { + "4444": "555" + } + }, + "contract_updates":{ + "66666": "7777" + }, + "declared_classes":{ + "88888": "99999" + }, + "message_to_starknet_segment":["123","456","123","128"], + "message_to_appchain_segment":["108","109","110","111","1","112"] + }"#; + let mut input = serde_json::from_str::(input)?; + input.fill_da(FieldElement::from_str("333")?); + + println!("{:?}", input); + + let serialized = input.serialize_to_prover_args(); + + let expected = vec![ + 101, 102, 103, 104, 1, 1111, 22222, 1, 333, 1, 4444, 555, 1, 66666, 7777, 1, 88888, 99999, + 4, 123, 456, 1, 128, 6, 108, 109, 110, 111, 1, 112, 1, 4444, 555, 0u64, + ] + .into_iter() + .map(FieldElement::from) + .collect::>(); + + assert_eq!(serialized, expected); Ok(()) } diff --git a/crates/saya/core/src/prover/scheduler.rs b/crates/saya/core/src/prover/scheduler.rs new file mode 100644 index 0000000000..3f90eab46f --- /dev/null +++ b/crates/saya/core/src/prover/scheduler.rs @@ -0,0 +1,222 @@ +use anyhow::{bail, Context}; +use cairo_proof_parser::output::{extract_output, ExtractOutputResult}; +use futures::future::BoxFuture; +use futures::FutureExt; +use katana_primitives::state::StateUpdates; +use katana_primitives::FieldElement; +use tokio::sync::{mpsc, oneshot}; +use tracing::{info, trace}; + +use super::{prove_diff, ProgramInput, ProverIdentifier}; +use crate::prover::extract::program_input_from_program_output; +use crate::prover::ProveProgram; +use crate::LOG_TARGET; + +type Proof = String; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ProvingState { + Proving, + Proved, + NotPushed, +} +type ProvingStateWithBlock = (u64, ProvingState); + +pub struct Scheduler { + root_task: BoxFuture<'static, anyhow::Result<(Proof, ProgramInput)>>, + free_differs: Vec>, + proving_tasks: Vec, + update_channel: mpsc::Receiver, + block_range: (u64, u64), +} + +impl Scheduler { + pub fn new(capacity: usize, world: FieldElement, prover: ProverIdentifier) -> Self { + let (senders, receivers): (Vec<_>, Vec<_>) = + (0..capacity).map(|_| oneshot::channel::()).unzip(); + + let (update_sender, update_channel) = mpsc::channel(capacity * 2); + let root_task = prove_recursively(receivers, world, prover, update_sender); + + Scheduler { + root_task, + free_differs: senders, + proving_tasks: Vec::with_capacity(capacity), + update_channel, + block_range: (u64::MAX, 0), + } + } + + pub fn is_full(&self) -> bool { + self.free_differs.is_empty() + } + + pub fn push_diff(&mut self, input: ProgramInput) -> anyhow::Result<()> { + if self.is_full() { + bail!("Scheduler is full"); + } + let block_number = input.block_number; + + let sender = self.free_differs.remove(0); + + if sender.send(input).is_err() { + bail!("Failed to send input to differ"); + } + + self.block_range = + (self.block_range.0.min(block_number), self.block_range.1.max(block_number)); + + Ok(()) + } + + pub async fn proved(self) -> anyhow::Result<(Proof, ProgramInput, (u64, u64))> { + let (proof, input) = self.root_task.await?; + Ok((proof, input, self.block_range)) + } + + pub async fn merge( + inputs: Vec, + world: FieldElement, + prover: ProverIdentifier, + ) -> anyhow::Result<(Proof, ProgramInput)> { + let mut scheduler = Scheduler::new(inputs.len(), world, prover); + let number_of_inputs = inputs.len(); + trace!(target: LOG_TARGET, number_of_inputs, "Pushing inputs to scheduler"); + for input in inputs { + scheduler.push_diff(input)?; + } + info!(target: LOG_TARGET, number_of_inputs, "inputs pushed to scheduler"); + let (merged_proof, merged_input, _) = scheduler.proved().await?; + Ok((merged_proof, merged_input)) + } + + pub async fn query(&mut self, block_number: u64) -> anyhow::Result { + while !self.update_channel.is_empty() { + let (block_number, state) = + self.update_channel.recv().await.context("Failed to recv")?; + + match state { + ProvingState::Proved => { + if let Some((_, s)) = + self.proving_tasks.iter_mut().find(|(n, _)| *n == block_number) + { + *s = ProvingState::Proved; + } else { + bail!("Block number {} was not found in proving tasks", block_number); + } + } + ProvingState::Proving => { + self.proving_tasks.push((block_number, ProvingState::Proved)); + } + _ => { + unreachable!("Update should be either Proving or Proved"); + } + } + } + + match self.proving_tasks.iter().find(|(n, _)| *n == block_number) { + Some((_, s)) => Ok(*s), + None => Ok(ProvingState::NotPushed), + } + } +} + +#[derive(serde::Serialize, serde::Deserialize)] +struct CombinedInputs { + earlier: ProgramInput, + later: ProgramInput, +} + +async fn combine_proofs( + first: Proof, + second: Proof, + prover: ProverIdentifier, + state_updates1: StateUpdates, + state_updates2: StateUpdates, + world: FieldElement, + number_of_inputs: usize, +) -> anyhow::Result { + let ExtractOutputResult { program_output: program_output1, program_output_hash: _ } = + extract_output(&first)?; + let ExtractOutputResult { program_output: program_output2, program_output_hash: _ } = + extract_output(&second)?; + + let earlier_input = + program_input_from_program_output(program_output1, state_updates1, world).unwrap(); + let later_input = + program_input_from_program_output(program_output2, state_updates2, world).unwrap(); + + let world = format!("{:x}", world); + trace!(target: LOG_TARGET, number_of_inputs, world, "Merging proofs"); + + let prover_input = + serde_json::to_string(&CombinedInputs { earlier: earlier_input, later: later_input })?; + + let merged_proof = prove_diff(prover_input, prover, ProveProgram::Merger).await?; + + Ok(merged_proof) +} + +/// Handles the recursive proving of blocks using asynchronous futures. +/// Returns a proof string asynchronously. +/// It returns a BoxFuture to allow for dynamic dispatch of futures, useful in recursive async +/// calls. +fn prove_recursively( + mut inputs: Vec>, + world: FieldElement, + prover: ProverIdentifier, + update_channel: mpsc::Sender<(u64, ProvingState)>, +) -> BoxFuture<'static, anyhow::Result<(Proof, ProgramInput)>> { + let handle = tokio::spawn(async move { + if inputs.len() == 1 { + let mut input = inputs.pop().unwrap().await.unwrap(); + input.fill_da(world); + let block_number = input.block_number; + trace!(target: LOG_TARGET, block_number, "Proving block"); + update_channel.send((block_number, ProvingState::Proving)).await.unwrap(); + + let prover_input = serde_json::to_string(&input.clone()).unwrap(); + let proof = prove_diff(prover_input, prover, ProveProgram::Differ).await?; + + info!(target: LOG_TARGET, block_number, "Block proven"); + update_channel.send((block_number, ProvingState::Proved)).await.unwrap(); + Ok((proof, input)) + } else { + let proof_count = inputs.len(); + let last = inputs.split_off(proof_count / 2); + + let provers = (prover.clone(), prover.clone()); + + let second_update_sender = update_channel.clone(); + let (earlier_result, later_result) = tokio::try_join!( + tokio::spawn(async move { + prove_recursively(inputs, world, provers.0, update_channel).await + }), + tokio::spawn(async move { + prove_recursively(last, world, provers.1, second_update_sender).await + }), + )?; + + let ((earlier_result, earlier_input), (later_result, later_input)) = + (earlier_result?, later_result?); + + let input = earlier_input.clone().combine(later_input.clone())?; + let merged_proofs = combine_proofs( + earlier_result, + later_result, + prover, + earlier_input.state_updates, + later_input.state_updates, + world, + proof_count, + ) + .await?; + + let first_proven = earlier_input.block_number; + info!(target: LOG_TARGET, first_proven, proof_count, "Merged proofs"); + Ok((merged_proofs, input)) + } + }); + + async move { handle.await? }.boxed() +} diff --git a/crates/saya/core/src/prover/state_diff.rs b/crates/saya/core/src/prover/state_diff.rs index 0c766b646e..2155688533 100644 --- a/crates/saya/core/src/prover/state_diff.rs +++ b/crates/saya/core/src/prover/state_diff.rs @@ -1,4 +1,3 @@ -use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; use starknet::core::types::FieldElement; @@ -55,64 +54,6 @@ pub const EXAMPLE_KATANA_DIFF: &str = r#"{ } }"#; -pub fn state_updates_to_json_like(state_updates: &StateUpdates, world: FieldElement) -> String { - let mut result = String::new(); - - result.push_str(&format!(r#""nonce_updates":{}"#, "{")); - let nonce_updates = state_updates - .nonce_updates - .iter() - .map(|(k, v)| format!(r#""{}":{}"#, k.0, v)) - .collect::>() - .join(","); - result.push_str(&format!("{}{}", nonce_updates, "}")); - - result.push_str(&format!(r#","storage_updates":{}"#, "{")); - let storage_updates = state_updates - .storage_updates - .iter() - .map(|(k, v)| { - let storage = - v.iter().map(|(k, v)| format!(r#""{}":{}"#, k, v)).collect::>().join(","); - - format!(r#""{}":{{{}}}"#, k.0, storage) - }) - .collect::>() - .join(","); - result.push_str(&format!("{}{}", storage_updates, "}")); - - result.push_str(&format!(r#","contract_updates":{}"#, "{")); - let contract_updates = state_updates - .contract_updates - .iter() - .map(|(k, v)| format!(r#""{}":{}"#, k.0, v)) - .collect::>() - .join(","); - result.push_str(&format!("{}{}", contract_updates, "}")); - - result.push_str(&format!(r#","declared_classes":{}"#, "{")); - let declared_classes = state_updates - .declared_classes - .iter() - .map(|(k, v)| format!(r#""{}":{}"#, k, v)) - .collect::>() - .join(","); - - result.push_str(&format!("{}{}", declared_classes, "}")); - - result.push_str(r#","world_da":"#); - let storage = - if let Some(storage) = state_updates.storage_updates.get(&ContractAddress::from(world)) { - storage.iter().map(|(k, v)| format!("{},{}", k, v)).collect::>().join(",") - } else { - String::new() - }; - - result.push_str(&format!("[{}]", storage)); - - result -} - /// We need custom implementation because of dynamic keys in json impl ProvedStateDiff { pub fn serialize(&self) -> String { diff --git a/crates/saya/core/src/prover/stone_image.rs b/crates/saya/core/src/prover/stone_image.rs index c5ad5de5d9..b6d3e655d0 100644 --- a/crates/saya/core/src/prover/stone_image.rs +++ b/crates/saya/core/src/prover/stone_image.rs @@ -1,3 +1,4 @@ +use std::fs::File; use std::process::Stdio; use anyhow::{bail, Context}; @@ -5,22 +6,27 @@ use async_trait::async_trait; use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}; use tokio::process::Command; use tokio::sync::OnceCell; -use tracing::warn; +use tracing::trace; -use super::{ProverClient, ProverIdentifier}; +use super::{ProveProgram, ProverClient, ProverIdentifier}; +use crate::prover::loader::prepare_input_cairo0; +use crate::LOG_TARGET; + +const PROVER_IMAGE: &str = "neotheprogramist/stone-cairo0:latest"; #[derive(Clone)] pub struct StoneProver(pub String); -pub async fn prove_stone(input: String) -> anyhow::Result { +pub async fn prove_stone(input: String, prove_program: ProveProgram) -> anyhow::Result { let prover = StoneProver::new().await?; - prover.prove(input).await -} + trace!(target: LOG_TARGET, "Proving with cairo0."); -pub async fn local_verify(input: String) -> anyhow::Result { - let prover = StoneProver::new().await?; - prover.local_verify(input).await?; - Ok(String::from("ok")) + let input = prepare_input_cairo0(input, prove_program).await?; + let input = serde_json::to_string(&input).context("Failed to serialize input")?; + + std::io::Write::write_all(&mut File::create("input.json")?, input.as_bytes())?; + + prover.prove(input).await.context("Failed to prove using the http prover") } #[async_trait] @@ -35,47 +41,26 @@ impl ProverClient for StoneProver { run(command, Some(input)).await } - - async fn local_verify(&self, proof: String) -> anyhow::Result<()> { - let mut command = Command::new("podman"); - command.arg("run").arg("-i").arg("--rm").arg("verifier"); - - run(command, Some(proof)).await?; - - Ok(()) - } } impl StoneProver { async fn new() -> anyhow::Result { - static STONE_PROVER: OnceCell<(anyhow::Result, anyhow::Result)> = - OnceCell::const_new(); - - let source = "piniom/state-diff-commitment"; - let verifier = "piniom/verifier:latest"; + static STONE_PROVER: OnceCell> = OnceCell::const_new(); let result = STONE_PROVER .get_or_init(|| async { let mut command = Command::new("podman"); - command.arg("pull").arg(format!("docker.io/{}", source)); - - let mut verifier_command = Command::new("podman"); - verifier_command.arg("pull").arg(format!("docker.io/{}", verifier)); + command.arg("pull").arg(format!("docker.io/{}", PROVER_IMAGE)); - ( - run(command, None).await.context("Failed to pull prover"), - run(verifier_command, None).await.context("Failed to pull prover"), - ) + run(command, None).await.context("Failed to pull prover") }) .await; - if result.0.is_err() { + if result.is_err() { bail!("Failed to pull prover"); - } else if result.1.is_err() { - warn!("Failed to pull verifier"); } - Ok(StoneProver(source.to_string())) + Ok(StoneProver(PROVER_IMAGE.to_string())) } } diff --git a/crates/saya/core/src/verifier/mod.rs b/crates/saya/core/src/verifier/mod.rs index 83edf92b64..28323f3e30 100644 --- a/crates/saya/core/src/verifier/mod.rs +++ b/crates/saya/core/src/verifier/mod.rs @@ -23,7 +23,7 @@ pub enum VerifierIdentifier { pub async fn verify( verifier: VerifierIdentifier, serialized_proof: Vec, -) -> anyhow::Result { +) -> anyhow::Result<(String, FieldElement)> { match verifier { VerifierIdentifier::HerodotusStarknetSepolia(fact_registry_address) => { starknet::starknet_verify(fact_registry_address, serialized_proof).await diff --git a/crates/saya/core/src/verifier/starknet.rs b/crates/saya/core/src/verifier/starknet.rs index 1a99132dd4..f948336575 100644 --- a/crates/saya/core/src/verifier/starknet.rs +++ b/crates/saya/core/src/verifier/starknet.rs @@ -1,5 +1,6 @@ use std::time::Duration; +use anyhow::Context; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use starknet::accounts::{Account, Call, ConnectedAccount}; @@ -13,17 +14,19 @@ use crate::dojo_os::STARKNET_ACCOUNT; pub async fn starknet_verify( fact_registry_address: FieldElement, serialized_proof: Vec, -) -> anyhow::Result { +) -> anyhow::Result<(String, FieldElement)> { let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; + let nonce = STARKNET_ACCOUNT.get_nonce().await?; let tx = STARKNET_ACCOUNT .execute(vec![Call { to: fact_registry_address, selector: get_selector_from_name("verify_and_register_fact").expect("invalid selector"), calldata: serialized_proof, }]) + .nonce(nonce) .send_with_cfg(&txn_config) .await - .unwrap(); + .context("Failed to send `verify_and_register_fact` transaction.")?; let start_fetching = std::time::Instant::now(); let wait_for = Duration::from_secs(60); @@ -64,5 +67,5 @@ pub async fn starknet_verify( } } - Ok(format!("{:#x}", tx.transaction_hash)) + Ok((format!("{:#x}", tx.transaction_hash), nonce)) } diff --git a/crates/sozo/ops/src/events.rs b/crates/sozo/ops/src/events.rs index 73ae19d7fa..b567157201 100644 --- a/crates/sozo/ops/src/events.rs +++ b/crates/sozo/ops/src/events.rs @@ -265,7 +265,7 @@ mod tests { let result = extract_events(&manifest, &manifest_dir).unwrap(); // we are just collecting all events from manifest file so just verifying count should work - assert_eq!(result.len(), 14); + assert_eq!(result.len(), 15); } #[test] diff --git a/crates/sozo/ops/src/model.rs b/crates/sozo/ops/src/model.rs index fd11cec2dd..1bfe108e96 100644 --- a/crates/sozo/ops/src/model.rs +++ b/crates/sozo/ops/src/model.rs @@ -90,6 +90,10 @@ pub async fn model_get( world_address: FieldElement, provider: JsonRpcClient, ) -> Result<()> { + if keys.is_empty() { + anyhow::bail!("Models always have at least one key. Please provide it (or them)."); + } + let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml index f80ccef0d2..2555ec3eda 100644 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" -original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 8a1e9613e9..e8b10f51c5 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -25,4 +25,4 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309" +world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json index 63207ddec9..c1a2447839 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json @@ -555,6 +555,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -573,7 +577,19 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", "inputs": [ { "name": "program_hash", @@ -585,7 +601,18 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -831,7 +858,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -859,8 +898,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json index 63207ddec9..c1a2447839 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json @@ -555,6 +555,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -573,7 +577,19 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", "inputs": [ { "name": "program_hash", @@ -585,7 +601,18 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -831,7 +858,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -859,8 +898,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml index f80ccef0d2..2555ec3eda 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml @@ -1,5 +1,5 @@ kind = "Class" -class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" -original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/base/dojo_world_world.json" name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 404bf0f8b6..76d212df2e 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f", - "original_class_hash": "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f", + "class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "original_class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", "abi": [ { "type": "impl", @@ -560,6 +560,10 @@ { "name": "program_output", "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" } ], "outputs": [], @@ -578,7 +582,19 @@ "items": [ { "type": "function", - "name": "set_program_hash", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", "inputs": [ { "name": "program_hash", @@ -590,7 +606,18 @@ }, { "type": "function", - "name": "get_program_hash", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", "inputs": [], "outputs": [ { @@ -836,7 +863,19 @@ }, { "type": "event", - "name": "dojo::config::component::Config::ProgramHashUpdate", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "struct", "members": [ { @@ -864,8 +903,13 @@ "kind": "enum", "variants": [ { - "name": "ProgramHashUpdate", - "type": "dojo::config::component::Config::ProgramHashUpdate", + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", "kind": "nested" }, { @@ -955,8 +999,8 @@ ] } ], - "address": "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309", - "transaction_hash": "0x7106054ad5c4ccfcd5e512d286ce7cadc5ddc21b8cf058e4daab09743bace76", + "address": "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30", + "transaction_hash": "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -975,7 +1019,7 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x263f89fc2bdf121a3bdcc9af35eb6b3d5c078f9bcc257e9f5627af81a7607fd", + "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", "class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", "original_class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", @@ -1280,7 +1324,7 @@ }, { "kind": "DojoContract", - "address": "0x2dc27292cc94aa40e4d2d327e511ce02e96f40ca3c41d1f9938860a1a4aee9f", + "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index ccc078a545..7dc49eadca 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" -original_class_hash = "0xf6f44afb3cacbcc01a371aff62c86ca9a45feba065424c99f7cd8637514d8f" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x2e31cfde9f9990c7fe44b25043e3c6958a849c0a66ab535686d2b710e97f309" -transaction_hash = "0x7106054ad5c4ccfcd5e512d286ce7cadc5ddc21b8cf058e4daab09743bace76" +address = "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" +transaction_hash = "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d" block_number = 3 seed = "dojo_examples" name = "dojo::world::world" @@ -21,7 +21,7 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" -address = "0x263f89fc2bdf121a3bdcc9af35eb6b3d5c078f9bcc257e9f5627af81a7607fd" +address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" @@ -37,7 +37,7 @@ name = "dojo_examples::actions::actions" [[contracts]] kind = "DojoContract" -address = "0x2dc27292cc94aa40e4d2d327e511ce02e96f40ca3c41d1f9938860a1a4aee9f" +address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" From 4f94695f3a547220264bb36f244881be12c49f5c Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:48:36 -0400 Subject: [PATCH 19/88] feat(spawn-and-move): modify example to take use of new layout for offchain msg (#2042) * feat(spawn-and-move): modify exmaple to take use of new layout for offchain msg * refactor: rename EmoteMessage to Message * chore; remove old emotemessage manifests * feat: add salt to offchain message * chore: fmt and manifests * fix: tests * fix: remove old abi file --------- Co-authored-by: glihm --- crates/dojo-bindgen/src/lib.rs | 6 +- ...json => dojo_examples_models_message.json} | 50 +++++-------- ...json => dojo_examples_models_message.json} | 50 +++++-------- .../dojo_examples_models_emote_message.toml | 15 ---- .../models/dojo_examples_models_message.toml | 25 +++++++ .../manifests/dev/manifest.json | 70 ++++++++----------- .../manifests/dev/manifest.toml | 22 ++++-- examples/spawn-and-move/src/models.cairo | 19 ++--- 8 files changed, 114 insertions(+), 143 deletions(-) rename examples/spawn-and-move/manifests/dev/abis/base/models/{dojo_examples_models_emote_message.json => dojo_examples_models_message.json} (90%) rename examples/spawn-and-move/manifests/dev/abis/deployments/models/{dojo_examples_models_emote_message.json => dojo_examples_models_message.json} (90%) delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index 3b25f4528d..5dfc2ff265 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -273,9 +273,9 @@ mod tests { assert_eq!(moves.name, "Moves"); assert_eq!(moves.qualified_path, "dojo_examples::models::Moves"); - let moved = data.models.get("EmoteMessage").unwrap(); - assert_eq!(moved.name, "EmoteMessage"); - assert_eq!(moved.qualified_path, "dojo_examples::models::EmoteMessage"); + let moved = data.models.get("Message").unwrap(); + assert_eq!(moved.name, "Message"); + assert_eq!(moved.qualified_path, "dojo_examples::models::Message"); let player_config = data.models.get("PlayerConfig").unwrap(); assert_eq!(player_config.name, "PlayerConfig"); diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_emote_message.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json similarity index 90% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_emote_message.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json index 9c63d0fc5d..ec760c99fb 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_emote_message.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json @@ -319,52 +319,34 @@ }, { "type": "impl", - "name": "emote_messageImpl", - "interface_name": "dojo_examples::models::Iemote_message" - }, - { - "type": "enum", - "name": "dojo_examples::models::Emote", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Happy", - "type": "()" - }, - { - "name": "Sad", - "type": "()" - }, - { - "name": "Angry", - "type": "()" - }, - { - "name": "Love", - "type": "()" - } - ] + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" }, { "type": "struct", - "name": "dojo_examples::models::EmoteMessage", + "name": "dojo_examples::models::Message", "members": [ { "name": "identity", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "emote", - "type": "dojo_examples::models::Emote" + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iemote_message", + "name": "dojo_examples::models::Imessage", "items": [ { "type": "function", @@ -372,7 +354,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::EmoteMessage" + "type": "dojo_examples::models::Message" } ], "outputs": [], @@ -382,7 +364,7 @@ }, { "type": "event", - "name": "dojo_examples::models::emote_message::Event", + "name": "dojo_examples::models::message::Event", "kind": "enum", "variants": [] } diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json similarity index 90% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json index 9c63d0fc5d..ec760c99fb 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json @@ -319,52 +319,34 @@ }, { "type": "impl", - "name": "emote_messageImpl", - "interface_name": "dojo_examples::models::Iemote_message" - }, - { - "type": "enum", - "name": "dojo_examples::models::Emote", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Happy", - "type": "()" - }, - { - "name": "Sad", - "type": "()" - }, - { - "name": "Angry", - "type": "()" - }, - { - "name": "Love", - "type": "()" - } - ] + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" }, { "type": "struct", - "name": "dojo_examples::models::EmoteMessage", + "name": "dojo_examples::models::Message", "members": [ { "name": "identity", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "emote", - "type": "dojo_examples::models::Emote" + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iemote_message", + "name": "dojo_examples::models::Imessage", "items": [ { "type": "function", @@ -372,7 +354,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::EmoteMessage" + "type": "dojo_examples::models::Message" } ], "outputs": [], @@ -382,7 +364,7 @@ }, { "type": "event", - "name": "dojo_examples::models::emote_message::Event", + "name": "dojo_examples::models::message::Event", "kind": "enum", "variants": [] } diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml deleted file mode 100644 index 3dfeddaf7b..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_emote_message.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" -original_class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" -abi = "manifests/dev/abis/base/models/dojo_examples_models_emote_message.json" -name = "dojo_examples::models::emote_message" - -[[members]] -name = "identity" -type = "ContractAddress" -key = true - -[[members]] -name = "emote" -type = "Emote" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml new file mode 100644 index 0000000000..15ad89aace --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml @@ -0,0 +1,25 @@ +kind = "DojoModel" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/dev/abis/base/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" + +[[members]] +name = "identity" +type = "ContractAddress" +key = true + +[[members]] +name = "channel" +type = "felt252" +key = true + +[[members]] +name = "message" +type = "ByteArray" +key = false + +[[members]] +name = "salt" +type = "felt252" +key = true diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 76d212df2e..ecf5e24f79 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1902,13 +1902,23 @@ "key": true }, { - "name": "emote", - "type": "Emote", + "name": "channel", + "type": "felt252", + "key": true + }, + { + "name": "message", + "type": "ByteArray", "key": false + }, + { + "name": "salt", + "type": "felt252", + "key": true } ], - "class_hash": "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5", - "original_class_hash": "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5", + "class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "original_class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", "abi": [ { "type": "impl", @@ -2230,52 +2240,34 @@ }, { "type": "impl", - "name": "emote_messageImpl", - "interface_name": "dojo_examples::models::Iemote_message" - }, - { - "type": "enum", - "name": "dojo_examples::models::Emote", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Happy", - "type": "()" - }, - { - "name": "Sad", - "type": "()" - }, - { - "name": "Angry", - "type": "()" - }, - { - "name": "Love", - "type": "()" - } - ] + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" }, { "type": "struct", - "name": "dojo_examples::models::EmoteMessage", + "name": "dojo_examples::models::Message", "members": [ { "name": "identity", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "emote", - "type": "dojo_examples::models::Emote" + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iemote_message", + "name": "dojo_examples::models::Imessage", "items": [ { "type": "function", @@ -2283,7 +2275,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::EmoteMessage" + "type": "dojo_examples::models::Message" } ], "outputs": [], @@ -2293,12 +2285,12 @@ }, { "type": "event", - "name": "dojo_examples::models::emote_message::Event", + "name": "dojo_examples::models::message::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::emote_message" + "name": "dojo_examples::models::message" }, { "kind": "DojoModel", diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 7dc49eadca..0e32561e97 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -71,10 +71,10 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" -original_class_hash = "0x6ec8bf0a073e509e5b442ee5d4bee75aa85b87671a110dff2b9e6a58cc2aaa5" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_emote_message.json" -name = "dojo_examples::models::emote_message" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/dev/abis/deployments/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" [[models.members]] name = "identity" @@ -82,10 +82,20 @@ type = "ContractAddress" key = true [[models.members]] -name = "emote" -type = "Emote" +name = "channel" +type = "felt252" +key = true + +[[models.members]] +name = "message" +type = "ByteArray" key = false +[[models.members]] +name = "salt" +type = "felt252" +key = true + [[models]] kind = "DojoModel" class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" diff --git a/examples/spawn-and-move/src/models.cairo b/examples/spawn-and-move/src/models.cairo index e04859bdf4..a0b733e28c 100644 --- a/examples/spawn-and-move/src/models.cairo +++ b/examples/spawn-and-move/src/models.cairo @@ -21,21 +21,16 @@ impl DirectionIntoFelt252 of Into { } } -#[derive(Serde, Copy, Drop, Introspect)] -enum Emote { - None, - Happy, - Sad, - Angry, - Love, -} - -#[derive(Copy, Drop, Serde)] +#[derive(Drop, Serde)] #[dojo::model] -struct EmoteMessage { +struct Message { #[key] identity: ContractAddress, - emote: Emote, + #[key] + channel: felt252, + message: ByteArray, + #[key] + salt: felt252 } #[derive(Copy, Drop, Serde)] From bc35dd0b1a7ea0ccb0bdb17583ef89c6c6b90d58 Mon Sep 17 00:00:00 2001 From: glihm Date: Tue, 11 Jun 2024 21:55:51 -0600 Subject: [PATCH 20/88] [dev] add foundry tools to the dev container (#2045) * feat: add foundry install * fix: attempt a new path for bashrc * fix: use dot as we're in shell instead of source --- .devcontainer/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8c8d028a18..ed7155c5c1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -17,6 +17,8 @@ RUN curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gp RUN echo "deb http://apt.llvm.org/${VARIANT}/ llvm-toolchain-${VARIANT}-17 main" | tee /etc/apt/sources.list.d/llvm.list && apt-get update RUN apt-get -y install -t llvm-toolchain-${VARIANT}-17 llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools +RUN curl -L https://foundry.paradigm.xyz/ | bash && . /root/.bashrc && foundryup + # To build Katana with 'native' feature, we need to set the following environment variables ENV MLIR_SYS_170_PREFIX=/usr/lib/llvm-17 ENV LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 From b91c7f3a4176cef5355c97c1f3f4de06ef9d6629 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:56:05 -0400 Subject: [PATCH 21/88] refactor(torii-libp2p): use cainome + integration test (#2044) * feat: use cainome + integration test * fmt * chore: remove unused imports * Update tests.rs --- Cargo.lock | 1 + crates/torii/libp2p/Cargo.toml | 1 + crates/torii/libp2p/src/server/mod.rs | 85 -------------- crates/torii/libp2p/src/tests.rs | 161 +++++++++++++++++++------- crates/torii/libp2p/src/typed_data.rs | 66 +++-------- 5 files changed, 138 insertions(+), 176 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96465fc1ff..667854d1df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14268,6 +14268,7 @@ version = "0.7.0-alpha.5" dependencies = [ "anyhow", "async-trait", + "cainome", "chrono", "crypto-bigint", "dojo-test-utils", diff --git a/crates/torii/libp2p/Cargo.toml b/crates/torii/libp2p/Cargo.toml index d95c0ff66a..08c0472988 100644 --- a/crates/torii/libp2p/Cargo.toml +++ b/crates/torii/libp2p/Cargo.toml @@ -26,6 +26,7 @@ starknet.workspace = true thiserror.workspace = true tracing-subscriber = { version = "0.3", features = [ "env-filter" ] } tracing.workspace = true +cainome.workspace = true [dev-dependencies] dojo-test-utils.workspace = true diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index 3562b5a46f..4a78db033b 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -20,7 +20,6 @@ use libp2p::swarm::{NetworkBehaviour, SwarmEvent}; use libp2p::{identify, identity, noise, ping, relay, tcp, yamux, PeerId, Swarm, Transport}; use libp2p_webrtc as webrtc; use rand::thread_rng; -use serde_json::Number; use starknet::core::types::{BlockId, BlockTag, FunctionCall}; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; @@ -692,90 +691,6 @@ fn read_or_create_certificate(path: &Path) -> anyhow::Result { Ok(cert) } -// Deprecated. These should be potentially removed. As Ty -> TypedData is now done -// on the SDKs side -pub fn parse_ty_to_object(ty: &Ty) -> Result, Error> { - match ty { - Ty::Struct(struct_ty) => { - let mut object = IndexMap::new(); - for member in &struct_ty.children { - let mut member_object = IndexMap::new(); - member_object.insert("key".to_string(), PrimitiveType::Bool(member.key)); - member_object.insert( - "type".to_string(), - PrimitiveType::String(ty_to_string_type(&member.ty)), - ); - member_object.insert("value".to_string(), parse_ty_to_primitive(&member.ty)?); - object.insert(member.name.clone(), PrimitiveType::Object(member_object)); - } - Ok(object) - } - _ => Err(Error::InvalidMessageError("Expected Struct type".to_string())), - } -} - -pub fn ty_to_string_type(ty: &Ty) -> String { - match ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(_) => "u8".to_string(), - Primitive::U16(_) => "u16".to_string(), - Primitive::U32(_) => "u32".to_string(), - Primitive::USize(_) => "usize".to_string(), - Primitive::U64(_) => "u64".to_string(), - Primitive::U128(_) => "u128".to_string(), - Primitive::U256(_) => "u256".to_string(), - Primitive::Felt252(_) => "felt252".to_string(), - Primitive::ClassHash(_) => "class_hash".to_string(), - Primitive::ContractAddress(_) => "contract_address".to_string(), - Primitive::Bool(_) => "bool".to_string(), - }, - Ty::Struct(_) => "struct".to_string(), - Ty::Tuple(_) => "tuple".to_string(), - Ty::Array(_) => "array".to_string(), - Ty::ByteArray(_) => "bytearray".to_string(), - Ty::Enum(_) => "enum".to_string(), - } -} - -pub fn parse_ty_to_primitive(ty: &Ty) -> Result { - match ty { - Ty::Primitive(primitive) => match primitive { - Primitive::U8(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U16(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U32(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::USize(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v as u64).unwrap_or(0u64)))) - } - Primitive::U64(value) => { - Ok(PrimitiveType::Number(Number::from(value.map(|v| v).unwrap_or(0u64)))) - } - Primitive::U128(value) => Ok(PrimitiveType::String( - value.map(|v| v.to_string()).unwrap_or_else(|| "0".to_string()), - )), - Primitive::U256(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::Felt252(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::ClassHash(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::ContractAddress(value) => Ok(PrimitiveType::String( - value.map(|v| format!("{:#x}", v)).unwrap_or_else(|| "0".to_string()), - )), - Primitive::Bool(value) => Ok(PrimitiveType::Bool(value.unwrap_or(false))), - }, - _ => Err(Error::InvalidMessageError("Expected Primitive type".to_string())), - } -} - #[cfg(test)] mod tests { use tempfile::tempdir; diff --git a/crates/torii/libp2p/src/tests.rs b/crates/torii/libp2p/src/tests.rs index 3d0e5581be..7db5ab677b 100644 --- a/crates/torii/libp2p/src/tests.rs +++ b/crates/torii/libp2p/src/tests.rs @@ -268,20 +268,25 @@ mod test { #[cfg(not(target_arch = "wasm32"))] #[tokio::test] async fn test_client_messaging() -> Result<(), Box> { + use std::time::Duration; + use dojo_test_utils::sequencer::{ get_default_test_starknet_config, SequencerConfig, TestSequencer, }; use dojo_types::schema::{Member, Struct, Ty}; + use dojo_world::contracts::abi::model::Layout; use indexmap::IndexMap; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; + use starknet::signers::SigningKey; use starknet_crypto::FieldElement; + use tokio::select; use tokio::time::sleep; use torii_core::sql::Sql; - use crate::server::{parse_ty_to_object, Relay}; - use crate::typed_data::{Domain, TypedData}; + use crate::server::Relay; + use crate::typed_data::{Domain, Field, SimpleField, TypedData}; use crate::types::Message; let _ = tracing_subscriber::fmt() @@ -300,7 +305,36 @@ mod test { .await; let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); - let db = Sql::new(pool.clone(), FieldElement::from_bytes_be(&[0; 32]).unwrap()).await?; + let account = sequencer.raw_account(); + + let mut db = Sql::new(pool.clone(), FieldElement::from_bytes_be(&[0; 32]).unwrap()).await?; + + // Register the model of our Message + db.register_model( + Ty::Struct(Struct { + name: "Message".to_string(), + children: vec![ + Member { + name: "identity".to_string(), + ty: Ty::Primitive(Primitive::ContractAddress(None)), + key: true, + }, + Member { + name: "message".to_string(), + ty: Ty::ByteArray("".to_string()), + key: false, + }, + ], + }), + Layout::Fixed(vec![]), + FieldElement::ZERO, + FieldElement::ZERO, + 0, + 0, + 0, + ) + .await + .unwrap(); // Initialize the relay server let mut relay_server = Relay::new(db, provider, 9900, 9901, None, None)?; @@ -314,27 +348,57 @@ mod test { client.event_loop.lock().await.run().await; }); - let mut data = Struct { name: "Message".to_string(), children: vec![] }; - - data.children.push(Member { - name: "player".to_string(), - ty: dojo_types::schema::Ty::Primitive( - dojo_types::primitive::Primitive::ContractAddress(Some( - FieldElement::from_bytes_be(&[0; 32]).unwrap(), - )), - ), - key: true, - }); - - data.children.push(Member { - name: "message".to_string(), - ty: dojo_types::schema::Ty::Primitive(dojo_types::primitive::Primitive::U8(Some(0))), - key: false, - }); - let mut typed_data = TypedData::new( - IndexMap::new(), - "Message", + IndexMap::from_iter(vec![ + ( + "OffchainMessage".to_string(), + vec![ + Field::SimpleType(SimpleField { + name: "model".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "Message".to_string(), + r#type: "Model".to_string(), + }), + ], + ), + ( + "Model".to_string(), + vec![ + Field::SimpleType(SimpleField { + name: "identity".to_string(), + r#type: "ContractAddress".to_string(), + }), + Field::SimpleType(SimpleField { + name: "message".to_string(), + r#type: "string".to_string(), + }), + ], + ), + ( + "StarknetDomain".to_string(), + vec![ + Field::SimpleType(SimpleField { + name: "name".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "version".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "chainId".to_string(), + r#type: "shortstring".to_string(), + }), + Field::SimpleType(SimpleField { + name: "revision".to_string(), + r#type: "shortstring".to_string(), + }), + ], + ), + ]), + "OffchainMessage", Domain::new("Message", "1", "0x0", Some("1")), IndexMap::new(), ); @@ -346,37 +410,50 @@ mod test { typed_data.message.insert( "Message".to_string(), crate::typed_data::PrimitiveType::Object( - parse_ty_to_object(&Ty::Struct(data.clone())).unwrap(), + vec![ + ( + "identity".to_string(), + crate::typed_data::PrimitiveType::String( + account.account_address.to_string(), + ), + ), + ( + "message".to_string(), + crate::typed_data::PrimitiveType::String("mimi".to_string()), + ), + ] + .into_iter() + .collect(), ), ); + let message_hash = typed_data.encode(account.account_address).unwrap(); + let signature = + SigningKey::from_secret_scalar(account.private_key).sign(&message_hash).unwrap(); + client .command_sender .publish(Message { message: typed_data, - signature_r: FieldElement::from_bytes_be(&[0; 32]).unwrap(), - signature_s: FieldElement::from_bytes_be(&[0; 32]).unwrap(), + signature_r: signature.r, + signature_s: signature.s, }) .await?; sleep(std::time::Duration::from_secs(2)).await; - Ok(()) - // loop { - // select! { - // entity = sqlx::query("SELECT * FROM entities WHERE id = ?") - // .bind(format!("{:#x}", FieldElement::from_bytes_be(&[0; - // 32]).unwrap())).fetch_one(&pool) => { if let Ok(_) = entity { - // println!("Test OK: Received message within 5 seconds."); - // return Ok(()); - // } - // } - // _ = sleep(Duration::from_secs(5)) => { - // println!("Test Failed: Did not receive message within 5 seconds."); - // return Err("Timeout reached without receiving a message".into()); - // } - // } - // } + loop { + select! { + entity = sqlx::query("SELECT * FROM entities").fetch_one(&pool) => if entity.is_ok() { + println!("Test OK: Received message within 5 seconds."); + return Ok(()); + }, + _ = sleep(Duration::from_secs(5)) => { + println!("Test Failed: Did not receive message within 5 seconds."); + return Err("Timeout reached without receiving a message".into()); + } + } + } } #[cfg(target_arch = "wasm32")] diff --git a/crates/torii/libp2p/src/typed_data.rs b/crates/torii/libp2p/src/typed_data.rs index dc752f751b..733c7ca29d 100644 --- a/crates/torii/libp2p/src/typed_data.rs +++ b/crates/torii/libp2p/src/typed_data.rs @@ -1,11 +1,10 @@ use std::str::FromStr; +use cainome::cairo_serde::ByteArray; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use serde_json::Number; -use starknet::core::utils::{ - cairo_short_string_to_felt, get_selector_from_name, CairoShortStringToFeltError, -}; +use starknet::core::utils::{cairo_short_string_to_felt, get_selector_from_name}; use starknet_crypto::{poseidon_hash_many, FieldElement}; use crate::errors::Error; @@ -176,39 +175,6 @@ pub fn encode_type(name: &str, types: &IndexMap>) -> Result Result<(Vec, FieldElement, usize), CairoShortStringToFeltError> { - let short_strings: Vec<&str> = split_long_string(target_string); - let remainder = short_strings.last().unwrap_or(&""); - - let mut short_strings_encoded = short_strings - .iter() - .map(|&s| cairo_short_string_to_felt(s)) - .collect::, _>>()?; - - let (pending_word, pending_word_length) = if remainder.is_empty() || remainder.len() == 31 { - (FieldElement::ZERO, 0) - } else { - (short_strings_encoded.pop().unwrap(), remainder.len()) - }; - - Ok((short_strings_encoded, pending_word, pending_word_length)) -} - -fn split_long_string(long_str: &str) -> Vec<&str> { - let mut result = Vec::new(); - - let mut start = 0; - while start < long_str.len() { - let end = (start + 31).min(long_str.len()); - result.push(&long_str[start..end]); - start = end; - } - - result -} - #[derive(Debug, Default)] pub struct Ctx { pub base_type: String, @@ -273,7 +239,7 @@ fn get_hex(value: &str) -> Result { } else { // assume its a short string and encode cairo_short_string_to_felt(value) - .map_err(|_| Error::InvalidMessageError("Invalid short string".to_string())) + .map_err(|e| Error::InvalidMessageError(format!("Invalid shortstring for felt: {}", e))) } } @@ -330,8 +296,11 @@ impl PrimitiveType { let type_hash = encode_type(r#type, if ctx.is_preset { preset_types } else { types })?; - hashes.push(get_selector_from_name(&type_hash).map_err(|_| { - Error::InvalidMessageError(format!("Invalid type {} for selector", r#type)) + hashes.push(get_selector_from_name(&type_hash).map_err(|e| { + Error::InvalidMessageError(format!( + "Invalid type {} for selector: {}", + r#type, e + )) })?); for (field_name, value) in obj { @@ -368,24 +337,23 @@ impl PrimitiveType { "shortstring" => get_hex(string), "string" => { // split the string into short strings and encode - let byte_array = byte_array_from_string(string).map_err(|_| { - Error::InvalidMessageError("Invalid short string".to_string()) + let byte_array = ByteArray::from_string(string).map_err(|e| { + Error::InvalidMessageError(format!("Invalid string for bytearray: {}", e)) })?; - let mut hashes = vec![FieldElement::from(byte_array.0.len())]; + let mut hashes = vec![FieldElement::from(byte_array.data.len())]; - for hash in byte_array.0 { - hashes.push(hash); + for hash in byte_array.data { + hashes.push(hash.felt()); } - hashes.push(byte_array.1); - hashes.push(FieldElement::from(byte_array.2)); + hashes.push(byte_array.pending_word); + hashes.push(FieldElement::from(byte_array.pending_word_len)); Ok(poseidon_hash_many(hashes.as_slice())) } - "selector" => get_selector_from_name(string).map_err(|_| { - Error::InvalidMessageError(format!("Invalid type {} for selector", r#type)) - }), + "selector" => get_selector_from_name(string) + .map_err(|e| Error::InvalidMessageError(format!("Invalid selector: {}", e))), "felt" => get_hex(string), "ContractAddress" => get_hex(string), "ClassHash" => get_hex(string), From 9fcd5abd6ac1b5e3f38742f16643e296f849c788 Mon Sep 17 00:00:00 2001 From: glihm Date: Wed, 12 Jun 2024 14:20:13 -0600 Subject: [PATCH 22/88] fix: fix RPC version checking (#2048) --- bin/sozo/src/commands/migrate.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 3acb7f25cb..1bf05338a8 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -201,8 +201,8 @@ fn is_compatible_version(provided_version: &str, expected_version: &str) -> Resu .map_err(|e| anyhow!("Failed to parse expected version '{}': {}", expected_version, e))?; // Specific backward compatibility rule: 0.6 is compatible with 0.7. - if (provided_ver.major == 0 && provided_ver.minor == 6) - && (expected_ver.major == 0 && expected_ver.minor == 7) + if (provided_ver.major == 0 && provided_ver.minor == 7) + && (expected_ver.major == 0 && expected_ver.minor == 6) { return Ok(true); } @@ -235,7 +235,9 @@ mod tests { #[test] fn test_is_compatible_version_specific_backward_compatibility() { - assert!(is_compatible_version("0.6.0", "0.7.1").unwrap()); + let node_version = "0.7.1"; + let katana_version = "0.6.0"; + assert!(is_compatible_version(node_version, katana_version).unwrap()); } #[test] From 1fe04888932ae429b09939dbbebfde79cdfd4ee1 Mon Sep 17 00:00:00 2001 From: glihm Date: Wed, 12 Jun 2024 17:03:57 -0600 Subject: [PATCH 23/88] fix(ci): add missing path to foundry binaries (#2051) fix: add missing path to foundry binaries --- .devcontainer/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ed7155c5c1..66bba6e674 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -18,6 +18,7 @@ RUN echo "deb http://apt.llvm.org/${VARIANT}/ llvm-toolchain-${VARIANT}-17 main" RUN apt-get -y install -t llvm-toolchain-${VARIANT}-17 llvm-17 llvm-17-dev llvm-17-runtime clang-17 clang-tools-17 lld-17 libpolly-17-dev libmlir-17-dev mlir-17-tools RUN curl -L https://foundry.paradigm.xyz/ | bash && . /root/.bashrc && foundryup +ENV PATH="${PATH}:/root/.foundry/bin" # To build Katana with 'native' feature, we need to set the following environment variables ENV MLIR_SYS_170_PREFIX=/usr/lib/llvm-17 From a5f043e39d4cc41da137b0cf20b24a1ebb8b4f77 Mon Sep 17 00:00:00 2001 From: notV4l <122404722+notV4l@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:49:56 +0200 Subject: [PATCH 24/88] [trick] to unlock toriiClient with safari/firefox (#2038) * trick: to unlock toriiClient with safari/firefox * same trick for other subscribers * refactor: send initial stream message directly * chore: avoid sender clone --------- Co-authored-by: Nasr --- crates/torii/grpc/src/client.rs | 32 +++++++++++++++---- .../grpc/src/server/subscriptions/entity.rs | 6 ++++ .../src/server/subscriptions/event_message.rs | 6 ++++ .../src/server/subscriptions/model_diff.rs | 6 ++++ crates/torii/server/src/proxy.rs | 3 +- 5 files changed, 44 insertions(+), 9 deletions(-) diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index 4a11e04777..7f34a60209 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -3,7 +3,7 @@ use std::num::ParseIntError; use futures_util::stream::MapOk; use futures_util::{Stream, StreamExt, TryStreamExt}; -use starknet::core::types::{FromStrError, StateUpdate}; +use starknet::core::types::{FromStrError, StateDiff, StateUpdate}; use starknet_crypto::FieldElement; use crate::proto::world::{ @@ -105,9 +105,9 @@ impl WorldClient { .map_err(Error::Grpc) .map(|res| res.into_inner())?; - Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| { - let entity = res.entity.expect("entity must exist"); - entity.try_into().expect("must able to serialize") + Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| match res.entity { + Some(entity) => entity.try_into().expect("must able to serialize"), + None => Entity { hashed_keys: FieldElement::ZERO, models: vec![] }, })))) } @@ -144,9 +144,11 @@ impl WorldClient { .map_err(Error::Grpc) .map(|res| res.into_inner())?; - Ok(ModelDiffsStreaming(stream.map_ok(Box::new(|res| { - let update = res.model_update.expect("qed; state update must exist"); - TryInto::::try_into(update).expect("must able to serialize") + Ok(ModelDiffsStreaming(stream.map_ok(Box::new(|res| match res.model_update { + Some(update) => { + TryInto::::try_into(update).expect("must able to serialize") + } + None => empty_state_update(), })))) } } @@ -184,3 +186,19 @@ impl Stream for EntityUpdateStreaming { self.0.poll_next_unpin(cx) } } + +fn empty_state_update() -> StateUpdate { + StateUpdate { + block_hash: FieldElement::ZERO, + new_root: FieldElement::ZERO, + old_root: FieldElement::ZERO, + state_diff: StateDiff { + declared_classes: vec![], + deployed_contracts: vec![], + deprecated_declared_classes: vec![], + nonces: vec![], + replaced_classes: vec![], + storage_diffs: vec![], + }, + } +} diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index 1573b5c61f..f9d4ae0d96 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -20,6 +20,7 @@ use torii_core::types::Entity; use tracing::{error, trace}; use crate::proto; +use crate::proto::world::SubscribeEntityResponse; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::entity"; @@ -43,6 +44,11 @@ impl EntityManager { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeEntityResponse { entity: None })).await; + self.subscribers.write().await.insert( id, EntitiesSubscriber { hashed_keys: hashed_keys.iter().cloned().collect(), sender }, diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 736f88c0f9..67cf1cf172 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -20,6 +20,7 @@ use torii_core::types::EventMessage; use tracing::{error, trace}; use crate::proto; +use crate::proto::world::SubscribeEntityResponse; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event_message"; pub struct EventMessagesSubscriber { @@ -42,6 +43,11 @@ impl EventMessageManager { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeEntityResponse { entity: None })).await; + self.subscribers.write().await.insert( id, EventMessagesSubscriber { hashed_keys: hashed_keys.iter().cloned().collect(), sender }, diff --git a/crates/torii/grpc/src/server/subscriptions/model_diff.rs b/crates/torii/grpc/src/server/subscriptions/model_diff.rs index ad257c719c..8e1f4e80cf 100644 --- a/crates/torii/grpc/src/server/subscriptions/model_diff.rs +++ b/crates/torii/grpc/src/server/subscriptions/model_diff.rs @@ -20,6 +20,7 @@ use tracing::{debug, error, trace}; use super::error::SubscriptionError; use crate::proto; +use crate::proto::world::SubscribeModelsResponse; use crate::types::KeysClause; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::model_diff"; @@ -82,6 +83,11 @@ impl StateDiffManager { .flatten() .collect::>(); + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeModelsResponse { model_update: None })).await; + self.subscribers .write() .await diff --git a/crates/torii/server/src/proxy.rs b/crates/torii/server/src/proxy.rs index df9f4e26f5..23539b5d49 100644 --- a/crates/torii/server/src/proxy.rs +++ b/crates/torii/server/src/proxy.rs @@ -17,7 +17,7 @@ use tower::ServiceBuilder; use tower_http::cors::{AllowOrigin, CorsLayer}; use tracing::error; -const DEFAULT_ALLOW_HEADERS: [&str; 12] = [ +const DEFAULT_ALLOW_HEADERS: [&str; 11] = [ "accept", "origin", "content-type", @@ -27,7 +27,6 @@ const DEFAULT_ALLOW_HEADERS: [&str; 12] = [ "x-grpc-timeout", "x-user-agent", "connection", - "upgrade", "sec-websocket-key", "sec-websocket-version", ]; From 78c88e5c4ffaa81134fb95e783c839efddf8e56b Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Thu, 13 Jun 2024 16:16:30 -0400 Subject: [PATCH 25/88] feat(dojo-bindgen): 2d+ arrays, bytearrays and enums serialization (#2028) * refacotr: handle bytearrays in systems * fix: system gen for calldata * chore: correctly map type * fmt * feat: only generate systems (funcs with no outputs) * compare by u8 * remove unused import * feat: add linq * feat: get index helper for new record enums * chore: fmt * refactor: to handle arrays * refactor: bindgen system gen logic * feat: support 2d+ arrays in system codegen * chore: flat map * chore: reset actions --- crates/dojo-bindgen/src/plugins/unity/mod.rs | 263 +++++++++++++++---- 1 file changed, 214 insertions(+), 49 deletions(-) diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index 2827519351..45578f2267 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::path::{Path, PathBuf}; use async_trait::async_trait; -use cainome::parser::tokens::{Composite, CompositeType, Function, Token}; +use cainome::parser::tokens::{Composite, CompositeType, Function, FunctionOutputKind, Token}; use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; @@ -87,6 +87,32 @@ impl UnityPlugin { ) } + fn contract_imports() -> String { + "using System; +using System.Threading.Tasks; +using Dojo; +using Dojo.Starknet; +using UnityEngine; +using dojo_bindings; +using System.Collections.Generic; +using System.Linq; +using Enum = Dojo.Starknet.Enum; +" + .to_string() + } + + fn model_imports() -> String { + "using System; +using Dojo; +using Dojo.Starknet; +using System.Reflection; +using System.Linq; +using System.Collections.Generic; +using Enum = Dojo.Starknet.Enum; +" + .to_string() + } + // Token should be a struct // This will be formatted into a C# struct // using C# and unity SDK types @@ -116,7 +142,8 @@ public struct {} {{ // This will be formatted into a C# enum // Enum is mapped using index of cairo enum fn format_enum(token: &Composite) -> String { - let mut name_with_generics = token.type_name(); + let name = token.type_name(); + let mut name_with_generics = name.clone(); if !token.generic_args.is_empty() { name_with_generics += &format!( "<{}>", @@ -127,7 +154,7 @@ public struct {} {{ let mut result = format!( " // Type definition for `{}` enum -public abstract record {}() {{", +public abstract record {}() : Enum {{", token.type_path, name_with_generics ); @@ -189,21 +216,23 @@ public class {} : ModelInstance {{ // Handles a model definition and its referenced tokens // Will map all structs and enums to C# types // Will format the model into a C# class - fn handle_model(&self, model: &DojoModel, handled_tokens: &mut Vec) -> String { + fn handle_model( + &self, + model: &DojoModel, + handled_tokens: &mut HashMap, + ) -> String { let mut out = String::new(); out += UnityPlugin::generated_header().as_str(); - out += "using System;\n"; - out += "using Dojo;\n"; - out += "using Dojo.Starknet;\n"; + out += UnityPlugin::model_imports().as_str(); let mut model_struct: Option<&Composite> = None; let tokens = &model.tokens; for token in &tokens.structs { - if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + if handled_tokens.contains_key(&token.type_path()) { continue; } - handled_tokens.push(token.to_composite().unwrap().to_owned()); + handled_tokens.insert(token.type_path(), token.to_composite().unwrap().to_owned()); // first index is our model struct if token.type_name() == model.name { @@ -215,11 +244,11 @@ public class {} : ModelInstance {{ } for token in &tokens.enums { - if handled_tokens.iter().any(|t| t.type_name() == token.type_name()) { + if handled_tokens.contains_key(&token.type_path()) { continue; } - handled_tokens.push(token.to_composite().unwrap().to_owned()); + handled_tokens.insert(token.type_path(), token.to_composite().unwrap().to_owned()); out += UnityPlugin::format_enum(token.to_composite().unwrap()).as_str(); } @@ -233,7 +262,145 @@ public class {} : ModelInstance {{ // Formats a system into a C# method used by the contract class // Handled tokens should be a list of all structs and enums used by the contract // Such as a set of referenced tokens from a model - fn format_system(system: &Function, handled_tokens: &[Composite]) -> String { + fn format_system(system: &Function, handled_tokens: &HashMap) -> String { + fn handle_arg_recursive( + arg_name: &str, + token: &Token, + handled_tokens: &HashMap, + // variant name + // if its an enum variant data + enum_variant: Option, + ) -> Vec<( + // formatted arg + String, + // if its an array + bool, + // enum name and variant name + // if its an enum variant data + Option, + )> { + let mapped_type = UnityPlugin::map_type(token); + + match token { + Token::Composite(t) => { + let t = handled_tokens.get(&t.type_path).unwrap_or(t); + + // Need to flatten the struct members. + match t.r#type { + CompositeType::Struct if t.type_name() == "ByteArray" => vec![( + format!("ByteArray.Serialize({}).Select(f => f.Inner)", arg_name), + true, + enum_variant, + )], + CompositeType::Struct => { + let mut tokens = vec![]; + t.inners.iter().for_each(|f| { + tokens.extend(handle_arg_recursive( + &format!("{}.{}", arg_name, f.name), + &f.token, + handled_tokens, + enum_variant.clone(), + )); + }); + + tokens + } + CompositeType::Enum => { + let mut tokens = vec![( + format!("new FieldElement(Enum.GetIndex({})).Inner", arg_name), + false, + enum_variant, + )]; + + t.inners.iter().for_each(|field| { + if let Token::CoreBasic(basic) = &field.token { + // ignore unit type + if basic.type_path == "()" { + return; + } + } + + tokens.extend(handle_arg_recursive( + &format!( + "(({}.{}){}).value", + mapped_type, + field.name.clone(), + arg_name + ), + &if let Token::GenericArg(generic_arg) = &field.token { + let generic_token = t + .generic_args + .iter() + .find(|(name, _)| name == generic_arg) + .unwrap() + .1 + .clone(); + generic_token + } else { + field.token.clone() + }, + handled_tokens, + Some(field.name.clone()), + )) + }); + + tokens + } + CompositeType::Unknown => panic!("Unknown composite type: {:?}", t), + } + } + Token::Array(array) => { + let is_inner_array = matches!(array.inner.as_ref(), Token::Array(_)); + let inner = handle_arg_recursive( + &format!("{arg_name}Item"), + &array.inner, + handled_tokens, + enum_variant.clone(), + ); + + let inners = inner + .into_iter() + .map(|(arg, _, _)| arg) + .collect::>() + .join(", "); + + vec![( + if is_inner_array { + format!( + "{arg_name}.SelectMany({arg_name}Item => new dojo.FieldElement[] \ + {{ }}.Concat({inners}))" + ) + } else { + format!( + "{arg_name}.SelectMany({arg_name}Item => new [] {{ {inners} }})" + ) + }, + true, + enum_variant.clone(), + )] + } + Token::Tuple(tuple) => tuple + .inners + .iter() + .enumerate() + .flat_map(|(idx, token)| { + handle_arg_recursive( + &format!("{}.Item{}", arg_name, idx + 1), + token, + handled_tokens, + enum_variant.clone(), + ) + }) + .collect(), + _ => match mapped_type.as_str() { + "FieldElement" => vec![(format!("{}.Inner", arg_name), false, enum_variant)], + _ => { + vec![(format!("new FieldElement({}).Inner", arg_name), false, enum_variant)] + } + }, + } + } + let args = system .inputs .iter() @@ -244,35 +411,31 @@ public class {} : ModelInstance {{ let calldata = system .inputs .iter() - .map(|arg| { - let token = &arg.1; - let type_name = &arg.0; - - match handled_tokens.iter().find(|t| t.type_name() == token.type_name()) { - Some(t) => { - // Need to flatten the struct members. - match t.r#type { - CompositeType::Struct => t - .inners - .iter() - .map(|field| { - format!("new FieldElement({}.{}).Inner", type_name, field.name) - }) - .collect::>() - .join(",\n "), - _ => { - format!("new FieldElement({}).Inner", type_name) - } + .flat_map(|(name, token)| { + let tokens = handle_arg_recursive(name, token, handled_tokens, None); + + tokens + .iter() + .map(|(arg, is_array, enum_variant)| { + let calldata_op = if *is_array { + format!("calldata.AddRange({arg});") + } else { + format!("calldata.Add({arg});") + }; + + if let Some(variant) = enum_variant { + let mapped_token = UnityPlugin::map_type(token); + let mapped_variant_type = format!("{}.{}", mapped_token, variant); + + format!("if ({name} is {mapped_variant_type}) {calldata_op}",) + } else { + calldata_op } - } - None => match UnityPlugin::map_type(token).as_str() { - "FieldElement" => format!("{}.Inner", type_name), - _ => format!("new FieldElement({}).Inner", type_name), - }, - } + }) + .collect::>() }) .collect::>() - .join(",\n "); + .join("\n\t\t"); format!( " @@ -280,13 +443,14 @@ public class {} : ModelInstance {{ // Returns the transaction hash. Use `WaitForTransaction` to wait for the transaction to be \ confirmed. public async Task {system_name}(Account account{arg_sep}{args}) {{ + List calldata = new List(); + {calldata} + return await account.ExecuteRaw(new dojo.Call[] {{ new dojo.Call{{ to = contractAddress, selector = \"{system_name}\", - calldata = new dojo.FieldElement[] {{ - {calldata} - }} + calldata = calldata.ToArray() }} }}); }} @@ -315,19 +479,20 @@ public class {} : ModelInstance {{ // Will format the contract into a C# class and // all systems into C# methods // Handled tokens should be a list of all structs and enums used by the contract - fn handle_contract(&self, contract: &DojoContract, handled_tokens: &[Composite]) -> String { + fn handle_contract( + &self, + contract: &DojoContract, + handled_tokens: &HashMap, + ) -> String { let mut out = String::new(); out += UnityPlugin::generated_header().as_str(); - out += "using System;\n"; - out += "using System.Threading.Tasks;\n"; - out += "using Dojo;\n"; - out += "using Dojo.Starknet;\n"; - out += "using UnityEngine;\n"; - out += "using dojo_bindings;\n"; + out += UnityPlugin::contract_imports().as_str(); let systems = contract .systems .iter() + // we assume systems dont have outputs + .filter(|s| s.to_function().unwrap().get_output_kind() as u8 == FunctionOutputKind::NoOutput as u8) .map(|system| UnityPlugin::format_system(system.to_function().unwrap(), handled_tokens)) .collect::>() .join("\n\n "); @@ -356,7 +521,7 @@ public class {} : MonoBehaviour {{ impl BuiltinPlugin for UnityPlugin { async fn generate_code(&self, data: &DojoData) -> BindgenResult>> { let mut out: HashMap> = HashMap::new(); - let mut handled_tokens = Vec::::new(); + let mut handled_tokens = HashMap::::new(); // Handle codegen for models for (name, model) in &data.models { From af5be666fb9b5096705b1041d8ebc8c89a55d4bb Mon Sep 17 00:00:00 2001 From: glihm Date: Thu, 13 Jun 2024 17:18:20 -0600 Subject: [PATCH 26/88] feat(core): add state mutability computation from world param (#2049) * rework: add state mutability computation from world param * fix: run fmt * fix: apply review comments * fix: address missing review comment --- crates/dojo-lang/src/contract.rs | 235 +++------- crates/dojo-lang/src/interface.rs | 72 ++-- crates/dojo-lang/src/lib.rs | 1 + crates/dojo-lang/src/plugin_test_data/system | 405 ++++++------------ crates/dojo-lang/src/syntax/mod.rs | 3 + crates/dojo-lang/src/syntax/self_param.rs | 49 +++ crates/dojo-lang/src/syntax/utils.rs | 20 + crates/dojo-lang/src/syntax/world_param.rs | 92 ++++ crates/torii/types-test/src/contracts.cairo | 13 +- .../dojo_examples_actions_actions.json | 15 +- .../dojo_examples_actions_actions.json | 15 +- .../dojo_examples_actions_actions.toml | 4 +- .../manifests/dev/manifest.json | 19 +- .../manifests/dev/manifest.toml | 4 +- examples/spawn-and-move/src/actions.cairo | 18 +- examples/spawn-and-move/src/others.cairo | 2 +- 16 files changed, 439 insertions(+), 528 deletions(-) create mode 100644 crates/dojo-lang/src/syntax/mod.rs create mode 100644 crates/dojo-lang/src/syntax/self_param.rs create mode 100644 crates/dojo-lang/src/syntax/utils.rs create mode 100644 crates/dojo-lang/src/syntax/world_param.rs diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index fac9667ba0..c2a9c292ff 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -4,37 +4,28 @@ use cairo_lang_defs::patcher::{PatchBuilder, RewriteNode}; use cairo_lang_defs::plugin::{ DynGeneratedFileAuxData, PluginDiagnostic, PluginGeneratedFile, PluginResult, }; -use cairo_lang_diagnostics::Severity; -use cairo_lang_syntax::attribute::structured::{ - Attribute, AttributeArg, AttributeArgVariant, AttributeListStructurize, -}; use cairo_lang_syntax::node::ast::MaybeModuleBody; use cairo_lang_syntax::node::db::SyntaxGroup; use cairo_lang_syntax::node::{ast, ids, Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use dojo_types::system::Dependency; -use crate::plugin::{DojoAuxData, SystemAuxData, DOJO_CONTRACT_ATTR}; +use crate::plugin::{DojoAuxData, SystemAuxData}; +use crate::syntax::world_param::{self, WorldParamInjectionKind}; +use crate::syntax::{self_param, utils as syntax_utils}; -const ALLOW_REF_SELF_ARG: &str = "allow_ref_self"; const DOJO_INIT_FN: &str = "dojo_init"; pub struct DojoContract { diagnostics: Vec, dependencies: HashMap, - do_allow_ref_self: bool, } impl DojoContract { pub fn from_module(db: &dyn SyntaxGroup, module_ast: ast::ItemModule) -> PluginResult { let name = module_ast.name(db).text(db); - let attrs = module_ast.attributes(db).structurize(db); - let dojo_contract_attr = attrs.iter().find(|attr| attr.id.as_str() == DOJO_CONTRACT_ATTR); - let do_allow_ref_self = extract_allow_ref_self(dojo_contract_attr, db).unwrap_or_default(); - - let mut system = - DojoContract { diagnostics: vec![], dependencies: HashMap::new(), do_allow_ref_self }; + let mut system = DojoContract { diagnostics: vec![], dependencies: HashMap::new() }; let mut has_event = false; let mut has_storage = false; let mut has_init = false; @@ -182,14 +173,14 @@ impl DojoContract { let fn_decl = fn_ast.declaration(db); let fn_name = fn_decl.name(db).text(db); - let (params_str, _, world_removed) = self.rewrite_parameters( + let (params_str, was_world_injected) = self.rewrite_parameters( db, fn_decl.signature(db).parameters(db), fn_ast.stable_ptr().untyped(), ); let mut world_read = ""; - if world_removed { + if was_world_injected { world_read = "let world = self.world_dispatcher.read();"; } @@ -303,166 +294,61 @@ impl DojoContract { )] } - /// Gets name, modifiers and type from a function parameter. - pub fn get_parameter_info( - &mut self, - db: &dyn SyntaxGroup, - param: ast::Param, - ) -> (String, String, String) { - let name = param.name(db).text(db).trim().to_string(); - let modifiers = param.modifiers(db).as_syntax_node().get_text(db).trim().to_string(); - let param_type = - param.type_clause(db).ty(db).as_syntax_node().get_text(db).trim().to_string(); - - (name, modifiers, param_type) - } - - /// Check if the function has a self parameter. - /// - /// Returns - /// * a boolean indicating if `self` has to be added, - // * a boolean indicating if there is a `ref self` parameter. - pub fn check_self_parameter( - &mut self, - db: &dyn SyntaxGroup, - param_list: ast::ParamList, - ) -> (bool, bool) { - let mut add_self = true; - let mut has_ref_self = false; - if !param_list.elements(db).is_empty() { - let (param_name, param_modifiers, param_type) = - self.get_parameter_info(db, param_list.elements(db)[0].clone()); - - if param_name.eq(&"self".to_string()) { - if param_modifiers.contains(&"ref".to_string()) - && param_type.eq(&"ContractState".to_string()) - { - has_ref_self = true; - add_self = false; - } - - if param_type.eq(&"@ContractState".to_string()) { - add_self = false; - } - } - }; - - (add_self, has_ref_self) - } - - /// Check if the function has multiple IWorldDispatcher parameters. - /// - /// Returns - /// * a boolean indicating if the function has multiple world dispatchers. - pub fn check_world_dispatcher( - &mut self, - db: &dyn SyntaxGroup, - param_list: ast::ParamList, - ) -> bool { - let mut count = 0; - - param_list.elements(db).iter().for_each(|param| { - let (_, _, param_type) = self.get_parameter_info(db, param.clone()); - - if param_type.eq(&"IWorldDispatcher".to_string()) { - count += 1; - } - }); - - count > 1 - } - /// Rewrites parameter list by: - /// * adding `self` parameter if missing, - /// * removing `world` if present as first parameter (self excluded), as it will be read from - /// the first function statement. + /// * adding `self` parameter based on the `world` parameter mutability. If `world` is not + /// provided, a `View` is assumed. + /// * removing `world` if present as first parameter, as it will be read from the first + /// function statement. /// /// Reports an error in case of: - /// * `ref self`, as systems are supposed to be 100% stateless, - /// * multiple IWorldDispatcher parameters. - /// * the `IWorldDispatcher` is not the first parameter (self excluded) and named 'world'. + /// * `self` used explicitly, + /// * multiple world parameters, + /// * the `world` parameter is not the first parameter and named 'world'. /// /// Returns - /// * the list of parameters in a String - /// * a boolean indicating if `self` has been added - // * a boolean indicating if `world` parameter has been removed + /// * the list of parameters in a String. + /// * true if the world has to be injected (found as the first param). pub fn rewrite_parameters( &mut self, db: &dyn SyntaxGroup, param_list: ast::ParamList, - diagnostic_item: ids::SyntaxStablePtrId, - ) -> (String, bool, bool) { - let (add_self, has_ref_self) = self.check_self_parameter(db, param_list.clone()); - let has_multiple_world_dispatchers = self.check_world_dispatcher(db, param_list.clone()); + fn_diagnostic_item: ids::SyntaxStablePtrId, + ) -> (String, bool) { + self_param::check_parameter(db, ¶m_list, fn_diagnostic_item, &mut self.diagnostics); - let mut world_removed = false; + let world_injection = world_param::parse_world_injection( + db, + param_list.clone(), + fn_diagnostic_item, + &mut self.diagnostics, + ); let mut params = param_list .elements(db) .iter() - .enumerate() - .filter_map(|(idx, param)| { - let (name, modifiers, param_type) = self.get_parameter_info(db, param.clone()); - - if param_type.eq(&"IWorldDispatcher".to_string()) - && modifiers.eq(&"".to_string()) - && !has_multiple_world_dispatchers - { - let has_good_pos = (add_self && idx == 0) || (!add_self && idx == 1); - let has_good_name = name.eq(&"world".to_string()); - - if has_good_pos && has_good_name { - world_removed = true; - None - } else { - if !has_good_pos { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: param.stable_ptr().untyped(), - message: "The IWorldDispatcher parameter must be the first \ - parameter of the function (self excluded)." - .to_string(), - severity: Severity::Error, - }); - } + .filter_map(|param| { + let (name, _, param_type) = syntax_utils::get_parameter_info(db, param.clone()); - if !has_good_name { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: param.stable_ptr().untyped(), - message: "The IWorldDispatcher parameter must be named 'world'." - .to_string(), - severity: Severity::Error, - }); - } - Some(param.as_syntax_node().get_text(db)) - } + // If the param is `IWorldDispatcher`, we don't need to keep it in the param list + // as it is flatten in the first statement. + if world_param::is_world_param(&name, ¶m_type) { + None } else { Some(param.as_syntax_node().get_text(db)) } }) .collect::>(); - if has_multiple_world_dispatchers { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "Only one parameter of type IWorldDispatcher is allowed.".to_string(), - severity: Severity::Error, - }); - } - - if has_ref_self && !self.do_allow_ref_self { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "Functions of dojo::contract cannot have 'ref self' parameter." - .to_string(), - severity: Severity::Error, - }); - } - - if add_self { - params.insert(0, "self: @ContractState".to_string()); + match world_injection { + WorldParamInjectionKind::None | WorldParamInjectionKind::View => { + params.insert(0, "self: @ContractState".to_string()); + } + WorldParamInjectionKind::External => { + params.insert(0, "ref self: ContractState".to_string()); + } } - (params.join(", "), add_self, world_removed) + (params.join(", "), world_injection != WorldParamInjectionKind::None) } /// Rewrites function statements by adding the reading of `world` at first statement. @@ -493,21 +379,23 @@ impl DojoContract { ) -> Vec { let mut rewritten_fn = RewriteNode::from_ast(&fn_ast); - let (params_str, self_added, world_removed) = self.rewrite_parameters( + let (params_str, was_world_injected) = self.rewrite_parameters( db, fn_ast.declaration(db).signature(db).parameters(db), fn_ast.stable_ptr().untyped(), ); - if self_added || world_removed { - let rewritten_params = rewritten_fn - .modify_child(db, ast::FunctionWithBody::INDEX_DECLARATION) - .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) - .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); - rewritten_params.set_str(params_str); - } - - if world_removed { + // We always rewrite the params as the self parameter is added based on the + // world mutability. + let rewritten_params = rewritten_fn + .modify_child(db, ast::FunctionWithBody::INDEX_DECLARATION) + .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) + .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); + rewritten_params.set_str(params_str); + + // If the world was injected, we also need to rewrite the statements of the function + // to ensure the `world` injection is effective. + if was_world_injected { let rewritten_statements = rewritten_fn .modify_child(db, ast::FunctionWithBody::INDEX_BODY) .modify_child(db, ast::ExprBlock::INDEX_STATEMENTS); @@ -557,26 +445,3 @@ impl DojoContract { vec![RewriteNode::Copied(impl_ast.as_syntax_node())] } } - -/// Extract the allow_ref_self attribute. -pub(crate) fn extract_allow_ref_self( - allow_ref_self_attr: Option<&Attribute>, - db: &dyn SyntaxGroup, -) -> Option { - let Some(attr) = allow_ref_self_attr else { - return None; - }; - - #[allow(clippy::collapsible_match)] - match &attr.args[..] { - [AttributeArg { variant: AttributeArgVariant::Unnamed(value), .. }] => match value { - ast::Expr::Path(path) - if path.as_syntax_node().get_text_without_trivia(db) == ALLOW_REF_SELF_ARG => - { - Some(true) - } - _ => None, - }, - _ => None, - } -} diff --git a/crates/dojo-lang/src/interface.rs b/crates/dojo-lang/src/interface.rs index 54205335c0..fc9bf2ef1b 100644 --- a/crates/dojo-lang/src/interface.rs +++ b/crates/dojo-lang/src/interface.rs @@ -5,6 +5,9 @@ use cairo_lang_syntax::node::db::SyntaxGroup; use cairo_lang_syntax::node::{ast, ids, Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; +use crate::syntax::self_param; +use crate::syntax::world_param::{self, WorldParamInjectionKind}; + pub struct DojoInterface { diagnostics: Vec, } @@ -77,9 +80,7 @@ impl DojoInterface { } } - /// Rewrites parameter list by adding `self` parameter if missing. - /// - /// Reports an error in case of `ref self` as systems are supposed to be 100% stateless. + /// Rewrites parameter list by adding `self` parameter based on the `world` parameter. pub fn rewrite_parameters( &mut self, db: &dyn SyntaxGroup, @@ -92,50 +93,29 @@ impl DojoInterface { .map(|e| e.as_syntax_node().get_text(db)) .collect::>(); - let mut need_to_add_self = true; - if !params.is_empty() { - let first_param = param_list.elements(db)[0].clone(); - let param_name = first_param.name(db).text(db).to_string(); - - if param_name.eq(&"self".to_string()) { - let param_modifiers = first_param - .modifiers(db) - .elements(db) - .iter() - .map(|e| e.as_syntax_node().get_text(db).trim().to_string()) - .collect::>(); - - let param_type = first_param - .type_clause(db) - .ty(db) - .as_syntax_node() - .get_text(db) - .trim() - .to_string(); - - if param_modifiers.contains(&"ref".to_string()) - && param_type.eq(&"TContractState".to_string()) - { - self.diagnostics.push(PluginDiagnostic { - stable_ptr: diagnostic_item, - message: "Functions of dojo::interface cannot have `ref self` parameter." - .to_string(), - severity: Severity::Error, - }); + self_param::check_parameter(db, ¶m_list, diagnostic_item, &mut self.diagnostics); - need_to_add_self = false; - } - - if param_type.eq(&"@TContractState".to_string()) { - need_to_add_self = false; - } + let world_injection = world_param::parse_world_injection( + db, + param_list, + diagnostic_item, + &mut self.diagnostics, + ); + + match world_injection { + WorldParamInjectionKind::None => { + params.insert(0, "self: @TContractState".to_string()); + } + WorldParamInjectionKind::View => { + params.remove(0); + params.insert(0, "self: @TContractState".to_string()); + } + WorldParamInjectionKind::External => { + params.remove(0); + params.insert(0, "ref self: TContractState".to_string()); } }; - if need_to_add_self { - params.insert(0, "self: @TContractState".to_string()); - } - params.join(", ") } @@ -151,11 +131,13 @@ impl DojoInterface { .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); - rewritten_params.set_str(self.rewrite_parameters( + let params_str = self.rewrite_parameters( db, fn_ast.declaration(db).signature(db).parameters(db), fn_ast.stable_ptr().untyped(), - )); + ); + + rewritten_params.set_str(params_str); vec![rewritten_fn] } } diff --git a/crates/dojo-lang/src/lib.rs b/crates/dojo-lang/src/lib.rs index b76ea602c8..4f7e0e4bca 100644 --- a/crates/dojo-lang/src/lib.rs +++ b/crates/dojo-lang/src/lib.rs @@ -13,6 +13,7 @@ pub mod model; pub mod plugin; pub mod print; pub mod semantics; +pub mod syntax; pub(crate) mod version; // Copy of non pub functions from scarb + extension. diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index c23d1a35a0..f7fbef26bb 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -85,81 +85,54 @@ trait IEmptyTrait; trait IFaultyTrait { const ONE: u8; - fn do_ref_self(ref self: TContractState); - #[my_attr] fn do_with_attrs(p1: u8) -> u16; } -#[starknet::interface] -trait IAllowedRefSelf { - fn spawn(ref self: T); -} - -#[dojo::contract(allow_ref_self)] -mod ContractAllowedRefSelf { - #[abi(embed_v0)] - impl AllowedImpl of IAllowedRefSelf { - fn spawn(ref self: ContractState) {} - } -} - #[dojo::interface] trait INominalTrait { - fn do_no_param(); - fn do_no_param_but_self(self: @TContractState); - fn do_params(p1: dojo_examples::models::Direction, p2: u8); - fn do_params_and_self(self: @TContractState, p2: u8); - fn do_return_value(p1: u8) -> u16; + fn do_no_param() -> felt252; + fn do_no_param_but_world(world: @IWorldDispatcher) -> felt252; + fn do_no_param_but_world_ref(ref world: IWorldDispatcher) -> felt252; + fn do_params_no_world(p1: felt252, p2: u8) -> felt252; + fn do_params_and_world(world: @IWorldDispatcher, p2: u8) -> felt252; + fn do_params_and_world_ref(ref world: IWorldDispatcher, p2: u8) -> felt252; } #[dojo::interface] -trait IWorldTrait { +trait IFaultyTrait { + fn do_with_self(self: @ContractState) -> felt252; fn do_with_ref_self(ref self: ContractState) -> felt252; fn do_with_several_world_dispatchers( - world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher - ) -> felt252; - fn do_with_world_not_named_world(another_world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_named_world( - self: @ContractState, another_world: IWorldDispatcher - ); - fn do_with_world_not_first(vec: Vec2, world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_first( - self: @ContractState, vec: Vec2, world: IWorldDispatcher + world: @IWorldDispatcher, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252; + fn do_with_world_not_named_world(another_world: @IWorldDispatcher) -> felt252; + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; } #[dojo::contract] mod MyFaultyContract { #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do_with_ref_self(ref self: ContractState) -> felt252 { - 'land' - } - - fn do_with_several_world_dispatchers( - world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher - ) -> felt252 { + impl TestFaultyImpl of IFaultyTrait { + fn do_with_self(ref self: ContractState) -> felt252 { 'land' } - fn do_with_world_not_named_world(another_world: IWorldDispatcher) -> felt252 { + fn do_with_ref_self(ref self: ContractState) -> felt252 { 'land' } - fn do_with_self_and_world_not_named_world( - self: @ContractState, another_world: IWorldDispatcher + fn do_with_several_world_dispatchers( + world: @IWorldDispatcher, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252 { 'land' } - fn do_with_world_not_first(vec: Vec2, world: IWorldDispatcher) -> felt252 { + fn do_with_world_not_named_world(another_world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_self_and_world_not_first( - self: @ContractState, vec: Vec2, world: IWorldDispatcher - ) -> felt252 { + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252 { 'land' } } @@ -173,22 +146,28 @@ mod MyNominalContract { } #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do(vec: Vec2) -> felt252 { + impl TestNominalImpl of INominalTrait { + fn do_no_param() -> felt252 { 'land' } - fn do_with_self(self: @ContractState, vec: Vec2) -> felt252 { + fn do_no_param_but_world(world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_world_first(world: IWorldDispatcher, vec: Vec2) -> felt252 { + fn do_no_param_but_world_ref(ref world: IWorldDispatcher) -> felt252 { 'land' } - fn do_with_self_and_world_first( - self: @ContractState, world: IWorldDispatcher, vec: Vec2 - ) -> felt252 { + fn do_params_no_world(p1: felt252, p2: u8) -> felt252 { + 'land' + } + + fn do_params_and_world(world: @IWorldDispatcher, p2: u8) -> felt252 { + 'land' + } + + fn do_params_and_world_ref(ref world: IWorldDispatcher, p2: u8) -> felt252 { 'land' } } @@ -347,40 +326,40 @@ error: Anything other than functions is not supported in a dojo::interface const ONE: u8; ^************^ -error: Functions of dojo::interface cannot have `ref self` parameter. - --> test_src/lib.cairo:82:5 - fn do_ref_self(ref self: TContractState); - ^***************************************^ +error: In a dojo contract or interface, you should use `world: @IWorldDispatcher` instead of `self: @ContractState`. + --> test_src/lib.cairo:98:5 + fn do_with_self(self: @ContractState) -> felt252; + ^***********************************************^ -error: Functions of dojo::contract cannot have 'ref self' parameter. - --> test_src/lib.cairo:130:9 - fn do_with_ref_self(ref self: ContractState) -> felt252 { - ^*******************************************************^ +error: In a dojo contract or interface, you should use `ref world: IWorldDispatcher` instead of `ref self: ContractState`. + --> test_src/lib.cairo:99:5 + fn do_with_ref_self(ref self: ContractState) -> felt252; + ^******************************************************^ -error: Only one parameter of type IWorldDispatcher is allowed. - --> test_src/lib.cairo:134:9 - fn do_with_several_world_dispatchers( - ^***********************************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:104:5 + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; + ^****************************************************************************^ -error: The IWorldDispatcher parameter must be named 'world'. - --> test_src/lib.cairo:140:42 - fn do_with_world_not_named_world(another_world: IWorldDispatcher) -> felt252 { - ^*****************************^ +error: In a dojo contract or interface, you should use `ref world: IWorldDispatcher` instead of `ref self: ContractState`. + --> test_src/lib.cairo:111:9 + fn do_with_self(ref self: ContractState) -> felt252 { + ^***************************************************^ -error: The IWorldDispatcher parameter must be named 'world'. - --> test_src/lib.cairo:145:35 - self: @ContractState, another_world: IWorldDispatcher - ^*****************************^ +error: In a dojo contract or interface, you should use `ref world: IWorldDispatcher` instead of `ref self: ContractState`. + --> test_src/lib.cairo:115:9 + fn do_with_ref_self(ref self: ContractState) -> felt252 { + ^*******************************************************^ -error: The IWorldDispatcher parameter must be the first parameter of the function (self excluded). - --> test_src/lib.cairo:150:47 - fn do_with_world_not_first(vec: Vec2, world: IWorldDispatcher) -> felt252 { - ^*********************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:129:9 + fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252 { + ^*****************************************************************************^ -error: The IWorldDispatcher parameter must be the first parameter of the function (self excluded). - --> test_src/lib.cairo:155:46 - self: @ContractState, vec: Vec2, world: IWorldDispatcher - ^*********************^ +error: World parameter must be a snapshot if `ref` is not used. + --> test_src/lib.cairo:180:5 + fn dojo_init( + ^***********^ error: Unsupported attribute. --> test_src/lib.cairo:1:1 @@ -408,32 +387,27 @@ error: Unsupported attribute. ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:84:5 + --> test_src/lib.cairo:82:5 #[my_attr] ^********^ error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ @@ -673,217 +647,172 @@ error: Unsupported attribute. ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:95:5 - #[abi(embed_v0)] - ^**************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unsupported attribute. - --> test_src/lib.cairo:93:1 -#[dojo::contract(allow_ref_self)] -^*******************************^ - -error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:128:5 + --> test_src/lib.cairo:109:5 #[abi(embed_v0)] ^**************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:107:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:169:5 + --> test_src/lib.cairo:142:5 #[abi(embed_v0)] ^**************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:162:1 + --> test_src/lib.cairo:135:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:199:1 + --> test_src/lib.cairo:178:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:216:1 + --> test_src/lib.cairo:195:1 #[dojo::contract] ^***************^ @@ -901,11 +830,6 @@ mod testcomponent2 { struct Storage {} } -#[starknet::interface] -trait IAllowedRefSelf { - fn spawn(ref self: T); -} - #[starknet::contract] mod spawn { use dojo::world; @@ -1210,95 +1134,31 @@ impl EventDrop of core::traits::Drop::; #[starknet::interface] trait IFaultyTrait { - fn do_ref_self(ref self: TContractState); - #[my_attr] fn do_with_attrs(self: @TContractState, p1: u8) -> u16; } - #[starknet::contract] - mod ContractAllowedRefSelf { - use dojo::world; - use dojo::world::IWorldDispatcher; - use dojo::world::IWorldDispatcherTrait; - use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; - - #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'ContractAllowedRefSelf' - } - } - - #[abi(embed_v0)] - impl WorldProviderImpl of IWorldProvider { - fn world(self: @ContractState) -> IWorldDispatcher { - self.world_dispatcher.read() - } - } - - #[abi(embed_v0)] - impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; - - #[abi(embed_v0)] - impl AllowedImpl of IAllowedRefSelf { - fn spawn(ref self: ContractState) {} - } - - #[starknet::interface] - trait IDojoInit { - fn dojo_init(self: @ContractState); - } - - #[abi(embed_v0)] - impl IDojoInitImpl of IDojoInit { - fn dojo_init(self: @ContractState) { - assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); - } - } - - #[event] - #[derive(Drop, starknet::Event)] - enum Event { - UpgradeableEvent: dojo::components::upgradeable::upgradeable::Event, - } - - #[storage] - struct Storage { - world_dispatcher: IWorldDispatcher, - #[substorage(v0)] - upgradeable: dojo::components::upgradeable::upgradeable::Storage, - } -impl EventDrop of core::traits::Drop::; - - } - #[starknet::interface] trait INominalTrait { - fn do_no_param(self: @TContractState); - fn do_no_param_but_self(self: @TContractState); - fn do_params(self: @TContractState, p1: dojo_examples::models::Direction, p2: u8); - fn do_params_and_self(self: @TContractState, p2: u8); - fn do_return_value(self: @TContractState, p1: u8) -> u16; + fn do_no_param(self: @TContractState) -> felt252; + fn do_no_param_but_world(self: @TContractState) -> felt252; + fn do_no_param_but_world_ref(ref self: TContractState) -> felt252; + fn do_params_no_world(self: @TContractState, p1: felt252, p2: u8) -> felt252; + fn do_params_and_world(self: @TContractState, p2: u8) -> felt252; + fn do_params_and_world_ref(ref self: TContractState, p2: u8) -> felt252; } #[starknet::interface] - trait IWorldTrait { - fn do_with_ref_self(self: @TContractState, ref self: ContractState) -> felt252; + trait IFaultyTrait { + fn do_with_self(self: @TContractState, self: @ContractState) -> felt252; + fn do_with_ref_self(self: @TContractState, ref self: ContractState) -> felt252; fn do_with_several_world_dispatchers( -self: @TContractState, world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher - ) -> felt252; - fn do_with_world_not_named_world(self: @TContractState, another_world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_named_world( -self: @TContractState, self: @ContractState, another_world: IWorldDispatcher - ); - fn do_with_world_not_first(self: @TContractState, vec: Vec2, world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_not_first( -self: @TContractState, self: @ContractState, vec: Vec2, world: IWorldDispatcher +self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252; + fn do_with_world_not_named_world(self: @TContractState, another_world: @IWorldDispatcher) -> felt252; + fn do_with_world_not_first(self: @TContractState, vec: Vec2, ref world: IWorldDispatcher) -> felt252; } @@ -1328,34 +1188,27 @@ self: @TContractState, self: @ContractState, vec: Vec2, world: IWorldDis impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do_with_ref_self(ref self: ContractState) -> felt252 { + impl TestFaultyImpl of IFaultyTrait { + fn do_with_self(self: @ContractState, ref self: ContractState) -> felt252 { 'land' } - fn do_with_several_world_dispatchers( -self: @ContractState, world: IWorldDispatcher, vec: Vec2, another_world: IWorldDispatcher - ) -> felt252 { - 'land' - } - - fn do_with_world_not_named_world(self: @ContractState, another_world: IWorldDispatcher) -> felt252 { + fn do_with_ref_self(self: @ContractState, ref self: ContractState) -> felt252 { 'land' } - fn do_with_self_and_world_not_named_world( - self: @ContractState, another_world: IWorldDispatcher + fn do_with_several_world_dispatchers( +self: @ContractState, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } - fn do_with_world_not_first(self: @ContractState, vec: Vec2, world: IWorldDispatcher) -> felt252 { + fn do_with_world_not_named_world(self: @ContractState, another_world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_self_and_world_not_first( - self: @ContractState, vec: Vec2, world: IWorldDispatcher - ) -> felt252 { + fn do_with_world_not_first(self: @ContractState, vec: Vec2) -> felt252 { 'land' } } @@ -1419,23 +1272,31 @@ impl EventDrop of core::traits::Drop::; } #[abi(embed_v0)] - impl TestWorldImpl of IWorldTrait { - fn do(self: @ContractState, vec: Vec2) -> felt252 { + impl TestNominalImpl of INominalTrait { + fn do_no_param(self: @ContractState) -> felt252 { + 'land' + } + + fn do_no_param_but_world(self: @ContractState) -> felt252 { +let world = self.world_dispatcher.read(); + 'land' + } + + fn do_no_param_but_world_ref(ref self: ContractState) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } - fn do_with_self(self: @ContractState, vec: Vec2) -> felt252 { + fn do_params_no_world(self: @ContractState, p1: felt252, p2: u8) -> felt252 { 'land' } - fn do_with_world_first(self: @ContractState, vec: Vec2) -> felt252 { + fn do_params_and_world(self: @ContractState, p2: u8) -> felt252 { let world = self.world_dispatcher.read(); 'land' } - fn do_with_self_and_world_first( - self: @ContractState, vec: Vec2 - ) -> felt252 { + fn do_params_and_world_ref(ref self: ContractState, p2: u8) -> felt252 { let world = self.world_dispatcher.read(); 'land' } diff --git a/crates/dojo-lang/src/syntax/mod.rs b/crates/dojo-lang/src/syntax/mod.rs new file mode 100644 index 0000000000..cfd40715a2 --- /dev/null +++ b/crates/dojo-lang/src/syntax/mod.rs @@ -0,0 +1,3 @@ +pub mod self_param; +pub mod utils; +pub mod world_param; diff --git a/crates/dojo-lang/src/syntax/self_param.rs b/crates/dojo-lang/src/syntax/self_param.rs new file mode 100644 index 0000000000..2f21ae7522 --- /dev/null +++ b/crates/dojo-lang/src/syntax/self_param.rs @@ -0,0 +1,49 @@ +use cairo_lang_defs::plugin::PluginDiagnostic; +use cairo_lang_diagnostics::Severity; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, ids}; + +use crate::syntax::utils as syntax_utils; + +const SELF_PARAM_NAME: &str = "self"; + +/// Checks if the given function parameter is using `self` instead of `world` param. +/// Adds diagnostic if that case. +/// +/// # Arguments +/// +/// - `db` - The syntax group. +/// - `param_list` - The parameter list of the function. +/// - `fn_diagnostic_item` - The diagnostic item of the function. +/// - `diagnostics` - The diagnostics vector. +pub fn check_parameter( + db: &dyn SyntaxGroup, + param_list: &ast::ParamList, + fn_diagnostic_item: ids::SyntaxStablePtrId, + diagnostics: &mut Vec, +) { + if param_list.elements(db).is_empty() { + return; + } + + let param_0 = param_list.elements(db)[0].clone(); + let (name, modifier, _) = syntax_utils::get_parameter_info(db, param_0.clone()); + + if name.eq(SELF_PARAM_NAME) { + let (expected, actual) = if modifier.eq(&"ref".to_string()) { + ("ref world: IWorldDispatcher", "ref self: ContractState") + } else { + ("world: @IWorldDispatcher", "self: @ContractState") + }; + + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: format!( + "In a dojo contract or interface, you should use `{}` instead of `{}`.", + expected, actual + ) + .to_string(), + severity: Severity::Error, + }); + } +} diff --git a/crates/dojo-lang/src/syntax/utils.rs b/crates/dojo-lang/src/syntax/utils.rs new file mode 100644 index 0000000000..b4bf5298a1 --- /dev/null +++ b/crates/dojo-lang/src/syntax/utils.rs @@ -0,0 +1,20 @@ +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; + +/// Gets the name, modifiers and type of a function parameter. +/// +/// # Arguments +/// +/// * `db` - The syntax group. +/// * `param` - The parameter. +/// +/// # Returns +/// +/// * A tuple containing the name, modifiers and type of the parameter. +pub fn get_parameter_info(db: &dyn SyntaxGroup, param: ast::Param) -> (String, String, String) { + let name = param.name(db).text(db).trim().to_string(); + let modifiers = param.modifiers(db).as_syntax_node().get_text(db).trim().to_string(); + let param_type = param.type_clause(db).ty(db).as_syntax_node().get_text(db).trim().to_string(); + + (name, modifiers, param_type) +} diff --git a/crates/dojo-lang/src/syntax/world_param.rs b/crates/dojo-lang/src/syntax/world_param.rs new file mode 100644 index 0000000000..aac7939770 --- /dev/null +++ b/crates/dojo-lang/src/syntax/world_param.rs @@ -0,0 +1,92 @@ +use cairo_lang_defs::plugin::PluginDiagnostic; +use cairo_lang_diagnostics::Severity; +use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::{ast, ids}; + +use super::utils as syntax_utils; + +const WORLD_PARAM_NAME: &str = "world"; +const WORLD_PARAM_TYPE: &str = "IWorldDispatcher"; +const WORLD_PARAM_TYPE_SNAPSHOT: &str = "@IWorldDispatcher"; + +#[derive(Debug, PartialEq, Eq)] +pub enum WorldParamInjectionKind { + None, + View, + External, +} + +/// Checks if the given parameter is the `world` parameter. +/// +/// The `world` must be named `world`, and be placed first in the argument list. +pub fn is_world_param(param_name: &str, param_type: &str) -> bool { + param_name == WORLD_PARAM_NAME + && (param_type == WORLD_PARAM_TYPE || param_type == WORLD_PARAM_TYPE_SNAPSHOT) +} + +/// Extracts the state mutability of a function from the `world` parameter. +/// +/// Checks if the function has only one `world` parameter (or None). +/// The `world` must be named `world`, and be placed first in the argument list. +/// +/// `fn func1(ref world)` // would be external. +/// `fn func2(world)` // would be view. +/// `fn func3()` // would be view. +/// +/// Returns +/// * The [`WorldParamInjectionKind`] determined from the function's params list. +pub fn parse_world_injection( + db: &dyn SyntaxGroup, + param_list: ast::ParamList, + fn_diagnostic_item: ids::SyntaxStablePtrId, + diagnostics: &mut Vec, +) -> WorldParamInjectionKind { + let mut has_world_injected = false; + let mut injection_kind = WorldParamInjectionKind::None; + + param_list.elements(db).iter().enumerate().for_each(|(idx, param)| { + let (name, modifiers, param_type) = syntax_utils::get_parameter_info(db, param.clone()); + + if !is_world_param(&name, ¶m_type) { + return; + } + + if has_world_injected { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "Only one world parameter is allowed".to_string(), + severity: Severity::Error, + }); + + return; + } else { + has_world_injected = true; + } + + if idx != 0 { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "World parameter must be the first parameter.".to_string(), + severity: Severity::Error, + }); + + return; + } + + if modifiers.contains(&"ref".to_string()) { + injection_kind = WorldParamInjectionKind::External; + } else { + injection_kind = WorldParamInjectionKind::View; + + if param_type == WORLD_PARAM_TYPE { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "World parameter must be a snapshot if `ref` is not used.".to_string(), + severity: Severity::Error, + }); + } + } + }); + + injection_kind +} diff --git a/crates/torii/types-test/src/contracts.cairo b/crates/torii/types-test/src/contracts.cairo index 821e8f957a..df0ef8be39 100644 --- a/crates/torii/types-test/src/contracts.cairo +++ b/crates/torii/types-test/src/contracts.cairo @@ -1,9 +1,9 @@ use starknet::{ContractAddress, ClassHash}; -#[starknet::interface] -trait IRecords { - fn create(self: @TContractState, num_records: u8); - fn delete(self: @TContractState, record_id: u32); +#[dojo::interface] +trait IRecords { + fn create(ref world: IWorldDispatcher, num_records: u8); + fn delete(ref world: IWorldDispatcher, record_id: u32); } #[dojo::contract] @@ -33,8 +33,7 @@ mod records { #[abi(embed_v0)] impl RecordsImpl of IRecords { - fn create(self: @ContractState, num_records: u8) { - let world = self.world_dispatcher.read(); + fn create(ref world: IWorldDispatcher, num_records: u8) { let mut record_idx = 0; loop { @@ -118,7 +117,7 @@ mod records { return (); } // Implemment fn delete, input param: record_id - fn delete(self: @ContractState, record_id: u32) { + fn delete(ref world: IWorldDispatcher, record_id: u32) { let world = self.world_dispatcher.read(); let (record, record_sibling) = get!(world, record_id, (Record, RecordSibling)); let subrecord_id = record_id + 1; diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json index 21aed968a7..0882f7c56d 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json @@ -182,7 +182,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -194,7 +194,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -206,6 +206,17 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json index 21aed968a7..0882f7c56d 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -182,7 +182,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -194,7 +194,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -206,6 +206,17 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index 09f30e5dfa..405be86d28 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" -original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" +original_class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index ecf5e24f79..0b6a6af2fb 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1020,8 +1020,8 @@ { "kind": "DojoContract", "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", - "class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", - "original_class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", + "class_hash": "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d", + "original_class_hash": "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1207,7 +1207,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -1219,7 +1219,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -1231,6 +1231,17 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], "state_mutability": "view" } ] diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 0e32561e97..601c02ab1b 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -22,8 +22,8 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" -class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" -original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" +original_class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 65dc16c55c..143696ed80 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -2,9 +2,10 @@ use dojo_examples::models::{Direction, Position, Vec2}; #[dojo::interface] trait IActions { - fn spawn(); - fn move(direction: Direction); - fn set_player_config(name: ByteArray); + fn spawn(ref world: IWorldDispatcher); + fn move(ref world: IWorldDispatcher, direction: Direction); + fn set_player_config(ref world: IWorldDispatcher, name: ByteArray); + fn get_player_position(world: @IWorldDispatcher) -> Position; } #[dojo::interface] @@ -61,7 +62,7 @@ mod actions { #[abi(embed_v0)] impl ActionsImpl of IActions { // ContractState is defined by system decorator expansion - fn spawn(world: IWorldDispatcher) { + fn spawn(ref world: IWorldDispatcher) { let player = get_caller_address(); let position = get!(world, player, (Position)); @@ -76,7 +77,7 @@ mod actions { ); } - fn move(world: IWorldDispatcher, direction: Direction) { + fn move(ref world: IWorldDispatcher, direction: Direction) { let player = get_caller_address(); let (mut position, mut moves) = get!(world, player, (Position, Moves)); moves.remaining -= 1; @@ -86,7 +87,7 @@ mod actions { emit!(world, (Moved { player, direction })); } - fn set_player_config(world: IWorldDispatcher, name: ByteArray) { + fn set_player_config(ref world: IWorldDispatcher, name: ByteArray) { let player = get_caller_address(); let items = array![ @@ -97,6 +98,11 @@ mod actions { set!(world, (config)); } + + fn get_player_position(world: @IWorldDispatcher) -> Position { + let player = get_caller_address(); + get!(world, player, (Position)) + } } } diff --git a/examples/spawn-and-move/src/others.cairo b/examples/spawn-and-move/src/others.cairo index 0f27d036a8..8b64df6a23 100644 --- a/examples/spawn-and-move/src/others.cairo +++ b/examples/spawn-and-move/src/others.cairo @@ -16,7 +16,7 @@ mod others { fn dojo_init( - world: IWorldDispatcher, + world: @IWorldDispatcher, actions_address: ContractAddress, actions_class: ClassHash, value: u8 From 0b8b0e5c50888233bfb47763845e0ff2bc1d3f22 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Fri, 14 Jun 2024 05:22:40 +0530 Subject: [PATCH 27/88] feat: ability to skip migration of certain contracts/models (#2026) * initial commit * Revert "initial commit" This reverts commit 2975876f484f03a62ea584ea2061bdc16360d287. * implement skip_migration logic in DojoMetadata so it is profile specific * do a clean build and migrate * fix tests * fix lints * fix more tests * fix more lints * update dev to use skip_migration * abstract out skipping logic * clean old manifest times during build to remove unused manifets * update example * fix tests * add test for remove_items * fix: use world dispatcher snapshot --------- Co-authored-by: glihm --- .gitignore | 1 + Cargo.lock | 3 + bin/sozo/src/commands/build.rs | 21 +- bin/sozo/src/commands/clean.rs | 8 +- bin/sozo/src/commands/dev.rs | 14 +- bin/sozo/src/commands/migrate.rs | 17 +- bin/sozo/tests/register_test.rs | 9 +- crates/dojo-bindgen/Cargo.toml | 4 + crates/dojo-bindgen/src/lib.rs | 41 +- .../src/plugins/typescript_v2/mod.rs | 21 +- crates/dojo-test-utils/src/migration.rs | 5 + crates/dojo-world/src/contracts/model_test.rs | 8 +- crates/dojo-world/src/contracts/world_test.rs | 18 +- .../dojo-world/src/manifest/manifest_test.rs | 63 +- crates/dojo-world/src/manifest/mod.rs | 21 +- crates/dojo-world/src/metadata.rs | 9 +- crates/dojo-world/src/metadata_test.rs | 5 + crates/sozo/ops/src/migration/mod.rs | 9 +- crates/sozo/ops/src/migration/utils.rs | 5 + crates/torii/core/src/sql_test.rs | 11 +- crates/torii/graphql/src/tests/mod.rs | 21 +- crates/torii/grpc/Cargo.toml | 1 + .../grpc/src/server/tests/entities_test.rs | 20 +- examples/spawn-and-move/Scarb.toml | 26 + .../dojo_examples_mock_token_mock_token.json | 133 + .../dojo_examples_models_mock_token.json | 363 ++ .../dojo_examples_mock_token_mock_token.json | 133 + .../dojo_examples_models_mock_token.json | 363 ++ .../dojo_examples_mock_token_mock_token.toml | 10 + .../dojo_examples_models_mock_token.toml | 15 + .../manifests/dev/manifest.json | 526 +++ .../manifests/dev/manifest.toml | 30 + .../dojo_examples_actions_actions.json | 290 ++ .../dojo_examples_mock_token_mock_token.json | 133 + .../dojo_examples_others_others.json | 146 + .../release/abis/base/dojo_world_world.json | 996 +++++ .../dojo_examples_actions_actions_moved.json | 389 ++ .../models/dojo_examples_models_message.json | 371 ++ .../dojo_examples_models_mock_token.json | 363 ++ .../models/dojo_examples_models_moves.json | 393 ++ .../dojo_examples_models_player_config.json | 385 ++ .../models/dojo_examples_models_position.json | 377 ++ ...es_others_others_contract_initialized.json | 367 ++ .../dojo_examples_actions_actions.json | 290 ++ .../dojo_examples_others_others.json | 146 + .../abis/deployments/dojo_world_world.json | 996 +++++ .../dojo_examples_actions_actions_moved.json | 389 ++ .../dojo_examples_models_emote_message.json | 389 ++ .../models/dojo_examples_models_message.json | 371 ++ .../models/dojo_examples_models_moves.json | 393 ++ .../dojo_examples_models_player_config.json | 385 ++ .../models/dojo_examples_models_position.json | 377 ++ ...es_others_others_contract_initialized.json | 367 ++ .../dojo_examples_actions_actions.toml | 10 + .../dojo_examples_mock_token_mock_token.toml | 10 + .../dojo_examples_others_others.toml | 10 + .../release/base/dojo_base_base.toml | 4 + .../release/base/dojo_world_world.toml | 5 + .../dojo_examples_actions_actions_moved.toml | 15 + .../models/dojo_examples_models_message.toml | 25 + .../dojo_examples_models_mock_token.toml | 15 + .../models/dojo_examples_models_moves.toml | 20 + .../dojo_examples_models_player_config.toml | 25 + .../models/dojo_examples_models_position.toml | 15 + ...es_others_others_contract_initialized.toml | 20 + .../manifests/release/manifest.json | 3910 +++++++++++++++++ .../manifests/release/manifest.toml | 185 + .../dojo_examples_actions_actions.toml | 4 + .../dojo_examples_others_others.toml | 8 + .../release/overlays/dojo_base_base.toml | 1 + .../release/overlays/dojo_world_world.toml | 1 + .../dojo_examples_actions_actions_moved.toml | 1 + .../models/dojo_examples_models_message.toml | 1 + .../dojo_examples_models_mock_token.toml | 1 + .../models/dojo_examples_models_moves.toml | 1 + .../dojo_examples_models_player_config.toml | 1 + .../models/dojo_examples_models_position.toml | 1 + ...es_others_others_contract_initialized.toml | 1 + examples/spawn-and-move/src/lib.cairo | 1 + examples/spawn-and-move/src/mock_token.cairo | 11 + examples/spawn-and-move/src/models.cairo | 8 + 81 files changed, 14494 insertions(+), 63 deletions(-) create mode 100644 examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json create mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml create mode 100644 examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json create mode 100644 examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json create mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json create mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml create mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml create mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml create mode 100644 examples/spawn-and-move/manifests/release/base/dojo_base_base.toml create mode 100644 examples/spawn-and-move/manifests/release/base/dojo_world_world.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml create mode 100644 examples/spawn-and-move/manifests/release/manifest.json create mode 100644 examples/spawn-and-move/manifests/release/manifest.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml create mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml create mode 100644 examples/spawn-and-move/src/mock_token.cairo diff --git a/.gitignore b/.gitignore index 6498958892..09a5b8fd5f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ crates/benches/bench_results.txt **/generated .vscode bindings +justfile diff --git a/Cargo.lock b/Cargo.lock index 667854d1df..877b081274 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4584,7 +4584,9 @@ dependencies = [ "camino", "chrono", "convert_case 0.6.0", + "dojo-test-utils", "dojo-world", + "scarb", "serde", "serde_json", "starknet", @@ -14224,6 +14226,7 @@ name = "torii-grpc" version = "0.7.0-alpha.5" dependencies = [ "bytes", + "camino", "crypto-bigint", "dojo-test-utils", "dojo-types", diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index e278e693d0..b94785575e 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -2,6 +2,8 @@ use anyhow::{Context, Result}; use clap::Args; use dojo_bindgen::{BuiltinPlugins, PluginManager}; use dojo_lang::scarb_internal::compile_workspace; +use dojo_world::manifest::MANIFESTS_DIR; +use dojo_world::metadata::dojo_metadata_from_workspace; use prettytable::format::consts::FORMAT_NO_LINESEP_WITH_TITLE; use prettytable::{format, Cell, Row, Table}; use scarb::core::{Config, TargetKind}; @@ -9,6 +11,8 @@ use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; use sozo_ops::statistics::{get_contract_statistics_for_dir, ContractStatistics}; use tracing::trace; +use crate::commands::clean::CleanArgs; + const BYTECODE_SIZE_LABEL: &str = "Bytecode size [in felts]\n(Sierra, Casm)"; const CONTRACT_CLASS_SIZE_LABEL: &str = "Contract Class size [in bytes]\n(Sierra, Casm)"; @@ -39,6 +43,18 @@ pub struct BuildArgs { impl BuildArgs { pub fn run(self, config: &Config) -> Result<()> { + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + + let profile_name = + ws.current_profile().expect("Scarb profile is expected at this point.").to_string(); + + // Manifest path is always a file, we can unwrap safely to get the + // parent folder. + let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + + let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(profile_name); + CleanArgs::clean_manifests(&profile_dir)?; + let features_opts = FeaturesOpts { features: FeaturesSelector::AllFeatures, no_default_features: false }; @@ -110,9 +126,12 @@ impl BuildArgs { }; trace!(pluginManager=?bindgen, "Generating bindings."); + let ws = scarb::ops::read_workspace(config.manifest_path(), config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + tokio::runtime::Runtime::new() .unwrap() - .block_on(bindgen.generate()) + .block_on(bindgen.generate(dojo_metadata.skip_migration)) .expect("Error generating bindings"); Ok(()) diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 7d02a03834..41da4a1921 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -21,7 +21,7 @@ impl CleanArgs { /// # Arguments /// /// * `profile_dir` - The directory where the profile files are located. - pub fn clean_manifests(&self, profile_dir: &Utf8PathBuf) -> Result<()> { + pub fn clean_manifests(profile_dir: &Utf8PathBuf) -> Result<()> { trace!(?profile_dir, "Cleaning manifests."); let dirs = vec![profile_dir.join(BASE_DIR), profile_dir.join(ABIS_DIR).join(BASE_DIR)]; @@ -51,7 +51,7 @@ impl CleanArgs { // By default, this command cleans the build manifests and scarb artifacts. trace!("Cleaning Scarb artifacts and build manifests."); scarb::ops::clean(config)?; - self.clean_manifests(&profile_dir)?; + Self::clean_manifests(&profile_dir)?; if self.all && profile_dir.exists() { trace!(?profile_dir, "Removing entire profile directory."); @@ -65,6 +65,7 @@ impl CleanArgs { #[cfg(test)] mod tests { use dojo_test_utils::compiler; + use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use katana_runner::KatanaRunner; use sozo_ops::migration; @@ -84,6 +85,8 @@ mod tests { let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + // Plan the migration to generate some manifests other than base. config.tokio_handle().block_on(async { migration::migrate( @@ -94,6 +97,7 @@ mod tests { "dojo_examples", true, TxnConfig::default(), + dojo_metadata.skip_migration, ) .await .unwrap() diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index 2ff6eef64a..79d866b1a0 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -47,13 +47,13 @@ pub struct DevArgs { #[command(flatten)] pub account: AccountOptions, } - impl DevArgs { pub fn run(self, config: &Config) -> Result<()> { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let dojo_metadata = dojo_metadata_from_workspace(&ws); let env_metadata = if config.manifest_path().exists() { - dojo_metadata_from_workspace(&ws).env().cloned() + dojo_metadata.env().cloned() } else { trace!("Manifest path does not exist."); None @@ -97,6 +97,7 @@ impl DevArgs { &name, &context.ws, previous_manifest.clone(), + dojo_metadata.skip_migration.clone(), )) { Ok((manifest, address)) => { previous_manifest = Some(manifest); @@ -131,6 +132,7 @@ impl DevArgs { &name, &context.ws, previous_manifest.clone(), + dojo_metadata.skip_migration.clone(), )) { Ok((manifest, address)) => { previous_manifest = Some(manifest); @@ -222,12 +224,14 @@ fn build(context: &mut DevContext<'_>) -> Result<()> { Ok(()) } +// TODO: fix me async fn migrate( mut world_address: Option, account: &SingleOwnerAccount, name: &str, ws: &Workspace<'_>, previous_manifest: Option, + skip_migration: Option>, ) -> Result<(DeploymentManifest, Option)> where P: Provider + Sync + Send + 'static, @@ -243,9 +247,13 @@ where return Err(anyhow!("Build project using `sozo build` first")); } - let new_manifest = + let mut new_manifest = BaseManifest::load_from_path(&manifest_dir.join(MANIFESTS_DIR).join(BASE_DIR))?; + if let Some(skip_manifests) = skip_migration { + new_manifest.remove_items(skip_manifests); + } + let diff = WorldDiff::compute(new_manifest.clone(), previous_manifest); let total_diffs = diff.count_diffs(); let config = ws.config(); diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 1bf05338a8..6f6abe7404 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -58,6 +58,7 @@ impl MigrateArgs { pub fn run(self, config: &Config) -> Result<()> { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let dojo_metadata = dojo_metadata_from_workspace(&ws); // This variant is tested before the match on `self.command` to avoid // having the need to spin up a Katana to generate the files. @@ -67,7 +68,7 @@ impl MigrateArgs { } let env_metadata = if config.manifest_path().exists() { - dojo_metadata_from_workspace(&ws).env().cloned() + dojo_metadata.env().cloned() } else { trace!("Manifest path does not exist."); None @@ -99,6 +100,7 @@ impl MigrateArgs { &name, true, TxnConfig::default(), + dojo_metadata.skip_migration, ) .await }), @@ -106,8 +108,17 @@ impl MigrateArgs { trace!(name, "Applying migration."); let txn_config: TxnConfig = transaction.into(); - migration::migrate(&ws, world_address, rpc_url, account, &name, false, txn_config) - .await + migration::migrate( + &ws, + world_address, + rpc_url, + account, + &name, + false, + txn_config, + dojo_metadata.skip_migration, + ) + .await }), _ => unreachable!("other case handled above."), } diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index 11053bd38f..7faf1ce474 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -3,6 +3,7 @@ mod utils; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use katana_runner::KatanaRunner; use scarb::ops; @@ -20,11 +21,13 @@ async fn reregister_models() { let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + let dojo_metadata = dojo_metadata_from_workspace(&ws); - let base = config.manifest_path().parent().unwrap(); - let target_dir = format!("{}/target/dev", base); + let target_path = + ws.target_dir().path_existent().unwrap().join(ws.config().profile().to_string()); - let migration = prepare_migration(base.into(), target_dir.into()).unwrap(); + let migration = + prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); let sequencer = KatanaRunner::new().expect("Failed to start runner."); diff --git a/crates/dojo-bindgen/Cargo.toml b/crates/dojo-bindgen/Cargo.toml index 1d9f376db1..8a97d8c2c2 100644 --- a/crates/dojo-bindgen/Cargo.toml +++ b/crates/dojo-bindgen/Cargo.toml @@ -22,3 +22,7 @@ thiserror.workspace = true cainome.workspace = true dojo-world = { path = "../dojo-world", features = [ "manifest" ] } + +[dev-dependencies] +dojo-test-utils = { path = "../dojo-test-utils", features = [ "build-examples" ] } +scarb = { workspace = true } diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index 5dfc2ff265..d92999ad14 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -73,13 +73,17 @@ pub struct PluginManager { impl PluginManager { /// Generates the bindings for all the given Plugin. - pub async fn generate(&self) -> BindgenResult<()> { + pub async fn generate(&self, skip_migration: Option>) -> BindgenResult<()> { if self.builtin_plugins.is_empty() && self.plugins.is_empty() { return Ok(()); } - let data = - gather_dojo_data(&self.manifest_path, &self.root_package_name, &self.profile_name)?; + let data = gather_dojo_data( + &self.manifest_path, + &self.root_package_name, + &self.profile_name, + skip_migration, + )?; for plugin in &self.builtin_plugins { // Get the plugin builder from the plugin enum. @@ -111,10 +115,15 @@ fn gather_dojo_data( manifest_path: &Utf8PathBuf, root_package_name: &str, profile_name: &str, + skip_migration: Option>, ) -> BindgenResult { let root_dir: Utf8PathBuf = manifest_path.parent().unwrap().into(); let base_manifest_dir: Utf8PathBuf = root_dir.join("manifests").join(profile_name).join("base"); - let base_manifest = BaseManifest::load_from_path(&base_manifest_dir)?; + let mut base_manifest = BaseManifest::load_from_path(&base_manifest_dir)?; + + if let Some(skip_manifests) = skip_migration { + base_manifest.remove_items(skip_manifests); + } let mut models = HashMap::new(); let mut contracts = HashMap::new(); @@ -244,6 +253,9 @@ fn model_name_from_fully_qualified_path(file_name: &str) -> Option { #[cfg(test)] mod tests { + use dojo_test_utils::compiler; + use dojo_world::metadata::dojo_metadata_from_workspace; + use super::*; #[test] @@ -254,14 +266,21 @@ mod tests { #[test] fn gather_data_ok() { - let data = gather_dojo_data( - &Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"), - "dojo_example", - "dev", - ) - .unwrap(); + let manifest_path = Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"); + + let config = compiler::copy_tmp_config( + &Utf8PathBuf::from("../../examples/spawn-and-move"), + &Utf8PathBuf::from("../dojo-core"), + ); + + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + + let data = + gather_dojo_data(&manifest_path, "dojo_example", "dev", dojo_metadata.skip_migration) + .unwrap(); - assert_eq!(data.models.len(), 6); + assert_eq!(data.models.len(), 7); assert_eq!(data.world.name, "dojo_example"); diff --git a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs index 7ae5d5b2a6..498b032c86 100644 --- a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs @@ -237,7 +237,7 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ constructor(contractAddress: string, account?: Account) {{ super(contractAddress, account); }} - + {} }} ", @@ -630,6 +630,8 @@ mod tests { use std::io::Read; use camino::Utf8PathBuf; + use dojo_test_utils::compiler; + use dojo_world::metadata::dojo_metadata_from_workspace; use super::*; use crate::gather_dojo_data; @@ -646,12 +648,17 @@ mod tests { let expected_output_without_header = expected_output.lines().skip(1).collect::>().join("\n"); - let data = gather_dojo_data( - &Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"), - "dojo_examples", - "dev", - ) - .unwrap(); + let manifest_path = Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"); + let config = compiler::copy_tmp_config( + &Utf8PathBuf::from("../../examples/spawn-and-move"), + &Utf8PathBuf::from("../dojo-core"), + ); + + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + let data = + gather_dojo_data(&manifest_path, "dojo_examples", "dev", dojo_metadata.skip_migration) + .unwrap(); let actual_output = TypeScriptV2Plugin::generate_code_content(&data); let actual_output_without_header = diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index e8a576f341..9edfb3e969 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -10,6 +10,7 @@ use starknet::macros::felt; pub fn prepare_migration( manifest_dir: Utf8PathBuf, target_dir: Utf8PathBuf, + skip_migration: Option>, ) -> Result { // In testing, profile name is always dev. let profile_name = "dev"; @@ -19,6 +20,10 @@ pub fn prepare_migration( ) .unwrap(); + if let Some(skip_manifests) = skip_migration { + manifest.remove_items(skip_manifests); + } + let overlay_manifest = OverlayManifest::load_from_path( &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), ) diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 178e9b6495..8aeeec1649 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -9,6 +9,7 @@ use starknet::macros::felt; use crate::contracts::model::ModelReader; use crate::contracts::world::test::deploy_world; use crate::contracts::world::WorldContractReader; +use crate::metadata::dojo_metadata_from_workspace; #[tokio::test(flavor = "multi_thread")] async fn test_model() { @@ -24,7 +25,12 @@ async fn test_model() { let manifest_dir = config.manifest_path().parent().unwrap(); let target_dir = manifest_dir.join("target").join("dev"); - let world_address = deploy_world(&runner, &manifest_dir.into(), &target_dir).await; + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + + let world_address = + deploy_world(&runner, &manifest_dir.into(), &target_dir, dojo_metadata.skip_migration) + .await; let world = WorldContractReader::new(world_address, provider); let position = world.model_reader("Position").await.unwrap(); diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index c011d573fb..21759c1ee2 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -8,6 +8,7 @@ use starknet::core::types::{BlockId, BlockTag, FieldElement}; use super::{WorldContract, WorldContractReader}; use crate::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; +use crate::metadata::dojo_metadata_from_workspace; use crate::migration::strategy::prepare_for_migration; use crate::migration::world::WorldDiff; use crate::migration::{Declarable, Deployable, TxnConfig}; @@ -28,8 +29,16 @@ async fn test_world_contract_reader() { let provider = account.provider(); - let world_address = - deploy_world(&runner, &manifest_dir.to_path_buf(), &target_dir.to_path_buf()).await; + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + + let world_address = deploy_world( + &runner, + &manifest_dir.to_path_buf(), + &target_dir.to_path_buf(), + dojo_metadata.skip_migration, + ) + .await; let _world = WorldContractReader::new(world_address, provider); } @@ -38,6 +47,7 @@ pub async fn deploy_world( sequencer: &KatanaRunner, manifest_dir: &Utf8PathBuf, target_dir: &Utf8PathBuf, + skip_migration: Option>, ) -> FieldElement { // Dev profile is used by default for testing: let profile_name = "dev"; @@ -47,6 +57,10 @@ pub async fn deploy_world( ) .unwrap(); + if let Some(skip_manifests) = skip_migration { + manifest.remove_items(skip_manifests); + } + let overlay_manifest = OverlayManifest::load_from_path( &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), ) diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index a003fc0e23..b979b93675 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -6,6 +6,7 @@ use dojo_test_utils::compiler; use dojo_test_utils::rpc::MockJsonRpcTransport; use katana_runner::KatanaRunner; use serde_json::json; +use smol_str::SmolStr; use starknet::accounts::ConnectedAccount; use starknet::core::types::contract::AbiEntry; use starknet::core::types::{EmittedEvent, FieldElement}; @@ -21,6 +22,7 @@ use crate::manifest::{ parse_models_events, AbstractManifestError, DeploymentManifest, Manifest, OverlayClass, OverlayDojoModel, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, }; +use crate::metadata::dojo_metadata_from_workspace; use crate::migration::world::WorldDiff; #[tokio::test] @@ -381,17 +383,30 @@ fn fetch_remote_manifest() { let (temp_project_dir, config, _) = compiler::copy_build_project_temp(source_project, dojo_core_path, true); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + let artifacts_path = temp_project_dir.join(format!("target/{profile_name}")); - let world_address = config - .tokio_handle() - .block_on(async { deploy_world(&runner, &temp_project_dir, &artifacts_path).await }); + let world_address = config.tokio_handle().block_on(async { + deploy_world( + &runner, + &temp_project_dir, + &artifacts_path, + dojo_metadata.skip_migration.clone(), + ) + .await + }); let mut local_manifest = BaseManifest::load_from_path( &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), ) .unwrap(); + if let Some(skip_manifests) = dojo_metadata.skip_migration { + local_manifest.remove_items(skip_manifests); + } + let overlay_manifest = OverlayManifest::load_from_path( &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), ) @@ -403,11 +418,11 @@ fn fetch_remote_manifest() { DeploymentManifest::load_from_remote(provider, world_address).await.unwrap() }); - assert_eq!(local_manifest.models.len(), 6); - assert_eq!(local_manifest.contracts.len(), 2); + assert_eq!(local_manifest.models.len(), 7); + assert_eq!(local_manifest.contracts.len(), 3); - assert_eq!(remote_manifest.models.len(), 6); - assert_eq!(remote_manifest.contracts.len(), 2); + assert_eq!(remote_manifest.models.len(), 7); + assert_eq!(remote_manifest.contracts.len(), 3); // compute diff from local and remote manifest @@ -641,3 +656,37 @@ fn overlay_merge_for_base_work_as_expected() { current.merge(other); assert_eq!(current, expected); } + +#[test] +fn base_manifest_remove_items_work_as_expected() { + let contracts = ["c1", "c2", "c3"]; + let models = ["m1", "m2", "m3"]; + + let world = Manifest { name: "world".into(), inner: Default::default() }; + let base = Manifest { name: "base".into(), inner: Default::default() }; + + let contracts = contracts + .iter() + .map(|c| Manifest { name: SmolStr::from(*c), inner: Default::default() }) + .collect(); + let models = models + .iter() + .map(|c| Manifest { name: SmolStr::from(*c), inner: Default::default() }) + .collect(); + + let mut base = BaseManifest { contracts, models, world, base }; + + base.remove_items(vec!["c1".to_string(), "c3".to_string(), "m2".to_string()]); + + assert_eq!(base.contracts.len(), 1); + assert_eq!( + base.contracts.iter().map(|c| c.name.clone().into()).collect::>(), + vec!["c2"] + ); + + assert_eq!(base.models.len(), 2); + assert_eq!( + base.models.iter().map(|c| c.name.clone().into()).collect::>(), + vec!["m1", "m3"] + ); +} diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 5391761e49..d3906595ab 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -17,6 +17,7 @@ use starknet::macros::selector; use starknet::providers::{Provider, ProviderError}; use thiserror::Error; use toml; +use tracing::error; use crate::contracts::model::ModelError; use crate::contracts::world::WorldEvent; @@ -121,6 +122,12 @@ impl BaseManifest { Ok(Self { world, base, contracts, models }) } + /// Given a list of contract or model names, remove those from the manifest. + pub fn remove_items(&mut self, items: Vec) { + self.contracts.retain(|contract| !items.contains(&contract.name.to_string())); + self.models.retain(|model| !items.contains(&model.name.to_string())); + } + pub fn merge(&mut self, overlay: OverlayManifest) { let mut base_map = HashMap::new(); @@ -129,11 +136,15 @@ impl BaseManifest { } for contract in overlay.contracts { - base_map - .get_mut(&contract.name) - .expect("qed; overlay contract not found") - .inner - .merge(contract); + if let Some(manifest) = base_map.get_mut(&contract.name) { + manifest.inner.merge(contract); + } else { + error!( + "OverlayManifest configured for contract \"{}\", but contract is not present \ + in BaseManifest.", + contract.name + ); + } } if let Some(overlay_world) = overlay.world { diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index c432d09186..12f6cc837f 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -95,8 +95,11 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); let project_metadata = ws.current_package().unwrap().manifest.metadata.dojo(); - let mut dojo_metadata = - DojoMetadata { env: project_metadata.env.clone(), ..Default::default() }; + let mut dojo_metadata = DojoMetadata { + env: project_metadata.env.clone(), + skip_migration: project_metadata.skip_migration.clone(), + ..Default::default() + }; let world_artifact = build_artifact_from_name(&sources_dir, &abis_dir, WORLD_CONTRACT_NAME); @@ -147,6 +150,7 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { pub struct ProjectMetadata { pub world: Option, pub env: Option, + pub skip_migration: Option>, } /// Metadata for a user defined resource (models, contracts). @@ -162,6 +166,7 @@ pub struct DojoMetadata { pub world: WorldMetadata, pub env: Option, pub resources_artifacts: HashMap, + pub skip_migration: Option>, } #[derive(Debug)] diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index 00da193bf8..adeb0df9a7 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -175,6 +175,7 @@ async fn get_full_dojo_metadata_from_workspace() { dbg!(&artifacts); for (abi_subdir, name) in artifacts { let resource = dojo_metadata.resources_artifacts.get(&name); + dbg!(&dojo_metadata.resources_artifacts); assert!(resource.is_some(), "bad resource metadata for {}", name); let resource = resource.unwrap(); @@ -230,6 +231,9 @@ fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, Strin let name = name.replace("_others_", "::others::"); let name = name.replace("::others_", "::others::"); + + let name = name.replace("_mock_token_", "::mock_token::"); + let name = name.replace("::mock_token_", "::mock_token::"); artifacts.push(("models".to_string(), name)); } @@ -238,6 +242,7 @@ fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, Strin let name = entry.path().file_stem().unwrap().to_string_lossy().to_string(); let name = name.replace("_actions_", "::actions::"); let name = name.replace("_others_", "::others::"); + let name = name.replace("_mock_token_", "::mock_token::"); artifacts.push(("contracts".to_string(), name)); } diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index d7d45d4c49..393ec72785 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -58,6 +58,7 @@ pub async fn migrate( name: &str, dry_run: bool, txn_config: TxnConfig, + skip_manifests: Option>, ) -> Result<()> where P: Provider + Sync + Send + 'static, @@ -77,15 +78,15 @@ where // Load local and remote World manifests. let (local_manifest, remote_manifest) = - utils::load_world_manifests(&profile_dir, &account, world_address, &ui).await.map_err( - |e| { + utils::load_world_manifests(&profile_dir, &account, world_address, &ui, skip_manifests) + .await + .map_err(|e| { ui.error(e.to_string()); anyhow!( "\n Use `sozo clean` to clean your project.\nThen, rebuild your project with \ `sozo build`.", ) - }, - )?; + })?; // Calculate diff between local and remote World manifests. ui.print_step(2, "🧰", "Evaluating Worlds diff..."); diff --git a/crates/sozo/ops/src/migration/utils.rs b/crates/sozo/ops/src/migration/utils.rs index d85ffb6df8..e8f6f50165 100644 --- a/crates/sozo/ops/src/migration/utils.rs +++ b/crates/sozo/ops/src/migration/utils.rs @@ -20,6 +20,7 @@ pub(super) async fn load_world_manifests( account: &SingleOwnerAccount, world_address: Option, ui: &Ui, + skip_migration: Option>, ) -> Result<(BaseManifest, Option)> where P: Provider + Sync + Send, @@ -30,6 +31,10 @@ where let mut local_manifest = BaseManifest::load_from_path(&profile_dir.join(BASE_DIR)) .map_err(|e| anyhow!("Fail to load local manifest file: {e}."))?; + if let Some(skip_manifests) = skip_migration { + local_manifest.remove_items(skip_manifests); + } + let overlay_path = profile_dir.join(OVERLAYS_DIR); if overlay_path.exists() { let overlay_manifest = OverlayManifest::load_from_path(&profile_dir.join(OVERLAYS_DIR)) diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 360e0a988c..cceb20d657 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -4,6 +4,7 @@ use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; use dojo_world::contracts::world::WorldContractReader; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; use katana_runner::KatanaRunner; @@ -61,12 +62,16 @@ async fn test_load_from_remote() { let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = dojo_metadata_from_workspace(&ws); let manifest_path = config.manifest_path(); let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let mut migration = prepare_migration(base_dir.into(), target_dir.into()).unwrap(); + let mut migration = + prepare_migration(base_dir.into(), target_dir.into(), dojo_metadata.skip_migration) + .unwrap(); migration.resolve_variable(migration.world_address().unwrap()).unwrap(); let sequencer = KatanaRunner::new().expect("Failed to start runner."); @@ -112,7 +117,7 @@ async fn test_load_from_remote() { let _block_timestamp = 1710754478_u64; let models = sqlx::query("SELECT * FROM models").fetch_all(&pool).await.unwrap(); - assert_eq!(models.len(), 6); + assert_eq!(models.len(), 7); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'Position'", @@ -152,7 +157,7 @@ async fn test_load_from_remote() { // print all entities let entities = sqlx::query("SELECT * FROM entities").fetch_all(&pool).await.unwrap(); - assert_eq!(entities.len(), 1); + assert_eq!(entities.len(), 2); let (id, keys): (String, String) = sqlx::query_as( format!( diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index 86fcf37ad3..737cacc5ad 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -2,7 +2,8 @@ use std::str::FromStr; use anyhow::Result; use async_graphql::dynamic::Schema; -use dojo_test_utils::compiler::build_test_config; +use camino::Utf8PathBuf; +use dojo_test_utils::compiler::{self, build_test_config}; use dojo_test_utils::migration::prepare_migration; use dojo_test_utils::sequencer::{ get_default_test_starknet_config, SequencerConfig, TestSequencer, @@ -12,6 +13,7 @@ use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use dojo_world::contracts::abi::model::Layout; use dojo_world::contracts::WorldContractReader; use dojo_world::manifest::DeploymentManifest; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; use scarb::ops; @@ -277,9 +279,18 @@ pub async fn spinup_types_test() -> Result { let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let base_path = "../types-test"; - let target_path = format!("{}/target/dev", base_path); - let migration = prepare_migration(base_path.into(), target_path.into()).unwrap(); + let source_project_dir = Utf8PathBuf::from("../types-test"); + let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + + let ws = ops::read_workspace(config.manifest_path(), &config) + .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + + let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); + let migration = + prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); let config = build_test_config("../types-test/Scarb.toml").unwrap(); let db = Sql::new(pool.clone(), migration.world_address().unwrap()).await.unwrap(); @@ -294,7 +305,7 @@ pub async fn spinup_types_test() -> Result { let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - execute_strategy(&ws, &migration, &account, TxnConfig::default()).await.unwrap(); + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); let manifest = DeploymentManifest::load_from_remote(&provider, migration.world_address().unwrap()) diff --git a/crates/torii/grpc/Cargo.toml b/crates/torii/grpc/Cargo.toml index 48fd1a8c20..3673a790a2 100644 --- a/crates/torii/grpc/Cargo.toml +++ b/crates/torii/grpc/Cargo.toml @@ -31,6 +31,7 @@ tower.workspace = true tracing.workspace = true [dev-dependencies] +camino.workspace = true dojo-test-utils.workspace = true dojo-world = { path = "../../dojo-world", features = [ "contracts" ] } scarb.workspace = true diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 4776659558..786c1ffd1a 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -1,12 +1,14 @@ use std::str::FromStr; use std::sync::Arc; -use dojo_test_utils::compiler::build_test_config; +use camino::Utf8PathBuf; +use dojo_test_utils::compiler::{self, build_test_config}; use dojo_test_utils::migration::prepare_migration; use dojo_test_utils::sequencer::{ get_default_test_starknet_config, SequencerConfig, TestSequencer, }; use dojo_world::contracts::WorldContractReader; +use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; use scarb::ops; @@ -34,10 +36,20 @@ async fn test_entities_queries() { SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let base_path = "../../../examples/spawn-and-move"; - let target_path = format!("{}/target/dev", base_path); - let mut migration = prepare_migration(base_path.into(), target_path.into()).unwrap(); + let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move"); + let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + + let ws = ops::read_workspace(config.manifest_path(), &config) + .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + let dojo_metadata = dojo_metadata_from_workspace(&ws); + + let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); + + let mut migration = + prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); migration.resolve_variable(migration.world_address().unwrap()).unwrap(); dbg!(&migration); diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index e8b10f51c5..5dd277ffa0 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -15,6 +15,8 @@ dojo = { path = "../../crates/dojo-core" } [[target.dojo]] build-external-contracts = [ ] +# `dev` profile + [tool.dojo.world] description = "example world" name = "example" @@ -26,3 +28,27 @@ rpc_url = "http://localhost:5050/" account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" + +# `release` profile +# +# for now configurations in `tool` are not merged recursively so to override +# `skip_migration` we need to redefine the whole `tool.dojo` table +[profile.release] + +[profile.release.tool.dojo.world] +description = "example world" +name = "example" + +[profile.release.tool.dojo.env] +rpc_url = "http://localhost:5050/" + +# Default account for katana with seed = 0 +account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" +private_key = "0x1800000000300000180000000000030000000000003006001800006600" +world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" + +[profile.release.tool.dojo] +skip_migration = [ + "dojo_examples::mock_token::mock_token", + "dojo_examples::models::mock_token", +] diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json new file mode 100644 index 0000000000..f4bde33e6d --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json @@ -0,0 +1,133 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json new file mode 100644 index 0000000000..b2c1c340fa --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json @@ -0,0 +1,363 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json new file mode 100644 index 0000000000..f4bde33e6d --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json @@ -0,0 +1,133 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json new file mode 100644 index 0000000000..b2c1c340fa --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json @@ -0,0 +1,363 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml new file mode 100644 index 0000000000..572af4068e --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::mock_token::mock_token" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml new file mode 100644 index 0000000000..1bf036168c --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +abi = "manifests/dev/abis/base/models/dojo_examples_models_mock_token.json" +name = "dojo_examples::models::mock_token" + +[[members]] +name = "account" +type = "ContractAddress" +key = true + +[[members]] +name = "amount" +type = "u128" +key = false diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 0b6a6af2fb..9f2e854a95 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1333,6 +1333,151 @@ "init_calldata": [], "name": "dojo_examples::actions::actions" }, + { + "kind": "DojoContract", + "address": "0x75961b2027c52948ecebfd347aa427436ea308d41997fa9b3c98380f7011d53", + "class_hash": "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2", + "original_class_hash": "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "computed": [], + "init_calldata": [], + "name": "dojo_examples::mock_token::mock_token" + }, { "kind": "DojoContract", "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", @@ -2303,6 +2448,387 @@ ], "name": "dojo_examples::models::message" }, + { + "kind": "DojoModel", + "members": [ + { + "name": "account", + "type": "ContractAddress", + "key": true + }, + { + "name": "amount", + "type": "u128", + "key": false + } + ], + "class_hash": "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d", + "original_class_hash": "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::mock_token" + }, { "kind": "DojoModel", "members": [ diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 601c02ab1b..ec501b9733 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -35,6 +35,19 @@ computed = [] init_calldata = [] name = "dojo_examples::actions::actions" +[[contracts]] +kind = "DojoContract" +address = "0x75961b2027c52948ecebfd347aa427436ea308d41997fa9b3c98380f7011d53" +class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::mock_token::mock_token" + [[contracts]] kind = "DojoContract" address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" @@ -96,6 +109,23 @@ name = "salt" type = "felt252" key = true +[[models]] +kind = "DojoModel" +class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +abi = "manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json" +name = "dojo_examples::models::mock_token" + +[[models.members]] +name = "account" +type = "ContractAddress" +key = true + +[[models.members]] +name = "amount" +type = "u128" +key = false + [[models]] kind = "DojoModel" class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json new file mode 100644 index 0000000000..21aed968a7 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json @@ -0,0 +1,290 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsComputedImpl", + "interface_name": "dojo_examples::actions::IActionsComputed" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActionsComputed", + "items": [ + { + "type": "function", + "name": "tile_terrain", + "inputs": [ + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "quadrant", + "inputs": [ + { + "name": "pos", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "dojo_examples::actions::IActions" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActions", + "items": [ + { + "type": "function", + "name": "spawn", + "inputs": [], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_player_config", + "inputs": [ + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json new file mode 100644 index 0000000000..f4bde33e6d --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json @@ -0,0 +1,133 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json new file mode 100644 index 0000000000..c1a2447839 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json @@ -0,0 +1,996 @@ +[ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::resource_metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "model", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::interfaces::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::interfaces::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::interfaces::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::interfaces::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::config::interface::IConfig" + }, + { + "type": "interface", + "name": "dojo::config::interface::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "model", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::config::component::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world::StateUpdated", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json new file mode 100644 index 0000000000..89abdcfec5 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json @@ -0,0 +1,389 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::actions::actions::Moved", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::Imoved", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::actions::actions::Moved" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json new file mode 100644 index 0000000000..ec760c99fb --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json @@ -0,0 +1,371 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json new file mode 100644 index 0000000000..b2c1c340fa --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json @@ -0,0 +1,363 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "mock_tokenImpl", + "interface_name": "dojo_examples::models::Imock_token" + }, + { + "type": "struct", + "name": "dojo_examples::models::MockToken", + "members": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u128" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imock_token", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::MockToken" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::mock_token::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json new file mode 100644 index 0000000000..ee2cf17b26 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json @@ -0,0 +1,393 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Moves", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imoves", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Moves" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::moves::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json new file mode 100644 index 0000000000..8c33ebabc4 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json @@ -0,0 +1,385 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ + { + "name": "item_id", + "type": "core::integer::u32" + }, + { + "name": "quantity", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerConfig", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iplayer_config", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::PlayerConfig" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::player_config::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json new file mode 100644 index 0000000000..bceec42587 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json @@ -0,0 +1,377 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iposition", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::position::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json new file mode 100644 index 0000000000..21aed968a7 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -0,0 +1,290 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsComputedImpl", + "interface_name": "dojo_examples::actions::IActionsComputed" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActionsComputed", + "items": [ + { + "type": "function", + "name": "tile_terrain", + "inputs": [ + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "quadrant", + "inputs": [ + { + "name": "pos", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "dojo_examples::actions::IActions" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActions", + "items": [ + { + "type": "function", + "name": "spawn", + "inputs": [], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_player_config", + "inputs": [ + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json new file mode 100644 index 0000000000..36d8c3ef78 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json @@ -0,0 +1,146 @@ +[ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json new file mode 100644 index 0000000000..c1a2447839 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json @@ -0,0 +1,996 @@ +[ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::resource_metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "model", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::interfaces::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::interfaces::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::interfaces::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::interfaces::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::config::interface::IConfig" + }, + { + "type": "interface", + "name": "dojo::config::interface::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "model", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::config::component::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world::StateUpdated", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json new file mode 100644 index 0000000000..89abdcfec5 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json @@ -0,0 +1,389 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::actions::actions::Moved", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::Imoved", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::actions::actions::Moved" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json new file mode 100644 index 0000000000..9c63d0fc5d --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json @@ -0,0 +1,389 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "emote_messageImpl", + "interface_name": "dojo_examples::models::Iemote_message" + }, + { + "type": "enum", + "name": "dojo_examples::models::Emote", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Happy", + "type": "()" + }, + { + "name": "Sad", + "type": "()" + }, + { + "name": "Angry", + "type": "()" + }, + { + "name": "Love", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::EmoteMessage", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "emote", + "type": "dojo_examples::models::Emote" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iemote_message", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::EmoteMessage" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::emote_message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json new file mode 100644 index 0000000000..ec760c99fb --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json @@ -0,0 +1,371 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json new file mode 100644 index 0000000000..ee2cf17b26 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json @@ -0,0 +1,393 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Moves", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imoves", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Moves" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::moves::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json new file mode 100644 index 0000000000..8c33ebabc4 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json @@ -0,0 +1,385 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ + { + "name": "item_id", + "type": "core::integer::u32" + }, + { + "name": "quantity", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerConfig", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iplayer_config", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::PlayerConfig" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::player_config::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json new file mode 100644 index 0000000000..bceec42587 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json @@ -0,0 +1,377 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iposition", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::position::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json new file mode 100644 index 0000000000..1dbbd313d8 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml new file mode 100644 index 0000000000..bf0f86489b --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples_actions_actions.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::actions::actions" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml new file mode 100644 index 0000000000..65fbfcc8ad --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::mock_token::mock_token" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..66cb83c9d6 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml @@ -0,0 +1,10 @@ +kind = "DojoContract" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml b/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml new file mode 100644 index 0000000000..6c4b5de67e --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml @@ -0,0 +1,4 @@ +kind = "Class" +class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml new file mode 100644 index 0000000000..e9badcfe4c --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml @@ -0,0 +1,5 @@ +kind = "Class" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +abi = "manifests/release/abis/base/dojo_world_world.json" +name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml new file mode 100644 index 0000000000..74c1e890a1 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +abi = "manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json" +name = "dojo_examples::actions::actions::moved" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml new file mode 100644 index 0000000000..fdc87b27cb --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml @@ -0,0 +1,25 @@ +kind = "DojoModel" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/release/abis/base/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" + +[[members]] +name = "identity" +type = "ContractAddress" +key = true + +[[members]] +name = "channel" +type = "felt252" +key = true + +[[members]] +name = "message" +type = "ByteArray" +key = false + +[[members]] +name = "salt" +type = "felt252" +key = true diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml new file mode 100644 index 0000000000..3d0147bc11 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" +abi = "manifests/release/abis/base/models/dojo_examples_models_mock_token.json" +name = "dojo_examples::models::mock_token" + +[[members]] +name = "account" +type = "ContractAddress" +key = true + +[[members]] +name = "amount" +type = "u128" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml new file mode 100644 index 0000000000..8954550f5e --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +abi = "manifests/release/abis/base/models/dojo_examples_models_moves.json" +name = "dojo_examples::models::moves" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "remaining" +type = "u8" +key = false + +[[members]] +name = "last_direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml new file mode 100644 index 0000000000..bbeae83193 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml @@ -0,0 +1,25 @@ +kind = "DojoModel" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +abi = "manifests/release/abis/base/models/dojo_examples_models_player_config.json" +name = "dojo_examples::models::player_config" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false + +[[members]] +name = "items" +type = "Array" +key = false + +[[members]] +name = "favorite_item" +type = "Option" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml new file mode 100644 index 0000000000..562adaba78 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml @@ -0,0 +1,15 @@ +kind = "DojoModel" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +abi = "manifests/release/abis/base/models/dojo_examples_models_position.json" +name = "dojo_examples::models::position" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "vec" +type = "Vec2" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..51efb699ba --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +abi = "manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/release/manifest.json b/examples/spawn-and-move/manifests/release/manifest.json new file mode 100644 index 0000000000..8ae464adc9 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/manifest.json @@ -0,0 +1,3910 @@ +{ + "world": { + "kind": "WorldContract", + "class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "original_class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "abi": [ + { + "type": "impl", + "name": "World", + "interface_name": "dojo::world::IWorld" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo::resource_metadata::ResourceMetadata", + "members": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorld", + "items": [ + { + "type": "function", + "name": "metadata", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_metadata", + "inputs": [ + { + "name": "metadata", + "type": "dojo::resource_metadata::ResourceMetadata" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "model", + "inputs": [ + { + "name": "selector", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "register_model", + "inputs": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "deploy_contract", + "inputs": [ + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "init_calldata", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_contract", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "uuid", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "emit", + "inputs": [ + { + "name": "keys", + "type": "core::array::Array::" + }, + { + "name": "values", + "type": "core::array::Span::" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [ + { + "type": "core::array::Span::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "values", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "delete_entity", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "keys", + "type": "core::array::Span::" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::class_hash::ClassHash" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_owner", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "resource", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "grant_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "revoke_writer", + "inputs": [ + { + "name": "model", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableWorld", + "interface_name": "dojo::world::IUpgradeableWorld" + }, + { + "type": "interface", + "name": "dojo::world::IUpgradeableWorld", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableState", + "interface_name": "dojo::interfaces::IUpgradeableState" + }, + { + "type": "struct", + "name": "dojo::interfaces::StorageUpdate", + "members": [ + { + "name": "key", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::interfaces::ProgramOutput", + "members": [ + { + "name": "prev_state_root", + "type": "core::felt252" + }, + { + "name": "new_state_root", + "type": "core::felt252" + }, + { + "name": "block_number", + "type": "core::felt252" + }, + { + "name": "block_hash", + "type": "core::felt252" + }, + { + "name": "config_hash", + "type": "core::felt252" + }, + { + "name": "world_da_hash", + "type": "core::felt252" + }, + { + "name": "message_to_starknet_segment", + "type": "core::array::Span::" + }, + { + "name": "message_to_appchain_segment", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "dojo::interfaces::IUpgradeableState", + "items": [ + { + "type": "function", + "name": "upgrade_state", + "inputs": [ + { + "name": "new_state", + "type": "core::array::Span::" + }, + { + "name": "program_output", + "type": "dojo::interfaces::ProgramOutput" + }, + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ConfigImpl", + "interface_name": "dojo::config::interface::IConfig" + }, + { + "type": "interface", + "name": "dojo::config::interface::IConfig", + "items": [ + { + "type": "function", + "name": "set_differ_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_merger_program_hash", + "inputs": [ + { + "name": "program_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_differ_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_merger_program_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_facts_registry", + "inputs": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_facts_registry", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldSpawned", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractDeployed", + "kind": "struct", + "members": [ + { + "name": "salt", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ContractUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WorldUpgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "uri", + "type": "core::byte_array::ByteArray", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::ModelRegistered", + "kind": "struct", + "members": [ + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "prev_class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + }, + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "prev_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreSetRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + }, + { + "name": "values", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StoreDelRecord", + "kind": "struct", + "members": [ + { + "name": "table", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "keys", + "type": "core::array::Span::", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::WriterUpdated", + "kind": "struct", + "members": [ + { + "name": "model", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::OwnerUpdated", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "resource", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "value", + "type": "core::bool", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "struct", + "members": [ + { + "name": "program_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "struct", + "members": [ + { + "name": "address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::config::component::Config::Event", + "kind": "enum", + "variants": [ + { + "name": "DifferProgramHashUpdate", + "type": "dojo::config::component::Config::DifferProgramHashUpdate", + "kind": "nested" + }, + { + "name": "MergerProgramHashUpdate", + "type": "dojo::config::component::Config::MergerProgramHashUpdate", + "kind": "nested" + }, + { + "name": "FactsRegistryUpdate", + "type": "dojo::config::component::Config::FactsRegistryUpdate", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::StateUpdated", + "kind": "struct", + "members": [ + { + "name": "da_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::Event", + "kind": "enum", + "variants": [ + { + "name": "WorldSpawned", + "type": "dojo::world::world::WorldSpawned", + "kind": "nested" + }, + { + "name": "ContractDeployed", + "type": "dojo::world::world::ContractDeployed", + "kind": "nested" + }, + { + "name": "ContractUpgraded", + "type": "dojo::world::world::ContractUpgraded", + "kind": "nested" + }, + { + "name": "WorldUpgraded", + "type": "dojo::world::world::WorldUpgraded", + "kind": "nested" + }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, + { + "name": "ModelRegistered", + "type": "dojo::world::world::ModelRegistered", + "kind": "nested" + }, + { + "name": "StoreSetRecord", + "type": "dojo::world::world::StoreSetRecord", + "kind": "nested" + }, + { + "name": "StoreDelRecord", + "type": "dojo::world::world::StoreDelRecord", + "kind": "nested" + }, + { + "name": "WriterUpdated", + "type": "dojo::world::world::WriterUpdated", + "kind": "nested" + }, + { + "name": "OwnerUpdated", + "type": "dojo::world::world::OwnerUpdated", + "kind": "nested" + }, + { + "name": "ConfigEvent", + "type": "dojo::config::component::Config::Event", + "kind": "nested" + }, + { + "name": "StateUpdated", + "type": "dojo::world::world::StateUpdated", + "kind": "nested" + } + ] + } + ], + "address": "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30", + "transaction_hash": "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d", + "block_number": 3, + "seed": "dojo_examples", + "metadata": { + "profile_name": "release", + "rpc_url": "http://localhost:5050/" + }, + "name": "dojo::world::world" + }, + "base": { + "kind": "Class", + "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": null, + "name": "dojo::base::base" + }, + "contracts": [ + { + "kind": "DojoContract", + "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", + "class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", + "original_class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsComputedImpl", + "interface_name": "dojo_examples::actions::IActionsComputed" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActionsComputed", + "items": [ + { + "type": "function", + "name": "tile_terrain", + "inputs": [ + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "quadrant", + "inputs": [ + { + "name": "pos", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ActionsImpl", + "interface_name": "dojo_examples::actions::IActions" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::IActions", + "items": [ + { + "type": "function", + "name": "spawn", + "inputs": [], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "move", + "inputs": [ + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ], + "outputs": [], + "state_mutability": "view" + }, + { + "type": "function", + "name": "set_player_config", + "inputs": [ + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::actions::actions::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [ + "Moves", + "Position" + ], + "computed": [], + "init_calldata": [], + "name": "dojo_examples::actions::actions" + }, + { + "kind": "DojoContract", + "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", + "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "abi": [ + { + "type": "impl", + "name": "DojoResourceProviderImpl", + "interface_name": "dojo::world::IDojoResourceProvider" + }, + { + "type": "interface", + "name": "dojo::world::IDojoResourceProvider", + "items": [ + { + "type": "function", + "name": "dojo_resource", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::others::others::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::others::others::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [ + { + "name": "actions_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "actions_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "computed": [], + "init_calldata": [ + "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples::actions::actions", + "10" + ], + "name": "dojo_examples::others::others" + } + ], + "models": [ + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "direction", + "type": "Direction", + "key": false + } + ], + "class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "original_class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::actions::actions::Moved", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::actions::actions::Imoved", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::actions::actions::Moved" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::actions::actions::moved::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::actions::actions::moved" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "identity", + "type": "ContractAddress", + "key": true + }, + { + "name": "channel", + "type": "felt252", + "key": true + }, + { + "name": "message", + "type": "ByteArray", + "key": false + }, + { + "name": "salt", + "type": "felt252", + "key": true + } + ], + "class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "original_class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "messageImpl", + "interface_name": "dojo_examples::models::Imessage" + }, + { + "type": "struct", + "name": "dojo_examples::models::Message", + "members": [ + { + "name": "identity", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel", + "type": "core::felt252" + }, + { + "name": "message", + "type": "core::byte_array::ByteArray" + }, + { + "name": "salt", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imessage", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Message" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::message::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::message" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "remaining", + "type": "u8", + "key": false + }, + { + "name": "last_direction", + "type": "Direction", + "key": false + } + ], + "class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "original_class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" + }, + { + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Moves", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "remaining", + "type": "core::integer::u8" + }, + { + "name": "last_direction", + "type": "dojo_examples::models::Direction" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Imoves", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Moves" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::moves::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::moves" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "name", + "type": "ByteArray", + "key": false + }, + { + "name": "items", + "type": "Array", + "key": false + }, + { + "name": "favorite_item", + "type": "Option", + "key": false + } + ], + "class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "original_class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerItem", + "members": [ + { + "name": "item_id", + "type": "core::integer::u32" + }, + { + "name": "quantity", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::PlayerConfig", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iplayer_config", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::PlayerConfig" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::player_config::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::player_config" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "vec", + "type": "Vec2", + "key": false + } + ], + "class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "original_class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" + }, + { + "type": "struct", + "name": "dojo_examples::models::Vec2", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "vec", + "type": "dojo_examples::models::Vec2" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iposition", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::Position" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::position::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::position" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "contract_address", + "type": "ContractAddress", + "key": true + }, + { + "name": "contract_class", + "type": "ClassHash", + "key": false + }, + { + "name": "value", + "type": "u8", + "key": false + } + ], + "class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "original_class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" + }, + { + "type": "struct", + "name": "dojo_examples::others::others::ContractInitialized", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::others::others::Icontract_initialized", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::others::others::ContractInitialized" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::others::others::contract_initialized::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::others::others::contract_initialized" + } + ] +} \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/manifest.toml b/examples/spawn-and-move/manifests/release/manifest.toml new file mode 100644 index 0000000000..71ebf9944e --- /dev/null +++ b/examples/spawn-and-move/manifests/release/manifest.toml @@ -0,0 +1,185 @@ +[world] +kind = "WorldContract" +class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" +abi = "manifests/release/abis/deployments/dojo_world_world.json" +address = "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" +transaction_hash = "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d" +block_number = 3 +seed = "dojo_examples" +name = "dojo::world::world" + +[world.metadata] +profile_name = "release" +rpc_url = "http://localhost:5050/" + +[base] +kind = "Class" +class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +name = "dojo::base::base" + +[[contracts]] +kind = "DojoContract" +address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" +class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json" +reads = [] +writes = [ + "Moves", + "Position", +] +computed = [] +init_calldata = [] +name = "dojo_examples::actions::actions" + +[[contracts]] +kind = "DojoContract" +address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" +class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +abi = "manifests/release/abis/deployments/contracts/dojo_examples_others_others.json" +reads = [] +writes = [] +computed = [] +init_calldata = [ + "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples::actions::actions", + "10", +] +name = "dojo_examples::others::others" + +[[models]] +kind = "DojoModel" +class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" +abi = "manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json" +name = "dojo_examples::actions::actions::moved" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "direction" +type = "Direction" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_message.json" +name = "dojo_examples::models::message" + +[[models.members]] +name = "identity" +type = "ContractAddress" +key = true + +[[models.members]] +name = "channel" +type = "felt252" +key = true + +[[models.members]] +name = "message" +type = "ByteArray" +key = false + +[[models.members]] +name = "salt" +type = "felt252" +key = true + +[[models]] +kind = "DojoModel" +class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_moves.json" +name = "dojo_examples::models::moves" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "remaining" +type = "u8" +key = false + +[[models.members]] +name = "last_direction" +type = "Direction" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_player_config.json" +name = "dojo_examples::models::player_config" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "name" +type = "ByteArray" +key = false + +[[models.members]] +name = "items" +type = "Array" +key = false + +[[models.members]] +name = "favorite_item" +type = "Option" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" +abi = "manifests/release/abis/deployments/models/dojo_examples_models_position.json" +name = "dojo_examples::models::position" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "vec" +type = "Vec2" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" +abi = "manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" +name = "dojo_examples::others::others::contract_initialized" + +[[models.members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[models.members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[models.members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml new file mode 100644 index 0000000000..188130a013 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml @@ -0,0 +1,4 @@ +init_calldata = [ ] +name = "dojo_examples::actions::actions" +reads = [ ] +writes = [ "Moves", "Position" ] diff --git a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml new file mode 100644 index 0000000000..82545bca81 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml @@ -0,0 +1,8 @@ +init_calldata = [ + "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples::actions::actions", + "10", +] +name = "dojo_examples::others::others" +reads = [ ] +writes = [ ] diff --git a/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml b/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml new file mode 100644 index 0000000000..f706470d45 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml @@ -0,0 +1 @@ +name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml b/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml new file mode 100644 index 0000000000..a3e686e3ef --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml @@ -0,0 +1 @@ +name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml new file mode 100644 index 0000000000..4958a7a15c --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml @@ -0,0 +1 @@ +name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml new file mode 100644 index 0000000000..5d9412cae2 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::message" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml new file mode 100644 index 0000000000..a5ba5684a6 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::mock_token" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml new file mode 100644 index 0000000000..dc8784e746 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml new file mode 100644 index 0000000000..6af8240b36 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml new file mode 100644 index 0000000000..df38e71c32 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml @@ -0,0 +1 @@ +name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml new file mode 100644 index 0000000000..f8f3053fe5 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml @@ -0,0 +1 @@ +name = "dojo_examples::others::others::contract_initialized" diff --git a/examples/spawn-and-move/src/lib.cairo b/examples/spawn-and-move/src/lib.cairo index 44309e5fca..b1273839ec 100644 --- a/examples/spawn-and-move/src/lib.cairo +++ b/examples/spawn-and-move/src/lib.cairo @@ -2,3 +2,4 @@ mod actions; mod models; mod utils; mod others; +mod mock_token; diff --git a/examples/spawn-and-move/src/mock_token.cairo b/examples/spawn-and-move/src/mock_token.cairo new file mode 100644 index 0000000000..75b4c00e16 --- /dev/null +++ b/examples/spawn-and-move/src/mock_token.cairo @@ -0,0 +1,11 @@ +#[dojo::contract] +mod mock_token { + use dojo_examples::models::{MockToken}; + use starknet::{ContractAddress, get_caller_address}; + + fn dojo_init(world: @IWorldDispatcher) { + let account: ContractAddress = get_caller_address(); + + set!(world, MockToken { account: account, amount: 1000 }); + } +} diff --git a/examples/spawn-and-move/src/models.cairo b/examples/spawn-and-move/src/models.cairo index a0b733e28c..85cfdf1711 100644 --- a/examples/spawn-and-move/src/models.cairo +++ b/examples/spawn-and-move/src/models.cairo @@ -42,6 +42,14 @@ struct Moves { last_direction: Direction } +#[derive(Copy, Drop, Serde)] +#[dojo::model] +struct MockToken { + #[key] + account: ContractAddress, + amount: u128, +} + #[derive(Copy, Drop, Serde, IntrospectPacked)] struct Vec2 { x: u32, From d6561159fbd438dd73dfa93e215ebbb7d205edc0 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Thu, 13 Jun 2024 21:25:09 -0400 Subject: [PATCH 28/88] Prepare release: v0.7.0 (#2055) --- Cargo.lock | 90 ++++++++++---------- Cargo.toml | 2 +- crates/dojo-core/Scarb.lock | 2 +- crates/dojo-core/Scarb.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- crates/torii/types-test/Scarb.lock | 2 +- crates/torii/types-test/Scarb.toml | 2 +- examples/spawn-and-move/Scarb.lock | 2 +- examples/spawn-and-move/Scarb.toml | 2 +- 9 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 877b081274..3e5c038dd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "clap", @@ -3776,7 +3776,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -4577,7 +4577,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "async-trait", "cainome", @@ -4595,15 +4595,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.0-alpha.5" +version = "0.7.0" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.0-alpha.5" +version = "0.7.0" [[package]] name = "dojo-lang" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -4654,7 +4654,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "cairo-lang-language-server", "clap", @@ -4663,7 +4663,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "hyper 0.14.28", @@ -4681,7 +4681,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "assert_fs", @@ -4715,7 +4715,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "cainome", "crypto-bigint", @@ -4731,7 +4731,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "assert_fs", @@ -4770,7 +4770,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7859,7 +7859,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-primitives", "anyhow", @@ -7867,7 +7867,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.0-alpha.5", + "common 0.7.0", "console", "dojo-metrics", "katana-core", @@ -7886,7 +7886,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -7899,7 +7899,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "bytes", "katana-primitives", @@ -7907,7 +7907,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "proc-macro2", "quote", @@ -7917,7 +7917,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-contract", "alloy-network", @@ -7965,7 +7965,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7987,7 +7987,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8014,7 +8014,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8039,7 +8039,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8065,7 +8065,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "assert_matches", @@ -8103,7 +8103,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8114,7 +8114,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8135,7 +8135,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "katana-executor", @@ -8147,7 +8147,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "assert_fs", @@ -8166,7 +8166,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "futures", "rayon", @@ -11545,7 +11545,7 @@ checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "runner-macro" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "quote", "syn 2.0.64", @@ -11813,7 +11813,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "cairo-proof-parser", @@ -11834,7 +11834,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "async-trait", @@ -11876,7 +11876,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "alloy-primitives", "anyhow", @@ -12048,7 +12048,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "clap", "clap_complete", @@ -12684,7 +12684,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "assert_fs", @@ -12743,7 +12743,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "assert_fs", @@ -12799,7 +12799,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "starknet", @@ -14070,7 +14070,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "async-trait", @@ -14078,7 +14078,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.0-alpha.5", + "common 0.7.0", "ctrlc", "dojo-metrics", "dojo-types", @@ -14115,7 +14115,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "async-trait", "camino", @@ -14143,7 +14143,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "async-trait", @@ -14182,7 +14182,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "async-graphql", @@ -14223,7 +14223,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "bytes", "camino", @@ -14267,7 +14267,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "async-trait", @@ -14303,7 +14303,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.0-alpha.5" +version = "0.7.0" dependencies = [ "anyhow", "async-trait", @@ -14626,7 +14626,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.0-alpha.5" +version = "0.7.0" [[package]] name = "ucd-trie" diff --git a/Cargo.toml b/Cargo.toml index cec0e4cd65..49ea3d3980 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.0-alpha.5" +version = "0.7.0" [profile.performance] codegen-units = 1 diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index 87f054ddd0..8f50ef208b 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 9e23066bca..ddc8fb6569 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -2,7 +2,7 @@ cairo-version = "=2.6.3" description = "The Dojo Core library for autonomous worlds." name = "dojo" -version = "0.6.0" +version = "0.7.0" [dependencies] dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.11" } diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 3b7767c142..18bf78b403 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.0-alpha.5" +version = "0.7.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index 112ae6dbe9..0babbac9af 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo_plugin", ] diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 0f11558350..1e34e4f328 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "2.4.0" name = "types_test" -version = "0.6.0" +version = "0.7.0" [cairo] sierra-replace-ids = true diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 9525e9db0e..d3ebe55642 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo_plugin", ] diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 5dd277ffa0..27de8bbe1d 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "=2.6.3" name = "dojo_examples" -version = "0.6.0" +version = "0.7.0" # Use the prelude with the less imports as possible # from corelib. edition = "2023_10" From 485711337b982ed9cd4c36e7a516c340febec48d Mon Sep 17 00:00:00 2001 From: glihm Date: Thu, 13 Jun 2024 20:01:32 -0600 Subject: [PATCH 29/88] fix: ensure pkg-config is also installed (#2056) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e733fc12f..ea0ccacc32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,7 +92,7 @@ jobs: if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} run: | sudo apt-get update -y - sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev + sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev pkg-config echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV # We build jemalloc with 64KB pagesize so that it works for all linux/arm64 pagesize variants # See: https://github.com/jemalloc/jemalloc/issues/467 From 34b13caa785c1149558d28f1a9d9fbd700c4aa2d Mon Sep 17 00:00:00 2001 From: glihm Date: Thu, 13 Jun 2024 20:31:29 -0600 Subject: [PATCH 30/88] ci: try arm64 ubuntu runner --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea0ccacc32..ee55da80f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: platform: linux target: x86_64-unknown-linux-gnu arch: amd64 - - os: ubuntu-latest-8-cores + - os: ubuntu-latest-8-cores-arm64 platform: linux target: aarch64-unknown-linux-gnu arch: arm64 @@ -92,8 +92,7 @@ jobs: if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }} run: | sudo apt-get update -y - sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev pkg-config - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev # We build jemalloc with 64KB pagesize so that it works for all linux/arm64 pagesize variants # See: https://github.com/jemalloc/jemalloc/issues/467 echo "JEMALLOC_SYS_WITH_LG_PAGE=16" >> $GITHUB_ENV From 0e9497516d6afe4c749b20695b309e763907357b Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Fri, 14 Jun 2024 16:43:35 -0400 Subject: [PATCH 31/88] Update devcontainer image: v0.7.0 (#2052) Co-authored-by: glihm --- .devcontainer/devcontainer.json | 2 +- .github/workflows/bench.yml | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/release-dispatch.yml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 176190883c..b71e0f6aa2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust { "name": "Rust", - "image": "ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5", + "image": "ghcr.io/dojoengine/dojo-dev:v0.7.0", "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 904d05fc3a..16b8df0133 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85f421dbfa..53876adc6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: test: runs-on: ubuntu-latest-32-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -33,7 +33,7 @@ jobs: ensure-wasm: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -67,7 +67,7 @@ jobs: dojo-core-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -76,7 +76,7 @@ jobs: dojo-spawn-and-move-example-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -85,7 +85,7 @@ jobs: dojo-world-bindings-check: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -94,7 +94,7 @@ jobs: clippy: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -103,7 +103,7 @@ jobs: fmt: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -112,7 +112,7 @@ jobs: docs: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index 944accd1ea..6374f2428a 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -14,7 +14,7 @@ jobs: contents: write runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0-alpha.5 + image: ghcr.io/dojoengine/dojo-dev:v0.7.0 env: VERSION: "" steps: From cab4d0541dd42df7570ac91d6fba9967e5ba1d2f Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:01:59 -0400 Subject: [PATCH 32/88] fix(dojo-bindgen): array length before array items (#2060) fix: include array length before array items --- crates/dojo-bindgen/src/plugins/unity/mod.rs | 36 ++++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index 45578f2267..8fe748a940 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -364,20 +364,28 @@ public class {} : ModelInstance {{ .collect::>() .join(", "); - vec![( - if is_inner_array { - format!( - "{arg_name}.SelectMany({arg_name}Item => new dojo.FieldElement[] \ - {{ }}.Concat({inners}))" - ) - } else { - format!( - "{arg_name}.SelectMany({arg_name}Item => new [] {{ {inners} }})" - ) - }, - true, - enum_variant.clone(), - )] + vec![ + ( + format!("new FieldElement({arg_name}.Length).Inner",), + false, + enum_variant.clone(), + ), + ( + if is_inner_array { + format!( + "{arg_name}.SelectMany({arg_name}Item => new \ + dojo.FieldElement[] {{ }}.Concat({inners}))" + ) + } else { + format!( + "{arg_name}.SelectMany({arg_name}Item => new [] {{ {inners} \ + }})" + ) + }, + true, + enum_variant.clone(), + ), + ] } Token::Tuple(tuple) => tuple .inners From 25e857365c8f61c21bb714e4c9e9e44e433658e5 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Sat, 15 Jun 2024 15:55:32 -0400 Subject: [PATCH 33/88] fix(torii): fix table name using reserved sql keywords (#2062) --- crates/torii/core/src/sql.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index e0d89bf3b4..7f54ae28b6 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -936,7 +936,7 @@ impl Sql { create_table_query.push_str(&format!(", idx_{i}", i = i)); } create_table_query.push_str(&format!( - ") REFERENCES {parent_table_id} (id", + ") REFERENCES [{parent_table_id}] (id", parent_table_id = parent_table_id )); for i in 0..parent_array_idx { From 3c661bd55afe132a8e7e6806869f7fd7558850d9 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sun, 16 Jun 2024 18:18:59 +0800 Subject: [PATCH 34/88] refactor(sozo): dont use explicit account type (#2061) * use account with trait * remove comments * fmt * remove comments * update dev as well --------- Co-authored-by: lambda-0x <0xlambda@protonmail.com> --- bin/sozo/src/commands/dev.rs | 13 ++-- crates/dojo-world/src/migration/mod.rs | 49 ++++++------ crates/sozo/ops/src/auth.rs | 9 ++- crates/sozo/ops/src/migration/auto_auth.rs | 7 +- crates/sozo/ops/src/migration/migrate.rs | 87 +++++++++++----------- crates/sozo/ops/src/migration/mod.rs | 13 ++-- crates/sozo/ops/src/migration/utils.rs | 12 ++- examples/spawn-and-move/Scarb.lock | 2 +- 8 files changed, 95 insertions(+), 97 deletions(-) diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index 79d866b1a0..3a80a75f96 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -19,10 +19,8 @@ use scarb::compiler::{CairoCompilationUnit, CompilationUnit, CompilationUnitAttr use scarb::core::{Config, Workspace}; use scarb::ops::{FeaturesOpts, FeaturesSelector}; use sozo_ops::migration; -use starknet::accounts::SingleOwnerAccount; +use starknet::accounts::ConnectedAccount; use starknet::core::types::FieldElement; -use starknet::providers::Provider; -use starknet::signers::Signer; use tracing::{error, trace}; use super::migrate::setup_env; @@ -225,17 +223,18 @@ fn build(context: &mut DevContext<'_>) -> Result<()> { } // TODO: fix me -async fn migrate( +async fn migrate( mut world_address: Option, - account: &SingleOwnerAccount, + account: A, name: &str, ws: &Workspace<'_>, previous_manifest: Option, skip_migration: Option>, ) -> Result<(DeploymentManifest, Option)> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::Provider: Send, + A::SignError: 'static, { let target_dir = ws.target_dir().path_existent().unwrap(); let target_dir = target_dir.join(ws.config().profile().as_str()); diff --git a/crates/dojo-world/src/migration/mod.rs b/crates/dojo-world/src/migration/mod.rs index 4f6b306bad..203b5d91de 100644 --- a/crates/dojo-world/src/migration/mod.rs +++ b/crates/dojo-world/src/migration/mod.rs @@ -7,7 +7,7 @@ use anyhow::{anyhow, Result}; use async_trait::async_trait; use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use cairo_lang_starknet_classes::contract_class::ContractClass; -use starknet::accounts::{Account, AccountError, Call, ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::{Account, AccountError, Call, ConnectedAccount}; use starknet::core::types::contract::{CompiledClass, SierraClass}; use starknet::core::types::{ BlockId, BlockTag, DeclareTransactionResult, FieldElement, FlattenedSierraClass, @@ -16,7 +16,6 @@ use starknet::core::types::{ use starknet::core::utils::{get_contract_address, CairoShortStringToFeltError}; use starknet::macros::{felt, selector}; use starknet::providers::{Provider, ProviderError}; -use starknet::signers::Signer; use thiserror::Error; use crate::utils::{TransactionExt, TransactionWaiter, TransactionWaitingError}; @@ -127,14 +126,14 @@ impl TxnConfig { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait Declarable { - async fn declare( + async fn declare( &self, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { let (flattened_class, casm_class_hash) = prepare_contract_declaration_params(self.artifact_path())?; @@ -168,20 +167,20 @@ pub trait Declarable { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait Deployable: Declarable + Sync { - async fn deploy_dojo_contract( + async fn deploy_dojo_contract( &self, world_address: FieldElement, class_hash: FieldElement, base_class_hash: FieldElement, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, calldata: &[String], - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { - let declare = match self.declare(account, txn_config).await { + let declare = match self.declare(&account, txn_config).await { Ok(res) => Some(res), Err(MigrationError::ClassAlreadyDeclared) => None, Err(e) => return Err(e), @@ -247,18 +246,18 @@ pub trait Deployable: Declarable + Sync { }) } - async fn deploy( + async fn deploy( &self, class_hash: FieldElement, constructor_calldata: Vec, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { - let declare = match self.declare(account, txn_config).await { + let declare = match self.declare(&account, txn_config).await { Ok(res) => Some(res), Err(MigrationError::ClassAlreadyDeclared) => None, Err(e) => return Err(e), @@ -322,19 +321,19 @@ pub trait Deployable: Declarable + Sync { #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait Upgradable: Deployable + Declarable + Sync { - async fn upgrade_world( + async fn upgrade_world( &self, class_hash: FieldElement, original_class_hash: FieldElement, original_base_class_hash: FieldElement, - account: &SingleOwnerAccount, + account: A, txn_config: &TxnConfig, - ) -> Result as Account>::SignError>> + ) -> Result::SignError>> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { - let declare = match self.declare(account, txn_config).await { + let declare = match self.declare(&account, txn_config).await { Ok(res) => Some(res), Err(MigrationError::ClassAlreadyDeclared) => None, Err(e) => return Err(e), diff --git a/crates/sozo/ops/src/auth.rs b/crates/sozo/ops/src/auth.rs index 35c805376f..9edb851b48 100644 --- a/crates/sozo/ops/src/auth.rs +++ b/crates/sozo/ops/src/auth.rs @@ -7,7 +7,7 @@ use dojo_world::contracts::{cairo_utils, WorldContractReader}; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use scarb_ui::Ui; -use starknet::accounts::ConnectedAccount; +use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag}; use starknet::core::utils::{get_selector_from_name, parse_cairo_short_string}; use starknet_crypto::FieldElement; @@ -88,14 +88,15 @@ impl FromStr for OwnerResource { } } -pub async fn grant_writer( - ui: &Ui, +pub async fn grant_writer<'a, A>( + ui: &'a Ui, world: &WorldContract, models_contracts: Vec, txn_config: TxnConfig, ) -> Result<()> where - A: ConnectedAccount + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + ::SignError: 'static, { let mut calls = Vec::new(); diff --git a/crates/sozo/ops/src/migration/auto_auth.rs b/crates/sozo/ops/src/migration/auto_auth.rs index 08d67772d9..df213e144c 100644 --- a/crates/sozo/ops/src/migration/auto_auth.rs +++ b/crates/sozo/ops/src/migration/auto_auth.rs @@ -10,15 +10,16 @@ use super::ui::MigrationUi; use super::MigrationOutput; use crate::auth::{grant_writer, ModelContract}; -pub async fn auto_authorize<'a, A>( +pub async fn auto_authorize( ws: &Workspace<'_>, - world: &'a WorldContract, + world: &WorldContract, txn_config: &TxnConfig, local_manifest: &BaseManifest, migration_output: &MigrationOutput, ) -> Result<()> where - A: ConnectedAccount + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::SignError: 'static, { let ui = ws.config().ui(); diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index b6c194e5a4..eb0b406b42 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -21,7 +21,7 @@ use dojo_world::utils::{TransactionExt, TransactionWaiter}; use futures::future; use scarb::core::Workspace; use scarb_ui::Ui; -use starknet::accounts::{Account, ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::ConnectedAccount; use starknet::core::types::{ BlockId, BlockTag, FunctionCall, InvokeTransactionResult, StarknetError, }; @@ -29,7 +29,6 @@ use starknet::core::utils::{ cairo_short_string_to_felt, get_contract_address, get_selector_from_name, }; use starknet::providers::{Provider, ProviderError}; -use starknet::signers::Signer; use starknet_crypto::FieldElement; use tokio::fs; @@ -64,15 +63,16 @@ pub fn prepare_migration( Ok(migration) } -pub async fn apply_diff( +pub async fn apply_diff( ws: &Workspace<'_>, - account: &SingleOwnerAccount, + account: A, txn_config: TxnConfig, strategy: &mut MigrationStrategy, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + ::Provider: Send, + A::SignError: 'static, { let ui = ws.config().ui(); @@ -116,15 +116,16 @@ where Ok(migration_output) } -pub async fn execute_strategy( +pub async fn execute_strategy( ws: &Workspace<'_>, strategy: &MigrationStrategy, - migrator: &SingleOwnerAccount, + migrator: A, txn_config: TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::Provider: Send, + A::SignError: 'static, { let ui = ws.config().ui(); let mut world_tx_hash: Option = None; @@ -134,7 +135,7 @@ where Some(base) => { ui.print_header("# Base Contract"); - match base.declare(migrator, &txn_config).await { + match base.declare(&migrator, &txn_config).await { Ok(res) => { ui.print_sub(format!("Class Hash: {:#x}", res.class_hash)); } @@ -165,7 +166,7 @@ where "world", world.diff.original_class_hash, strategy.base.as_ref().unwrap().diff.original_class_hash, - migrator, + &migrator, &ui, &txn_config, ) @@ -182,7 +183,7 @@ where } else { let calldata = vec![strategy.base.as_ref().unwrap().diff.local_class_hash]; let deploy_result = - deploy_contract(world, "world", calldata.clone(), migrator, &ui, &txn_config) + deploy_contract(world, "world", calldata.clone(), &migrator, &ui, &txn_config) .await .map_err(|e| { ui.verbose(format!("{e:?}")); @@ -215,7 +216,7 @@ where // Once Torii supports indexing arrays, we should declare and register the // ResourceMetadata model. - match register_dojo_models(&strategy.models, world_address, migrator, &ui, &txn_config).await { + match register_dojo_models(&strategy.models, world_address, &migrator, &ui, &txn_config).await { Ok(output) => { migration_output.models = output.registered_model_names; } @@ -292,15 +293,15 @@ fn create_resource_metadata( /// * `ws` - the workspace /// * `migrator` - the account used to migrate /// * `migration_output` - the output after having applied the migration plan. -pub async fn upload_metadata( +pub async fn upload_metadata( ws: &Workspace<'_>, - migrator: &SingleOwnerAccount, + migrator: A, migration_output: MigrationOutput, txn_config: TxnConfig, ) -> Result<()> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + ::Provider: Send, { let ui = ws.config().ui(); @@ -364,7 +365,7 @@ where ui.print("> All IPFS artifacts have been successfully uploaded.".to_string()); // update the resource registry - let world = WorldContract::new(migration_output.world_address, migrator); + let world = WorldContract::new(migration_output.world_address, &migrator); let calls = resources.iter().map(|r| world.set_metadata_getcall(r)).collect::>(); @@ -387,16 +388,16 @@ where Ok(()) } -async fn register_dojo_models( +async fn register_dojo_models( models: &[ClassMigration], world_address: FieldElement, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { if models.is_empty() { return Ok(RegisterOutput { @@ -414,7 +415,7 @@ where for c in models.iter() { ui.print(italic_message(&c.diff.name).to_string()); - let res = c.declare(migrator, txn_config).await; + let res = c.declare(&migrator, txn_config).await; match res { Ok(output) => { ui.print_hidden_sub(format!("Declare transaction: {:#x}", output.transaction_hash)); @@ -439,7 +440,7 @@ where ui.print_sub(format!("Class hash: {:#x}", c.diff.local_class_hash)); } - let world = WorldContract::new(world_address, migrator); + let world = WorldContract::new(world_address, &migrator); let calls = models .iter() @@ -462,16 +463,16 @@ where Ok(RegisterOutput { transaction_hash, declare_output, registered_model_names }) } -async fn register_dojo_contracts( +async fn register_dojo_contracts( contracts: &Vec, world_address: FieldElement, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result>> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { if contracts.is_empty() { return Ok(vec![]); @@ -489,7 +490,7 @@ where world_address, contract.diff.local_class_hash, contract.diff.base_class_hash, - migrator, + &migrator, txn_config, &contract.diff.init_calldata, ) @@ -550,17 +551,17 @@ where Ok(deploy_output) } -async fn deploy_contract( +async fn deploy_contract( contract: &ContractMigration, contract_id: &str, constructor_calldata: Vec, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { match contract .deploy(contract.diff.local_class_hash, constructor_calldata, migrator, txn_config) @@ -592,18 +593,18 @@ where } } -async fn upgrade_contract( +async fn upgrade_contract( contract: &ContractMigration, contract_id: &str, original_class_hash: FieldElement, original_base_class_hash: FieldElement, - migrator: &SingleOwnerAccount, + migrator: A, ui: &Ui, txn_config: &TxnConfig, ) -> Result where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Send + Sync, + ::Provider: Send, { match contract .upgrade_world( @@ -649,12 +650,12 @@ pub fn handle_artifact_error(ui: &Ui, artifact_path: &Path, error: anyhow::Error } pub async fn get_contract_operation_name

( - provider: &P, + provider: P, contract: &ContractMigration, world_address: Option, ) -> String where - P: Provider + Sync + Send + 'static, + P: Provider + Sync + Send, { if let Some(world_address) = world_address { if let Ok(base_class_hash) = provider @@ -691,11 +692,11 @@ where pub async fn print_strategy

( ui: &Ui, - provider: &P, + provider: P, strategy: &MigrationStrategy, world_address: FieldElement, ) where - P: Provider + Sync + Send + 'static, + P: Provider + Sync + Send, { ui.print("\n📋 Migration Strategy\n"); @@ -730,7 +731,7 @@ pub async fn print_strategy

( if !&strategy.contracts.is_empty() { ui.print_header(format!("# Contracts ({})", &strategy.contracts.len())); for c in &strategy.contracts { - let op_name = get_contract_operation_name(provider, c, strategy.world_address).await; + let op_name = get_contract_operation_name(&provider, c, strategy.world_address).await; ui.print(op_name); ui.print_sub(format!("Class hash: {:#x}", c.diff.local_class_hash)); diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index 393ec72785..21351004a2 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -12,10 +12,8 @@ use dojo_world::manifest::{ use dojo_world::migration::world::WorldDiff; use dojo_world::migration::{DeployOutput, TxnConfig, UpgradeOutput}; use scarb::core::Workspace; -use starknet::accounts::{ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::ConnectedAccount; use starknet::core::types::FieldElement; -use starknet::providers::Provider; -use starknet::signers::Signer; mod auto_auth; mod migrate; @@ -50,19 +48,20 @@ pub struct ContractMigrationOutput { } #[allow(clippy::too_many_arguments)] -pub async fn migrate( +pub async fn migrate( ws: &Workspace<'_>, world_address: Option, rpc_url: String, - account: SingleOwnerAccount, + account: A, name: &str, dry_run: bool, txn_config: TxnConfig, skip_manifests: Option>, ) -> Result<()> where - P: Provider + Sync + Send + 'static, - S: Signer + Sync + Send + 'static, + A: ConnectedAccount + Sync + Send, + A::Provider: Send, + A::SignError: 'static, { let ui = ws.config().ui(); diff --git a/crates/sozo/ops/src/migration/utils.rs b/crates/sozo/ops/src/migration/utils.rs index e8f6f50165..1afe38f305 100644 --- a/crates/sozo/ops/src/migration/utils.rs +++ b/crates/sozo/ops/src/migration/utils.rs @@ -5,9 +5,7 @@ use dojo_world::manifest::{ OVERLAYS_DIR, }; use scarb_ui::Ui; -use starknet::accounts::{ConnectedAccount, SingleOwnerAccount}; -use starknet::providers::Provider; -use starknet::signers::Signer; +use starknet::accounts::ConnectedAccount; use starknet_crypto::FieldElement; use super::ui::MigrationUi; @@ -15,16 +13,16 @@ use super::ui::MigrationUi; /// Loads: /// - `BaseManifest` from filesystem /// - `DeployedManifest` from onchain dataa if `world_address` is `Some` -pub(super) async fn load_world_manifests( +pub(super) async fn load_world_manifests( profile_dir: &Utf8PathBuf, - account: &SingleOwnerAccount, + account: A, world_address: Option, ui: &Ui, skip_migration: Option>, ) -> Result<(BaseManifest, Option)> where - P: Provider + Sync + Send, - S: Signer + Sync + Send, + A: ConnectedAccount + Sync + Send, + ::Provider: Send, { ui.print_step(1, "🌎", "Building World state..."); diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index d3ebe55642..427bc2e0e4 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo_examples" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo", ] From 88848efd9a3ecd7b85413d52cfe354c070ccc12a Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 16 Jun 2024 04:19:22 -0600 Subject: [PATCH 35/88] fix(sozo): allow sozo build in workspace and proper error for other cases (#2059) * fix: use default value instead of unwrap * wip: unlocking build in workspace + prepare workspace support * update implementations * fix tests * use current_package instead of root_package * update comments --------- Co-authored-by: lambda-0x <0xlambda@protonmail.com> --- bin/sozo/src/commands/build.rs | 14 +++++++------- bin/sozo/src/commands/clean.rs | 4 +++- bin/sozo/src/commands/dev.rs | 11 +++++++++-- bin/sozo/src/commands/migrate.rs | 12 ++++++++++-- bin/sozo/src/commands/print_env.rs | 13 +++++++++++-- bin/sozo/src/utils.rs | 13 ++++++++++--- bin/sozo/tests/register_test.rs | 8 ++++++-- crates/dojo-bindgen/src/lib.rs | 5 ++++- .../dojo-bindgen/src/plugins/typescript_v2/mod.rs | 5 ++++- .../manifest_test_data/compiler_cairo/Scarb.lock | 2 +- crates/dojo-test-utils/src/migration.rs | 5 ++++- crates/dojo-world/src/contracts/model_test.rs | 3 ++- crates/dojo-world/src/contracts/world_test.rs | 3 ++- crates/dojo-world/src/manifest/manifest_test.rs | 3 ++- crates/dojo-world/src/metadata.rs | 13 ++++++++++--- crates/dojo-world/src/metadata_test.rs | 3 ++- crates/sozo/ops/src/migration/migrate.rs | 6 +++++- crates/sozo/ops/src/tests/migration.rs | 3 ++- crates/torii/core/src/sql_test.rs | 3 ++- crates/torii/graphql/src/tests/mod.rs | 3 ++- .../torii/grpc/src/server/tests/entities_test.rs | 3 ++- 21 files changed, 100 insertions(+), 35 deletions(-) diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index b94785575e..5d1d5df7cf 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -126,13 +126,13 @@ impl BuildArgs { }; trace!(pluginManager=?bindgen, "Generating bindings."); - let ws = scarb::ops::read_workspace(config.manifest_path(), config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); - - tokio::runtime::Runtime::new() - .unwrap() - .block_on(bindgen.generate(dojo_metadata.skip_migration)) - .expect("Error generating bindings"); + // Only generate bindgen if a current package is defined with dojo metadata. + if let Some(dojo_metadata) = dojo_metadata_from_workspace(&ws) { + tokio::runtime::Runtime::new() + .unwrap() + .block_on(bindgen.generate(dojo_metadata.skip_migration)) + .expect("Error generating bindings"); + }; Ok(()) } diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 41da4a1921..bf44226bb8 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -85,7 +85,9 @@ mod tests { let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( + "No current package with dojo metadata found, clean is not yet support for workspaces.", + ); // Plan the migration to generate some manifests other than base. config.tokio_handle().block_on(async { diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index 3a80a75f96..92b20e7c66 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -48,7 +48,14 @@ pub struct DevArgs { impl DevArgs { pub fn run(self, config: &Config) -> Result<()> { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, dev is not yet support for \ + workspaces." + )); + }; let env_metadata = if config.manifest_path().exists() { dojo_metadata.env().cloned() @@ -67,7 +74,7 @@ impl DevArgs { RecursiveMode::Recursive, )?; - let name = self.name.unwrap_or_else(|| ws.root_package().unwrap().id.name.to_string()); + let name = self.name.unwrap_or_else(|| ws.current_package().unwrap().id.name.to_string()); let mut previous_manifest: Option = Option::None; let result = build(&mut context); diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 6f6abe7404..239a78f58d 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -58,7 +58,15 @@ impl MigrateArgs { pub fn run(self, config: &Config) -> Result<()> { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let dojo_metadata = dojo_metadata_from_workspace(&ws); + + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, migrate is not yet support for \ + workspaces." + )); + }; // This variant is tested before the match on `self.command` to avoid // having the need to spin up a Katana to generate the files. @@ -82,7 +90,7 @@ impl MigrateArgs { let MigrateArgs { name, world, starknet, account, .. } = self; let name = name.unwrap_or_else(|| { - ws.root_package().expect("Root package to be present").id.name.to_string() + ws.current_package().expect("Root package to be present").id.name.to_string() }); let (world_address, account, rpc_url) = config.tokio_handle().block_on(async { diff --git a/bin/sozo/src/commands/print_env.rs b/bin/sozo/src/commands/print_env.rs index 23c273fe57..f8be7e1df4 100644 --- a/bin/sozo/src/commands/print_env.rs +++ b/bin/sozo/src/commands/print_env.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use anyhow::{anyhow, Result}; use clap::Args; use dojo_world::metadata::dojo_metadata_from_workspace; use scarb::core::Config; @@ -26,8 +26,17 @@ impl PrintEnvArgs { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; let ui = ws.config().ui(); + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, print-env is not yet support for \ + workspaces." + )); + }; + let env_metadata = if config.manifest_path().exists() { - dojo_metadata_from_workspace(&ws).env().cloned() + dojo_metadata.env().cloned() } else { trace!("Manifest path does not exist."); None diff --git a/bin/sozo/src/utils.rs b/bin/sozo/src/utils.rs index d277c8d910..e65c0a2838 100644 --- a/bin/sozo/src/utils.rs +++ b/bin/sozo/src/utils.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use anyhow::{Error, Result}; +use anyhow::{anyhow, Error, Result}; use camino::Utf8PathBuf; use dojo_world::contracts::world::WorldContract; use dojo_world::contracts::WorldContractReader; @@ -28,8 +28,15 @@ use crate::commands::options::world::WorldOptions; pub fn load_metadata_from_config(config: &Config) -> Result, Error> { let env_metadata = if config.manifest_path().exists() { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - - dojo_metadata_from_workspace(&ws).env().cloned() + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { + metadata + } else { + return Err(anyhow!( + "No current package with dojo metadata found, workspaces are not suppored yet." + )); + }; + + dojo_metadata.env().cloned() } else { None }; diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index 7faf1ce474..8cc161abee 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -21,13 +21,15 @@ async fn reregister_models() { let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let target_path = ws.target_dir().path_existent().unwrap().join(ws.config().profile().to_string()); let migration = - prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); + prepare_migration(source_project_dir.clone(), target_path, dojo_metadata.skip_migration) + .unwrap(); let sequencer = KatanaRunner::new().expect("Failed to start runner."); @@ -55,6 +57,8 @@ async fn reregister_models() { rpc_url, "--private-key", private_key, + "--manifest-path", + config.manifest_path().as_ref(), ]; let assert = get_snapbox().args(args_vec.iter()).assert().success(); diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index d92999ad14..c8cbe96172 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -274,7 +274,10 @@ mod tests { ); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( + "No current package with dojo metadata found, bindgen is not yet supported for \ + workspaces.", + ); let data = gather_dojo_data(&manifest_path, "dojo_example", "dev", dojo_metadata.skip_migration) diff --git a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs index 498b032c86..d7846ceef0 100644 --- a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs @@ -655,7 +655,10 @@ mod tests { ); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( + "No current package with dojo metadata found, bindgen is not yet support for \ + workspaces.", + ); let data = gather_dojo_data(&manifest_path, "dojo_examples", "dev", dojo_metadata.skip_migration) .unwrap(); diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock index 6f542bc33a..440bb61dbe 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index 9edfb3e969..d0ecc91126 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -34,7 +34,10 @@ pub fn prepare_migration( let mut world = WorldDiff::compute(manifest, None); world.update_order().unwrap(); - prepare_for_migration(None, felt!("0x12345"), &target_dir, world) + let mut strat = prepare_for_migration(None, felt!("0x12345"), &target_dir, world).unwrap(); + strat.resolve_variable(strat.world_address().unwrap()).unwrap(); + + Ok(strat) } pub fn prepare_migration_with_world_and_seed( diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 8aeeec1649..2fd460b729 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -26,7 +26,8 @@ async fn test_model() { let target_dir = manifest_dir.join("target").join("dev"); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let world_address = deploy_world(&runner, &manifest_dir.into(), &target_dir, dojo_metadata.skip_migration) diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index 21759c1ee2..5680d52c45 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -30,7 +30,8 @@ async fn test_world_contract_reader() { let provider = account.provider(); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let world_address = deploy_world( &runner, diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index b979b93675..d19a69b01b 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -384,7 +384,8 @@ fn fetch_remote_manifest() { compiler::copy_build_project_temp(source_project, dojo_core_path, true); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let artifacts_path = temp_project_dir.join(format!("target/{profile_name}")); diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index 12f6cc837f..d778476a2f 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -85,7 +85,7 @@ pub fn project_to_world_metadata(project_metadata: Option) /// /// # Returns /// A [`DojoMetadata`] object containing all Dojo metadata. -pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { +pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Option { let profile = ws.config().profile(); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); @@ -94,7 +94,14 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { let sources_dir = target_dir.join(profile.as_str()).join(SOURCES_DIR); let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); - let project_metadata = ws.current_package().unwrap().manifest.metadata.dojo(); + let project_metadata = if let Ok(current_package) = ws.current_package() { + current_package.manifest.metadata.dojo() + } else { + // On workspaces, dojo metadata are not accessible because if no current package is defined + // (being the only package or using --package). + return None; + }; + let mut dojo_metadata = DojoMetadata { env: project_metadata.env.clone(), skip_migration: project_metadata.skip_migration.clone(), @@ -142,7 +149,7 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> DojoMetadata { } } - dojo_metadata + Some(dojo_metadata) } /// Metadata coming from project configuration (Scarb.toml) diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index adeb0df9a7..e564e3a8e4 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -121,7 +121,8 @@ async fn get_full_dojo_metadata_from_workspace() { let sources_dir = target_dir.join(profile.as_str()).join(SOURCES_DIR); let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); // env assert!(dojo_metadata.env.is_some()); diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index eb0b406b42..420c269237 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -309,7 +309,11 @@ where ui.print_step(7, "🌐", "Uploading metadata..."); ui.print(" "); - let dojo_metadata = dojo_metadata_from_workspace(ws); + let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(ws) { + metadata + } else { + return Err(anyhow!("No current package with dojo metadata found.")); + }; let mut ipfs = vec![]; let mut resources = vec![]; diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 006c9a731e..1c070dbd48 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -164,7 +164,8 @@ async fn migrate_with_metadata() { .unwrap_or_else(|_| panic!("Unable to initialize the IPFS Client")) .with_credentials(IPFS_USERNAME, IPFS_PASSWORD); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); // check world metadata let resource = world_reader.metadata(&FieldElement::ZERO).call().await.unwrap(); diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index cceb20d657..09f4100caa 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -63,7 +63,8 @@ async fn test_load_from_remote() { let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let manifest_path = config.manifest_path(); let base_dir = manifest_path.parent().unwrap(); diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index 737cacc5ad..ddfc8fa182 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -286,7 +286,8 @@ pub async fn spinup_types_test() -> Result { let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); let migration = diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 786c1ffd1a..6d5cdbe9a1 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -44,7 +44,8 @@ async fn test_entities_queries() { let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - let dojo_metadata = dojo_metadata_from_workspace(&ws); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); From 70ad72826df84cef73368cb38abda3d4715548dd Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Mon, 17 Jun 2024 19:21:40 +0530 Subject: [PATCH 36/88] fix(migrate): when `init_calldata` depends on contract that was already deployed (#2058) * fix(migrate): when `init_calldata` depends on contract that was already deployed * add tests --- crates/dojo-world/src/migration/strategy.rs | 51 ++++++--- crates/sozo/ops/src/tests/migration.rs | 109 +++++++++++++++++++- crates/torii/types-test/Scarb.lock | 2 +- 3 files changed, 144 insertions(+), 18 deletions(-) diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index 2a1ce96155..258b34ea68 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -13,6 +13,11 @@ use super::contract::{ContractDiff, ContractMigration}; use super::world::WorldDiff; use super::MigrationType; +#[derive(Debug, Clone)] +pub enum MigrationMetadata { + Contract(ContractDiff), +} + #[derive(Debug, Clone)] pub struct MigrationStrategy { pub world_address: Option, @@ -20,6 +25,7 @@ pub struct MigrationStrategy { pub base: Option, pub contracts: Vec, pub models: Vec, + pub metadata: HashMap, } #[derive(Debug)] @@ -61,23 +67,29 @@ impl MigrationStrategy { } pub fn resolve_variable(&mut self, world_address: FieldElement) -> Result<()> { - let contracts_clone = self.contracts.clone(); for contract in self.contracts.iter_mut() { for field in contract.diff.init_calldata.iter_mut() { if let Some(dependency) = field.strip_prefix("$contract_address:") { - let dependency_contract = - contracts_clone.iter().find(|c| c.diff.name == dependency).unwrap(); - let contract_address = get_contract_address( - generate_salt(&dependency_contract.diff.name), - dependency_contract.diff.base_class_hash, - &[], - world_address, - ); - *field = contract_address.to_string(); + let dependency_contract = self.metadata.get(dependency).unwrap(); + + match dependency_contract { + MigrationMetadata::Contract(c) => { + let contract_address = get_contract_address( + generate_salt(&c.name), + c.base_class_hash, + &[], + world_address, + ); + *field = contract_address.to_string(); + } + } } else if let Some(dependency) = field.strip_prefix("$class_hash:") { - let dependency_contract = - contracts_clone.iter().find(|c| c.diff.name == dependency).unwrap(); - *field = dependency_contract.diff.local_class_hash.to_string(); + let dependency_contract = self.metadata.get(dependency).unwrap(); + match dependency_contract { + MigrationMetadata::Contract(c) => { + *field = c.local_class_hash.to_string(); + } + } } } } @@ -94,6 +106,7 @@ pub fn prepare_for_migration( target_dir: &Utf8PathBuf, diff: WorldDiff, ) -> Result { + let mut metadata = HashMap::new(); let entries = fs::read_dir(target_dir).with_context(|| { format!( "Failed trying to read target directory ({target_dir})\nNOTE: build files are profile \ @@ -122,8 +135,12 @@ pub fn prepare_for_migration( // else we need to evaluate which contracts need to be migrated. let mut world = evaluate_contract_to_migrate(&diff.world, &artifact_paths, false)?; let base = evaluate_class_to_migrate(&diff.base, &artifact_paths, world.is_some())?; - let contracts = - evaluate_contracts_to_migrate(&diff.contracts, &artifact_paths, world.is_some())?; + let contracts = evaluate_contracts_to_migrate( + &diff.contracts, + &artifact_paths, + &mut metadata, + world.is_some(), + )?; let models = evaluate_models_to_migrate(&diff.models, &artifact_paths, world.is_some())?; // If world needs to be migrated, then we expect the `seed` to be provided. @@ -151,7 +168,7 @@ pub fn prepare_for_migration( world.contract_address = generated_world_address; } - Ok(MigrationStrategy { world_address, world, base, contracts, models }) + Ok(MigrationStrategy { world_address, world, base, contracts, models, metadata }) } fn evaluate_models_to_migrate( @@ -191,11 +208,13 @@ fn evaluate_class_to_migrate( fn evaluate_contracts_to_migrate( contracts: &[ContractDiff], artifact_paths: &HashMap, + metadata: &mut HashMap, world_contract_will_migrate: bool, ) -> Result> { let mut comps_to_migrate = vec![]; for c in contracts { + metadata.insert(c.name.clone(), MigrationMetadata::Contract(c.clone())); match c.remote_class_hash { Some(remote) if remote == c.local_class_hash && !world_contract_will_migrate => { continue; diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 1c070dbd48..1cc6b0b3a8 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -12,7 +12,7 @@ use dojo_world::metadata::{ dojo_metadata_from_workspace, ArtifactMetadata, DojoMetadata, Uri, WorldMetadata, IPFS_CLIENT_URL, IPFS_PASSWORD, IPFS_USERNAME, }; -use dojo_world::migration::strategy::prepare_for_migration; +use dojo_world::migration::strategy::{prepare_for_migration, MigrationMetadata}; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::TxnConfig; use futures::TryStreamExt; @@ -91,6 +91,113 @@ async fn migrate_with_small_fee_multiplier_will_fail() { ); } +#[tokio::test] +async fn metadata_calculated_properly() { + let config = setup::load_config(); + let ws = setup::setup_ws(&config); + + let base = config.manifest_path().parent().unwrap(); + let target_dir = format!("{}/target/dev", base); + + let profile_name = ws.current_profile().unwrap().to_string(); + + let mut manifest = BaseManifest::load_from_path( + &base.to_path_buf().join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), + ) + .unwrap(); + + let overlay_manifest = + OverlayManifest::load_from_path(&base.join(MANIFESTS_DIR).join("dev").join(OVERLAYS_DIR)) + .unwrap(); + + manifest.merge(overlay_manifest); + + let world = WorldDiff::compute(manifest, None); + + let migration = prepare_for_migration( + None, + felt!("0x12345"), + &Utf8Path::new(&target_dir).to_path_buf(), + world, + ) + .unwrap(); + + // verifies that key name and actual item name are same + for (key, value) in migration.metadata.iter() { + match value { + MigrationMetadata::Contract(c) => { + assert_eq!(key, &c.name); + } + } + } +} + +#[tokio::test] +async fn migration_with_correct_calldata_second_time_work_as_expected() { + let config = setup::load_config(); + let ws = setup::setup_ws(&config); + + let base = config.manifest_path().parent().unwrap(); + let target_dir = format!("{}/target/dev", base); + + let sequencer = KatanaRunner::new().expect("Failed to start runner."); + + let account = sequencer.account(0); + + let profile_name = ws.current_profile().unwrap().to_string(); + + let mut manifest = BaseManifest::load_from_path( + &base.to_path_buf().join(MANIFESTS_DIR).join(&profile_name).join(BASE_DIR), + ) + .unwrap(); + + let world = WorldDiff::compute(manifest.clone(), None); + + let migration = prepare_for_migration( + None, + felt!("0x12345"), + &Utf8Path::new(&target_dir).to_path_buf(), + world, + ) + .unwrap(); + + let migration_output = + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + + // first time others will fail due to calldata error + assert!(!migration_output.full); + + let world_address = migration_output.world_address; + + let remote_manifest = DeploymentManifest::load_from_remote(sequencer.provider(), world_address) + .await + .expect("Failed to load remote manifest"); + + let overlay = OverlayManifest::load_from_path( + &base.join(MANIFESTS_DIR).join(&profile_name).join(OVERLAYS_DIR), + ) + .expect("Failed to load overlay"); + + // adding correct calldata + manifest.merge(overlay); + + let mut world = WorldDiff::compute(manifest, Some(remote_manifest)); + world.update_order().expect("Failed to update order"); + + let mut migration = prepare_for_migration( + Some(world_address), + felt!("0x12345"), + &Utf8Path::new(&target_dir).to_path_buf(), + world, + ) + .unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).expect("Failed to resolve"); + + let migration_output = + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + assert!(migration_output.full); +} + #[tokio::test] async fn migration_from_remote() { let config = setup::load_config(); diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index 0babbac9af..bf6a5a2123 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -15,7 +15,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7 [[package]] name = "types_test" -version = "0.6.0" +version = "0.7.0" dependencies = [ "dojo", ] From 71e9451f856067cba19f7ff1b5da2fafa4c49677 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Mon, 17 Jun 2024 17:43:50 -0500 Subject: [PATCH 37/88] fix(ci): ensure katana runs in debian:bookworm-slim (#2073) * Ensure katana runs in debian:bookworm-slim * chore: switch to cartridge fork and adjust CI to 4 core to build Katana * chore: add old prover-sdk version to check CI fail * fix katana bin permissions * chore: add ensure-docker as requirement for big jobs * chore: point to http-prover using rustls-tls * dbg * wip * chore: bump to artifacts v4 * fix: typo * wip * fix: don't use path explicitely * wip * fix: fix artifacts managment * add ls * fix: use other path with checkout * fix: remove prints --------- Co-authored-by: glihm --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++++++++-- Cargo.lock | 54 +++++-------------------------------- crates/saya/core/Cargo.toml | 2 +- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53876adc6e..c4db1a4df2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,16 +11,35 @@ env: RUST_VERSION: 1.76.0 jobs: + build: + runs-on: ubuntu-latest-4-cores + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - run: | + cargo build -r --bin katana + mkdir -p bins + cp ./target/release/katana bins/ + - uses: actions/upload-artifact@v4 + with: + name: katana-binary + path: bins + test: + needs: ensure-docker runs-on: ubuntu-latest-32-cores container: image: ghcr.io/dojoengine/dojo-dev:v0.7.0 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 + - uses: actions/download-artifact@v4 + with: + name: katana-binary + path: /tmp/bins - run: | - cargo build -r --bin katana - KATANA_RUNNER_BIN=$(pwd)/target/release/katana cargo llvm-cov nextest --no-report --all-features --workspace --exclude katana --build-jobs 20 + chmod +x /tmp/bins/katana + KATANA_RUNNER_BIN=/tmp/bins/katana cargo llvm-cov nextest --no-report --all-features --workspace --exclude katana --build-jobs 20 cargo llvm-cov nextest --no-report -p katana # TODO(kariy): uncomment this line when `sir` feature support Cairo 2.6.3 # cargo llvm-cov nextest --no-report -p katana --no-default-features --features sir @@ -40,6 +59,7 @@ jobs: - run: cargo build -r --target wasm32-unknown-unknown -p torii-client ensure-windows: + needs: ensure-docker runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -52,6 +72,28 @@ jobs: with: repo-token: ${{ secrets.github_token }} - run: cargo build --target x86_64-pc-windows-msvc --bins + + # This job is used to ensure the built katana image doesn't depend on any + # libraries that don't exist in the base docker image we use for distribution + ensure-docker: + needs: build + runs-on: ubuntu-latest + container: + image: debian:bookworm-slim + steps: + - uses: actions/download-artifact@v4 + with: + name: katana-binary + - run: | + chmod +x ./katana + ./katana & + KATANA_PID=$! + sleep 2 + if ! kill -0 $KATANA_PID; then + echo "Katana exited with an error" + exit 1 + fi + kill $KATANA_PID cairofmt: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 3e5c038dd6..445ad1030e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "common" version = "0.1.0" -source = "git+https://github.com/neotheprogramist/http-prover?rev=05aa9dbb7fdd5618693cead978d4ab0eebbf8f80#05aa9dbb7fdd5618693cead978d4ab0eebbf8f80" +source = "git+https://github.com/cartridge-gg/http-prover?rev=7d00b05#7d00b05fec6bdf533d4110656c635a086d5872b7" dependencies = [ "ed25519-dalek", "prefix-hex", @@ -6500,25 +6500,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h2" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.1.0", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "half" version = "2.4.1" @@ -6843,7 +6824,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -6866,7 +6847,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -6975,22 +6955,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper 1.3.1", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.3" @@ -10753,7 +10717,7 @@ dependencies = [ [[package]] name = "prover-sdk" version = "0.1.0" -source = "git+https://github.com/neotheprogramist/http-prover?rev=05aa9dbb7fdd5618693cead978d4ab0eebbf8f80#05aa9dbb7fdd5618693cead978d4ab0eebbf8f80" +source = "git+https://github.com/cartridge-gg/http-prover?rev=7d00b05#7d00b05fec6bdf533d4110656c635a086d5872b7" dependencies = [ "bytes", "common 0.1.0", @@ -11129,12 +11093,12 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls 0.24.2", - "hyper-tls 0.5.0", + "hyper-tls", "ipnet", "js-sys", "log", @@ -11175,23 +11139,19 @@ dependencies = [ "bytes", "cookie", "cookie_store", - "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2 0.4.5", "http 1.1.0", "http-body 1.0.0", "http-body-util", "hyper 1.3.1", "hyper-rustls 0.26.0", - "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -11202,9 +11162,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls 0.25.0", "tower-service", "url", @@ -13963,7 +13921,7 @@ dependencies = [ "axum", "base64 0.21.7", "bytes", - "h2 0.3.26", + "h2", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", diff --git a/crates/saya/core/Cargo.toml b/crates/saya/core/Cargo.toml index 256d727638..4881647506 100644 --- a/crates/saya/core/Cargo.toml +++ b/crates/saya/core/Cargo.toml @@ -47,4 +47,4 @@ cairo-felt = "0.9.1" num-bigint = "0.4.4" num-traits = "0.2.18" -prover-sdk = { git = "https://github.com/neotheprogramist/http-prover", rev = "05aa9dbb7fdd5618693cead978d4ab0eebbf8f80" } +prover-sdk = { git = "https://github.com/cartridge-gg/http-prover", rev = "7d00b05" } From 8347ac8c8639b20c592098aa0bcc4e518d9123f1 Mon Sep 17 00:00:00 2001 From: notV4l <122404722+notV4l@users.noreply.github.com> Date: Tue, 18 Jun 2024 05:33:09 +0200 Subject: [PATCH 38/88] [dojo-core]: update gas logs (#1877) dojo-core: update gas logs Co-authored-by: glihm --- crates/dojo-core/src/benchmarks.cairo | 209 ++++++++---------- .../dojo-core/src/database/introspect.cairo | 3 - crates/dojo-core/src/test_utils.cairo | 60 ++--- crates/dojo-core/src/world_test.cairo | 25 +-- 4 files changed, 139 insertions(+), 158 deletions(-) diff --git a/crates/dojo-core/src/benchmarks.cairo b/crates/dojo-core/src/benchmarks.cairo index 2aa7482f53..b0e827ed25 100644 --- a/crates/dojo-core/src/benchmarks.cairo +++ b/crates/dojo-core/src/benchmarks.cairo @@ -10,15 +10,14 @@ use dojo::database; use dojo::database::storage; use dojo::model::Model; use dojo::world_test::Foo; -use dojo::test_utils::end; - +use dojo::test_utils::GasCounterImpl; +use dojo::database::introspect::{Introspect, Layout}; #[test] #[available_gas(1000000000)] fn bench_reference_offset() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - end(gas, 'bench empty'); + let gas = GasCounterImpl::start(); + gas.end("bench empty"); } #[test] @@ -26,15 +25,13 @@ fn bench_reference_offset() { fn bench_storage_single() { let keys = array!['database_test', '42'].span(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); storage::set(0, keys, 420); - end(gas, 'storage set'); + gas.end("storage set"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let res = storage::get(0, keys); - end(gas, 'storage get'); + gas.end("storage get"); assert(res == 420, 'values differ'); } @@ -46,15 +43,13 @@ fn bench_storage_many() { let values = array![1, 2].span(); let layout = array![251, 251].span(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); storage::set_many(0, keys, values, 0, layout).unwrap(); - end(gas, 'storage set mny'); + gas.end("storage set_many"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let res = storage::get_many(0, keys, layout).unwrap(); - end(gas, 'storage get mny'); + gas.end("storage get_many"); assert(res.len() == 2, 'wrong number of values'); assert(*res.at(0) == *values.at(0), 'value not set'); @@ -64,22 +59,19 @@ fn bench_storage_many() { #[test] #[available_gas(1000000000)] fn bench_native_storage() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let keys = array![0x1337].span(); let base = starknet::storage_base_address_from_felt252(poseidon_hash_span(keys)); let address = starknet::storage_address_from_base(base); - end(gas, 'native prep'); + gas.end("native prep"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); starknet::storage_write_syscall(0, address, 42).unwrap_syscall(); - end(gas, 'native write'); + gas.end("native write"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let value = starknet::storage_read_syscall(0, address).unwrap_syscall(); - end(gas, 'native read'); + gas.end("native read"); assert(value == 42, 'read invalid'); } @@ -87,22 +79,19 @@ fn bench_native_storage() { #[test] #[available_gas(1000000000)] fn bench_native_storage_offset() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let keys = array![0x1337].span(); let base = starknet::storage_base_address_from_felt252(poseidon_hash_span(keys)); let address = starknet::storage_address_from_base_and_offset(base, 42); - end(gas, 'native prep of'); + gas.end("native prep of"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); starknet::storage_write_syscall(0, address, 42).unwrap_syscall(); - end(gas, 'native writ of'); + gas.end("native writ of"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let value = starknet::storage_read_syscall(0, address).unwrap_syscall(); - end(gas, 'native read of'); + gas.end("native read of"); assert(value == 42, 'read invalid'); } @@ -129,15 +118,13 @@ fn bench_database_array() { i += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); database::set('table', 'key', values.span(), 0, layout.span()); - end(gas, 'db set arr'); + gas.end("db set arr"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let res = database::get('table', 'key', layout.span()); - end(gas, 'db get arr'); + gas.end("db get arr"); let mut i = 0; loop { @@ -155,23 +142,20 @@ fn bench_database_array() { fn bench_simple_struct() { let caller = starknet::contract_address_const::<0x42>(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut foo = Foo { caller, a: 0x123456789abcdef, b: 0x123456789abcdef, }; - end(gas, 'foo init'); + gas.end("foo init"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@foo.a, ref serialized); serde::Serde::serialize(@foo.b, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'foo serialize'); + gas.end("foo serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = foo.values(); - end(gas, 'foo values'); + gas.end("foo values"); assert(serialized.len() == 2, 'serialized wrong length'); assert(values.len() == 2, 'value wrong length'); @@ -179,7 +163,7 @@ fn bench_simple_struct() { assert(serialized.at(1) == values.at(1), 'serialized differ at 1'); } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(Copy, Drop, Serde, IntrospectPacked)] #[dojo::model] struct PositionWithQuaterions { #[key] @@ -195,11 +179,9 @@ struct PositionWithQuaterions { // TODO: this test should be adapted to benchmark the new layout system #[test] -#[ignore] #[available_gas(1000000000)] -fn test_struct_with_many_fields() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); +fn test_struct_with_many_fields_fixed() { + let gas = GasCounterImpl::start(); let mut pos = PositionWithQuaterions { id: 0x123456789abcdef, @@ -211,10 +193,9 @@ fn test_struct_with_many_fields() { c: 0x123456789abcdef, d: 0x123456789abcdef, }; - end(gas, 'pos init'); + gas.end("pos init"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@pos.x, ref serialized); serde::Serde::serialize(@pos.y, ref serialized); @@ -224,12 +205,11 @@ fn test_struct_with_many_fields() { serde::Serde::serialize(@pos.c, ref serialized); serde::Serde::serialize(@pos.d, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'pos serialize'); + gas.end("pos serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = pos.values(); - end(gas, 'pos values'); + gas.end("pos values"); assert(serialized.len() == values.len(), 'serialized not equal'); let mut idx = 0; @@ -241,26 +221,27 @@ fn test_struct_with_many_fields() { idx += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let layout = match dojo::model::Model::::layout() { + Layout::Fixed(layout) => layout, + _ => panic!("expected fixed layout"), + }; - //database::set('positions', '42', pos.values(), 0, pos.instance_layout()); - end(gas, 'pos db set'); + let gas = GasCounterImpl::start(); + database::set('positions', '42', pos.values(), 0, layout); + gas.end("pos db set"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::get('positions', '42', pos.instance_layout()); - end(gas, 'pos db get'); + let gas = GasCounterImpl::start(); + database::get('positions', '42', layout); + gas.end("pos db get"); } - -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] struct Sword { swordsmith: ContractAddress, damage: u32, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] #[dojo::model] struct Case { #[key] @@ -269,35 +250,33 @@ struct Case { material: felt252, } - // TODO: this test should be adapted to benchmark the new layout system #[test] #[ignore] #[available_gas(1000000000)] -fn bench_nested_struct() { +fn bench_nested_struct_packed() { let caller = starknet::contract_address_const::<0x42>(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut case = Case { owner: caller, sword: Sword { swordsmith: caller, damage: 0x12345678, }, material: 'wooden', }; - end(gas, 'case init'); + gas.end("case init"); + + // ???? let _gas = testing::get_available_gas(); gas::withdraw_gas().unwrap(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@case.sword, ref serialized); serde::Serde::serialize(@case.material, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'case serialize'); + gas.end("case serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = case.values(); - end(gas, 'case values'); + gas.end("case values"); assert(serialized.len() == values.len(), 'serialized not equal'); let mut idx = 0; @@ -309,19 +288,21 @@ fn bench_nested_struct() { idx += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let layout = match dojo::model::Model::::layout() { + Layout::Fixed(layout) => layout, + _ => panic!("expected fixed layout"), + }; - //database::set('cases', '42', values, case.instance_layout()); - end(gas, 'case db set'); + let gas = GasCounterImpl::start(); + database::set('cases', '42', values, 0, layout); + gas.end("case db set"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::get('cases', '42', case.instance_layout()); - end(gas, 'case db get'); + let gas = GasCounterImpl::start(); + database::get('cases', '42', layout); + gas.end("case db get"); } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] #[dojo::model] struct Character { #[key] @@ -333,7 +314,7 @@ struct Character { gold: u32, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] struct Abilities { strength: u8, dexterity: u8, @@ -343,7 +324,7 @@ struct Abilities { charisma: u8, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] struct Stats { kills: u128, deaths: u16, @@ -356,7 +337,7 @@ struct Stats { romances: u16, } -#[derive(Introspect, Copy, Drop, Serde)] +#[derive(IntrospectPacked, Copy, Drop, Serde)] enum Weapon { DualWield: (Sword, Sword), Fists: (Sword, Sword), // Introspect requires same arms @@ -366,9 +347,8 @@ enum Weapon { #[test] #[ignore] #[available_gas(1000000000)] -fn bench_complex_struct() { - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); +fn bench_complex_struct_packed() { + let gas = GasCounterImpl::start(); let char = Character { caller: starknet::contract_address_const::<0x42>(), @@ -404,10 +384,9 @@ fn bench_complex_struct() { ), gold: 0x12345678, }; - end(gas, 'chars init'); + gas.end("chars init"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let mut serialized = ArrayTrait::new(); serde::Serde::serialize(@char.heigth, ref serialized); serde::Serde::serialize(@char.abilities, ref serialized); @@ -415,12 +394,11 @@ fn bench_complex_struct() { serde::Serde::serialize(@char.weapon, ref serialized); serde::Serde::serialize(@char.gold, ref serialized); let serialized = array::ArrayTrait::span(@serialized); - end(gas, 'chars serialize'); + gas.end("chars serialize"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let values: Span = char.values(); - end(gas, 'chars values'); + gas.end("chars values"); assert(serialized.len() == values.len(), 'serialized not equal'); @@ -433,13 +411,16 @@ fn bench_complex_struct() { idx += 1; }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::set('chars', '42', char.values(), char.instance_layout()); - end(gas, 'chars db set'); + let layout = match dojo::model::Model::::layout() { + Layout::Fixed(layout) => layout, + _ => panic!("expected fixed layout"), + }; - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - //database::get('chars', '42', char.instance_layout()); - end(gas, 'chars db get'); + let gas = GasCounterImpl::start(); + database::set('chars', '42', char.values(), 0, layout); + gas.end("chars db set"); + + let gas = GasCounterImpl::start(); + database::get('chars', '42', layout); + gas.end("chars db get"); } diff --git a/crates/dojo-core/src/database/introspect.cairo b/crates/dojo-core/src/database/introspect.cairo index d3ad4e6962..1eb1e2a1ad 100644 --- a/crates/dojo-core/src/database/introspect.cairo +++ b/crates/dojo-core/src/database/introspect.cairo @@ -60,7 +60,6 @@ trait Introspect { fn ty() -> Ty; } - impl Introspect_felt252 of Introspect { fn size() -> Option { Option::Some(1) @@ -73,7 +72,6 @@ impl Introspect_felt252 of Introspect { } } - impl Introspect_bool of Introspect { fn size() -> Option { Option::Some(1) @@ -182,7 +180,6 @@ impl Introspect_classhash of Introspect { } } - impl Introspect_bytearray of Introspect { fn size() -> Option { Option::None diff --git a/crates/dojo-core/src/test_utils.cairo b/crates/dojo-core/src/test_utils.cairo index 0079e18429..1bb6c91286 100644 --- a/crates/dojo-core/src/test_utils.cairo +++ b/crates/dojo-core/src/test_utils.cairo @@ -68,36 +68,40 @@ fn spawn_test_world(models: Array) -> IWorldDispatcher { } -const GAS_OFFSET: felt252 = 0x1_000000_000000_000000_000000_000000; // 15 bajtów +#[derive(Drop)] +struct GasCounter { + start: u128, +} -/// Measures gas used after previous measurement and prints it -/// -/// # Arguments -/// -/// * `start` - gas before measurement -/// * `name` - name of test, at most 15 bytes, will be padded with spaces -fn end(start: u128, name: felt252) { - let gas_after = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); - let mut name: u256 = name.into(); - - // overwriting zeros with spaces - let mut char = 0; - loop { - if char == 15 { - break; - } - // if given byte is zero - if shl(0xff, 8 * char) & name == 0 { - name = name | shl(0x20, 8 * char); // set space - } - char += 1; - }; +#[generate_trait] +impl GasCounterImpl of GasCounterTrait { + fn start() -> GasCounter { + let start = testing::get_available_gas(); + gas::withdraw_gas().unwrap(); + GasCounter { start } + } + + fn end(self: GasCounter, name: ByteArray) { + let end = testing::get_available_gas(); + let gas_used = self.start - end; - let name: felt252 = (name % GAS_OFFSET.into()).try_into().unwrap(); - // Q?: What's this 1070 value that needed to be adjusted? - let used_gas = (start - gas_after - 1070).into() * GAS_OFFSET; - (used_gas + name).print(); + println!("# GAS # {}: {}", Self::pad_start(name, 18), gas_used); + gas::withdraw_gas().unwrap(); + } + + fn pad_start(str: ByteArray, len: u32) -> ByteArray { + let mut missing: ByteArray = ""; + let missing_len = if str.len() >= len { + 0 + } else { + len - str.len() + }; + + while missing.len() < missing_len { + missing.append(@"."); + }; + missing + str + } } // assert that `value` and `expected` have the same size and the same content diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/world_test.cairo index 4d8829410e..634309cd61 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/world_test.cairo @@ -16,11 +16,11 @@ use dojo::world::{ use dojo::database::introspect::{Introspect, Layout, FieldLayout}; use dojo::database::MAX_ARRAY_LENGTH; use dojo::test_utils::{spawn_test_world, deploy_with_world_address, assert_array}; -use dojo::benchmarks::{Character, end}; use dojo::config::component::Config::{ DifferProgramHashUpdate, MergerProgramHashUpdate, FactsRegistryUpdate }; use dojo::model::Model; +use dojo::benchmarks::{Character, GasCounterImpl}; #[derive(Introspect, Copy, Drop, Serde)] enum OneEnum { @@ -690,15 +690,14 @@ fn bench_execute() { let alice = starknet::contract_address_const::<0x1337>(); starknet::testing::set_contract_address(alice); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); + bar_contract.set_foo(1337, 1337); - end(gas, 'foo set call'); + gas.end("foo set call"); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); let data = get!(world, alice, Foo); - end(gas, 'foo get macro'); + gas.end("foo get macro"); assert(data.a == 1337, 'data not stored'); } @@ -713,15 +712,15 @@ fn bench_execute_complex() { let alice = starknet::contract_address_const::<0x1337>(); starknet::testing::set_contract_address(alice); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); + let gas = GasCounterImpl::start(); + bar_contract.set_char(1337, 1337); - end(gas, 'char set call'); + gas.end("char set call"); + + let gas = GasCounterImpl::start(); - let gas = testing::get_available_gas(); - gas::withdraw_gas().unwrap(); let data = get!(world, alice, Character); - end(gas, 'char get macro'); + gas.end("char get macro"); assert(data.heigth == 1337, 'data not stored'); } From 36bef0f14f8e8a9afa23d9744f60cd7bbef3828d Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Mon, 17 Jun 2024 22:35:35 -0500 Subject: [PATCH 39/88] Prepare release: v0.7.1 (#2076) Co-authored-by: glihm --- Cargo.lock | 90 ++++++++++---------- Cargo.toml | 2 +- crates/dojo-core/Scarb.lock | 2 +- crates/dojo-core/Scarb.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- crates/torii/types-test/Scarb.lock | 2 +- crates/torii/types-test/Scarb.toml | 2 +- examples/spawn-and-move/Scarb.lock | 2 +- examples/spawn-and-move/Scarb.toml | 2 +- 9 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 445ad1030e..62ac297394 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "clap", @@ -3776,7 +3776,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -4577,7 +4577,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-trait", "cainome", @@ -4595,15 +4595,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.0" +version = "0.7.1" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.0" +version = "0.7.1" [[package]] name = "dojo-lang" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -4654,7 +4654,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.0" +version = "0.7.1" dependencies = [ "cairo-lang-language-server", "clap", @@ -4663,7 +4663,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "hyper 0.14.28", @@ -4681,7 +4681,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "assert_fs", @@ -4715,7 +4715,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.0" +version = "0.7.1" dependencies = [ "cainome", "crypto-bigint", @@ -4731,7 +4731,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "assert_fs", @@ -4770,7 +4770,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.0" +version = "0.7.1" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7823,7 +7823,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", @@ -7831,7 +7831,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.0", + "common 0.7.1", "console", "dojo-metrics", "katana-core", @@ -7850,7 +7850,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.0" +version = "0.7.1" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -7863,7 +7863,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.0" +version = "0.7.1" dependencies = [ "bytes", "katana-primitives", @@ -7871,7 +7871,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.0" +version = "0.7.1" dependencies = [ "proc-macro2", "quote", @@ -7881,7 +7881,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-contract", "alloy-network", @@ -7929,7 +7929,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7951,7 +7951,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", @@ -7978,7 +7978,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8003,7 +8003,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8029,7 +8029,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "assert_matches", @@ -8067,7 +8067,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.0" +version = "0.7.1" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8078,7 +8078,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8099,7 +8099,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "katana-executor", @@ -8111,7 +8111,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "assert_fs", @@ -8130,7 +8130,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.0" +version = "0.7.1" dependencies = [ "futures", "rayon", @@ -11503,7 +11503,7 @@ checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "runner-macro" -version = "0.7.0" +version = "0.7.1" dependencies = [ "quote", "syn 2.0.64", @@ -11771,7 +11771,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "cairo-proof-parser", @@ -11792,7 +11792,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-trait", @@ -11834,7 +11834,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.0" +version = "0.7.1" dependencies = [ "alloy-primitives", "anyhow", @@ -12006,7 +12006,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.0" +version = "0.7.1" dependencies = [ "clap", "clap_complete", @@ -12642,7 +12642,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "assert_fs", @@ -12701,7 +12701,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "assert_fs", @@ -12757,7 +12757,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "starknet", @@ -14028,7 +14028,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-trait", @@ -14036,7 +14036,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.0", + "common 0.7.1", "ctrlc", "dojo-metrics", "dojo-types", @@ -14073,7 +14073,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-trait", "camino", @@ -14101,7 +14101,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-trait", @@ -14140,7 +14140,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-graphql", @@ -14181,7 +14181,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.0" +version = "0.7.1" dependencies = [ "bytes", "camino", @@ -14225,7 +14225,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-trait", @@ -14261,7 +14261,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.0" +version = "0.7.1" dependencies = [ "anyhow", "async-trait", @@ -14584,7 +14584,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.0" +version = "0.7.1" [[package]] name = "ucd-trie" diff --git a/Cargo.toml b/Cargo.toml index 49ea3d3980..a04570f1aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.0" +version = "0.7.1" [profile.performance] codegen-units = 1 diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index 8f50ef208b..f084666a86 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.0" +version = "0.7.1" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index ddc8fb6569..9749d61ff3 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -2,7 +2,7 @@ cairo-version = "=2.6.3" description = "The Dojo Core library for autonomous worlds." name = "dojo" -version = "0.7.0" +version = "0.7.1" [dependencies] dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.11" } diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 18bf78b403..97f6626b4a 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.0" +version = "0.7.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index bf6a5a2123..d88534e849 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.0" +version = "0.7.1" dependencies = [ "dojo_plugin", ] diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 1e34e4f328..915bb556fb 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "2.4.0" name = "types_test" -version = "0.7.0" +version = "0.7.1" [cairo] sierra-replace-ids = true diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 427bc2e0e4..55bf0af53d 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.0" +version = "0.7.1" dependencies = [ "dojo_plugin", ] diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 27de8bbe1d..cace95fe62 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "=2.6.3" name = "dojo_examples" -version = "0.7.0" +version = "0.7.1" # Use the prelude with the less imports as possible # from corelib. edition = "2023_10" From c4a1feadf1d5c5ecf9593b50c1a2ca2856ae2313 Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 17 Jun 2024 22:24:07 -0600 Subject: [PATCH 40/88] fix: allow the use of self and world in an exclusive manner (#2063) * fix: allow the use of self and world in an exclusive manner * fix: fmt * fix: cairo fmt * fix: ensure a warning is emitted with generate trait and world * fix: cairo fmt --- crates/dojo-lang/src/contract.rs | 37 ++- crates/dojo-lang/src/interface.rs | 14 +- crates/dojo-lang/src/plugin.rs | 2 - crates/dojo-lang/src/plugin_test_data/system | 233 +++++++++++++----- crates/dojo-lang/src/syntax/self_param.rs | 39 +-- crates/dojo-lang/src/syntax/world_param.rs | 8 + .../dojo_examples_actions_actions.toml | 4 +- .../manifests/dev/manifest.json | 4 +- .../manifests/dev/manifest.toml | 4 +- examples/spawn-and-move/src/actions.cairo | 32 ++- 10 files changed, 259 insertions(+), 118 deletions(-) diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index c2a9c292ff..1e4e5147e0 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -4,8 +4,10 @@ use cairo_lang_defs::patcher::{PatchBuilder, RewriteNode}; use cairo_lang_defs::plugin::{ DynGeneratedFileAuxData, PluginDiagnostic, PluginGeneratedFile, PluginResult, }; +use cairo_lang_diagnostics::Severity; use cairo_lang_syntax::node::ast::MaybeModuleBody; use cairo_lang_syntax::node::db::SyntaxGroup; +use cairo_lang_syntax::node::helpers::QueryAttrs; use cairo_lang_syntax::node::{ast, ids, Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use dojo_types::system::Dependency; @@ -314,7 +316,7 @@ impl DojoContract { param_list: ast::ParamList, fn_diagnostic_item: ids::SyntaxStablePtrId, ) -> (String, bool) { - self_param::check_parameter(db, ¶m_list, fn_diagnostic_item, &mut self.diagnostics); + let is_self_used = self_param::check_parameter(db, ¶m_list); let world_injection = world_param::parse_world_injection( db, @@ -323,6 +325,14 @@ impl DojoContract { &mut self.diagnostics, ); + if is_self_used && world_injection != WorldParamInjectionKind::None { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "You cannot use `self` and `world` parameters together.".to_string(), + severity: Severity::Error, + }); + } + let mut params = param_list .elements(db) .iter() @@ -340,7 +350,12 @@ impl DojoContract { .collect::>(); match world_injection { - WorldParamInjectionKind::None | WorldParamInjectionKind::View => { + WorldParamInjectionKind::None => { + if !is_self_used { + params.insert(0, "self: @ContractState".to_string()); + } + } + WorldParamInjectionKind::View => { params.insert(0, "self: @ContractState".to_string()); } WorldParamInjectionKind::External => { @@ -372,10 +387,13 @@ impl DojoContract { /// * removing `world` if present as first parameter (self excluded), /// * adding `let world = self.world_dispatcher.read();` statement at the beginning of the /// function to restore the removed `world` parameter. + /// * if `has_generate_trait` is true, the implementation containing the function has the + /// #[generate_trait] attribute. pub fn rewrite_function( &mut self, db: &dyn SyntaxGroup, fn_ast: ast::FunctionWithBody, + has_generate_trait: bool, ) -> Vec { let mut rewritten_fn = RewriteNode::from_ast(&fn_ast); @@ -385,6 +403,16 @@ impl DojoContract { fn_ast.stable_ptr().untyped(), ); + if has_generate_trait && was_world_injected { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: fn_ast.stable_ptr().untyped(), + message: "You cannot use `world` and `#[generate_trait]` together. Use `self` \ + instead." + .to_string(), + severity: Severity::Error, + }); + } + // We always rewrite the params as the self parameter is added based on the // world mutability. let rewritten_params = rewritten_fn @@ -409,6 +437,9 @@ impl DojoContract { /// Rewrites all the functions of a Impl block. fn rewrite_impl(&mut self, db: &dyn SyntaxGroup, impl_ast: ast::ItemImpl) -> Vec { + let generate_attrs = impl_ast.attributes(db).query_attr(db, "generate_trait"); + let has_generate_trait = !generate_attrs.is_empty(); + if let ast::MaybeImplBody::Some(body) = impl_ast.body(db) { let body_nodes: Vec<_> = body .items(db) @@ -416,7 +447,7 @@ impl DojoContract { .iter() .flat_map(|el| { if let ast::ImplItem::Function(fn_ast) = el { - return self.rewrite_function(db, fn_ast.clone()); + return self.rewrite_function(db, fn_ast.clone(), has_generate_trait); } vec![RewriteNode::Copied(el.as_syntax_node())] }) diff --git a/crates/dojo-lang/src/interface.rs b/crates/dojo-lang/src/interface.rs index fc9bf2ef1b..1fc64b6759 100644 --- a/crates/dojo-lang/src/interface.rs +++ b/crates/dojo-lang/src/interface.rs @@ -93,7 +93,7 @@ impl DojoInterface { .map(|e| e.as_syntax_node().get_text(db)) .collect::>(); - self_param::check_parameter(db, ¶m_list, diagnostic_item, &mut self.diagnostics); + let is_self_used = self_param::check_parameter(db, ¶m_list); let world_injection = world_param::parse_world_injection( db, @@ -102,9 +102,19 @@ impl DojoInterface { &mut self.diagnostics, ); + if is_self_used && world_injection != WorldParamInjectionKind::None { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: diagnostic_item, + message: "You cannot use `self` and `world` parameters together.".to_string(), + severity: Severity::Error, + }); + } + match world_injection { WorldParamInjectionKind::None => { - params.insert(0, "self: @TContractState".to_string()); + if !is_self_used { + params.insert(0, "self: @TContractState".to_string()); + } } WorldParamInjectionKind::View => { params.remove(0); diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index fdd7d28419..2da354fded 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -126,8 +126,6 @@ impl BuiltinDojoPlugin { ) -> PluginResult { PluginResult { code: None, - // All diagnostics are for now error. Severity may be moved as argument - // if warnings are required in this file. diagnostics: vec![PluginDiagnostic { stable_ptr, message, severity: Severity::Error }], remove_original_item: false, } diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index f7fbef26bb..1cc4ec33cc 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -97,12 +97,19 @@ trait INominalTrait { fn do_params_no_world(p1: felt252, p2: u8) -> felt252; fn do_params_and_world(world: @IWorldDispatcher, p2: u8) -> felt252; fn do_params_and_world_ref(ref world: IWorldDispatcher, p2: u8) -> felt252; + + fn do_with_self(self: @ContractState) -> felt252; + fn do_with_ref_self(ref self: ContractState) -> felt252; } #[dojo::interface] trait IFaultyTrait { - fn do_with_self(self: @ContractState) -> felt252; - fn do_with_ref_self(ref self: ContractState) -> felt252; + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252; + fn do_with_ref_self_and_world_inv( + ref world: IWorldDispatcher, ref self: ContractState + ) -> felt252; fn do_with_several_world_dispatchers( world: @IWorldDispatcher, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252; @@ -114,11 +121,23 @@ trait IFaultyTrait { mod MyFaultyContract { #[abi(embed_v0)] impl TestFaultyImpl of IFaultyTrait { - fn do_with_self(ref self: ContractState) -> felt252 { + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252 { 'land' } - fn do_with_ref_self(ref self: ContractState) -> felt252 { + fn do_with_ref_self_and_world( + ref self: ContractState, ref world: IWorldDispatcher + ) -> felt252 { + 'land' + } + + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252 { + 'land' + } + + fn do_with_ref_self_and_world_inv( + ref world: IWorldDispatcher, ref self: ContractState + ) -> felt252 { 'land' } @@ -136,6 +155,13 @@ mod MyFaultyContract { 'land' } } + + #[generate_trait] + impl InternalImplBad of InternalUtils { + fn bad_func_using_generate(world: @IWorldDispatcher) -> felt252 { + 'land' + } + } } #[dojo::contract] @@ -170,6 +196,14 @@ mod MyNominalContract { fn do_params_and_world_ref(ref world: IWorldDispatcher, p2: u8) -> felt252 { 'land' } + + fn do_with_self(self: @ContractState) -> felt252 { + 'land' + } + + fn do_with_ref_self(ref self: ContractState) -> felt252 { + 'land' + } } #[generate_trait] @@ -326,38 +360,63 @@ error: Anything other than functions is not supported in a dojo::interface const ONE: u8; ^************^ -error: In a dojo contract or interface, you should use `world: @IWorldDispatcher` instead of `self: @ContractState`. - --> test_src/lib.cairo:98:5 - fn do_with_self(self: @ContractState) -> felt252; - ^***********************************************^ - -error: In a dojo contract or interface, you should use `ref world: IWorldDispatcher` instead of `ref self: ContractState`. - --> test_src/lib.cairo:99:5 - fn do_with_ref_self(ref self: ContractState) -> felt252; - ^******************************************************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:101:5 + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + ^***********************************************************************************^ error: World parameter must be the first parameter. + --> test_src/lib.cairo:102:5 + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + ^*********************************************************************************************^ + +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:103:5 + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252; + ^***************************************************************************************^ + +error: You cannot use `self` and `world` parameters together. --> test_src/lib.cairo:104:5 + fn do_with_ref_self_and_world_inv( + ^********************************^ + +error: World parameter must be the first parameter. + --> test_src/lib.cairo:111:5 fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; ^****************************************************************************^ -error: In a dojo contract or interface, you should use `ref world: IWorldDispatcher` instead of `ref self: ContractState`. - --> test_src/lib.cairo:111:9 - fn do_with_self(ref self: ContractState) -> felt252 { - ^***************************************************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:118:9 + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252 { + ^************************************************************************************^ -error: In a dojo contract or interface, you should use `ref world: IWorldDispatcher` instead of `ref self: ContractState`. - --> test_src/lib.cairo:115:9 - fn do_with_ref_self(ref self: ContractState) -> felt252 { - ^*******************************************************^ +error: World parameter must be the first parameter. + --> test_src/lib.cairo:122:9 + fn do_with_ref_self_and_world( + ^****************************^ + +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:128:9 + fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252 { + ^****************************************************************************************^ + +error: You cannot use `self` and `world` parameters together. + --> test_src/lib.cairo:132:9 + fn do_with_ref_self_and_world_inv( + ^********************************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:129:9 + --> test_src/lib.cairo:148:9 fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252 { ^*****************************************************************************^ +error: You cannot use `world` and `#[generate_trait]` together. Use `self` instead. + --> test_src/lib.cairo:155:9 + fn bad_func_using_generate(world: @IWorldDispatcher) -> felt252 { + ^***************************************************************^ + error: World parameter must be a snapshot if `ref` is not used. - --> test_src/lib.cairo:180:5 + --> test_src/lib.cairo:214:5 fn dojo_init( ^***********^ @@ -392,22 +451,22 @@ error: Unsupported attribute. ^********^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ @@ -647,172 +706,177 @@ error: Unsupported attribute. ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:109:5 + --> test_src/lib.cairo:116:5 #[abi(embed_v0)] ^**************^ +error: Generated trait must have generic args matching the impl's generic params. + --> test_src/lib.cairo:154:29 + impl InternalImplBad of InternalUtils { + ^**************************^ + error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:107:1 + --> test_src/lib.cairo:114:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:142:5 + --> test_src/lib.cairo:168:5 #[abi(embed_v0)] ^**************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:135:1 + --> test_src/lib.cairo:161:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:178:1 + --> test_src/lib.cairo:212:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:195:1 + --> test_src/lib.cairo:229:1 #[dojo::contract] ^***************^ @@ -1148,12 +1212,19 @@ impl EventDrop of core::traits::Drop::; fn do_params_and_world(self: @TContractState, p2: u8) -> felt252; fn do_params_and_world_ref(ref self: TContractState, p2: u8) -> felt252; + fn do_with_self(self: @ContractState) -> felt252; + fn do_with_ref_self(ref self: ContractState) -> felt252; + } #[starknet::interface] trait IFaultyTrait { - fn do_with_self(self: @TContractState, self: @ContractState) -> felt252; - fn do_with_ref_self(self: @TContractState, ref self: ContractState) -> felt252; + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; + fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; + fn do_with_self_and_world_inv(self: @TContractState, self: @ContractState) -> felt252; + fn do_with_ref_self_and_world_inv( +ref self: TContractState, ref self: ContractState + ) -> felt252; fn do_with_several_world_dispatchers( self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher ) -> felt252; @@ -1189,11 +1260,24 @@ self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher #[abi(embed_v0)] impl TestFaultyImpl of IFaultyTrait { - fn do_with_self(self: @ContractState, ref self: ContractState) -> felt252 { + fn do_with_self_and_world(self: @ContractState) -> felt252 { 'land' } - fn do_with_ref_self(self: @ContractState, ref self: ContractState) -> felt252 { + fn do_with_ref_self_and_world( + ref self: ContractState ) -> felt252 { + 'land' + } + + fn do_with_self_and_world_inv(self: @ContractState, self: @ContractState) -> felt252 { +let world = self.world_dispatcher.read(); + 'land' + } + + fn do_with_ref_self_and_world_inv( +ref self: ContractState, ref self: ContractState + ) -> felt252 { +let world = self.world_dispatcher.read(); 'land' } @@ -1213,6 +1297,14 @@ let world = self.world_dispatcher.read(); } } + #[generate_trait] + impl InternalImplBad of InternalUtils { + fn bad_func_using_generate(self: @ContractState) -> felt252 { +let world = self.world_dispatcher.read(); + 'land' + } + } + #[starknet::interface] trait IDojoInit { fn dojo_init(self: @ContractState); @@ -1237,6 +1329,9 @@ let world = self.world_dispatcher.read(); #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } + trait InternalUtils{ + fn bad_func_using_generate(self: @ContractState) -> felt252; + } impl EventDrop of core::traits::Drop::; } @@ -1300,6 +1395,14 @@ let world = self.world_dispatcher.read(); let world = self.world_dispatcher.read(); 'land' } + + fn do_with_self(self: @ContractState) -> felt252 { + 'land' + } + + fn do_with_ref_self(ref self: ContractState) -> felt252 { + 'land' + } } #[generate_trait] diff --git a/crates/dojo-lang/src/syntax/self_param.rs b/crates/dojo-lang/src/syntax/self_param.rs index 2f21ae7522..aaf3593fac 100644 --- a/crates/dojo-lang/src/syntax/self_param.rs +++ b/crates/dojo-lang/src/syntax/self_param.rs @@ -1,11 +1,9 @@ -use cairo_lang_defs::plugin::PluginDiagnostic; -use cairo_lang_diagnostics::Severity; +use cairo_lang_syntax::node::ast; use cairo_lang_syntax::node::db::SyntaxGroup; -use cairo_lang_syntax::node::{ast, ids}; use crate::syntax::utils as syntax_utils; -const SELF_PARAM_NAME: &str = "self"; +pub const SELF_PARAM_NAME: &str = "self"; /// Checks if the given function parameter is using `self` instead of `world` param. /// Adds diagnostic if that case. @@ -16,34 +14,17 @@ const SELF_PARAM_NAME: &str = "self"; /// - `param_list` - The parameter list of the function. /// - `fn_diagnostic_item` - The diagnostic item of the function. /// - `diagnostics` - The diagnostics vector. -pub fn check_parameter( - db: &dyn SyntaxGroup, - param_list: &ast::ParamList, - fn_diagnostic_item: ids::SyntaxStablePtrId, - diagnostics: &mut Vec, -) { +/// +/// # Returns +/// +/// - `true` if the function first parameter is `self`. +pub fn check_parameter(db: &dyn SyntaxGroup, param_list: &ast::ParamList) -> bool { if param_list.elements(db).is_empty() { - return; + return false; } let param_0 = param_list.elements(db)[0].clone(); - let (name, modifier, _) = syntax_utils::get_parameter_info(db, param_0.clone()); + let (name, _, _) = syntax_utils::get_parameter_info(db, param_0.clone()); - if name.eq(SELF_PARAM_NAME) { - let (expected, actual) = if modifier.eq(&"ref".to_string()) { - ("ref world: IWorldDispatcher", "ref self: ContractState") - } else { - ("world: @IWorldDispatcher", "self: @ContractState") - }; - - diagnostics.push(PluginDiagnostic { - stable_ptr: fn_diagnostic_item, - message: format!( - "In a dojo contract or interface, you should use `{}` instead of `{}`.", - expected, actual - ) - .to_string(), - severity: Severity::Error, - }); - } + name.eq(SELF_PARAM_NAME) } diff --git a/crates/dojo-lang/src/syntax/world_param.rs b/crates/dojo-lang/src/syntax/world_param.rs index aac7939770..66ef198a5e 100644 --- a/crates/dojo-lang/src/syntax/world_param.rs +++ b/crates/dojo-lang/src/syntax/world_param.rs @@ -48,6 +48,14 @@ pub fn parse_world_injection( let (name, modifiers, param_type) = syntax_utils::get_parameter_info(db, param.clone()); if !is_world_param(&name, ¶m_type) { + if name.eq(super::self_param::SELF_PARAM_NAME) && has_world_injected { + diagnostics.push(PluginDiagnostic { + stable_ptr: fn_diagnostic_item, + message: "You cannot use `self` and `world` parameters together.".to_string(), + severity: Severity::Error, + }); + } + return; } diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index 405be86d28..f1134d5536 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" -original_class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" +class_hash = "0x54ef672addb35455d35217a62c4293f2dc681b20737716b4ef9630d759d7a96" +original_class_hash = "0x54ef672addb35455d35217a62c4293f2dc681b20737716b4ef9630d759d7a96" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 9f2e854a95..133a1a9e54 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1020,8 +1020,8 @@ { "kind": "DojoContract", "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", - "class_hash": "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d", - "original_class_hash": "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d", + "class_hash": "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590", + "original_class_hash": "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index ec501b9733..71caee992c 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -22,8 +22,8 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" -class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" -original_class_hash = "0x69ba4e0f7a03ae24f85aad88bd1a6b4eab5395474bbb6717803ffeb5aa13b8d" +class_hash = "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590" +original_class_hash = "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 143696ed80..1e9140b308 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -64,17 +64,7 @@ mod actions { // ContractState is defined by system decorator expansion fn spawn(ref world: IWorldDispatcher) { let player = get_caller_address(); - let position = get!(world, player, (Position)); - - set!( - world, - ( - Moves { player, remaining: 99, last_direction: Direction::None(()) }, - Position { - player, vec: Vec2 { x: position.vec.x + 10, y: position.vec.y + 10 } - }, - ) - ); + self.set_default_position(player, world); } fn move(ref world: IWorldDispatcher, direction: Direction) { @@ -104,6 +94,26 @@ mod actions { get!(world, player, (Position)) } } + + // The `generate_trait` attribute is not compatible with `world` parameter expansion. + // Hence, the use of `self` to access the contract state. + #[generate_trait] + impl InternalImpl of InternalUtils { + fn set_default_position( + self: @ContractState, player: ContractAddress, world: IWorldDispatcher + ) { + // The world is always accessible from `self` inside a `dojo::contract`. + // let world = self.world(); + + set!( + world, + ( + Moves { player, remaining: 99, last_direction: Direction::None }, + Position { player, vec: Vec2 { x: 10, y: 10 } }, + ) + ); + } + } } #[cfg(test)] From 7c5dd43cbb0dae159410754878f94d576747418f Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Tue, 18 Jun 2024 09:25:32 -0500 Subject: [PATCH 41/88] Update devcontainer image: v0.7.1 (#2077) Co-authored-by: glihm --- .devcontainer/devcontainer.json | 2 +- .github/workflows/bench.yml | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/release-dispatch.yml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b71e0f6aa2..7c2d597f16 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust { "name": "Rust", - "image": "ghcr.io/dojoengine/dojo-dev:v0.7.0", + "image": "ghcr.io/dojoengine/dojo-dev:v0.7.1", "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 16b8df0133..3754955f2e 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4db1a4df2..ec3bb90dd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: needs: ensure-docker runs-on: ubuntu-latest-32-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -52,7 +52,7 @@ jobs: ensure-wasm: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -109,7 +109,7 @@ jobs: dojo-core-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -118,7 +118,7 @@ jobs: dojo-spawn-and-move-example-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -127,7 +127,7 @@ jobs: dojo-world-bindings-check: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -136,7 +136,7 @@ jobs: clippy: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -145,7 +145,7 @@ jobs: fmt: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -154,7 +154,7 @@ jobs: docs: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index 6374f2428a..b857f806ec 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -14,7 +14,7 @@ jobs: contents: write runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.0 + image: ghcr.io/dojoengine/dojo-dev:v0.7.1 env: VERSION: "" steps: From aa926756a06c45d47e7eb0f335e19f38eea4ae74 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:46:07 -0500 Subject: [PATCH 42/88] fix(torii): handle array of unknown enum variants and empty arrays (#2078) fix(torii): handle array of enums and empty arrays --- crates/dojo-types/src/schema.rs | 15 +++++---------- crates/torii/core/src/sql.rs | 5 ++++- crates/torii/graphql/src/object/entity.rs | 6 +++--- crates/torii/graphql/src/query/mod.rs | 5 +++++ 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs index 5b7a2615f3..fa4f2819e7 100644 --- a/crates/dojo-types/src/schema.rs +++ b/crates/dojo-types/src/schema.rs @@ -196,16 +196,11 @@ impl Ty { let arr_len: u32 = felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?; - if arr_len > 0 { - let item_ty = items_ty[0].clone(); - - items_ty.clear(); - - for _ in 0..arr_len { - let mut cur_item_ty = item_ty.clone(); - cur_item_ty.deserialize(felts)?; - items_ty.push(cur_item_ty); - } + let item_ty = items_ty.pop().unwrap(); + for _ in 0..arr_len { + let mut cur_item_ty = item_ty.clone(); + cur_item_ty.deserialize(felts)?; + items_ty.push(cur_item_ty); } } Ty::ByteArray(bytes) => { diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 7f54ae28b6..a22963a5af 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -760,9 +760,12 @@ impl Sql { .join(", "); create_table_query.push_str(&format!( - "external_{name} TEXT CHECK(external_{name} IN ({all_options})) NOT NULL, ", + "external_{name} TEXT CHECK(external_{name} IN ({all_options})) ", )); + // if we're an array, we could have multiple enum options + create_table_query.push_str(if array_idx > 0 { ", " } else { "NOT NULL, " }); + indices.push(format!( "CREATE INDEX IF NOT EXISTS idx_{table_id}_{name} ON [{table_id}] \ (external_{name});" diff --git a/crates/torii/graphql/src/object/entity.rs b/crates/torii/graphql/src/object/entity.rs index 281f6bb356..75013b4032 100644 --- a/crates/torii/graphql/src/object/entity.rs +++ b/crates/torii/graphql/src/object/entity.rs @@ -184,7 +184,7 @@ pub async fn model_data_recursive_query( let rows = sqlx::query(&query).fetch_all(conn.as_mut()).await?; if rows.is_empty() { - return Ok(Value::Null); + return Ok(Value::List(vec![])); } let value_mapping: Value; @@ -242,9 +242,9 @@ pub async fn model_data_recursive_query( .iter() .map(|v| match v { Value::Object(map) => map.get(&Name::new("data")).unwrap().clone(), - _ => unreachable!( + ty => unreachable!( "Expected Value::Object for list \"data\" field, got {:?}", - v + ty ), }) .collect(), diff --git a/crates/torii/graphql/src/query/mod.rs b/crates/torii/graphql/src/query/mod.rs index 8a3f2f8a73..b66c37b8fd 100644 --- a/crates/torii/graphql/src/query/mod.rs +++ b/crates/torii/graphql/src/query/mod.rs @@ -94,6 +94,11 @@ fn member_to_type_data(member: &ModelMember, nested_members: &[&ModelMember]) -> if !nested_members.iter().any(|&nested_member| { nested_member.model_id == member.model_id && nested_member.id.ends_with(&member.name) + && nested_member + .id + .split('$') + .collect::>() + .starts_with(&member.id.split('$').collect::>()) }) => { TypeData::Simple(TypeRef::named("Enum")) From fc44c36cb9174645ef5a498f9e54f922370409e1 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Wed, 19 Jun 2024 00:45:44 -0500 Subject: [PATCH 43/88] refactor(torii): delete entity in all tables & array references for entity delete! (#2072) --- crates/torii/core/src/sql.rs | 52 ++++++- crates/torii/core/src/sql_test.rs | 143 +++++++++++++++++- examples/spawn-and-move/Scarb.lock | 2 +- .../dojo_examples_actions_actions.json | 7 + .../dojo_examples_actions_actions.json | 7 + .../dojo_examples_actions_actions.toml | 4 +- .../manifests/dev/manifest.json | 11 +- .../manifests/dev/manifest.toml | 4 +- examples/spawn-and-move/src/actions.cairo | 22 +++ examples/spawn-and-move/src/models.cairo | 2 +- 10 files changed, 233 insertions(+), 21 deletions(-) diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index a22963a5af..02fe9ccb21 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -696,22 +696,60 @@ impl Sql { self.query_queue .push_front(statement, vec![Argument::String(entity_id.to_string())]); for member in s.children.iter() { - if let Ty::Struct(_) = &member.ty { - let mut path_clone = path.clone(); - path_clone.push(member.name.clone()); - self.build_delete_entity_queries_recursive( - path_clone, entity_id, &member.ty, - ); - } + let mut path_clone = path.clone(); + path_clone.push(member.name.clone()); + self.build_delete_entity_queries_recursive(path_clone, entity_id, &member.ty); } } Ty::Enum(e) => { + if e.options + .iter() + .all(|o| if let Ty::Tuple(t) = &o.ty { t.is_empty() } else { false }) + { + return; + } + + let table_id = path.join("$"); + let statement = format!("DELETE FROM [{table_id}] WHERE entity_id = ?"); + self.query_queue + .push_front(statement, vec![Argument::String(entity_id.to_string())]); + for child in e.options.iter() { + if let Ty::Tuple(t) = &child.ty { + if t.is_empty() { + continue; + } + } + let mut path_clone = path.clone(); path_clone.push(child.name.clone()); self.build_delete_entity_queries_recursive(path_clone, entity_id, &child.ty); } } + Ty::Array(array) => { + let table_id = path.join("$"); + let statement = format!("DELETE FROM [{table_id}] WHERE entity_id = ?"); + self.query_queue + .push_front(statement, vec![Argument::String(entity_id.to_string())]); + + for member in array.iter() { + let mut path_clone = path.clone(); + path_clone.push("data".to_string()); + self.build_delete_entity_queries_recursive(path_clone, entity_id, member); + } + } + Ty::Tuple(t) => { + let table_id = path.join("$"); + let statement = format!("DELETE FROM [{table_id}] WHERE entity_id = ?"); + self.query_queue + .push_front(statement, vec![Argument::String(entity_id.to_string())]); + + for (idx, member) in t.iter().enumerate() { + let mut path_clone = path.clone(); + path_clone.push(format!("_{}", idx)); + self.build_delete_entity_queries_recursive(path_clone, entity_id, member); + } + } _ => {} } } diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 09f4100caa..92d45a68e8 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -6,7 +6,7 @@ use dojo_test_utils::migration::prepare_migration; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::dojo_metadata_from_workspace; use dojo_world::migration::TxnConfig; -use dojo_world::utils::TransactionWaiter; +use dojo_world::utils::{TransactionExt, TransactionWaiter}; use katana_runner::KatanaRunner; use scarb::ops; use sozo_ops::migration::execute_strategy; @@ -16,11 +16,12 @@ use starknet::core::types::{BlockId, BlockTag}; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider}; -use starknet_crypto::poseidon_hash_many; +use starknet_crypto::{poseidon_hash_many, FieldElement}; use tokio::sync::broadcast; use crate::engine::{Engine, EngineConfig, Processors}; use crate::processors::register_model::RegisterModelProcessor; +use crate::processors::store_del_record::StoreDelRecordProcessor; use crate::processors::store_set_record::StoreSetRecordProcessor; use crate::sql::Sql; @@ -38,7 +39,11 @@ where db, provider, Processors { - event: vec![Box::new(RegisterModelProcessor), Box::new(StoreSetRecordProcessor)], + event: vec![ + Box::new(RegisterModelProcessor), + Box::new(StoreSetRecordProcessor), + Box::new(StoreDelRecordProcessor), + ], ..Processors::default() }, EngineConfig::default(), @@ -156,9 +161,7 @@ async fn test_load_from_remote() { assert_eq!(packed_size, 0); assert_eq!(unpacked_size, 0); - // print all entities - let entities = sqlx::query("SELECT * FROM entities").fetch_all(&pool).await.unwrap(); - assert_eq!(entities.len(), 2); + assert_eq!(count_table("entities", &pool).await, 2); let (id, keys): (String, String) = sqlx::query_as( format!( @@ -176,3 +179,131 @@ async fn test_load_from_remote() { db.execute().await.unwrap(); } + +#[tokio::test(flavor = "multi_thread")] +async fn test_load_from_remote_del() { + let options = + SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); + let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); + sqlx::migrate!("../migrations").run(&pool).await.unwrap(); + + let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); + let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let dojo_metadata = + dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); + + let manifest_path = config.manifest_path(); + let base_dir = manifest_path.parent().unwrap(); + let target_dir = format!("{}/target/dev", base_dir); + + let mut migration = + prepare_migration(base_dir.into(), target_dir.into(), dojo_metadata.skip_migration) + .unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); + + let sequencer = KatanaRunner::new().expect("Failed to start runner."); + + let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); + + let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); + + let mut account = sequencer.account(0); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + + let ws = ops::read_workspace(config.manifest_path(), &config) + .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); + + let migration_output = + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + + let world_address = migration_output.world_address; + + assert!(migration.world_address().unwrap() == world_address); + + // spawn + account + .execute(vec![Call { + to: migration_output + .contracts + .first() + .expect("shouldn't be empty") + .as_ref() + .expect("should be deployed") + .contract_address, + selector: get_selector_from_name("spawn").unwrap(), + calldata: vec![], + }]) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + + // Set player config. + account + .execute(vec![Call { + to: migration_output + .contracts + .first() + .expect("shouldn't be empty") + .as_ref() + .expect("should be deployed") + .contract_address, + selector: get_selector_from_name("set_player_config").unwrap(), + // Empty ByteArray. + calldata: vec![FieldElement::ZERO, FieldElement::ZERO, FieldElement::ZERO], + }]) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + + account + .execute(vec![Call { + to: migration_output + .contracts + .first() + .expect("shouldn't be empty") + .as_ref() + .expect("should be deployed") + .contract_address, + selector: get_selector_from_name("reset_player_config").unwrap(), + calldata: vec![], + }]) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + + let mut db = Sql::new(pool.clone(), world_address).await.unwrap(); + let _ = bootstrap_engine(world, db.clone(), &provider).await; + + assert_eq!(count_table("PlayerConfig", &pool).await, 0); + assert_eq!(count_table("PlayerConfig$favorite_item", &pool).await, 0); + assert_eq!(count_table("PlayerConfig$items", &pool).await, 0); + + // TODO: check how we can have a test that is more chronological with Torii re-syncing + // to ensure we can test intermediate states. + + db.execute().await.unwrap(); +} + +/// Count the number of rows in a table. +/// +/// # Arguments +/// * `table_name` - The name of the table to count the rows of. +/// * `pool` - The database pool. +/// +/// # Returns +/// The number of rows in the table. +async fn count_table(table_name: &str, pool: &sqlx::Pool) -> i64 { + let count_query = format!("SELECT COUNT(*) FROM {}", table_name); + let count: (i64,) = sqlx::query_as(&count_query).fetch_one(pool).await.unwrap(); + + count.0 +} diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 55bf0af53d..0ec4b351ac 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo_examples" -version = "0.7.0" +version = "0.7.1" dependencies = [ "dojo", ] diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json index 0882f7c56d..4be28b68dd 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json @@ -218,6 +218,13 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json index 0882f7c56d..4be28b68dd 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -218,6 +218,13 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index f1134d5536..b1680ae07c 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x54ef672addb35455d35217a62c4293f2dc681b20737716b4ef9630d759d7a96" -original_class_hash = "0x54ef672addb35455d35217a62c4293f2dc681b20737716b4ef9630d759d7a96" +class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" +original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 133a1a9e54..a1a575d4aa 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1020,8 +1020,8 @@ { "kind": "DojoContract", "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", - "class_hash": "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590", - "original_class_hash": "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590", + "class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3", + "original_class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1243,6 +1243,13 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index 71caee992c..c292ce25af 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -22,8 +22,8 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" -class_hash = "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590" -original_class_hash = "0x386b6b90ce188fb732305f8742885ae2fb12f120d2616d6b4d396a0fcdf3590" +class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" +original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 1e9140b308..6737cdea48 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -6,6 +6,7 @@ trait IActions { fn move(ref world: IWorldDispatcher, direction: Direction); fn set_player_config(ref world: IWorldDispatcher, name: ByteArray); fn get_player_position(world: @IWorldDispatcher) -> Position; + fn reset_player_config(ref world: IWorldDispatcher); } #[dojo::interface] @@ -89,6 +90,27 @@ mod actions { set!(world, (config)); } + fn reset_player_config(ref world: IWorldDispatcher) { + let player = get_caller_address(); + + let (position, moves, config) = get!(world, player, (Position, Moves, PlayerConfig)); + + delete!(world, (position, moves, config)); + + let (position, moves, config) = get!(world, player, (Position, Moves, PlayerConfig)); + + assert(moves.remaining == 0, 'bad remaining'); + assert(moves.last_direction == Direction::None, 'bad last direction'); + + assert(position.vec.x == 0, 'bad x'); + assert(position.vec.y == 0, 'bad y'); + + assert(config.items.len() == 0, 'bad items'); + assert(config.favorite_item == Option::Some(0), 'bad favorite item'); + let empty_string: ByteArray = ""; + assert(config.name == empty_string, 'bad name'); + } + fn get_player_position(world: @IWorldDispatcher) -> Position { let player = get_caller_address(); get!(world, player, (Position)) diff --git a/examples/spawn-and-move/src/models.cairo b/examples/spawn-and-move/src/models.cairo index 85cfdf1711..443c3a2e53 100644 --- a/examples/spawn-and-move/src/models.cairo +++ b/examples/spawn-and-move/src/models.cairo @@ -1,6 +1,6 @@ use starknet::ContractAddress; -#[derive(Serde, Copy, Drop, Introspect)] +#[derive(Serde, Copy, Drop, Introspect, PartialEq)] enum Direction { None, Left, From 4db8ae0c89ebbb750f75c0425e78e378363a37e0 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 19 Jun 2024 16:36:39 -0400 Subject: [PATCH 44/88] fix(katana-rpc): only include successful transactions in pending block (#2082) Only include successful transactions in pending block --- crates/katana/rpc/rpc/src/starknet.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/katana/rpc/rpc/src/starknet.rs b/crates/katana/rpc/rpc/src/starknet.rs index 4bc8e544a7..603dcff366 100644 --- a/crates/katana/rpc/rpc/src/starknet.rs +++ b/crates/katana/rpc/rpc/src/starknet.rs @@ -228,10 +228,16 @@ impl StarknetApiServer for StarknetApi { sequencer_address: block_env.sequencer_address, }; + // TODO(kariy): create a method that can perform this filtering for us instead + // of doing it manually. + + // A block should only include successful transactions, we filter out the failed + // ones (didn't pass validation stage). let transactions = executor .read() .transactions() .iter() + .filter(|(_, receipt)| receipt.is_success()) .map(|(tx, _)| tx.hash) .collect::>(); @@ -307,10 +313,16 @@ impl StarknetApiServer for StarknetApi { sequencer_address: block_env.sequencer_address, }; + // TODO(kariy): create a method that can perform this filtering for us instead + // of doing it manually. + + // A block should only include successful transactions, we filter out the failed + // ones (didn't pass validation stage). let transactions = executor .read() .transactions() .iter() + .filter(|(_, receipt)| receipt.is_success()) .map(|(tx, _)| tx.clone()) .collect::>(); From 30e98034acb96545e859c22067b68eb8e281d0e8 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:37:30 -0500 Subject: [PATCH 45/88] refactor(torii-core): ignore invalid txs that are included in the pending block (#2081) * refactor(torii-core): ignore invalid txs that are included in the pending block txs * fmt --- crates/torii/core/src/engine.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 2fb4935e6d..dcf4918c1a 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -174,12 +174,11 @@ impl Engine

{ Err(e) => { match e.to_string().as_str() { "TransactionHashNotFound" => { - warn!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction."); - // We failed to fetch the transaction, which might be due to us indexing - // the pending transaction too fast. We will - // fail silently and retry processing the transaction in the next - // iteration. - return Ok(pending_block_tx); + // We failed to fetch the transaction, which is because + // the transaction might not have passed the validation stage. + // So we can safely ignore this transaction and not process it, as it + // rejected. + warn!(target: LOG_TARGET, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Ignored failed pending transaction."); } _ => { error!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction."); From 3da5cad9fdd39b81551e0668015d88262e6c5fc4 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 19 Jun 2024 22:15:48 -0500 Subject: [PATCH 46/88] Prepare release: v0.7.2 (#2090) Co-authored-by: glihm --- Cargo.lock | 90 ++++++++++---------- Cargo.toml | 2 +- crates/dojo-core/Scarb.lock | 2 +- crates/dojo-core/Scarb.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- crates/torii/types-test/Scarb.lock | 2 +- crates/torii/types-test/Scarb.toml | 2 +- examples/spawn-and-move/Scarb.lock | 2 +- examples/spawn-and-move/Scarb.toml | 2 +- 9 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62ac297394..87fe8db017 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "clap", @@ -3776,7 +3776,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -4577,7 +4577,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.1" +version = "0.7.2" dependencies = [ "async-trait", "cainome", @@ -4595,15 +4595,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.1" +version = "0.7.2" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.1" +version = "0.7.2" [[package]] name = "dojo-lang" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -4654,7 +4654,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.1" +version = "0.7.2" dependencies = [ "cairo-lang-language-server", "clap", @@ -4663,7 +4663,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "hyper 0.14.28", @@ -4681,7 +4681,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", @@ -4715,7 +4715,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.1" +version = "0.7.2" dependencies = [ "cainome", "crypto-bigint", @@ -4731,7 +4731,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", @@ -4770,7 +4770,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.1" +version = "0.7.2" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7823,7 +7823,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7831,7 +7831,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.1", + "common 0.7.2", "console", "dojo-metrics", "katana-core", @@ -7850,7 +7850,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.1" +version = "0.7.2" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -7863,7 +7863,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.1" +version = "0.7.2" dependencies = [ "bytes", "katana-primitives", @@ -7871,7 +7871,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.1" +version = "0.7.2" dependencies = [ "proc-macro2", "quote", @@ -7881,7 +7881,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-contract", "alloy-network", @@ -7929,7 +7929,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -7951,7 +7951,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -7978,7 +7978,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -8003,7 +8003,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -8029,7 +8029,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "assert_matches", @@ -8067,7 +8067,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.1" +version = "0.7.2" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8078,7 +8078,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -8099,7 +8099,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "katana-executor", @@ -8111,7 +8111,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", @@ -8130,7 +8130,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.1" +version = "0.7.2" dependencies = [ "futures", "rayon", @@ -11503,7 +11503,7 @@ checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "runner-macro" -version = "0.7.1" +version = "0.7.2" dependencies = [ "quote", "syn 2.0.64", @@ -11771,7 +11771,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "cairo-proof-parser", @@ -11792,7 +11792,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -11834,7 +11834,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.1" +version = "0.7.2" dependencies = [ "alloy-primitives", "anyhow", @@ -12006,7 +12006,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.1" +version = "0.7.2" dependencies = [ "clap", "clap_complete", @@ -12642,7 +12642,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", @@ -12701,7 +12701,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "assert_fs", @@ -12757,7 +12757,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "starknet", @@ -14028,7 +14028,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -14036,7 +14036,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.1", + "common 0.7.2", "ctrlc", "dojo-metrics", "dojo-types", @@ -14073,7 +14073,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.1" +version = "0.7.2" dependencies = [ "async-trait", "camino", @@ -14101,7 +14101,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -14140,7 +14140,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-graphql", @@ -14181,7 +14181,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.1" +version = "0.7.2" dependencies = [ "bytes", "camino", @@ -14225,7 +14225,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -14261,7 +14261,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.1" +version = "0.7.2" dependencies = [ "anyhow", "async-trait", @@ -14584,7 +14584,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.1" +version = "0.7.2" [[package]] name = "ucd-trie" diff --git a/Cargo.toml b/Cargo.toml index a04570f1aa..6bf2173cee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.1" +version = "0.7.2" [profile.performance] codegen-units = 1 diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index f084666a86..f6e3d948fe 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.1" +version = "0.7.2" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 9749d61ff3..5946ebcb71 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -2,7 +2,7 @@ cairo-version = "=2.6.3" description = "The Dojo Core library for autonomous worlds." name = "dojo" -version = "0.7.1" +version = "0.7.2" [dependencies] dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.11" } diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 97f6626b4a..19dab27834 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.1" +version = "0.7.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index d88534e849..e891786546 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.1" +version = "0.7.2" dependencies = [ "dojo_plugin", ] diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 915bb556fb..301b44469f 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "2.4.0" name = "types_test" -version = "0.7.1" +version = "0.7.2" [cairo] sierra-replace-ids = true diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 0ec4b351ac..3fc3103280 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.1" +version = "0.7.2" dependencies = [ "dojo_plugin", ] diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index cace95fe62..a122b55aca 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "=2.6.3" name = "dojo_examples" -version = "0.7.1" +version = "0.7.2" # Use the prelude with the less imports as possible # from corelib. edition = "2023_10" From 06d5803ecc2c838975ec7819f14a740360b8d379 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Thu, 20 Jun 2024 06:45:54 -0500 Subject: [PATCH 47/88] Update devcontainer image: v0.7.2 (#2091) --- .devcontainer/devcontainer.json | 2 +- .github/workflows/bench.yml | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/release-dispatch.yml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7c2d597f16..ec5debbc8c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust { "name": "Rust", - "image": "ghcr.io/dojoengine/dojo-dev:v0.7.1", + "image": "ghcr.io/dojoengine/dojo-dev:v0.7.2", "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 3754955f2e..a1c2b4ffd7 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec3bb90dd8..a01131d856 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: needs: ensure-docker runs-on: ubuntu-latest-32-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -52,7 +52,7 @@ jobs: ensure-wasm: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -109,7 +109,7 @@ jobs: dojo-core-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -118,7 +118,7 @@ jobs: dojo-spawn-and-move-example-test: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -127,7 +127,7 @@ jobs: dojo-world-bindings-check: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -136,7 +136,7 @@ jobs: clippy: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -145,7 +145,7 @@ jobs: fmt: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -154,7 +154,7 @@ jobs: docs: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index b857f806ec..f53e873184 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -14,7 +14,7 @@ jobs: contents: write runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.1 + image: ghcr.io/dojoengine/dojo-dev:v0.7.2 env: VERSION: "" steps: From 45fa7dc12ef292ef9e59a043e6be0a4248a19a12 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:53:18 -0600 Subject: [PATCH 48/88] feat(torii-grpc): add events subscription (#2065) --- crates/torii/client/src/client/mod.rs | 29 +++- crates/torii/grpc/proto/world.proto | 11 ++ crates/torii/grpc/src/client.rs | 55 ++++++- crates/torii/grpc/src/server/mod.rs | 72 ++++++++-- .../grpc/src/server/subscriptions/event.rs | 134 ++++++++++++++++++ .../grpc/src/server/subscriptions/mod.rs | 1 + crates/torii/grpc/src/types/mod.rs | 50 +++++++ 7 files changed, 334 insertions(+), 18 deletions(-) create mode 100644 crates/torii/grpc/src/server/subscriptions/event.rs diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index a87415bb95..dead3ab1b0 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -17,10 +17,10 @@ use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use starknet_crypto::FieldElement; use tokio::sync::RwLock as AsyncRwLock; -use torii_grpc::client::{EntityUpdateStreaming, ModelDiffsStreaming}; -use torii_grpc::proto::world::RetrieveEntitiesResponse; -use torii_grpc::types::schema::Entity; -use torii_grpc::types::{KeysClause, Query}; +use torii_grpc::client::{EntityUpdateStreaming, EventUpdateStreaming, ModelDiffsStreaming}; +use torii_grpc::proto::world::{RetrieveEntitiesResponse, RetrieveEventsResponse}; +use torii_grpc::types::schema::{Entity, SchemaError}; +use torii_grpc::types::{Event, EventQuery, KeysClause, Query}; use torii_relay::client::EventLoop; use torii_relay::types::Message; @@ -148,6 +148,18 @@ impl Client { Ok(entities.into_iter().map(TryInto::try_into).collect::, _>>()?) } + /// Retrieve raw starknet events matching the keys provided. + /// If the keys are empty, it will return all events. + pub async fn starknet_events(&self, query: EventQuery) -> Result, Error> { + let mut grpc_client = self.inner.write().await; + let RetrieveEventsResponse { events } = grpc_client.retrieve_events(query).await?; + Ok(events + .into_iter() + .map(TryInto::try_into) + .collect::, _>>() + .map_err(SchemaError::SliceError)?) + } + /// A direct stream to grpc subscribe entities pub async fn on_entity_updated( &self, @@ -168,6 +180,15 @@ impl Client { Ok(stream) } + pub async fn on_starknet_event( + &self, + keys: Option>, + ) -> Result { + let mut grpc_client = self.inner.write().await; + let stream = grpc_client.subscribe_events(keys).await?; + Ok(stream) + } + /// Returns the value of a model. /// /// This function will only return `None`, if `model` doesn't exist. If there is no model with diff --git a/crates/torii/grpc/proto/world.proto b/crates/torii/grpc/proto/world.proto index 4bf5b181a9..7ab0c6f971 100644 --- a/crates/torii/grpc/proto/world.proto +++ b/crates/torii/grpc/proto/world.proto @@ -25,6 +25,9 @@ service World { // Retrieve events rpc RetrieveEvents (RetrieveEventsRequest) returns (RetrieveEventsResponse); + + // Subscribe to events + rpc SubscribeEvents (SubscribeEventsRequest) returns (stream SubscribeEventsResponse); } @@ -78,3 +81,11 @@ message RetrieveEventsRequest { message RetrieveEventsResponse { repeated types.Event events = 1; } + +message SubscribeEventsRequest { + types.EventKeysClause keys = 1; +} + +message SubscribeEventsResponse { + types.Event event = 1; +} diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index 7f34a60209..e2db66576e 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -6,13 +6,15 @@ use futures_util::{Stream, StreamExt, TryStreamExt}; use starknet::core::types::{FromStrError, StateDiff, StateUpdate}; use starknet_crypto::FieldElement; +use crate::proto::types::EventKeysClause; use crate::proto::world::{ world_client, MetadataRequest, RetrieveEntitiesRequest, RetrieveEntitiesResponse, - SubscribeEntitiesRequest, SubscribeEntityResponse, SubscribeModelsRequest, - SubscribeModelsResponse, + RetrieveEventsRequest, RetrieveEventsResponse, SubscribeEntitiesRequest, + SubscribeEntityResponse, SubscribeEventsRequest, SubscribeEventsResponse, + SubscribeModelsRequest, SubscribeModelsResponse, }; use crate::types::schema::{self, Entity, SchemaError}; -use crate::types::{KeysClause, Query}; +use crate::types::{Event, EventQuery, KeysClause, Query}; #[derive(Debug, thiserror::Error)] pub enum Error { @@ -92,6 +94,14 @@ impl WorldClient { .map(|res| res.into_inner()) } + pub async fn retrieve_events( + &mut self, + query: EventQuery, + ) -> Result { + let request = RetrieveEventsRequest { query: Some(query.into()) }; + self.inner.retrieve_events(request).await.map_err(Error::Grpc).map(|res| res.into_inner()) + } + /// Subscribe to entities updates of a World. pub async fn subscribe_entities( &mut self, @@ -130,6 +140,28 @@ impl WorldClient { })))) } + /// Subscribe to the events of a World. + pub async fn subscribe_events( + &mut self, + keys: Option>, + ) -> Result { + let keys = keys.map(|keys| EventKeysClause { + keys: keys.iter().map(|key| key.to_bytes_be().to_vec()).collect(), + }); + + let stream = self + .inner + .subscribe_events(SubscribeEventsRequest { keys }) + .await + .map_err(Error::Grpc) + .map(|res| res.into_inner())?; + + Ok(EventUpdateStreaming(stream.map_ok(Box::new(|res| match res.event { + Some(event) => event.try_into().expect("must able to serialize"), + None => Event { keys: vec![], data: vec![], transaction_hash: FieldElement::ZERO }, + })))) + } + /// Subscribe to the model diff for a set of models of a World. pub async fn subscribe_model_diffs( &mut self, @@ -187,6 +219,23 @@ impl Stream for EntityUpdateStreaming { } } +type EventMappedStream = MapOk< + tonic::Streaming, + Box Event + Send>, +>; + +pub struct EventUpdateStreaming(EventMappedStream); + +impl Stream for EventUpdateStreaming { + type Item = ::Item; + fn poll_next( + mut self: std::pin::Pin<&mut Self>, + cx: &mut std::task::Context<'_>, + ) -> std::task::Poll> { + self.0.poll_next_unpin(cx) + } +} + fn empty_state_update() -> StateUpdate { StateUpdate { block_hash: FieldElement::ZERO, diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index 15db131a30..7948cc6e56 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -24,6 +24,7 @@ use starknet::core::utils::{cairo_short_string_to_felt, get_selector_from_name}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use starknet_crypto::FieldElement; +use subscriptions::event::EventManager; use tokio::net::TcpListener; use tokio::sync::mpsc::Receiver; use tokio_stream::wrappers::{ReceiverStream, TcpListenerStream}; @@ -38,7 +39,9 @@ use self::subscriptions::event_message::EventMessageManager; use self::subscriptions::model_diff::{ModelDiffRequest, StateDiffManager}; use crate::proto::types::clause::ClauseType; use crate::proto::world::world_server::WorldServer; -use crate::proto::world::{SubscribeEntitiesRequest, SubscribeEntityResponse}; +use crate::proto::world::{ + SubscribeEntitiesRequest, SubscribeEntityResponse, SubscribeEventsResponse, +}; use crate::proto::{self}; use crate::types::ComparisonOperator; @@ -57,6 +60,7 @@ pub struct DojoWorld { model_cache: Arc, entity_manager: Arc, event_message_manager: Arc, + event_manager: Arc, state_diff_manager: Arc, } @@ -70,6 +74,7 @@ impl DojoWorld { let model_cache = Arc::new(ModelCache::new(pool.clone())); let entity_manager = Arc::new(EntityManager::default()); let event_message_manager = Arc::new(EventMessageManager::default()); + let event_manager = Arc::new(EventManager::default()); let state_diff_manager = Arc::new(StateDiffManager::default()); tokio::task::spawn(subscriptions::model_diff::Service::new_with_block_rcv( @@ -91,12 +96,15 @@ impl DojoWorld { Arc::clone(&model_cache), )); + tokio::task::spawn(subscriptions::event::Service::new(Arc::clone(&event_manager))); + Self { pool, world_address, model_cache, entity_manager, event_message_manager, + event_manager, state_diff_manager, } } @@ -307,7 +315,7 @@ impl DojoWorld { return Ok("%".to_string()); } Ok(FieldElement::from_byte_slice_be(bytes) - .map(|felt| format!("{:#x}", felt)) + .map(|felt| format!("{felt:#x}")) .map_err(ParseError::FromByteSliceError)?) }) .collect::, Error>>()?; @@ -392,7 +400,10 @@ impl DojoWorld { if bytes.is_empty() { return Ok("%".to_string()); } - Ok(str::from_utf8(bytes).unwrap().to_string()) + + Ok(FieldElement::from_byte_slice_be(bytes) + .map(|felt| format!("{felt:#x}")) + .map_err(ParseError::FromByteSliceError)?) }) .collect::, Error>>()?; let keys_pattern = keys.join("/") + "/%"; @@ -736,6 +747,24 @@ impl DojoWorld { Ok(RetrieveEventsResponse { events }) } + async fn subscribe_events( + &self, + clause: proto::types::EventKeysClause, + ) -> Result>, Error> { + self.event_manager + .add_subscriber( + clause + .keys + .iter() + .map(|key| { + FieldElement::from_byte_slice_be(key) + .map_err(ParseError::FromByteSliceError) + }) + .collect::, _>>()?, + ) + .await + } + fn map_row_to_entity( row: &SqliteRow, arrays_rows: &HashMap>, @@ -761,14 +790,21 @@ impl DojoWorld { } } -fn process_event_field(data: &str) -> Vec> { - data.trim_end_matches('/').split('/').map(|s| s.to_owned().into_bytes()).collect() +fn process_event_field(data: &str) -> Result>, Error> { + Ok(data + .trim_end_matches('/') + .split('/') + .map(|d| { + FieldElement::from_str(d).map_err(ParseError::FromStr).map(|f| f.to_bytes_be().to_vec()) + }) + .collect::, _>>()?) } fn map_row_to_event(row: &(String, String, String)) -> Result { - let keys = process_event_field(&row.0); - let data = process_event_field(&row.1); - let transaction_hash = row.2.to_owned().into_bytes(); + let keys = process_event_field(&row.0)?; + let data = process_event_field(&row.1)?; + let transaction_hash = + FieldElement::from_str(&row.2).map_err(ParseError::FromStr)?.to_bytes_be().to_vec(); Ok(proto::types::Event { keys, data, transaction_hash }) } @@ -778,23 +814,26 @@ type SubscribeModelsResponseStream = Pin> + Send>>; type SubscribeEntitiesResponseStream = Pin> + Send>>; +type SubscribeEventsResponseStream = + Pin> + Send>>; #[tonic::async_trait] impl proto::world::world_server::World for DojoWorld { type SubscribeModelsStream = SubscribeModelsResponseStream; type SubscribeEntitiesStream = SubscribeEntitiesResponseStream; type SubscribeEventMessagesStream = SubscribeEntitiesResponseStream; + type SubscribeEventsStream = SubscribeEventsResponseStream; async fn world_metadata( &self, _request: Request, ) -> Result, Status> { - let metadata = self.metadata().await.map_err(|e| match e { + let metadata = Some(self.metadata().await.map_err(|e| match e { Error::Sql(sqlx::Error::RowNotFound) => Status::not_found("World not found"), e => Status::internal(e.to_string()), - })?; + })?); - Ok(Response::new(MetadataResponse { metadata: Some(metadata) })) + Ok(Response::new(MetadataResponse { metadata })) } async fn subscribe_models( @@ -895,6 +934,17 @@ impl proto::world::world_server::World for DojoWorld { Ok(Response::new(events)) } + + async fn subscribe_events( + &self, + request: Request, + ) -> ServiceResult { + let keys = request.into_inner().keys.unwrap_or_default(); + + let rx = self.subscribe_events(keys).await.map_err(|e| Status::internal(e.to_string()))?; + + Ok(Response::new(Box::pin(ReceiverStream::new(rx)) as Self::SubscribeEventsStream)) + } } pub async fn new( diff --git a/crates/torii/grpc/src/server/subscriptions/event.rs b/crates/torii/grpc/src/server/subscriptions/event.rs new file mode 100644 index 0000000000..1b44ed7c23 --- /dev/null +++ b/crates/torii/grpc/src/server/subscriptions/event.rs @@ -0,0 +1,134 @@ +use std::collections::HashMap; +use std::future::Future; +use std::pin::Pin; +use std::str::FromStr; +use std::sync::Arc; +use std::task::{Context, Poll}; + +use futures::Stream; +use futures_util::StreamExt; +use rand::Rng; +use starknet_crypto::FieldElement; +use tokio::sync::mpsc::{channel, Receiver, Sender}; +use tokio::sync::RwLock; +use torii_core::error::{Error, ParseError}; +use torii_core::simple_broker::SimpleBroker; +use torii_core::sql::FELT_DELIMITER; +use torii_core::types::Event; +use tracing::{error, trace}; + +use crate::proto; +use crate::proto::world::SubscribeEventsResponse; + +pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event"; + +pub struct EventSubscriber { + /// Event keys that the subscriber is interested in + keys: Vec, + /// The channel to send the response back to the subscriber. + sender: Sender>, +} + +#[derive(Default)] +pub struct EventManager { + subscribers: RwLock>, +} + +impl EventManager { + pub async fn add_subscriber( + &self, + keys: Vec, + ) -> Result>, Error> { + let id = rand::thread_rng().gen::(); + let (sender, receiver) = channel(1); + + // NOTE: unlock issue with firefox/safari + // initially send empty stream message to return from + // initial subscribe call + let _ = sender.send(Ok(SubscribeEventsResponse { event: None })).await; + + self.subscribers.write().await.insert(id, EventSubscriber { keys, sender }); + + Ok(receiver) + } + + pub(super) async fn remove_subscriber(&self, id: usize) { + self.subscribers.write().await.remove(&id); + } +} + +#[must_use = "Service does nothing unless polled"] +pub struct Service { + subs_manager: Arc, + simple_broker: Pin + Send>>, +} + +impl Service { + pub fn new(subs_manager: Arc) -> Self { + Self { subs_manager, simple_broker: Box::pin(SimpleBroker::::subscribe()) } + } + + async fn publish_updates(subs: Arc, event: &Event) -> Result<(), Error> { + let mut closed_stream = Vec::new(); + let keys = event + .keys + .trim_end_matches(FELT_DELIMITER) + .split(FELT_DELIMITER) + .map(FieldElement::from_str) + .collect::, _>>() + .map_err(ParseError::from)?; + let data = event + .data + .trim_end_matches(FELT_DELIMITER) + .split(FELT_DELIMITER) + .map(FieldElement::from_str) + .collect::, _>>() + .map_err(ParseError::from)?; + + for (idx, sub) in subs.subscribers.read().await.iter() { + // publish all updates if ids is empty or only ids that are subscribed to + if sub.keys.is_empty() || keys.starts_with(&sub.keys) { + let resp = proto::world::SubscribeEventsResponse { + event: Some(proto::types::Event { + keys: keys.iter().map(|k| k.to_bytes_be().to_vec()).collect(), + data: data.iter().map(|d| d.to_bytes_be().to_vec()).collect(), + transaction_hash: FieldElement::from_str(&event.transaction_hash) + .map_err(ParseError::from)? + .to_bytes_be() + .to_vec(), + }), + }; + + if sub.sender.send(Ok(resp)).await.is_err() { + closed_stream.push(*idx); + } + } + } + + for id in closed_stream { + trace!(target = LOG_TARGET, id = %id, "Closing events stream."); + subs.remove_subscriber(id).await + } + + Ok(()) + } +} + +impl Future for Service { + type Output = (); + + fn poll(self: std::pin::Pin<&mut Self>, cx: &mut Context<'_>) -> std::task::Poll { + let pin = self.get_mut(); + + while let Poll::Ready(Some(event)) = pin.simple_broker.poll_next_unpin(cx) { + let subs = Arc::clone(&pin.subs_manager); + tokio::spawn(async move { + if let Err(e) = Service::publish_updates(subs, &event).await { + error!(target = LOG_TARGET, error = %e, "Publishing events update."); + } + }); + } + + Poll::Pending + } +} diff --git a/crates/torii/grpc/src/server/subscriptions/mod.rs b/crates/torii/grpc/src/server/subscriptions/mod.rs index 821328c325..f591862bd9 100644 --- a/crates/torii/grpc/src/server/subscriptions/mod.rs +++ b/crates/torii/grpc/src/server/subscriptions/mod.rs @@ -1,4 +1,5 @@ pub mod entity; pub mod error; +pub mod event; pub mod event_message; pub mod model_diff; diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index ca39ed5510..63c108e96b 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -280,3 +280,53 @@ impl TryFrom for StateUpdate { }) } } + +#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] +pub struct Event { + pub keys: Vec, + pub data: Vec, + pub transaction_hash: FieldElement, +} + +impl TryFrom for Event { + type Error = FromByteSliceError; + + fn try_from(value: proto::types::Event) -> Result { + let keys = value + .keys + .into_iter() + .map(|k| FieldElement::from_byte_slice_be(&k)) + .collect::, _>>()?; + + let data = value + .data + .into_iter() + .map(|d| FieldElement::from_byte_slice_be(&d)) + .collect::, _>>()?; + + Ok(Self { + keys, + data, + transaction_hash: FieldElement::from_byte_slice_be(&value.transaction_hash)?, + }) + } +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] +pub struct EventQuery { + pub keys: Vec, + pub limit: u32, + pub offset: u32, +} + +impl From for proto::types::EventQuery { + fn from(value: EventQuery) -> Self { + Self { + keys: Some(proto::types::EventKeysClause { + keys: value.keys.iter().map(|k| k.to_bytes_be().into()).collect(), + }), + limit: value.limit, + offset: value.offset, + } + } +} From 4ff3bb91c0a206514025f1254120b0370bdc9328 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sat, 22 Jun 2024 05:30:47 +0800 Subject: [PATCH 49/88] refactor(sozo): use a wrapper type as the concrete account type (#2068) * refactor(sozo): use a wrapper type as the concrete account type commit-id:4fed8a11 * fmt * add deleted stuff * don't allow --slot.controller along with other signer * remove path requirement when giving keystore_path --------- Co-authored-by: lambda-0x <0xlambda@protonmail.com> --- Cargo.lock | 1 + bin/sozo/Cargo.toml | 1 + .../options/{account.rs => account/mod.rs} | 18 ++- bin/sozo/src/commands/options/account/type.rs | 135 ++++++++++++++++++ bin/sozo/src/commands/options/signer.rs | 2 + 5 files changed, 153 insertions(+), 4 deletions(-) rename bin/sozo/src/commands/options/{account.rs => account/mod.rs} (94%) create mode 100644 bin/sozo/src/commands/options/account/type.rs diff --git a/Cargo.lock b/Cargo.lock index 87fe8db017..6ecd7bee10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12665,6 +12665,7 @@ dependencies = [ "clap-verbosity-flag", "clap_complete", "console", + "derive_more", "dojo-bindgen", "dojo-lang", "dojo-test-utils", diff --git a/bin/sozo/Cargo.toml b/bin/sozo/Cargo.toml index 7c09cd7eb8..9ddf45dae6 100644 --- a/bin/sozo/Cargo.toml +++ b/bin/sozo/Cargo.toml @@ -29,6 +29,7 @@ dojo-bindgen.workspace = true dojo-lang.workspace = true dojo-types.workspace = true dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] } +derive_more.workspace = true futures.workspace = true hex = "0.4.3" hex-literal = "0.4.1" diff --git a/bin/sozo/src/commands/options/account.rs b/bin/sozo/src/commands/options/account/mod.rs similarity index 94% rename from bin/sozo/src/commands/options/account.rs rename to bin/sozo/src/commands/options/account/mod.rs index 6b57fa6ed1..fc71cb3f40 100644 --- a/bin/sozo/src/commands/options/account.rs +++ b/bin/sozo/src/commands/options/account/mod.rs @@ -12,6 +12,8 @@ use tracing::trace; use super::signer::SignerOptions; use super::DOJO_ACCOUNT_ADDRESS_ENV_VAR; +mod r#type; + // INVARIANT: // - For commandline: we can either specify `private_key` or `keystore_path` along with // `keystore_password`. This is enforced by Clap. @@ -24,6 +26,14 @@ pub struct AccountOptions { #[arg(global = true)] pub account_address: Option, + #[arg(global = true)] + #[arg(long = "slot.controller")] + #[arg(help_heading = "Controller options")] + #[arg(help = "Use Slot's Controller account")] + #[cfg(feature = "controller")] + #[arg(conflicts_with = "signer")] + pub controller: bool, + #[command(flatten)] #[command(next_help_heading = "Signer options")] pub signer: SignerOptions, @@ -41,7 +51,8 @@ impl AccountOptions { env_metadata: Option<&Environment>, ) -> Result> where - P: Provider + Send + Sync, + P: Provider, + P: Send + Sync, { trace!(account_options=?self, "Creating account."); let account_address = self.account_address(env_metadata)?; @@ -50,9 +61,9 @@ impl AccountOptions { let signer = self.signer.signer(env_metadata, false)?; trace!(?signer, "Signer obtained."); - let chain_id = - provider.chain_id().await.with_context(|| "Failed to retrieve network chain id.")?; + let chain_id = provider.chain_id().await.context("Failed to retrieve network chain id.")?; trace!(?chain_id); + let encoding = if self.legacy { ExecutionEncoding::Legacy } else { ExecutionEncoding::New }; trace!(?encoding, "Creating SingleOwnerAccount."); let mut account = @@ -61,7 +72,6 @@ impl AccountOptions { // The default is `Latest` in starknet-rs, which does not reflect // the nonce changes in the pending block. account.set_block_id(BlockId::Tag(BlockTag::Pending)); - Ok(account) } diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs new file mode 100644 index 0000000000..eb388398b0 --- /dev/null +++ b/bin/sozo/src/commands/options/account/type.rs @@ -0,0 +1,135 @@ +use std::sync::Arc; + +use async_trait::async_trait; +use starknet::accounts::single_owner::SignError; +use starknet::accounts::{ + Account, Call, ConnectedAccount, Declaration, Execution, ExecutionEncoder, LegacyDeclaration, + RawDeclaration, RawExecution, RawLegacyDeclaration, SingleOwnerAccount, +}; +use starknet::core::types::contract::legacy::LegacyContractClass; +use starknet::core::types::{FieldElement, FlattenedSierraClass}; +use starknet::providers::Provider; +use starknet::signers::LocalWallet; + +#[derive(Debug, thiserror::Error)] +pub enum SozoAccountSignError { + #[error(transparent)] + Standard(#[from] SignError), +} + +/// To unify the account types, we define a wrapper type that implements the +/// [ConnectedAccount] trait and wrap the different account types. +/// +/// This is the account type that should be used by the CLI. +#[must_use] +#[non_exhaustive] +#[derive(derive_more::From)] +pub enum SozoAccount

+where + P: Send, + P: Provider, +{ + Standard(SingleOwnerAccount), +} + +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +impl

Account for SozoAccount

+where + P: Provider, + P: Send + Sync, +{ + type SignError = SozoAccountSignError; + + fn address(&self) -> FieldElement { + match self { + Self::Standard(account) => account.address(), + } + } + + fn chain_id(&self) -> FieldElement { + match self { + Self::Standard(account) => account.chain_id(), + } + } + + fn declare( + &self, + contract_class: Arc, + compiled_class_hash: FieldElement, + ) -> Declaration<'_, Self> { + Declaration::new(contract_class, compiled_class_hash, self) + } + + fn declare_legacy( + &self, + contract_class: Arc, + ) -> LegacyDeclaration<'_, Self> { + LegacyDeclaration::new(contract_class, self) + } + + fn execute(&self, calls: Vec) -> Execution<'_, Self> { + Execution::new(calls, self) + } + + async fn sign_execution( + &self, + execution: &RawExecution, + query_only: bool, + ) -> Result, Self::SignError> { + let result = match self { + Self::Standard(account) => account.sign_execution(execution, query_only).await?, + }; + Ok(result) + } + + async fn sign_declaration( + &self, + declaration: &RawDeclaration, + query_only: bool, + ) -> Result, Self::SignError> { + let result = match self { + Self::Standard(account) => account.sign_declaration(declaration, query_only).await?, + }; + Ok(result) + } + + async fn sign_legacy_declaration( + &self, + declaration: &RawLegacyDeclaration, + query_only: bool, + ) -> Result, Self::SignError> { + match self { + Self::Standard(account) => { + let result = account.sign_legacy_declaration(declaration, query_only).await?; + Ok(result) + } + } + } +} + +impl

ExecutionEncoder for SozoAccount

+where + P: Provider, + P: Send + Sync, +{ + fn encode_calls(&self, calls: &[Call]) -> Vec { + match self { + Self::Standard(account) => account.encode_calls(calls), + } + } +} + +impl

ConnectedAccount for SozoAccount

+where + P: Provider, + P: Send + Sync, +{ + type Provider = P; + + fn provider(&self) -> &Self::Provider { + match self { + Self::Standard(account) => account.provider(), + } + } +} diff --git a/bin/sozo/src/commands/options/signer.rs b/bin/sozo/src/commands/options/signer.rs index 2fb9c4823b..582099eff9 100644 --- a/bin/sozo/src/commands/options/signer.rs +++ b/bin/sozo/src/commands/options/signer.rs @@ -22,6 +22,7 @@ pub struct SignerOptions { #[arg(help_heading = "Signer options - RAW")] #[arg(help = "The raw private key associated with the account contract.")] #[arg(global = true)] + #[arg(group = "signer")] pub private_key: Option, #[arg(long = "keystore", env = DOJO_KEYSTORE_PATH_ENV_VAR)] @@ -29,6 +30,7 @@ pub struct SignerOptions { #[arg(help_heading = "Signer options - KEYSTORE")] #[arg(help = "Use the keystore in the given folder or file.")] #[arg(global = true)] + #[arg(group = "signer")] pub keystore_path: Option, #[arg(long = "password", env = DOJO_KEYSTORE_PASSWORD_ENV_VAR)] From ab3306530fa3fffc005523c37582c3f49beea9f0 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Sat, 22 Jun 2024 07:26:22 +0530 Subject: [PATCH 50/88] fix(sozo): dev subcommand (#2080) * fix: filter out test targets * fix manifests path * return error instead of unwrap * fix: propose newer implementation to take manifests in account * fix: remove the content compare for better performances * fix: clippy * update dojo_plugin version * migrate during initial run * remove manual skipping * fix lints --------- Co-authored-by: glihm --- Cargo.lock | 4 +- bin/sozo/src/commands/build.rs | 2 +- bin/sozo/src/commands/dev.rs | 355 +++++-------------- bin/sozo/src/commands/migrate.rs | 16 + bin/sozo/src/commands/options/account/mod.rs | 2 +- bin/sozo/src/commands/options/signer.rs | 2 +- bin/sozo/src/commands/options/starknet.rs | 2 +- bin/sozo/src/commands/options/transaction.rs | 6 +- bin/sozo/src/commands/options/world.rs | 2 +- crates/dojo-core/Scarb.toml | 2 +- crates/dojo-lang/Scarb.toml | 2 +- crates/torii/types-test/Scarb.lock | 4 +- examples/spawn-and-move/.tool-versions | 2 +- examples/spawn-and-move/Scarb.lock | 4 +- 14 files changed, 122 insertions(+), 283 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ecd7bee10..5637ea021e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10986,9 +10986,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7508e692a49b6b2290b56540384ccae9b1fb4d77065640b165835b56ffe3bb" +checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" dependencies = [ "libc", ] diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index 5d1d5df7cf..f7384266f0 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -18,7 +18,7 @@ const CONTRACT_CLASS_SIZE_LABEL: &str = "Contract Class size [in bytes]\n(Sierra const CONTRACT_NAME_LABEL: &str = "Contract"; -#[derive(Debug, Args)] +#[derive(Debug, Args, Default)] pub struct BuildArgs { // Should we deprecate typescript bindings codegen? // Disabled due to lack of support in dojo.js diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index 92b20e7c66..53e7687ae8 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -1,29 +1,15 @@ -use std::mem; -use std::path::{Path, PathBuf}; use std::sync::mpsc::channel; use std::time::Duration; -use anyhow::{anyhow, Result}; -use cairo_lang_compiler::db::RootDatabase; -use cairo_lang_filesystem::db::{AsFilesGroupMut, FilesGroupEx, PrivRawFileContentQuery}; -use cairo_lang_filesystem::ids::FileId; +use anyhow::Result; use clap::Args; -use dojo_lang::scarb_internal::build_scarb_root_database; -use dojo_world::manifest::{BaseManifest, DeploymentManifest, BASE_DIR, MANIFESTS_DIR}; -use dojo_world::metadata::dojo_metadata_from_workspace; -use dojo_world::migration::world::WorldDiff; -use dojo_world::migration::TxnConfig; -use notify_debouncer_mini::notify::RecursiveMode; -use notify_debouncer_mini::{new_debouncer, DebouncedEvent, DebouncedEventKind}; -use scarb::compiler::{CairoCompilationUnit, CompilationUnit, CompilationUnitAttributes}; -use scarb::core::{Config, Workspace}; -use scarb::ops::{FeaturesOpts, FeaturesSelector}; -use sozo_ops::migration; -use starknet::accounts::ConnectedAccount; -use starknet::core::types::FieldElement; -use tracing::{error, trace}; +use notify::event::Event; +use notify::{EventKind, PollWatcher, RecursiveMode, Watcher}; +use scarb::core::Config; +use tracing::{error, info, trace}; -use super::migrate::setup_env; +use super::build::BuildArgs; +use super::migrate::MigrateArgs; use super::options::account::AccountOptions; use super::options::starknet::StarknetOptions; use super::options::world::WorldOptions; @@ -45,281 +31,114 @@ pub struct DevArgs { #[command(flatten)] pub account: AccountOptions, } + impl DevArgs { + /// Watches the `src` directory that is found at the same level of the `Scarb.toml` manifest + /// of the project into the provided [`Config`]. + /// + /// When a change is detected, it rebuilds the project and applies the migrations. pub fn run(self, config: &Config) -> Result<()> { - let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { - metadata - } else { - return Err(anyhow!( - "No current package with dojo metadata found, dev is not yet support for \ - workspaces." - )); - }; + let (tx, rx) = channel(); - let env_metadata = if config.manifest_path().exists() { - dojo_metadata.env().cloned() - } else { - trace!("Manifest path does not exist."); - None - }; + let watcher_config = notify::Config::default().with_poll_interval(Duration::from_secs(1)); - let mut context = load_context(config)?; + let mut watcher = PollWatcher::new(tx, watcher_config)?; - let (tx, rx) = channel(); - let mut debouncer = new_debouncer(Duration::from_secs(1), None, tx)?; + let watched_directory = config.manifest_path().parent().unwrap().join("src"); - debouncer.watcher().watch( - config.manifest_path().parent().unwrap().as_std_path(), - RecursiveMode::Recursive, - )?; + watcher.watch(watched_directory.as_std_path(), RecursiveMode::Recursive).unwrap(); - let name = self.name.unwrap_or_else(|| ws.current_package().unwrap().id.name.to_string()); + // Always build the project before starting the dev loop to make sure that the project is + // in a valid state. Devs may not use `build` anymore when using `dev`. + BuildArgs::default().run(config)?; + info!("Initial build completed."); - let mut previous_manifest: Option = Option::None; - let result = build(&mut context); + let _ = MigrateArgs::new_apply( + self.name.clone(), + self.world.clone(), + self.starknet.clone(), + self.account.clone(), + ) + .run(config); - let Some((mut world_address, account, _)) = context - .ws - .config() - .tokio_handle() - .block_on(setup_env( - &context.ws, - self.account, - self.starknet, - self.world, - &name, - env_metadata.as_ref(), - )) - .ok() - else { - return Err(anyhow!("Failed to setup environment.")); - }; + info!( + directory = watched_directory.to_string(), + "Initial migration completed. Waiting for changes." + ); + + let mut e_handler = EventHandler; - match context.ws.config().tokio_handle().block_on(migrate( - world_address, - &account, - &name, - &context.ws, - previous_manifest.clone(), - dojo_metadata.skip_migration.clone(), - )) { - Ok((manifest, address)) => { - previous_manifest = Some(manifest); - world_address = address; - } - Err(error) => { - error!( - error = ?error, - address = ?world_address, - "Migrating world." - ); - } - } loop { - let action = match rx.recv() { - Ok(Ok(events)) => events - .iter() - .map(|event| process_event(event, &mut context)) - .last() - .unwrap_or(DevAction::None), - Ok(Err(_)) => DevAction::None, + let is_rebuild_needed = match rx.recv() { + Ok(maybe_event) => match maybe_event { + Ok(event) => e_handler.process_event(event), + Err(error) => { + error!(?error, "Processing event."); + break; + } + }, Err(error) => { - error!(error = ?error, "Receiving dev action."); + error!(?error, "Receiving event."); break; } }; - if action != DevAction::None && build(&mut context).is_ok() { - match context.ws.config().tokio_handle().block_on(migrate( - world_address, - &account, - &name, - &context.ws, - previous_manifest.clone(), - dojo_metadata.skip_migration.clone(), - )) { - Ok((manifest, address)) => { - previous_manifest = Some(manifest); - world_address = address; - } - Err(error) => { - error!( - error = ?error, - address = ?world_address, - "Migrating world.", - ); - } - } - } - } - result - } -} - -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] -enum DevAction { - None, - Reload, - Build(PathBuf), -} - -fn handle_event(event: &DebouncedEvent) -> DevAction { - let action = match event.kind { - DebouncedEventKind::Any => { - let p = event.path.clone(); - if let Some(filename) = p.file_name() { - if filename == "Scarb.toml" { - return DevAction::Reload; - } else if let Some(extension) = p.extension() { - if extension == "cairo" { - return DevAction::Build(p.clone()); - } - } + if is_rebuild_needed { + // Ignore the fails of those commands as the `run` function + // already logs the error. + let _ = BuildArgs::default().run(config); + + let _ = MigrateArgs::new_apply( + self.name.clone(), + self.world.clone(), + self.starknet.clone(), + self.account.clone(), + ) + .run(config); } - DevAction::None } - _ => DevAction::None, - }; - trace!(?action, "Determined action."); - action -} - -struct DevContext<'a> { - pub db: RootDatabase, - pub unit: CairoCompilationUnit, - pub ws: Workspace<'a>, -} - -fn load_context(config: &Config) -> Result> { - let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let packages: Vec = ws.members().map(|p| p.id).collect(); - let resolve = scarb::ops::resolve_workspace(&ws)?; - - let features_opts = - FeaturesOpts { features: FeaturesSelector::AllFeatures, no_default_features: false }; - - let compilation_units = scarb::ops::generate_compilation_units(&resolve, &features_opts, &ws)? - .into_iter() - .filter(|cu| packages.contains(&cu.main_package_id())) - .collect::>(); - - // we have only 1 unit in projects - // TODO: double check if we always have one with the new version and the order if many. - trace!(unit_count = compilation_units.len(), "Gathering compilation units."); - if let CompilationUnit::Cairo(unit) = compilation_units.first().unwrap() { - let db = build_scarb_root_database(unit).unwrap(); - Ok(DevContext { db, unit: unit.clone(), ws }) - } else { - Err(anyhow!("Cairo Compilation Unit is expected at this point.")) + Ok(()) } } -fn build(context: &mut DevContext<'_>) -> Result<()> { - let ws = &context.ws; - let unit = &context.unit; - let package_name = unit.main_package_id.name.clone(); - ws.config().compilers().compile(unit.clone(), &mut (context.db), ws).map_err(|err| { - ws.config().ui().anyhow(&err); +#[derive(Debug, Default)] +struct EventHandler; - anyhow!("could not compile `{package_name}` due to previous error") - })?; - ws.config().ui().print("📦 Rebuild done"); - Ok(()) -} - -// TODO: fix me -async fn migrate( - mut world_address: Option, - account: A, - name: &str, - ws: &Workspace<'_>, - previous_manifest: Option, - skip_migration: Option>, -) -> Result<(DeploymentManifest, Option)> -where - A: ConnectedAccount + Sync + Send, - A::Provider: Send, - A::SignError: 'static, -{ - let target_dir = ws.target_dir().path_existent().unwrap(); - let target_dir = target_dir.join(ws.config().profile().as_str()); +impl EventHandler { + /// Processes a debounced event and return true if a rebuild is needed. + /// Only considers Cairo file and the Scarb.toml manifest. + fn process_event(&mut self, event: Event) -> bool { + trace!(?event, "Processing event."); - // `parent` returns `None` only when its root path, so its safe to unwrap - let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); - - if !manifest_dir.join(MANIFESTS_DIR).exists() { - return Err(anyhow!("Build project using `sozo build` first")); - } - - let mut new_manifest = - BaseManifest::load_from_path(&manifest_dir.join(MANIFESTS_DIR).join(BASE_DIR))?; - - if let Some(skip_manifests) = skip_migration { - new_manifest.remove_items(skip_manifests); - } - - let diff = WorldDiff::compute(new_manifest.clone(), previous_manifest); - let total_diffs = diff.count_diffs(); - let config = ws.config(); - config.ui().print(format!("Total diffs found: {total_diffs}")); - if total_diffs == 0 { - return Ok((new_manifest.into(), world_address)); - } - - let ui = ws.config().ui(); - let mut strategy = migration::prepare_migration(&target_dir, diff, name, world_address, &ui)?; + let paths = match event.kind { + EventKind::Modify(_) => event.paths, + EventKind::Remove(_) => event.paths, + EventKind::Create(_) => event.paths, + _ => vec![], + }; - match migration::apply_diff(ws, account, TxnConfig::default(), &mut strategy).await { - Ok(migration_output) => { - config.ui().print(format!( - "🎉 World at address {} updated!", - format_args!("{:#x}", migration_output.world_address) - )); - world_address = Some(migration_output.world_address); + if paths.is_empty() { + return false; } - Err(err) => { - config.ui().error(err.to_string()); - return Err(err); - } - } - Ok((new_manifest.into(), world_address)) -} + let mut is_rebuild_needed = false; -fn process_event(event: &DebouncedEvent, context: &mut DevContext<'_>) -> DevAction { - trace!(event=?event, "Processing event."); - let action = handle_event(event); - match &action { - DevAction::None => {} - DevAction::Build(path) => handle_build_action(path, context), - DevAction::Reload => { - handle_reload_action(context); + for path in &paths { + if let Some(filename) = path.file_name() { + if filename == "Scarb.toml" { + info!("Rebuild to include Scarb.toml changes."); + is_rebuild_needed = true; + } else if let Some(extension) = path.extension() { + if extension == "cairo" { + let file = path.to_string_lossy().to_string(); + info!(file, "Rebuild from Cairo file change."); + is_rebuild_needed = true; + } + } + } } - } - - trace!(action=?action, "Processed action."); - action -} -fn handle_build_action(path: &Path, context: &mut DevContext<'_>) { - context - .ws - .config() - .ui() - .print(format!("📦 Need to rebuild {}", path.to_str().unwrap_or_default(),)); - let db = &mut context.db; - let file = FileId::new(db, path.to_path_buf()); - PrivRawFileContentQuery.in_db_mut(db.as_files_group_mut()).invalidate(&file); - db.override_file_content(file, None); -} - -fn handle_reload_action(context: &mut DevContext<'_>) { - trace!("Reloading context."); - let config = context.ws.config(); - config.ui().print("Reloading project"); - let new_context = load_context(config).expect("Failed to load context"); - let _ = mem::replace(context, new_context); - trace!("Context reloaded."); + is_rebuild_needed + } } diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 239a78f58d..02a8bf46aa 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -55,6 +55,22 @@ pub enum MigrateCommand { } impl MigrateArgs { + /// Creates a new `MigrateArgs` with the `Apply` command. + pub fn new_apply( + name: Option, + world: WorldOptions, + starknet: StarknetOptions, + account: AccountOptions, + ) -> Self { + Self { + command: MigrateCommand::Apply { transaction: TransactionOptions::init_wait() }, + name, + world, + starknet, + account, + } + } + pub fn run(self, config: &Config) -> Result<()> { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; diff --git a/bin/sozo/src/commands/options/account/mod.rs b/bin/sozo/src/commands/options/account/mod.rs index fc71cb3f40..eba8d53d63 100644 --- a/bin/sozo/src/commands/options/account/mod.rs +++ b/bin/sozo/src/commands/options/account/mod.rs @@ -19,7 +19,7 @@ mod r#type; // `keystore_password`. This is enforced by Clap. // - For `Scarb.toml`: if both private_key and keystore are specified in `Scarb.toml` private_key // will take priority -#[derive(Debug, Args)] +#[derive(Debug, Args, Clone)] #[command(next_help_heading = "Account options")] pub struct AccountOptions { #[arg(long, env = DOJO_ACCOUNT_ADDRESS_ENV_VAR)] diff --git a/bin/sozo/src/commands/options/signer.rs b/bin/sozo/src/commands/options/signer.rs index 582099eff9..04b59b913b 100644 --- a/bin/sozo/src/commands/options/signer.rs +++ b/bin/sozo/src/commands/options/signer.rs @@ -9,7 +9,7 @@ use tracing::trace; use super::{DOJO_KEYSTORE_PASSWORD_ENV_VAR, DOJO_KEYSTORE_PATH_ENV_VAR, DOJO_PRIVATE_KEY_ENV_VAR}; -#[derive(Debug, Args)] +#[derive(Debug, Args, Clone)] #[command(next_help_heading = "Signer options")] // INVARIANT: // - For commandline: we can either specify `private_key` or `keystore_path` along with diff --git a/bin/sozo/src/commands/options/starknet.rs b/bin/sozo/src/commands/options/starknet.rs index 5b14de281d..186d7ea242 100644 --- a/bin/sozo/src/commands/options/starknet.rs +++ b/bin/sozo/src/commands/options/starknet.rs @@ -8,7 +8,7 @@ use url::Url; use super::STARKNET_RPC_URL_ENV_VAR; -#[derive(Debug, Args)] +#[derive(Debug, Args, Clone)] #[command(next_help_heading = "Starknet options")] pub struct StarknetOptions { #[arg(long, env = STARKNET_RPC_URL_ENV_VAR)] diff --git a/bin/sozo/src/commands/options/transaction.rs b/bin/sozo/src/commands/options/transaction.rs index ddd028e117..f3fb1d9534 100644 --- a/bin/sozo/src/commands/options/transaction.rs +++ b/bin/sozo/src/commands/options/transaction.rs @@ -4,7 +4,7 @@ use dojo_world::migration::{TxnAction, TxnConfig}; use starknet::core::types::FieldElement; use tracing::trace; -#[derive(Debug, Args)] +#[derive(Debug, Args, Default)] #[command(next_help_heading = "Transaction options")] pub struct TransactionOptions { #[arg(long, value_name = "MULTIPLIER")] @@ -40,6 +40,10 @@ pub struct TransactionOptions { } impl TransactionOptions { + pub fn init_wait() -> Self { + TransactionOptions { wait: true, ..Default::default() } + } + pub fn to_txn_action(&self, simulate: bool, estimate_only: bool) -> Result { match (estimate_only, simulate) { (true, true) => { diff --git a/bin/sozo/src/commands/options/world.rs b/bin/sozo/src/commands/options/world.rs index 7cd4584355..88f1bbd5f2 100644 --- a/bin/sozo/src/commands/options/world.rs +++ b/bin/sozo/src/commands/options/world.rs @@ -8,7 +8,7 @@ use tracing::trace; use super::DOJO_WORLD_ADDRESS_ENV_VAR; -#[derive(Debug, Args)] +#[derive(Debug, Args, Clone)] #[command(next_help_heading = "World options")] pub struct WorldOptions { #[arg(help = "The address of the World contract.")] diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 5946ebcb71..98a8f89e3f 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -5,5 +5,5 @@ name = "dojo" version = "0.7.2" [dependencies] -dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.3.11" } +dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.2" } starknet = "=2.6.3" diff --git a/crates/dojo-lang/Scarb.toml b/crates/dojo-lang/Scarb.toml index a533c510d2..8431e93375 100644 --- a/crates/dojo-lang/Scarb.toml +++ b/crates/dojo-lang/Scarb.toml @@ -1,5 +1,5 @@ [package] name = "dojo_plugin" -version = "0.4.1" +version = "0.7.2" [cairo-plugin] diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index e891786546..fbf70e2be2 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -10,8 +10,8 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.3.11" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7d8aa29a92062fcb9e6659" +version = "0.4.1" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" [[package]] name = "types_test" diff --git a/examples/spawn-and-move/.tool-versions b/examples/spawn-and-move/.tool-versions index 21cfc80772..f239fe235a 100644 --- a/examples/spawn-and-move/.tool-versions +++ b/examples/spawn-and-move/.tool-versions @@ -1 +1 @@ -scarb 2.4.0 +scarb 2.6.3 diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 3fc3103280..e9a0b90f18 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -17,5 +17,5 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.3.11" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7d8aa29a92062fcb9e6659" +version = "0.4.1" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" From 0d3c0b0d5a36e36e003ce8ef066054d54a3c4041 Mon Sep 17 00:00:00 2001 From: Neo <128649481+neotheprogramist@users.noreply.github.com> Date: Sat, 22 Jun 2024 03:59:15 +0200 Subject: [PATCH 51/88] [saya] Publish proof to Celestia (#2053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * updated celestia and publishing proof * specifying whether to include proof blob * fix: cleanup --------- Co-authored-by: Mateusz Zając Co-authored-by: glihm --- Cargo.lock | 29 +++++++++++++------ bin/saya/src/args/data_availability.rs | 5 ++++ bin/saya/src/args/mod.rs | 5 ++++ bin/saya/src/args/test_saya_config_file.json | 1 + crates/saya/core/Cargo.toml | 4 +-- .../src/data_availability/celestia/mod.rs | 22 ++++++++++++-- crates/saya/core/src/data_availability/mod.rs | 15 ++++++++++ crates/saya/core/src/lib.rs | 29 ++++++++++++++----- 8 files changed, 89 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5637ea021e..5c48da049b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1576,11 +1576,10 @@ dependencies = [ [[package]] name = "blockstore" -version = "0.1.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bff157a9c999bf0a39ca45e0b62076aa27135012cfbf9cc54ad1cf971876f0" +checksum = "358358b19add120a5afc3dd1c8e9161d6d06c44dfec2ef8da58b7fe5c369c90d" dependencies = [ - "async-trait", "cid", "dashmap", "multihash 0.19.1", @@ -3425,9 +3424,9 @@ dependencies = [ [[package]] name = "celestia-proto" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d93904482a787d8caecb3a348788704fa044df6fb2402f28da5b91a2a5eabb" +checksum = "7f22a6baf972f7277acfd5c4ff9b894df7db5b0aaecdb57b9b77b5679fff323e" dependencies = [ "anyhow", "celestia-tendermint-proto", @@ -3439,9 +3438,9 @@ dependencies = [ [[package]] name = "celestia-rpc" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4c948ab3cd9562d256b752d874d573c836ec8b200bba87d1154bbf662d3a00" +checksum = "c891b0371a6ae5a37650f1806221185cad25a1e19a11031707b6239ac720f0df" dependencies = [ "async-trait", "celestia-types", @@ -3501,9 +3500,9 @@ dependencies = [ [[package]] name = "celestia-types" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc3c4c6698257125b315c04236a28cf5156a866211d336ba6ac70cc5f88e24eb" +checksum = "e20dce9a482131ec8a3c69c2cbe9b57bd838b26757952094e35397acb170b427" dependencies = [ "base64 0.21.7", "bech32", @@ -3515,6 +3514,7 @@ dependencies = [ "cid", "const_format", "enum_dispatch", + "leopard-codec", "libp2p-identity", "multiaddr 0.18.1", "multihash 0.19.1", @@ -8269,6 +8269,17 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "leopard-codec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee58dbc414bd23885d7da915e0457618b36d1fc950a6169ef2cb29829d1b1a1d" +dependencies = [ + "bytes", + "lazy_static", + "thiserror", +] + [[package]] name = "libc" version = "0.2.154" diff --git a/bin/saya/src/args/data_availability.rs b/bin/saya/src/args/data_availability.rs index ba5ca4dd38..8b7e406b0e 100644 --- a/bin/saya/src/args/data_availability.rs +++ b/bin/saya/src/args/data_availability.rs @@ -43,6 +43,11 @@ pub struct CelestiaOptions { #[arg(help = "The namespace used to submit blobs.")] #[arg(requires = "celestia_node_url")] pub celestia_namespace: Option, + + #[arg(long)] + #[arg(help = "Whether to include a proof to the publish DA.")] + #[arg(default_value_t = false)] + pub skip_publishing_proof: bool, } // -- Clap enums impls -- diff --git a/bin/saya/src/args/mod.rs b/bin/saya/src/args/mod.rs index 7c40bd4935..f0a257d6e4 100644 --- a/bin/saya/src/args/mod.rs +++ b/bin/saya/src/args/mod.rs @@ -97,6 +97,8 @@ impl TryFrom for SayaConfig { type Error = Box; fn try_from(args: SayaArgs) -> Result { + let skip_publishing_proof = args.data_availability.celestia.skip_publishing_proof; + if let Some(config_file) = args.config_file { let file = File::open(config_file).map_err(|_| "Failed to open config file")?; let reader = BufReader::new(file); @@ -147,6 +149,7 @@ impl TryFrom for SayaConfig { data_availability: da_config, world_address: args.proof.world_address, fact_registry_address: args.proof.fact_registry_address, + skip_publishing_proof, }) } } @@ -181,6 +184,7 @@ mod tests { celestia_node_url: None, celestia_node_auth_token: None, celestia_namespace: None, + skip_publishing_proof: true, }, }, proof: ProofOptions { @@ -199,6 +203,7 @@ mod tests { "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" ); assert!(!config.store_proofs); + assert!(config.skip_publishing_proof); assert_eq!(config.start_block, 0); if let Some(DataAvailabilityConfig::Celestia(celestia_config)) = config.data_availability { assert_eq!(celestia_config.node_url.as_str(), "http://localhost:26657/"); diff --git a/bin/saya/src/args/test_saya_config_file.json b/bin/saya/src/args/test_saya_config_file.json index 478f88faf6..ba73f97434 100644 --- a/bin/saya/src/args/test_saya_config_file.json +++ b/bin/saya/src/args/test_saya_config_file.json @@ -7,6 +7,7 @@ "world_address": "0x332b8ff41b1b026991fa9b7f0ec352909f8bc33416b65a80527edc988a9b082", "fact_registry_address": "0x217746a5f74c2e5b6fa92c97e902d8cd78b1fabf1e8081c4aa0d2fe159bc0eb", "start_block": 0, + "skip_publishing_proof": true, "data_availability": { "Celestia": { "node_url": "http://localhost:26657", diff --git a/crates/saya/core/Cargo.toml b/crates/saya/core/Cargo.toml index 4881647506..b44ecbeabc 100644 --- a/crates/saya/core/Cargo.toml +++ b/crates/saya/core/Cargo.toml @@ -40,8 +40,8 @@ tracing.workspace = true url.workspace = true # TODO: use features for each possible DA. -celestia-rpc = "0.1.1" -celestia-types = "0.1.1" +celestia-rpc = "0.2.0" +celestia-types = "0.2.0" cairo-felt = "0.9.1" num-bigint = "0.4.4" diff --git a/crates/saya/core/src/data_availability/celestia/mod.rs b/crates/saya/core/src/data_availability/celestia/mod.rs index 17bbed633c..7e85dd1567 100644 --- a/crates/saya/core/src/data_availability/celestia/mod.rs +++ b/crates/saya/core/src/data_availability/celestia/mod.rs @@ -3,7 +3,7 @@ use std::fmt::Display; use async_trait::async_trait; use celestia_rpc::{BlobClient, Client}; -use celestia_types::blob::SubmitOptions; +use celestia_types::blob::GasPrice; use celestia_types::nmt::Namespace; use celestia_types::Blob; use serde::{Deserialize, Serialize}; @@ -65,7 +65,25 @@ impl DataAvailabilityClient for CelestiaClient { // TODO: we may want to use `blob_get` to ensure the state diff has been published // correctly. self.client - .blob_submit(&[blob], SubmitOptions::default()) + .blob_submit(&[blob], GasPrice::default()) + .await + .map_err(|e| Error::Client(format!("Celestia RPC error: {e}"))) + } + + async fn publish_state_diff_and_proof_felts( + &self, + state_diff: &[FieldElement], + state_diff_proof: &[FieldElement], + ) -> DataAvailabilityResult { + let bytes: Vec = state_diff.iter().flat_map(|fe| fe.to_bytes_be().to_vec()).collect(); + let blob = Blob::new(self.namespace, bytes)?; + + let proof_bytes: Vec = + state_diff_proof.iter().flat_map(|fe| fe.to_bytes_be().to_vec()).collect(); + let proof_blob = Blob::new(self.namespace, proof_bytes)?; + + self.client + .blob_submit(&[blob, proof_blob], GasPrice::default()) .await .map_err(|e| Error::Client(format!("Celestia RPC error: {e}"))) } diff --git a/crates/saya/core/src/data_availability/mod.rs b/crates/saya/core/src/data_availability/mod.rs index 8bfe270cc6..d5ae1d410b 100644 --- a/crates/saya/core/src/data_availability/mod.rs +++ b/crates/saya/core/src/data_availability/mod.rs @@ -61,6 +61,21 @@ pub trait DataAvailabilityClient { &self, state_diff: &[FieldElement], ) -> DataAvailabilityResult; + + /// Publishes both data and transition proof on the DA layer atomically. + /// Returns the block height in which the state diff was included. + /// + /// # Arguments + /// + /// * `state_diff` - An array of felt representing the data to be published on the DA layer. We + /// use felt as all fields inside the state diff can be expressed as a felt. Nonce and updates + /// count are limited to 64 bits anyway. + /// * `state_diff_proof` - The serialized transition proof corresponding to the `state_diff`. + async fn publish_state_diff_and_proof_felts( + &self, + state_diff: &[FieldElement], + state_diff_proof: &[FieldElement], + ) -> DataAvailabilityResult; } /// Initializes a [`DataAvailabilityClient`] from a [`DataAvailabilityConfig`]. diff --git a/crates/saya/core/src/lib.rs b/crates/saya/core/src/lib.rs index f3c98ef1de..60e4f891bd 100644 --- a/crates/saya/core/src/lib.rs +++ b/crates/saya/core/src/lib.rs @@ -53,6 +53,7 @@ pub struct SayaConfig { pub data_availability: Option, pub world_address: FieldElement, pub fact_registry_address: FieldElement, + pub skip_publishing_proof: bool, } fn url_deserializer<'de, D>(deserializer: D) -> Result @@ -190,7 +191,9 @@ impl Saya { let mut state_updates_and_exec_info = vec![]; - let (state_updates, da_state_updates): (Vec<_>, Vec<_>) = future::try_join_all( + // The serialized DA is not used here as we only need the state updates to generate the + // proof and the DA data are generated by the `dojo-os`. + let (state_updates, _): (Vec<_>, Vec<_>) = future::try_join_all( block_numbers .clone() .map(|block_number| self.provider.fetch_state_updates(block_number)), @@ -205,13 +208,6 @@ impl Saya { ) .await?; - for da_state_update in da_state_updates { - if let Some(da) = &self.da_client { - // Publish state difference if DA client is available - da.publish_state_diff_felts(&da_state_update).await?; - } - } - state_updates.into_iter().zip(transactions_executions.into_iter()).for_each( |(state_updates, exec_info)| { state_updates_and_exec_info.push((state_updates, exec_info)); @@ -326,6 +322,8 @@ impl Saya { let (proof, state_diff, (_, last_block)) = prove_scheduler.proved().await.context("Failed to prove.")?; + trace!(target: LOG_TARGET, last_block, "Processing proven blocks."); + if self.config.store_proofs { let filename = format!("proof_{}.json", last_block); let mut file = File::create(filename).await.context("Failed to create proof file.")?; @@ -335,6 +333,17 @@ impl Saya { let serialized_proof: Vec = parse(&proof)?.into(); let world_da = state_diff.world_da.unwrap(); + // Publish state difference if DA client is available + if let Some(da) = &self.da_client { + trace!(target: LOG_TARGET, last_block, "Publishing DA."); + + if self.config.skip_publishing_proof { + da.publish_state_diff_felts(&world_da).await?; + } else { + da.publish_state_diff_and_proof_felts(&world_da, &serialized_proof).await?; + } + } + trace!(target: LOG_TARGET, last_block, "Verifying block."); let (transaction_hash, nonce_after) = verifier::verify( VerifierIdentifier::HerodotusStarknetSepolia(self.config.fact_registry_address), @@ -348,6 +357,10 @@ impl Saya { let expected_fact = poseidon_hash_many(&[program_hash, program_output_hash]).to_string(); info!(target: LOG_TARGET, expected_fact, "Expected fact."); + // When not waiting for couple of second `apply_diffs` will sometimes fail due to reliance + // on registered fact + tokio::time::sleep(std::time::Duration::from_secs(2)).await; + trace!(target: LOG_TARGET, last_block, "Applying diffs."); let transaction_hash = dojo_os::starknet_apply_diffs( self.config.world_address, From 8a5902b0074537f96384ea0829d54543adeb2367 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sat, 22 Jun 2024 10:30:09 +0800 Subject: [PATCH 52/88] feat(sozo): add Cartridge's Controller-based account (#2069) --- Cargo.lock | 350 +++++++++++++++++- Cargo.toml | 4 + bin/sozo/Cargo.toml | 9 +- bin/sozo/src/commands/auth.rs | 11 +- bin/sozo/src/commands/execute.rs | 5 +- bin/sozo/src/commands/migrate.rs | 22 +- .../commands/options/account/controller.rs | 238 ++++++++++++ bin/sozo/src/commands/options/account/mod.rs | 67 +++- bin/sozo/src/commands/options/account/type.rs | 27 ++ bin/sozo/src/commands/register.rs | 3 +- bin/sozo/src/utils.rs | 23 +- 11 files changed, 711 insertions(+), 48 deletions(-) create mode 100644 bin/sozo/src/commands/options/account/controller.rs diff --git a/Cargo.lock b/Cargo.lock index 5c48da049b..12305480f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,42 @@ dependencies = [ "regex", ] +[[package]] +name = "account_sdk" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/controller?rev=e8276cfffe48b5d09f0598026d13635374204b72#e8276cfffe48b5d09f0598026d13635374204b72" +dependencies = [ + "anyhow", + "async-trait", + "base64 0.21.7", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "cairo-lang-starknet 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "coset", + "ecdsa", + "futures", + "indexmap 2.2.6", + "js-sys", + "lazy_static", + "p256", + "primitive-types", + "rand_core", + "serde", + "serde_json", + "sha2 0.10.8", + "starknet", + "starknet-crypto 0.6.2", + "thiserror", + "tokio", + "toml 0.8.13", + "u256-literal", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "wasm-webauthn", + "web-sys", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -766,6 +802,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + [[package]] name = "ascii-canvas" version = "3.0.0" @@ -1247,7 +1289,11 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", "sync_wrapper", + "tokio", "tower", "tower-layer", "tower-service", @@ -1760,6 +1806,29 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" +[[package]] +name = "cainome" +version = "0.2.3" +source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +dependencies = [ + "anyhow", + "async-trait", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "camino", + "clap", + "clap_complete", + "convert_case 0.6.0", + "serde", + "serde_json", + "starknet", + "thiserror", + "tracing", + "tracing-subscriber", + "url", +] + [[package]] name = "cainome" version = "0.2.3" @@ -1767,9 +1836,9 @@ source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3 dependencies = [ "anyhow", "async-trait", - "cainome-cairo-serde", - "cainome-parser", - "cainome-rs", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "cainome-rs-macro", "camino", "clap", @@ -1784,6 +1853,16 @@ dependencies = [ "url", ] +[[package]] +name = "cainome-cairo-serde" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +dependencies = [ + "serde", + "starknet", + "thiserror", +] + [[package]] name = "cainome-cairo-serde" version = "0.1.0" @@ -1794,6 +1873,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cainome-parser" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +dependencies = [ + "convert_case 0.6.0", + "quote", + "serde_json", + "starknet", + "syn 2.0.64", + "thiserror", +] + [[package]] name = "cainome-parser" version = "0.1.0" @@ -1807,14 +1899,32 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cainome-rs" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +dependencies = [ + "anyhow", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "camino", + "prettyplease 0.2.20", + "proc-macro2", + "quote", + "serde_json", + "starknet", + "syn 2.0.64", + "thiserror", +] + [[package]] name = "cainome-rs" version = "0.1.0" source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" dependencies = [ "anyhow", - "cainome-cairo-serde", - "cainome-parser", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "camino", "prettyplease 0.2.20", "proc-macro2", @@ -1831,9 +1941,9 @@ version = "0.1.0" source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" dependencies = [ "anyhow", - "cainome-cairo-serde", - "cainome-parser", - "cainome-rs", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "proc-macro2", "quote", "serde_json", @@ -3752,6 +3862,19 @@ dependencies = [ "yansi", ] +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + [[package]] name = "combine" version = "4.6.7" @@ -3950,6 +4073,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "coset" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff8aad850c1f86daa47e812913051eb5a26c4d9fb4242a89178bf99b946e4e3c" +dependencies = [ + "ciborium", + "ciborium-io", +] + [[package]] name = "cpp_demangle" version = "0.4.3" @@ -4401,13 +4534,34 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro 0.12.0", +] + [[package]] name = "derive_builder" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.20.0", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -4422,13 +4576,23 @@ dependencies = [ "syn 2.0.64", ] +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core 0.12.0", + "syn 1.0.109", +] + [[package]] name = "derive_builder_macro" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.20.0", "syn 2.0.64", ] @@ -4580,7 +4744,7 @@ name = "dojo-bindgen" version = "0.7.2" dependencies = [ "async-trait", - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "camino", "chrono", "convert_case 0.6.0", @@ -4717,7 +4881,7 @@ dependencies = [ name = "dojo-types" version = "0.7.2" dependencies = [ - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "crypto-bigint", "hex", "itertools 0.12.1", @@ -4737,7 +4901,7 @@ dependencies = [ "assert_fs", "assert_matches", "async-trait", - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -6470,6 +6634,64 @@ dependencies = [ "minilp", ] +[[package]] +name = "graphql-introspection-query" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2a4732cf5140bd6c082434494f785a19cfb566ab07d1382c3671f5812fed6d" +dependencies = [ + "serde", +] + +[[package]] +name = "graphql-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" +dependencies = [ + "combine 3.8.1", + "thiserror", +] + +[[package]] +name = "graphql_client" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cdf7b487d864c2939b23902291a5041bc4a84418268f25fda1c8d4e15ad8fa" +dependencies = [ + "graphql_query_derive", + "serde", + "serde_json", +] + +[[package]] +name = "graphql_client_codegen" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a40f793251171991c4eb75bd84bc640afa8b68ff6907bc89d3b712a22f700506" +dependencies = [ + "graphql-introspection-query", + "graphql-parser", + "heck 0.4.1", + "lazy_static", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "graphql_query_derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00bda454f3d313f909298f626115092d348bc231025699f557b27e248475f48c" +dependencies = [ + "graphql_client_codegen", + "proc-macro2", + "syn 1.0.109", +] + [[package]] name = "group" version = "0.13.0" @@ -7488,7 +7710,7 @@ checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", "cfg-if", - "combine", + "combine 4.6.7", "jni-sys", "log", "thiserror", @@ -11900,7 +12122,7 @@ dependencies = [ "create-output-dir", "data-encoding", "deno_task_shell", - "derive_builder", + "derive_builder 0.20.0", "directories", "dunce", "fs4", @@ -11974,7 +12196,7 @@ version = "1.12.0" source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" dependencies = [ "camino", - "derive_builder", + "derive_builder 0.20.0", "semver 1.0.23", "serde", "serde_json", @@ -12209,6 +12431,17 @@ dependencies = [ "serde", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde_bytes" version = "0.11.14" @@ -12262,6 +12495,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.19" @@ -12561,6 +12804,31 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slot" +version = "0.8.0" +source = "git+https://github.com/cartridge-gg/slot?rev=1d0c9f7#1d0c9f79122202bb448279f68c97092413e72cd3" +dependencies = [ + "anyhow", + "axum", + "dirs 5.0.1", + "graphql_client", + "hyper 0.14.28", + "reqwest 0.11.27", + "serde", + "serde_json", + "serde_with 2.3.3", + "starknet", + "tempfile", + "thiserror", + "tokio", + "tower-http", + "tracing", + "url", + "urlencoding", + "webbrowser", +] + [[package]] name = "smallvec" version = "1.13.2" @@ -12655,11 +12923,12 @@ dependencies = [ name = "sozo" version = "0.7.2" dependencies = [ + "account_sdk", "anyhow", "assert_fs", "async-trait", "bigdecimal 0.4.3", - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -12698,6 +12967,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", + "slot", "smol_str", "snapbox", "sozo-ops", @@ -12718,7 +12988,7 @@ dependencies = [ "anyhow", "assert_fs", "async-trait", - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -14118,7 +14388,7 @@ dependencies = [ "anyhow", "async-trait", "base64 0.21.7", - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "camino", "chrono", "crypto-bigint", @@ -14241,7 +14511,7 @@ version = "0.7.2" dependencies = [ "anyhow", "async-trait", - "cainome", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "chrono", "crypto-bigint", "dojo-test-utils", @@ -14598,6 +14868,16 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" name = "types-test" version = "0.7.2" +[[package]] +name = "u256-literal" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39a1ed842845c7cdbcf413a186dba1fb3cf8b13753c21e5572bf64aadec4778" +dependencies = [ + "primitive-types", + "syn 1.0.109", +] + [[package]] name = "ucd-trie" version = "0.1.6" @@ -14710,6 +14990,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + [[package]] name = "unsigned-varint" version = "0.7.2" @@ -14904,6 +15193,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", + "serde", + "serde_json", "wasm-bindgen-macro", ] @@ -15029,6 +15320,25 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasm-webauthn" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/wasm-webauthn?rev=972693f#972693fdeaa5dbcf7eee181c1e4aad5dfdb73a82" +dependencies = [ + "ciborium", + "coset", + "derive_builder 0.12.0", + "js-sys", + "serde", + "serde-wasm-bindgen", + "serde_bytes", + "thiserror", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.69" diff --git a/Cargo.toml b/Cargo.toml index 6bf2173cee..7048dcf5ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -215,6 +215,10 @@ alloy-sol-types = { version = "0.7.2", default-features = false } criterion = "0.5.1" +# Controller integration +account_sdk = { git = "https://github.com/cartridge-gg/controller", rev = "e8276cfffe48b5d09f0598026d13635374204b72" } +slot = { git = "https://github.com/cartridge-gg/slot", rev = "1d0c9f7" } + [patch.crates-io] cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" } cairo-vm = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" } diff --git a/bin/sozo/Cargo.toml b/bin/sozo/Cargo.toml index 9ddf45dae6..cf01f1302f 100644 --- a/bin/sozo/Cargo.toml +++ b/bin/sozo/Cargo.toml @@ -6,6 +6,9 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +account_sdk = { workspace = true, optional = true } +slot = { workspace = true, optional = true } + anyhow.workspace = true async-trait.workspace = true bigdecimal = "0.4.1" @@ -25,11 +28,11 @@ clap-verbosity-flag.workspace = true clap.workspace = true clap_complete.workspace = true console.workspace = true +derive_more.workspace = true dojo-bindgen.workspace = true dojo-lang.workspace = true dojo-types.workspace = true dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] } -derive_more.workspace = true futures.workspace = true hex = "0.4.3" hex-literal = "0.4.1" @@ -63,3 +66,7 @@ assert_fs.workspace = true dojo-test-utils = { workspace = true, features = [ "build-examples" ] } katana-runner.workspace = true snapbox = "0.4.6" + +[features] +controller = [ "dep:account_sdk", "dep:slot" ] +default = [ "controller" ] diff --git a/bin/sozo/src/commands/auth.rs b/bin/sozo/src/commands/auth.rs index ef6a687406..01e3c6189d 100644 --- a/bin/sozo/src/commands/auth.rs +++ b/bin/sozo/src/commands/auth.rs @@ -73,6 +73,7 @@ impl AuthArgs { env_metadata, kind, transaction, + config, )) } AuthCommand::Revoke { kind, world, starknet, account, transaction } => { @@ -84,6 +85,7 @@ impl AuthArgs { env_metadata, kind, transaction, + config, )) } } @@ -115,6 +117,7 @@ pub enum AuthKind { }, } +#[allow(clippy::too_many_arguments)] pub async fn grant( ui: &Ui, world: WorldOptions, @@ -123,10 +126,11 @@ pub async fn grant( env_metadata: Option, kind: AuthKind, transaction: TransactionOptions, + config: &Config, ) -> Result<()> { trace!(?kind, ?world, ?starknet, ?account, ?transaction, "Executing Grant command."); let world = - utils::world_from_env_metadata(world, account, starknet, &env_metadata).await.unwrap(); + utils::world_from_env_metadata(world, account, starknet, &env_metadata, config).await?; match kind { AuthKind::Writer { models_contracts } => { @@ -146,6 +150,7 @@ pub async fn grant( } } +#[allow(clippy::too_many_arguments)] pub async fn revoke( ui: &Ui, world: WorldOptions, @@ -154,10 +159,12 @@ pub async fn revoke( env_metadata: Option, kind: AuthKind, transaction: TransactionOptions, + config: &Config, ) -> Result<()> { trace!(?kind, ?world, ?starknet, ?account, ?transaction, "Executing Revoke command."); let world = - utils::world_from_env_metadata(world, account, starknet, &env_metadata).await.unwrap(); + utils::world_from_env_metadata(world, account, starknet, &env_metadata, config).await?; + match kind { AuthKind::Writer { models_contracts } => { trace!( diff --git a/bin/sozo/src/commands/execute.rs b/bin/sozo/src/commands/execute.rs index 40e3305e42..243c1595a8 100644 --- a/bin/sozo/src/commands/execute.rs +++ b/bin/sozo/src/commands/execute.rs @@ -55,9 +55,10 @@ impl ExecuteArgs { self.account, self.starknet, &env_metadata, + config, ) - .await - .unwrap(); + .await?; + let tx_config = self.transaction.into(); trace!( diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 02a8bf46aa..4ab758ed9e 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -6,18 +6,18 @@ use dojo_world::migration::TxnConfig; use katana_rpc_api::starknet::RPC_SPEC_VERSION; use scarb::core::{Config, Workspace}; use sozo_ops::migration; -use starknet::accounts::{Account, ConnectedAccount, SingleOwnerAccount}; +use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag, FieldElement, StarknetError}; use starknet::core::utils::parse_cairo_short_string; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider, ProviderError}; -use starknet::signers::LocalWallet; use tracing::trace; -use super::options::account::AccountOptions; +use super::options::account::{AccountOptions, SozoAccount}; use super::options::starknet::StarknetOptions; use super::options::transaction::TransactionOptions; use super::options::world::WorldOptions; +use crate::commands::options::account::WorldAddressOrName; #[derive(Debug, Args)] pub struct MigrateArgs { @@ -156,11 +156,7 @@ pub async fn setup_env<'a>( world: WorldOptions, name: &str, env: Option<&'a Environment>, -) -> Result<( - Option, - SingleOwnerAccount, LocalWallet>, - String, -)> { +) -> Result<(Option, SozoAccount>, String)> { trace!("Setting up environment."); let ui = ws.config().ui(); @@ -190,8 +186,14 @@ pub async fn setup_env<'a>( .with_context(|| "Cannot parse chain_id as string")?; trace!(chain_id); - let mut account = account.account(provider, env).await?; - account.set_block_id(BlockId::Tag(BlockTag::Pending)); + let account = { + // This is mainly for controller account for creating policies. + let world_address_or_name = world_address + .map(WorldAddressOrName::Address) + .unwrap_or(WorldAddressOrName::Name(name.to_string())); + + account.account(provider, world_address_or_name, &starknet, env, ws.config()).await? + }; let address = account.address(); diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs new file mode 100644 index 0000000000..f110a9b7f3 --- /dev/null +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -0,0 +1,238 @@ +use account_sdk::account::session::hash::{AllowedMethod, Session}; +use account_sdk::account::session::SessionAccount; +use account_sdk::deploy_contract::UDC_ADDRESS; +use account_sdk::signers::HashSigner; +use anyhow::{Context, Result}; +use camino::{Utf8Path, Utf8PathBuf}; +use dojo_world::manifest::{BaseManifest, DojoContract, Manifest}; +use dojo_world::migration::strategy::generate_salt; +use scarb::core::Config; +use slot::session::Policy; +use starknet::core::types::contract::{AbiEntry, StateMutability}; +use starknet::core::types::FieldElement; +use starknet::core::utils::{cairo_short_string_to_felt, get_contract_address}; +use starknet::macros::short_string; +use starknet::providers::Provider; +use starknet::signers::SigningKey; +use starknet_crypto::poseidon_hash_single; +use tracing::trace; +use url::Url; + +use super::WorldAddressOrName; + +pub type ControllerSessionAccount

= SessionAccount; + +/// Create a new Catridge Controller account based on session key. +#[tracing::instrument( + name = "create_controller", + skip(rpc_url, provider, world_addr_or_name, config) +)] +pub async fn create_controller

( + // Ideally we can get the url from the provider so we dont have to pass an extra url param here + rpc_url: Url, + provider: P, + // Use to either specify the world address or compute the world address from the world name + world_addr_or_name: WorldAddressOrName, + config: &Config, +) -> Result> +where + P: Provider, + P: Send + Sync, +{ + let chain_id = provider.chain_id().await?; + let credentials = slot::credential::Credentials::load()?; + + let username = credentials.account.id; + let contract_address = credentials.account.contract_address; + + trace!( + %username, + chain = format!("{chain_id:#x}"), + address = format!("{contract_address:#x}"), + "Creating Controller session account" + ); + + // Check if the session exists, if not create a new one + let session_details = match slot::session::get(chain_id)? { + Some(session) => { + trace!(expires_at = %session.expires_at, policies = session.policies.len(), "Found existing session."); + + // Perform policies diff check. For security reasons, we will always create a new + // session here if the current policies are different from the existing + // session. TODO(kariy): maybe don't need to update if current policies is a + // subset of the existing policies. + let policies = collect_policies(world_addr_or_name, contract_address, config)?; + + if policies != session.policies { + trace!( + new_policies = policies.len(), + existing_policies = session.policies.len(), + "Policies have changed. Creating new session." + ); + + let session = slot::session::create(rpc_url, &policies).await?; + slot::session::store(chain_id, &session)?; + session + } else { + session + } + } + + // Create a new session if not found + None => { + trace!(%username, chain = format!("{chain_id:#}"), "Creating new session."); + let policies = collect_policies(world_addr_or_name, contract_address, config)?; + let session = slot::session::create(rpc_url, &policies).await?; + slot::session::store(chain_id, &session)?; + session + } + }; + + let methods = session_details + .policies + .into_iter() + .map(|p| AllowedMethod::new(p.target, &p.method)) + .collect::, _>>()?; + + // Copied from `account-wasm` + let guardian = SigningKey::from_secret_scalar(short_string!("CARTRIDGE_GUARDIAN")); + let signer = SigningKey::from_secret_scalar(session_details.credentials.private_key); + // TODO(kariy): make `expires_at` a `u64` type in the session struct + let expires_at = session_details.expires_at.parse::()?; + let session = Session::new(methods, expires_at, &signer.signer())?; + + let session_account = SessionAccount::new( + provider, + signer, + guardian, + contract_address, + chain_id, + session_details.credentials.authorization, + session, + ); + + Ok(session_account) +} + +/// Policies are the building block of a session key. It's what defines what methods are allowed for +/// an external signer to execute using the session key. +/// +/// This function collect all the contracts' methods in the current project according to the +/// project's base manifest ( `/manifests//base` ) and convert them into policies. +fn collect_policies( + world_addr_or_name: WorldAddressOrName, + user_address: FieldElement, + config: &Config, +) -> Result> { + let root_dir = config.root(); + let manifest = get_project_base_manifest(root_dir, config.profile().as_str())?; + let policies = + collect_policies_from_base_manifest(world_addr_or_name, user_address, root_dir, manifest)?; + trace!(policies_count = policies.len(), "Extracted policies from project."); + Ok(policies) +} + +fn get_project_base_manifest(root_dir: &Utf8Path, profile: &str) -> Result { + let mut manifest_path = root_dir.to_path_buf(); + manifest_path.extend(["manifests", profile, "base"]); + Ok(BaseManifest::load_from_path(&manifest_path)?) +} + +fn collect_policies_from_base_manifest( + world_address: WorldAddressOrName, + user_address: FieldElement, + base_path: &Utf8Path, + manifest: BaseManifest, +) -> Result> { + let mut policies: Vec = Vec::new(); + let base_path: Utf8PathBuf = base_path.to_path_buf(); + + // compute the world address here if it's a name + let world_address = get_dojo_world_address(world_address, &manifest)?; + + // get methods from all project contracts + for contract in manifest.contracts { + let contract_address = get_dojo_contract_address(world_address, &contract); + let abis = contract.inner.abi.unwrap().load_abi_string(&base_path)?; + let abis = serde_json::from_str::>(&abis)?; + policies_from_abis(&mut policies, &contract.name, contract_address, &abis); + } + + // get method from world contract + let abis = manifest.world.inner.abi.unwrap().load_abi_string(&base_path)?; + let abis = serde_json::from_str::>(&abis)?; + policies_from_abis(&mut policies, &manifest.world.name, world_address, &abis); + + // special policy for sending declare tx + // corresponds to [account_sdk::account::DECLARATION_SELECTOR] + let method = "__declare_transaction__".to_string(); + policies.push(Policy { target: user_address, method }); + trace!("Adding declare transaction policy"); + + // for deploying using udc + let method = "deployContract".to_string(); + policies.push(Policy { target: *UDC_ADDRESS, method }); + trace!("Adding UDC deployment policy"); + + Ok(policies) +} + +/// Recursively extract methods and convert them into policies from the all the +/// ABIs in the project. +fn policies_from_abis( + policies: &mut Vec, + contract_name: &str, + contract_address: FieldElement, + entries: &[AbiEntry], +) { + for entry in entries { + match entry { + AbiEntry::Function(f) => { + // we only create policies for non-view functions + if let StateMutability::External = f.state_mutability { + let policy = Policy { target: contract_address, method: f.name.to_string() }; + trace!(name = contract_name, target = format!("{:#x}", policy.target), method = %policy.method, "Adding policy"); + policies.push(policy); + } + } + + AbiEntry::Interface(i) => { + policies_from_abis(policies, contract_name, contract_address, &i.items) + } + + _ => {} + } + } +} + +fn get_dojo_contract_address( + world_address: FieldElement, + manifest: &Manifest, +) -> FieldElement { + if let Some(address) = manifest.inner.address { + address + } else { + let salt = generate_salt(&manifest.name); + get_contract_address(salt, manifest.inner.base_class_hash, &[], world_address) + } +} + +fn get_dojo_world_address( + world_address: WorldAddressOrName, + manifest: &BaseManifest, +) -> Result { + match world_address { + WorldAddressOrName::Address(addr) => Ok(addr), + WorldAddressOrName::Name(name) => { + let seed = cairo_short_string_to_felt(&name).context("Failed to parse World name.")?; + let salt = poseidon_hash_single(seed); + let address = get_contract_address( + salt, + manifest.world.inner.original_class_hash, + &[manifest.base.inner.original_class_hash], + FieldElement::ZERO, + ); + Ok(address) + } + } +} diff --git a/bin/sozo/src/commands/options/account/mod.rs b/bin/sozo/src/commands/options/account/mod.rs index eba8d53d63..8a33772848 100644 --- a/bin/sozo/src/commands/options/account/mod.rs +++ b/bin/sozo/src/commands/options/account/mod.rs @@ -3,17 +3,35 @@ use std::str::FromStr; use anyhow::{anyhow, Context, Result}; use clap::Args; use dojo_world::metadata::Environment; +use scarb::core::Config; use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount}; use starknet::core::types::{BlockId, BlockTag, FieldElement}; use starknet::providers::Provider; use starknet::signers::LocalWallet; use tracing::trace; +use url::Url; use super::signer::SignerOptions; +use super::starknet::StarknetOptions; use super::DOJO_ACCOUNT_ADDRESS_ENV_VAR; +#[cfg(feature = "controller")] +pub mod controller; mod r#type; +#[cfg(feature = "controller")] +use controller::ControllerSessionAccount; +pub use r#type::*; + +/// Helper type for identifying how the world address will be provided. +/// If it's a name, it will be used as the seed for computing the address. +/// Else if it's an address, it will be used directly. +#[derive(Debug)] +pub enum WorldAddressOrName { + Address(FieldElement), + Name(String), +} + // INVARIANT: // - For commandline: we can either specify `private_key` or `keystore_path` along with // `keystore_password`. This is enforced by Clap. @@ -31,7 +49,6 @@ pub struct AccountOptions { #[arg(help_heading = "Controller options")] #[arg(help = "Use Slot's Controller account")] #[cfg(feature = "controller")] - #[arg(conflicts_with = "signer")] pub controller: bool, #[command(flatten)] @@ -45,7 +62,48 @@ pub struct AccountOptions { } impl AccountOptions { + /// Create a new Catridge Controller account based on session key. + #[cfg(feature = "controller")] + pub async fn controller

( + &self, + rpc_url: Url, + provider: P, + world_address_or_name: WorldAddressOrName, + config: &Config, + ) -> Result> + where + P: Provider, + P: Send + Sync, + { + controller::create_controller(rpc_url, provider, world_address_or_name, config) + .await + .context("Failed to create a Controller account") + } + pub async fn account

( + &self, + provider: P, + world_address_or_name: WorldAddressOrName, + starknet: &StarknetOptions, + env_metadata: Option<&Environment>, + config: &Config, + ) -> Result> + where + P: Provider, + P: Send + Sync, + { + #[cfg(feature = "controller")] + if self.controller { + let url = starknet.url(env_metadata)?; + let account = self.controller(url, provider, world_address_or_name, config).await?; + return Ok(SozoAccount::from(account)); + } + + let account = self.std_account(provider, env_metadata).await?; + Ok(SozoAccount::from(account)) + } + + pub async fn std_account

( &self, provider: P, env_metadata: Option<&Environment>, @@ -54,14 +112,13 @@ impl AccountOptions { P: Provider, P: Send + Sync, { - trace!(account_options=?self, "Creating account."); let account_address = self.account_address(env_metadata)?; trace!(?account_address, "Account address determined."); let signer = self.signer.signer(env_metadata, false)?; trace!(?signer, "Signer obtained."); - let chain_id = provider.chain_id().await.context("Failed to retrieve network chain id.")?; + let chain_id = provider.chain_id().await?; trace!(?chain_id); let encoding = if self.legacy { ExecutionEncoding::Legacy } else { ExecutionEncoding::New }; @@ -177,7 +234,7 @@ mod tests { // HACK: SingleOwnerAccount doesn't expose a way to check `encoding` type used in struct, so // checking it by encoding a dummy call and checking which method it used to encode the call - let account = cmd.account.account(runner.provider(), None).await.unwrap(); + let account = cmd.account.std_account(runner.provider(), None).await.unwrap(); let result = account.encode_calls(&dummy_call); // 0x0 is the data offset. assert!(*result.get(3).unwrap() == FieldElement::from_hex_be("0x0").unwrap()); @@ -197,7 +254,7 @@ mod tests { // HACK: SingleOwnerAccount doesn't expose a way to check `encoding` type used in struct, so // checking it by encoding a dummy call and checking which method it used to encode the call - let account = cmd.account.account(runner.provider(), None).await.unwrap(); + let account = cmd.account.std_account(runner.provider(), None).await.unwrap(); let result = account.encode_calls(&dummy_call); // 0x2 is the Calldata len. assert!(*result.get(3).unwrap() == FieldElement::from_hex_be("0x2").unwrap()); diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs index eb388398b0..6368fabb71 100644 --- a/bin/sozo/src/commands/options/account/type.rs +++ b/bin/sozo/src/commands/options/account/type.rs @@ -11,10 +11,17 @@ use starknet::core::types::{FieldElement, FlattenedSierraClass}; use starknet::providers::Provider; use starknet::signers::LocalWallet; +#[cfg(feature = "controller")] +use super::controller::ControllerSessionAccount; + #[derive(Debug, thiserror::Error)] pub enum SozoAccountSignError { #[error(transparent)] Standard(#[from] SignError), + + #[cfg(feature = "controller")] + #[error(transparent)] + Controller(#[from] account_sdk::signers::SignError), } /// To unify the account types, we define a wrapper type that implements the @@ -30,6 +37,9 @@ where P: Provider, { Standard(SingleOwnerAccount), + + #[cfg(feature = "controller")] + Controller(ControllerSessionAccount

), } #[cfg_attr(not(target_arch = "wasm32"), async_trait)] @@ -44,12 +54,16 @@ where fn address(&self) -> FieldElement { match self { Self::Standard(account) => account.address(), + #[cfg(feature = "controller")] + Self::Controller(account) => account.address(), } } fn chain_id(&self) -> FieldElement { match self { Self::Standard(account) => account.chain_id(), + #[cfg(feature = "controller")] + Self::Controller(account) => account.chain_id(), } } @@ -79,6 +93,8 @@ where ) -> Result, Self::SignError> { let result = match self { Self::Standard(account) => account.sign_execution(execution, query_only).await?, + #[cfg(feature = "controller")] + Self::Controller(account) => account.sign_execution(execution, query_only).await?, }; Ok(result) } @@ -90,6 +106,8 @@ where ) -> Result, Self::SignError> { let result = match self { Self::Standard(account) => account.sign_declaration(declaration, query_only).await?, + #[cfg(feature = "controller")] + Self::Controller(account) => account.sign_declaration(declaration, query_only).await?, }; Ok(result) } @@ -104,6 +122,11 @@ where let result = account.sign_legacy_declaration(declaration, query_only).await?; Ok(result) } + #[cfg(feature = "controller")] + Self::Controller(account) => { + let result = account.sign_legacy_declaration(declaration, query_only).await?; + Ok(result) + } } } } @@ -116,6 +139,8 @@ where fn encode_calls(&self, calls: &[Call]) -> Vec { match self { Self::Standard(account) => account.encode_calls(calls), + #[cfg(feature = "controller")] + Self::Controller(account) => account.encode_calls(calls), } } } @@ -130,6 +155,8 @@ where fn provider(&self) -> &Self::Provider { match self { Self::Standard(account) => account.provider(), + #[cfg(feature = "controller")] + Self::Controller(account) => account.provider(), } } } diff --git a/bin/sozo/src/commands/register.rs b/bin/sozo/src/commands/register.rs index 8893cea2d4..f69fac41d2 100644 --- a/bin/sozo/src/commands/register.rs +++ b/bin/sozo/src/commands/register.rs @@ -60,7 +60,8 @@ impl RegisterArgs { config.tokio_handle().block_on(async { let world = - utils::world_from_env_metadata(world, account, starknet, &env_metadata).await?; + utils::world_from_env_metadata(world, account, starknet, &env_metadata, config) + .await?; let provider = world.account.provider(); let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); diff --git a/bin/sozo/src/utils.rs b/bin/sozo/src/utils.rs index e65c0a2838..51d59579cf 100644 --- a/bin/sozo/src/utils.rs +++ b/bin/sozo/src/utils.rs @@ -7,12 +7,10 @@ use dojo_world::contracts::WorldContractReader; use dojo_world::metadata::{dojo_metadata_from_workspace, Environment}; use scarb::core::{Config, TomlManifest}; use semver::Version; -use starknet::accounts::SingleOwnerAccount; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; -use starknet::signers::LocalWallet; -use crate::commands::options::account::AccountOptions; +use crate::commands::options::account::{AccountOptions, SozoAccount, WorldAddressOrName}; use crate::commands::options::starknet::StarknetOptions; use crate::commands::options::world::WorldOptions; @@ -61,11 +59,22 @@ pub async fn world_from_env_metadata( account: AccountOptions, starknet: StarknetOptions, env_metadata: &Option, -) -> Result, LocalWallet>>, Error> { - let world_address = world.address(env_metadata.as_ref())?; - let provider = starknet.provider(env_metadata.as_ref())?; + config: &Config, +) -> Result>>, Error> { + let env_metadata = env_metadata.as_ref(); + + let world_address = world.address(env_metadata)?; + let provider = starknet.provider(env_metadata)?; + let account = account + .account( + provider, + WorldAddressOrName::Address(world_address), + &starknet, + env_metadata, + config, + ) + .await?; - let account = account.account(provider, env_metadata.as_ref()).await?; Ok(WorldContract::new(world_address, account)) } From 79463be853eb309893dde946262359efbbecebde Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Tue, 25 Jun 2024 08:28:41 +0800 Subject: [PATCH 53/88] feat(katana): injects controller account in genesis config (#2089) --- Cargo.lock | 21 +- Cargo.toml | 6 +- bin/katana/Cargo.toml | 5 +- bin/katana/src/args.rs | 29 +- bin/katana/src/main.rs | 2 +- ...oller_CartridgeAccount.contract_class.json | 24937 ++++++++++++++++ crates/katana/controller/Cargo.toml | 19 + crates/katana/controller/src/lib.rs | 256 + crates/katana/controller/src/webauthn.rs | 22 + 9 files changed, 25286 insertions(+), 11 deletions(-) create mode 100644 crates/katana/contracts/compiled/controller_CartridgeAccount.contract_class.json create mode 100644 crates/katana/controller/Cargo.toml create mode 100644 crates/katana/controller/src/lib.rs create mode 100644 crates/katana/controller/src/webauthn.rs diff --git a/Cargo.lock b/Cargo.lock index 12305480f3..d97ffe98d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8061,6 +8061,7 @@ dependencies = [ "katana-primitives", "katana-rpc", "katana-rpc-api", + "katana-slot-controller", "serde_json", "shellexpand", "starknet_api", @@ -8350,6 +8351,22 @@ dependencies = [ "url", ] +[[package]] +name = "katana-slot-controller" +version = "0.7.2" +dependencies = [ + "account_sdk", + "alloy-primitives", + "anyhow", + "base64 0.22.1", + "coset", + "katana-primitives", + "serde_json", + "slot", + "starknet", + "tracing", +] + [[package]] name = "katana-tasks" version = "0.7.2" @@ -11219,9 +11236,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" +checksum = "ed7508e692a49b6b2290b56540384ccae9b1fb4d77065640b165835b56ffe3bb" dependencies = [ "libc", ] diff --git a/Cargo.toml b/Cargo.toml index 7048dcf5ad..9c6cd18dab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ members = [ "crates/dojo-types", "crates/dojo-world", "crates/dojo-world/abigen", + "crates/katana/controller", "crates/katana/core", "crates/katana/executor", "crates/katana/primitives", @@ -86,6 +87,7 @@ katana-rpc-api = { path = "crates/katana/rpc/rpc-api" } katana-rpc-types = { path = "crates/katana/rpc/rpc-types" } katana-rpc-types-builder = { path = "crates/katana/rpc/rpc-types-builder" } katana-runner = { path = "crates/katana/runner" } +katana-slot-controller = { path = "crates/katana/controller" } katana-tasks = { path = "crates/katana/tasks" } # torii @@ -165,6 +167,8 @@ rayon = "1.8.0" regex = "1.10.3" reqwest = { version = "0.12", features = [ "blocking", "rustls-tls" ], default-features = false } rpassword = "7.2.0" +rstest = "0.18.2" +rstest_reuse = "0.6.0" salsa = "0.16.1" scarb = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } @@ -190,8 +194,6 @@ tower-http = "0.4.4" tracing = "0.1.34" tracing-subscriber = { version = "0.3.16", features = [ "env-filter", "json" ] } url = { version = "2.4.0", features = [ "serde" ] } -rstest = "0.18.2" -rstest_reuse = "0.6.0" # server hyper = "0.14.27" diff --git a/bin/katana/Cargo.toml b/bin/katana/Cargo.toml index 600cf4d1ea..6f1a659af6 100644 --- a/bin/katana/Cargo.toml +++ b/bin/katana/Cargo.toml @@ -28,11 +28,13 @@ tracing-subscriber.workspace = true tracing.workspace = true url.workspace = true +katana-slot-controller = { workspace = true, optional = true } + [dev-dependencies] assert_matches.workspace = true [features] -default = [ "blockifier", "jemalloc", "messaging" ] +default = [ "blockifier", "jemalloc", "messaging", "slot" ] blockifier = [ "katana-executor/blockifier" ] # Disable until SIR support Cairo 2.6.3 @@ -40,4 +42,5 @@ blockifier = [ "katana-executor/blockifier" ] jemalloc = [ "dojo-metrics/jemalloc" ] messaging = [ "katana-core/messaging" ] +slot = [ "dep:katana-slot-controller" ] starknet-messaging = [ "katana-core/starknet-messaging", "messaging" ] diff --git a/bin/katana/src/args.rs b/bin/katana/src/args.rs index 5bde75658d..15dd519485 100644 --- a/bin/katana/src/args.rs +++ b/bin/katana/src/args.rs @@ -14,6 +14,7 @@ use std::net::SocketAddr; use std::path::PathBuf; use alloy_primitives::U256; +use anyhow::Result; use clap::{Args, Parser, Subcommand}; use clap_complete::Shell; use common::parse::parse_socket_address; @@ -104,6 +105,11 @@ pub struct KatanaArgs { #[command(next_help_heading = "Starknet options")] pub starknet: StarknetOptions, + #[cfg(feature = "slot")] + #[command(flatten)] + #[command(next_help_heading = "Slot options")] + pub slot: SlotOptions, + #[command(subcommand)] pub command: Option, } @@ -201,6 +207,14 @@ pub struct EnvironmentOptions { pub l1_strk_gas_price: u128, } +#[cfg(feature = "slot")] +#[derive(Debug, Args, Clone)] +pub struct SlotOptions { + #[arg(hide = true)] + #[arg(long = "slot.controller")] + pub controller: bool, +} + impl KatanaArgs { pub fn init_logging(&self) -> Result<(), Box> { const DEFAULT_LOG_FILTER: &str = "info,executor=trace,forking::backend=trace,server=debug,\ @@ -245,7 +259,7 @@ impl KatanaArgs { } } - pub fn starknet_config(&self) -> StarknetConfig { + pub fn starknet_config(&self) -> Result { let genesis = match self.starknet.genesis.clone() { Some(genesis) => genesis, None => { @@ -265,12 +279,17 @@ impl KatanaArgs { ..Default::default() }; + #[cfg(feature = "slot")] + if self.slot.controller { + katana_slot_controller::add_controller_account(&mut genesis)?; + } + genesis.extend_allocations(accounts.into_iter().map(|(k, v)| (k, v.into()))); genesis } }; - StarknetConfig { + Ok(StarknetConfig { disable_fee: self.starknet.disable_fee, disable_validate: self.starknet.disable_validate, fork_rpc_url: self.rpc_url.clone(), @@ -282,7 +301,7 @@ impl KatanaArgs { }, db_dir: self.db_dir.clone(), genesis, - } + }) } } @@ -293,7 +312,7 @@ mod test { #[test] fn test_starknet_config_default() { let args = KatanaArgs::parse_from(["katana"]); - let config = args.starknet_config(); + let config = args.starknet_config().unwrap(); assert!(!config.disable_fee); assert!(!config.disable_validate); @@ -327,7 +346,7 @@ mod test { "--strk-gas-price", "20", ]); - let config = args.starknet_config(); + let config = args.starknet_config().unwrap(); assert!(config.disable_fee); assert!(config.disable_validate); diff --git a/bin/katana/src/main.rs b/bin/katana/src/main.rs index ffd96c4dec..b3edb21a49 100644 --- a/bin/katana/src/main.rs +++ b/bin/katana/src/main.rs @@ -43,7 +43,7 @@ async fn main() -> Result<(), Box> { let server_config = args.server_config(); let sequencer_config = args.sequencer_config(); - let starknet_config = args.starknet_config(); + let starknet_config = args.starknet_config()?; let cfg_env = CfgEnv { chain_id: starknet_config.env.chain_id, diff --git a/crates/katana/contracts/compiled/controller_CartridgeAccount.contract_class.json b/crates/katana/contracts/compiled/controller_CartridgeAccount.contract_class.json new file mode 100644 index 0000000000..ba8a9dc244 --- /dev/null +++ b/crates/katana/contracts/compiled/controller_CartridgeAccount.contract_class.json @@ -0,0 +1,24937 @@ +{ + "sierra_program": [ + "0x1", + "0x5", + "0x0", + "0x2", + "0x6", + "0x4", + "0xe81", + "0x17f", + "0x2af", + "0x52616e6765436865636b", + "0x800000000000000100000000000000000000000000000000", + "0x436f6e7374", + "0x800000000000000000000000000000000000000000000002", + "0x1", + "0x78", + "0x2", + "0x400000", + "0x40000000", + "0x4", + "0x200000", + "0x800", + "0x4000000", + "0x40", + "0x400", + "0x2000", + "0x80000", + "0x8000", + "0x20000", + "0x113", + "0x753132385f6d756c204f766572666c6f77", + "0x8", + "0x4000", + "0x40000", + "0x2000000", + "0x80", + "0x1d", + "0xf", + "0x753235365f6d756c204f766572666c6f77", + "0xff", + "0xff00", + "0xff0000", + "0xff000000", + "0x426f78", + "0x800000000000000700000000000000000000000000000001", + "0x537472756374", + "0x800000000000000f00000000000000000000000000000001", + "0x0", + "0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3", + "0x456e756d", + "0x800000000000000700000000000000000000000000000003", + "0x4b1e380069e7963309c0e55e06f89558735f9f25339d0e98b277713d25e3b8", + "0x19", + "0x1a", + "0x4172726179", + "0x800000000000000300000000000000000000000000000001", + "0x753332", + "0x800000000000000700000000000000000000000000000000", + "0x800000000000000300000000000000000000000000000004", + "0x1c", + "0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672", + "0x800000000000000300000000000000000000000000000003", + "0x1f", + "0x20", + "0x3233427478c39cc6fb5cecec70e0eeed7937f90d2b8277e2e198e4e77ddde52", + "0x1e", + "0x21", + "0xc67178f2", + "0xbef9a3f7", + "0xa4506ceb", + "0x90befffa", + "0x8cc70208", + "0x84c87814", + "0x78a5636f", + "0x748f82ee", + "0x682e6ff3", + "0x5b9cca4f", + "0x4ed8aa4a", + "0x391c0cb3", + "0x34b0bcb5", + "0x2748774c", + "0x1e376c08", + "0x19a4c116", + "0x106aa070", + "0xf40e3585", + "0xd6990624", + "0xd192e819", + "0xc76c51a3", + "0xc24b8b70", + "0xa81a664b", + "0xa2bfe8a1", + "0x92722c85", + "0x81c2c92e", + "0x766a0abb", + "0x650a7354", + "0x53380d13", + "0x4d2c6dfc", + "0x2e1b2138", + "0x27b70a85", + "0x14292967", + "0x6ca6351", + "0xd5a79147", + "0xc6e00bf3", + "0xbf597fc7", + "0xb00327c8", + "0xa831c66d", + "0x983e5152", + "0x76f988da", + "0x5cb0a9dc", + "0x4a7484aa", + "0x2de92c6f", + "0x240ca1cc", + "0xfc19dc6", + "0xefbe4786", + "0xe49b69c1", + "0xc19bf174", + "0x9bdc06a7", + "0x80deb1fe", + "0x72be5d74", + "0x550c7dc3", + "0x243185be", + "0x12835b01", + "0xd807aa98", + "0xab1c5ed5", + "0x923f82a4", + "0x59f111f1", + "0x3956c25b", + "0xe9b5dba5", + "0xb5c0fbcf", + "0x71374491", + "0x428a2f98", + "0x100", + "0x10000", + "0x1000000", + "0x7e", + "0x2b", + "0x1000", + "0x800000000000000000000000000000000000000000000003", + "0x7a", + "0x132", + "0x1ef", + "0xa1", + "0x8000000000000000", + "0x7536345f616464204f766572666c6f77", + "0x4b656363616b206c61737420696e70757420776f7264203e3762", + "0x7", + "0x6", + "0x5", + "0x11", + "0x313d53fcef2616901e3fd6801087e8d55f5cb59357e1fc8b603b82ae0af064c", + "0x75", + "0x3635c7f2a7ba93844c0d064e18e487f35ab90f7c39d00f186a781fc3f0c2ca9", + "0x75313238", + "0x800000000000000700000000000000000000000000000005", + "0x2907a9767b8e0b68c23345eea8650b1366373b598791523a07fddaa450ba526", + "0x25e2ca4b84968c2d8b83ef476ca8549410346b00836ce79beaf538155990bb2", + "0x3288d594b9a45d15bb2fcb7903f06cdb06b27f0ba88186ec4cfaa98307cb972", + "0x7b", + "0x7538", + "0x3b9ddf97bd58cc7301a2107c3eabad82196f38221c880cd3645d07c3aac1422", + "0x536e617073686f74", + "0x800000000000000700000000000000000000000000000002", + "0x336711c2797eda3aaf8c07c5cf7b92162501924a7090b25482d45dd3a24ddce", + "0x81", + "0x82", + "0x83", + "0x328d1905bfb061e36537046a0eb708096ff42f718199189ec21cd53bc201593", + "0x84", + "0x3464f35d469e3bc7d37c43520068e18802b3f0daffd9c12f56e2f13eab161e7", + "0x86", + "0x5be0cd19", + "0x1f83d9ab", + "0x9b05688c", + "0x510e527f", + "0xa54ff53a", + "0x3c6ef372", + "0xbb67ae85", + "0x6a09e667", + "0x34c1a4ee6ef3ec231b7e21635f0ab0f5e73f747e42beb02d65fc54c8e0e0575", + "0x90", + "0x91", + "0xd5f48e69d76fa1552ee38d030566f29c443df68722208d622820fe36f7538c", + "0x92", + "0x100000000", + "0xff00000000", + "0x10000000000", + "0xff0000000000", + "0x1000000000000", + "0xff000000000000", + "0x753634", + "0x4e6f6e5a65726f", + "0x100000000000000", + "0xff00000000000000", + "0x556e696e697469616c697a6564", + "0x800000000000000200000000000000000000000000000001", + "0x24", + "0x23", + "0x22", + "0xffffffff", + "0x3ab802bcce3a9ca953b0e1f31a5b29eb27a9b727c891e24300e1b5cc57387ba", + "0xab", + "0x3", + "0x3e13026be65060f5dc8ae6683244bbd2c2a437ea205f8034de5bc1d585e3388", + "0xb0", + "0x25", + "0x3d", + "0x22365a506e7e688670a0b910c1d9daa26979f0cd7bab6d2d9b2dc9155b03976", + "0xb7", + "0xb53894970a338bde3cea652ed971ad645c8fb92fdb44ebd5b12ae9537be17c", + "0xb9", + "0x7533325f6d756c204f766572666c6f77", + "0x3f", + "0x133", + "0x39", + "0x38", + "0x37", + "0x36", + "0x35", + "0x34", + "0x33", + "0x32", + "0x31", + "0x30", + "0x79", + "0x77", + "0x76", + "0x74", + "0x73", + "0x72", + "0x71", + "0x70", + "0x6f", + "0x6e", + "0x6d", + "0x6c", + "0x6b", + "0x6a", + "0x69", + "0x68", + "0x67", + "0x66", + "0x65", + "0x64", + "0x63", + "0x62", + "0x61", + "0x5a", + "0x59", + "0x58", + "0x57", + "0x56", + "0x55", + "0x54", + "0x53", + "0x52", + "0x51", + "0x50", + "0x4f", + "0x4e", + "0x4d", + "0x4c", + "0x4b", + "0x4a", + "0x49", + "0x48", + "0x47", + "0x46", + "0x45", + "0x44", + "0x43", + "0x42", + "0x41", + "0x4469766973696f6e2062792030", + "0x3f829a4bc463d91621ba418d447cc38c95ddc483f9ccfebae79050eb7b3dcb6", + "0x25e50662218619229b3f53f1dc3253192a0f68ca423d900214253db415a90b4", + "0x102", + "0x105", + "0x38b507bf259d96f5c53e8ab8f187781c3d096482729ec2d57f3366318a8502f", + "0x106", + "0x107", + "0x3c5ce4d28d473343dbe52c630edf038a582af9574306e1d609e379cd17fc87a", + "0x108", + "0x10f", + "0x10c", + "0x10e", + "0x10d", + "0x483ada7726a3c4655da4fbfc0e1108a8", + "0x79be667ef9dcbbac55a06295ce870b07", + "0x29bfcdb2dce28d959f2815b16f81798", + "0xfd17b448a68554199c47d08ffb10d4b8", + "0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62", + "0x110", + "0xd68730a6da3234af54b53990b22e9080c60fc5d23bba01caf98d5179837e27", + "0x66656c74323532", + "0x111", + "0x112", + "0x1d1e1b42b1f20bbc87a71f5be8d9386bfc03a25a9077d56fd258bfb27db0aca", + "0x114", + "0x38bb0eaaded40ffd0ffd2995e2b7603ee76746158c2f7cd494f201d4ca16a86", + "0x2a7d1ecdf754b100d735189f4969485656c828bfcb863a154c61199caa02434", + "0x53657373696f6e4163636f756e742e73657373696f6e", + "0x800000000000000000000000000000000000000000000004", + "0x201", + "0x121", + "0x120", + "0x11c", + "0x11f", + "0x11e", + "0x11d", + "0x1251e02a95a910a976c0a0b6bda4fb09cb4f8bc739c4d1d1f8de04a3a187f7d", + "0x5515ecfab0fb2375726420614d3392e0d5b56e83835983e6d1c980006573825", + "0x650c846da0df765be36399a49281411ec1345891914f5fd70b86c1186111f0e", + "0x6fc2208ec2c1cde9c7d059688e8192842c8fec60ec0749fa71b353f6f498b89", + "0xb3736fd99997096da04ac567ae0ae5b02e028509843fa329f84fc7d03e07fe", + "0x1878b48747836e11e4e58ebcbe12d29567def11ac1946c6dd7ef617015d03b2", + "0x252", + "0x122", + "0x123", + "0x6e5f627974657320746f6f20626967", + "0x1000000000000000000000000000000", + "0x10000000000000000000000000000", + "0x100000000000000000000000000", + "0x1000000000000000000000000", + "0x10000000000000000000000", + "0x100000000000000000000", + "0x1000000000000000000", + "0x10000000000000000", + "0x800000000000000700000000000000000000000000000011", + "0x14cb65c06498f4a8e9db457528e9290f453897bdb216ce18347fff8fef2cd11", + "0x426f756e646564496e74", + "0x53ab85eada0a6ea028c03d62be3bee85e33846f2cb70861f36156d3c342647", + "0x137", + "0x6f776e65722d6e6f742d666f756e64", + "0x1bb", + "0x1ff20c1b9fc017bc98394811a2148828b5aa6f49fe458c445ba3aebf98672f6", + "0x13a", + "0x753235365f737562204f766572666c6f77", + "0x553132384d756c47756172616e746565", + "0x144", + "0x141", + "0x143", + "0x142", + "0xffffffff00000000ffffffffffffffff", + "0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e16", + "0x2bce33576b315ececbb6406837bf51f5", + "0xbce6faada7179e84f3b9cac2fc632551", + "0x148", + "0x147", + "0x696e76616c69642d68617368", + "0x6b17d1f2e12c4247f8bce6e563a440f2", + "0x77037d812deb33a0f4a13945d898c296", + "0x800000000000000700000000000000000000000000000004", + "0x753fa73245da0fdf7e314194a53f87798f035997bdf761378f202d24ddaf5d", + "0x149", + "0x1e162ad648bf340755858b98f0036aef4c17aa7bd89162e2cd68e947132f3dd", + "0x14c", + "0x6b0f9ca0faa5017a7f858e635b7b38ad4a147844f39eee2372670e8060d0d2", + "0x14e", + "0x800000000000000300000000000000000000000000000002", + "0x150", + "0x696e76616c69642d6368616c6c656e6765", + "0x75385f616464204f766572666c6f77", + "0x696e76616c69642d757365722d666c616773", + "0xdee600d88abbe3015dacf1de7f46b1ecd4b5b4c45e5a3495e6d9f2cd79acb5", + "0x157", + "0x2d2cd740e0b96248253a3d4781ab839058a450486cfbc5875cfe39acad15715", + "0x159", + "0xe46e162f283715bff40d609883392a5adf192f7859b23fe027a1ec3476cefc", + "0x15a", + "0x80000000000000070000000000000000000000000000000e", + "0x6b086cf4eada82c368f17cb7242bb9288a189704f7b2f7f8af7318eb98eb5c", + "0x371462b763e09d5b4cd4da2b60a746babd17bd0e6325b87c413e9b22b5fa3ed", + "0x15c", + "0x15d", + "0x3cce7362bb62dd82a2197c32e572eb232d1f1c6398bda66f0396be0017dc53b", + "0x15e", + "0x22f0fa46620d4e0a147eaeba6c45cb3a6f3b9b6e5db245f9630750b32652ab8", + "0x5f", + "0x2d", + "0x5369676e6174757265206f7574206f662072616e6765", + "0x496e76616c6964207369676e6174757265", + "0x3233063c5dc6197e9bf4ddc53b925e10907665cf58255b7899f8212442d4605", + "0x165", + "0x1d8a68005db1b26d0d9f54faae1798d540e7df6326fae758cc2cf8f7ee88e72", + "0x166", + "0x536563703235366b31506f696e74", + "0x3179e7829d19e62b12c79010203ceee40c98166e97eb104c25ad1adb6b9675a", + "0x168", + "0x169", + "0x3c7b5436891664778e6019991e6bd154eeab5d43a552b1f19485dec008095d3", + "0x16a", + "0x16f", + "0x16e", + "0xfffffffffffffffffffffffffffffffe", + "0xbaaedce6af48a03bbfd25e8cd0364141", + "0x4563506f696e74", + "0x45635374617465", + "0x5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f", + "0x1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca", + "0x170", + "0x800000000000010ffffffffffffffffb781126dcae7b2321e66a241adc64d2f", + "0x73657373696f6e2f6163636f756e742d7369672d6d69736d61746368", + "0x73657373696f6e2f73657373696f6e2d6b65792d6d69736d61746368", + "0x73657373696f6e2f696e76616c69642d73657373696f6e2d736967", + "0x506f6c69637920696e76616c696420666f7220676976656e2063616c6c73", + "0x2f55ef6f53c7a512df32dc1527e796c99de82e988bed30a856eb7f43f66cf10", + "0x17a", + "0x3ba9a5697792104cbd4a534a5642092cda6b378ca34fbdb7187e057ca79cc39", + "0x17b", + "0x53657373696f6e20686173206265656e207265766f6b6564", + "0x73657373696f6e2f696e76616c69642d6163636f756e742d736967", + "0x53657373696f6e2065787069726564", + "0x4c656e677468206f662070726f6f6673206d69736d617463686564", + "0x278a61c0e5826a0665cc85d105443c3eb8da173ad094e3d07607439dc7c86eb", + "0x28dc486417d8af9898c4e5a579dc35d17ee44b79ba59f5f98c28e4ab1d70b8b", + "0x182", + "0x3b0976bf99766ff2842d8ff3f364263bd00a49f82c70a97866d811e77914227", + "0x183", + "0x184", + "0x63fe7ffc289269f18c75a0f2ed1a0ad61b2be88b273bcf71fd006ac49f9d3c", + "0x107a3e65b6e33d1b25fa00c80dfe693f414350005bc697782c25eaac141fedd", + "0x186", + "0x187", + "0x36f0c2ed8af4e07c34354445815632f497dde026ede86be86346543899b288f", + "0x189", + "0x800000000000000700000000000000000000000000000009", + "0x43460660022535da1908f8678811cc1b497040379dba19cf403cab4762235a", + "0x18a", + "0x18b", + "0x2db31b19e5788de13278144d0d475f2ce5e0e1b41cdd34acf4a3bee41bb54c8", + "0x185", + "0x188", + "0x18c", + "0x18e", + "0x28f8d296e28032baef1f420f78ea9d933102ba47a50b1c5f80fc8a3a1041da", + "0x18f", + "0x800000000000000700000000000000000000000000000006", + "0x35eb2c618fdfe84c0115d45acfe88748be1047ebfb899616c22a2a3e5604e3b", + "0x181", + "0x18d", + "0x190", + "0x191", + "0x275777addd83a499d4cff36d0fb305190a4cc6b628b2b53588376535f4764f1", + "0xe31b14a3157c6a5ac9d1fd355b4d62d23e24b11f201c8b46b929098200083f", + "0x195", + "0x143b49248950b13cd51495337deab12ad7cb3a805a29eff60266137d4794c42", + "0x196", + "0x38dc10454ac7a7c20102179cd9b661ee801b309035d8e112772879991b750c9", + "0x6e6f2d6d756c746963616c6c2d746f2d73656c66", + "0x1ff2f602e42168014d405a94f75e8a93d640751d71d16311266e140d8b0a210", + "0x312b56c05a7965066ddbda31c016d8d05afc305071c0ca3cdc2192c3c2f1f0f", + "0x13d20f70b017632fd676250ec387876342924ff0d0d3c80e55961780f4e8f", + "0x19e", + "0x377bb5b3faa7bd11156625a5afd4b627a893b9cbe0534bf3e3d150fa2e54721", + "0x19f", + "0x21e", + "0x18ef5e2178ac6be59ceafd15e6995810f636807e02c51d309c3f65e37000fc5", + "0x1a1", + "0x7533325f616464204f766572666c6f77", + "0x100000000000000000000000000000000", + "0x2f23416cc60464d4158423619ba713070eb82b686c9d621a22c67bd37f6e0a9", + "0x1a6", + "0x10", + "0x2db340e6c609371026731f47050d3976552c89b4fbb012941663841c59d1af3", + "0x3738f33693f5ab1f9bcc240ce0bb23fdb0cd879f9e76ae01cbbd6ef1b359105", + "0x302b4aa3237648863fc569a648f3625780753ababf66d86fd6f7e7bbc648c63", + "0x114a7f68d7ddec6c5190387d6ad7af1548e987c5f152b940ee48c2618efd29b", + "0x67753421a99564465b580dcc61f1e7befc7fd138c447dae233bba1d477458c", + "0x2f848284d06350a72286eb4ec07d996f783a2b4d3da1aee48058a2a6f8e4adf", + "0x2359336c3867f47c39316853ff81c09b6e5fe837f53a63fc4d88be37f96b748", + "0x10a4ad544c3e0608b1a9e1ff69b5fdc230bace25740547273d3877854c8b722", + "0x1b1", + "0x21133a377494b8d0d09028c44f433efe66b5daf28a351a5fbddd300cf24a859", + "0x1b2", + "0x576562617574686e205369676e6572", + "0x536563703235366b31205369676e6572", + "0x537461726b6e6574205369676e6572", + "0x1746f7542cac71b5c88f0b2301e87cd9b0896dab1c83b8b515762697e521040", + "0x1b8", + "0x1ddff015b55bb5afba07c17f59cf20e40f56e997bc461e27e26c897f1eedb12", + "0x1b9", + "0x8eeab0afd9d7bfc114415f8c850f988105431f58f270f9607f03e0b03fd716", + "0x193b1564fbaf82642eb2a34bb83fe8eb7f849cdf07d2fe9650d160c88237a75", + "0x1ba", + "0x1bc", + "0x2e51e169f1e69a8044577d65c702ea7081f28f01f5114838274b379716dd2c0", + "0x1bd", + "0x436f6e747261637441646472657373", + "0x1c6", + "0x1c0", + "0x1597b831feeb60c71f259624b79cf66995ea4f7e383403583674ab9c33b9cec", + "0x1c1", + "0x348a62b7a38c0673e61e888d83a3ac1bf334ee7361a8514593d3d9532ed8b39", + "0x1bf", + "0x1c2", + "0x1c3", + "0x3342418ef16b3e2799b906b1e4e89dbb9b111332dd44f72458ce44f9895b508", + "0x12867ecd09c884a5cf1f6d9eb0193b4695ce3bb3b2d796a8367d0c371f59cb2", + "0x1285071ce26920dc861d902176f38b138552fe3ec227c3561fcaff97a2dd005", + "0x172b2d029d59f97d93dd24b7cc98c01ca8efd7bf422afd18e9041d6a1a5c170", + "0x1c9", + "0x30f87c80a9ff91f3ba0997da70c24279680d81f2429f998f2964b1a555ebb1a", + "0x1ca", + "0x15c8f6405cdeb9eaae2ed24a3495b29405ab2908ba280b6359f0ecb1500a893", + "0x387338d4f63ce7d93d39064317baac12633ac3f7ff98ea26577b3726ef06ad1", + "0x8bfc0a0a415618003719e1de423237051467ae50ce81505e18c6f03b9aa576", + "0x696e76616c69642d6f776e65722d736967", + "0x696e76616c696420", + "0x696e76616c69642d7369672d666f726d6174", + "0x536563703235367231506f696e74", + "0xcb47311929e7a903ce831cb2b3e67fe265f121b394a36bc46c17cf352547fc", + "0x1d2", + "0x1d3", + "0x172443f63ea579f54ad273f7b38f1e36e11ac4fbb782c429172a3931099240c", + "0x1d4", + "0x2ce4352eafa6073ab4ecf9445ae96214f99c2c33a29c01fcae68ba501d10e2c", + "0x1d6", + "0x2288a6a89dada35a101b0a8d88bfe814fba6532e3a359b9a688db84415b40ac", + "0x1d8", + "0x185fda19bc33857e9f1d92d61312b69416f20cf740fa3993dcc2de228a6671d", + "0x1da", + "0xf83fa82126e7aeaf5fe12fff6a0f4a02d8a185bf5aaee3d10d1c4e751399b4", + "0x1db", + "0x526573756c743a3a756e77726170206661696c65642e", + "0x1c85cfe38772db9df99e2b01984abc87d868a6ed1abf1013cf120a0f3457fe1", + "0x1de", + "0x73657373696f6e2f696e76616c69642d6d616769632d76616c7565", + "0x1181d78f487b2a764db018f35faba23c5f9a14b91b3becc11041cc1682db757", + "0x800000000000000f00000000000000000000000000000002", + "0x3ab6fc0873248797de69f0001c155fcb85c8cbc5a2c1355aa032fe4883a6f49", + "0x1e1", + "0x1e2", + "0x39af97a814ff581c77c2a665fc49798e7dbb9877aa66bf1703e87edd5010eb9", + "0x1e3", + "0x1e2d095cee05e93aa3bb8032128e8368a6c1599003dea2b0423d775c309d8ec", + "0x1e5", + "0xf7ae5f9e9e483dca3e41022931e4cea02b7d485c001958a3f535b5d44ebec5", + "0x1e6", + "0x212c0191d31f49f0f3dfb855d91d40f886e0cb5f1dac8834b67820dc5346a20", + "0x1e9", + "0x7eb4cf1e8e3fb21260ea88949102e41de3a05104ec311331abeec50b884d9d", + "0x3e7", + "0x7a65726f2d7075626b65792d68617368", + "0x131", + "0x6f7574736964652d657865632f696e76616c69642d63616c6c6572", + "0x6475706c6963617465642d6f7574736964652d6e6f6e6365", + "0x6f7574736964652d657865632f696e76616c69642d74696d657374616d70", + "0x3808c701a5d13e100ab11b6c02f91f752ecae7e420d21b56c90ec0a475cc7e5", + "0x414e595f43414c4c4552", + "0x2a594b95e3522276fe0ac7ac7a7e4ad8c47eaa6223bc0fd6991aa683b7ee495", + "0x1f6", + "0x746b05def2f8fdb7c89ad1ffa1aed63cae60366b3e9be02436c976fb3660bd", + "0x4163636f756e742e657865637574655f66726f6d5f6f757473696465", + "0x537461726b4e6574204d657373616765", + "0x1ff", + "0x1fe", + "0x1fd", + "0x534e5f5345504f4c4941", + "0x7abc50a63c15ffb7ec71ea36a896b5a5dea1a19d8112fa1ad7de56920e84aba", + "0x232d972f874864113ad576c72a48202a0e881d01938dd292061dc80aec139f", + "0x1a5f60a5fff70a56c71d33f4f291874fa8dfb6123df29a4e30a07bc1e5c8c34", + "0x204", + "0x203", + "0x202", + "0x3b975cf4d9d3ea94e2e8c39cfb7d1f733f2cd518fd9d95d9b8cb8062e02095", + "0x4b3364d339865ca494e1dac77e84ef33e008ef352a37f088e042814d9df0b", + "0x1082ef94fc9a9ece1204fe67f24c9252be18e5fed355cecbf8a5e69d5d986f3", + "0x534e5f4d41494e", + "0x7533325f737562204f766572666c6f77", + "0x341d38eba34b7f63af136a2fa0264203bb537421424d8af22f13c0486c6bd62", + "0x6f6e6c792d73656c66", + "0x73657373696f6e2f616c72656164792d7265766f6b6564", + "0x3bf392771372ef5ecae9935cd9f1bc7f67be1551d1ad426a3a4439dada64457", + "0x1a0dcaba848bdff9e5397bf0b001ec1c8f87acf8790f4b2799fa66a2b957178", + "0x20c", + "0x389c7cf1a1d49c20322326b3fa30021386968a7e17068a02177e4d79ce9c901", + "0xcb225fab72ba716c11ed91a275ead37678197e582ac11d3b2ef895f8d3d209", + "0x436c61737348617368", + "0xc2c767022ebe56053ec449f9aabdfc801b9eafc42eb9143442cb78544d05fa", + "0x210", + "0x2b3f7ecaa1421c4d7fc3b1350be970992a4b9bc79d89ae0375c30afcac8b100", + "0x211", + "0x436c61737320686173682063616e6e6f74206265207a65726f", + "0x214", + "0x149ee8c97f9cdd259b09b6ca382e10945af23ee896a644de8c7b57da1779da7", + "0x215", + "0x36775737a2dc48f3b19f9a1f4bc3ab9cb367d1e2e827cef96323826fd39f53f", + "0x217", + "0x46a6158a16a947e5916b2a2ca68501a45e93d7110e81aa2d6438b1c57c879a3", + "0x679ea9c5b65e40ad9da80f5a4150d36f3b6af3e88305e2e3ae5eccbc5743d9", + "0x21a", + "0x556e696d706c656d656e746564207369676e65722074797065", + "0x62797465733331", + "0x214db10aa980ee6a46ac7de0f7eb71599e6e62f5efae422f2cec88555fb8a49", + "0x2f517c2aae113df7ef08e645fe398b6a55649c9f947d031edb66004dcd74e95", + "0x21f", + "0x31fe463048534a83cdf7bb6ad6660ae926c9baf36363ed903bd5edd57c4d852", + "0x104eb68e98232f2362ae8fd62c9465a5910d805fa88b305d1f7721b8727f04", + "0x222", + "0x4539183488166d705fdae1c3fe496c43cb571a328f8e7deb3d27520ee62a3a", + "0x800000000000000700000000000000000000000000000008", + "0x1621e24832caf217b6e01484eca5091d136e080123612e109bfbb42f01f9ea5", + "0x224", + "0x221", + "0x220", + "0x20d", + "0x1b0", + "0x1af", + "0x212", + "0x179dbfff6900e46277df3847de2e515627e934b8ba61e6b3813f23259ac840f", + "0x1b266b8be54812750339f69a13b9b45b8195bb6099c8fb608a6a6cd0cc65dda", + "0x22a", + "0x1a4ada30892d6735e8899156ba0086cb46bee82386fc40cb3a82ca34b4cc546", + "0x22b", + "0x958391e4cda6308b345ed50f8f11ed4e5ca2ef0ce982319b547f4d1f91d94f", + "0x22d", + "0x3082393ce5d640aaf27f817ef3cd67177680665716fd22f8c2d60c808f39c50", + "0x22e", + "0x230f62ce7038ee615eb691126d31fcfeaea7daec07a4b67d79f823ade813046", + "0x230", + "0x519a6f1a4263d0d5d354f005a358d57fc87ecd23fc23a938b9b9fa0adbafe8", + "0x231", + "0x3b80336ea2e057d898c1bcdd96c5205dcce7f11189eaf675d593e26f330e795", + "0xcc5e86243f861d2d64b08c35db21013e773ac5cf10097946fe0011304886d5", + "0x235", + "0x2268edf67b91950354fd1020241302474ef67970e8063160d48ee70c4e0da9e", + "0x4f7074696f6e3a3a756e77726170206661696c65642e", + "0x496e646578206f7574206f6620626f756e6473", + "0x23b", + "0x7a65726f2d7075626b6579", + "0x696e76616c69642d7369676e61747572652d666f726d6174", + "0x696e76616c69642d7369676e61747572652d6c656e677468", + "0x344f20987ae6d433bcd90c842fc0ec649738918bb4b6a120edacb2a7536ad7b", + "0x240", + "0x31ae8cf873afb8502f67f0c62063fdeb1bc5cbb7f2f868e315318efaba5c4d", + "0x241", + "0x1f5d91ca543c7f9a0585a1c8beffc7a207d4af73ee640223a154b1da196a40d", + "0x245", + "0x4163636f756e743a20696e76616c69642063616c6c6572", + "0x4163636f756e743a20696e76616c69642074782076657273696f6e", + "0x323bdb4694a42a11fa3f4cbbf3a9b7035efadb0edae2a4968275e71cdd51608", + "0x24a", + "0x100000000000000000000000000000001", + "0x56414c4944", + "0x1d3040cbc98057328ba18f0b7ebbc070381309d8777f33d59b861217fcde1fc", + "0x24e", + "0x73657373696f6e2d746f6b656e", + "0x756e737570706f727465642d7061796d6173746572", + "0x3693aea200ee3080885d21614d01b9532a8670f69e658a94addaadd72e9aca", + "0x18508a22cd4cf1437b721f596cd2277fc0a5e4dcd247b107ef2ef5fd2752cf7", + "0x253", + "0x8416421239ce8805ed9d27e6ddae62a97ab5d01883bb8f5246b4742a44b429", + "0x254", + "0x22796c0d6a650acdaf7abbc18976cfa91b8683b7c958233d75464bda0d6abda", + "0x187e287aa444f06666b3a791824f77072eca7802471b4feec6e5117778f2993", + "0x256", + "0x257", + "0xc5fb44287edb3b7934bf55053a0b8cc13f94e8af5da8f6e37f63f0381d6f9d", + "0x258", + "0x1d6c11a27ab1d80358fb55a47ea72cb37daf1519f3975e4a2b01b6c141853bc", + "0x25a", + "0x1d1144bb2138366ff28d8e9ab57456b1d332ac42196230c3a602003c89872", + "0x3f918d17e5ee77373b56385708f855659a07f75997f365cf87748628532a055", + "0x32b90df821786fc0a5a5492c92e3241a5e680e5d53cd88c2bfdd094a70c90f5", + "0x1707cbd3f89370a5affb26fb29b402f4eb99ff82d334aa99a33978ef1a61f8d", + "0x2fad01acaa00d4c3f0241c0c071338c8770df4688e65e59471d16af2d0b936f", + "0x260", + "0x261", + "0x1f508ef45b753b6d638b97c23f85e21eefd53d9e4eb955ea3205cb9a1307878", + "0x262", + "0x1d49f7a4b277bf7b55a2664ce8cef5d6922b5ffb806b89644b9e0cdbbcac378", + "0x264", + "0x13fdd7105045794a99550ae1c4ac13faa62610dfab62c16422bfcf5803baa6e", + "0x265", + "0x3dfebc955212ba0c7d4b3a4bc7cf2903be13d8f72927dba4c8721692b53b2f1", + "0x18dba4d6e57fc43648611e5af5d1706f53a927172cd1f1224c7ac6be29f9914", + "0x267", + "0x268", + "0x138ec51536c49d15fafa67a12eadbcec55c1620e4fa89c6662a67a64d74b297", + "0x269", + "0x45634f70", + "0x26d", + "0x506f736569646f6e", + "0x26f", + "0x42697477697365", + "0x271", + "0x506564657273656e", + "0x273", + "0xa853c166304d20fb0711becf2cbdf482dee3cac4e9717d040b7a7ab1df7eec", + "0x275", + "0x800000000000000f00000000000000000000000000000003", + "0x37e29a587e133b9b2bafb5475dbb9a447f2d864329caf14b210dec746f2f9ea", + "0x277", + "0x4163636f756e743a20756e617574686f72697a6564", + "0x104118274e7f2626bb48207a10c5b06aa1c485e34651c9a724f593b24758c1", + "0x27a", + "0x3bcb23d16ac841a63ae7314354d4e5996d2698509daf2f056950c6690303a8c", + "0x27b", + "0x1f4", + "0x7d4d99e9ed8d285b5c61b493cedb63976bc3d9da867933d829f49ce838b5e7", + "0x27e", + "0x27d", + "0x27f", + "0x4661696c656420746f20646573657269616c697a6520706172616d202333", + "0x6f6e6c795f67756964", + "0x53746f7261676541646472657373", + "0x53746f726167654261736541646472657373", + "0x2b23f1d00aec12304bb9b4b55f1b4d061b717555f0f4473423941aa83e1fad3", + "0x3a60bf31c3fd0a0f9de00d183de724829bca97d61825a4c2cabed2ea3d32f8e", + "0xdd18ca4118c7f8f231e7bcdbfb3b990e4d30340112e44788090ea62effba61", + "0x800000000000000f00000000000000000000000000000007", + "0x2017b2a1a899898ec9ffcdc0838e23269af948c978bb7cf9746ec66c0b650fe", + "0x28a", + "0x28b", + "0x28c", + "0x28d", + "0x1f3886b5b09d01be9424f6d09e8ad8542a8d0a6f98eca8c9ceb62fff69d276e", + "0x28e", + "0x2d60f05b80bec40b13caf5706c4ec260a4db40d992d7b69bd5f5f7aa3e7612", + "0x290", + "0x203b1e6af7ddd4564c35a43b76b3229f60764dd45baf8d2a94ae1c66c6f0af", + "0x291", + "0x4661696c656420746f20646573657269616c697a6520706172616d202332", + "0x10203be321c62a7bd4c060d69539c1fbe065baa9e253c74d2cc48be163e259", + "0x294", + "0x17b6ecc31946835b0d9d92c2dd7a9c14f29af0371571ae74a1b228828b2242", + "0x296", + "0x34f9bd7c6cb2dd4263175964ad75f1ff1461ddc332fbfb274e0fb2a5d7ab968", + "0x297", + "0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511", + "0x74584e9f10ffb1a40aa5a3582e203f6758defc4a497d1a2d5a89f274a320e9", + "0x29b", + "0x35b1d2e6efa1329668b64cbde2c6a8b9de11ee98e06a047411233d1cc82c495", + "0x29d", + "0x53797374656d", + "0x29f", + "0x4661696c656420746f20646573657269616c697a6520706172616d202331", + "0x4f7574206f6620676173", + "0x6f349d1f3797997e489172ca04ee2bd06c7b33fe7822eba3ff9766789378c3", + "0x2a4", + "0x4275696c74696e436f737473", + "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473", + "0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6", + "0x2a3", + "0x28f184fd9e4406cc4475e4faaa80e83b54a57026386ee7d5fc4fa8f347e327d", + "0x2a9", + "0xc1f0cb41289e2f6a79051e9af1ead07112b46ff17a492a90b3944dc53a51c8", + "0x2aa", + "0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7", + "0x2ac", + "0x4761734275696c74696e", + "0x634", + "0x7265766f6b655f61705f747261636b696e67", + "0x77697468647261775f676173", + "0x6272616e63685f616c69676e", + "0x7374727563745f6465636f6e737472756374", + "0x656e61626c655f61705f747261636b696e67", + "0x73746f72655f74656d70", + "0x61727261795f736e617073686f745f706f705f66726f6e74", + "0x656e756d5f696e6974", + "0x2ad", + "0x6a756d70", + "0x7374727563745f636f6e737472756374", + "0x656e756d5f6d61746368", + "0x64697361626c655f61705f747261636b696e67", + "0x756e626f78", + "0x61727261795f6e6577", + "0x72656e616d65", + "0x2ae", + "0x66756e6374696f6e5f63616c6c", + "0x2ab", + "0x2a8", + "0x64726f70", + "0x636f6e73745f61735f696d6d656469617465", + "0x2a7", + "0x61727261795f617070656e64", + "0x6765745f6275696c74696e5f636f737473", + "0x2a6", + "0x77697468647261775f6761735f616c6c", + "0x2a5", + "0x736e617073686f745f74616b65", + "0x2a2", + "0x2a1", + "0x616c6c6f635f6c6f63616c", + "0x66696e616c697a655f6c6f63616c73", + "0x2a0", + "0x12", + "0x73746f72655f6c6f63616c", + "0x29e", + "0x647570", + "0x61727261795f6c656e", + "0x7533325f746f5f66656c74323532", + "0x13", + "0x29c", + "0x299", + "0x14", + "0x298", + "0x15", + "0x295", + "0x293", + "0x29a", + "0x16", + "0x17", + "0x292", + "0x18", + "0x28f", + "0x73746f726167655f626173655f616464726573735f636f6e7374", + "0x1bc393ddc18fd27b1d9b1b129059925688d2f2d5818a5ec3ebb750b7c286ea6", + "0x73746f726167655f616464726573735f66726f6d5f62617365", + "0x287", + "0x288", + "0x73746f726167655f726561645f73797363616c6c", + "0x66656c743235325f69735f7a65726f", + "0x286", + "0x285", + "0x284", + "0x283", + "0x282", + "0x281", + "0x636c6173735f686173685f7472795f66726f6d5f66656c74323532", + "0x6765745f657865637574696f6e5f696e666f5f76325f73797363616c6c", + "0x280", + "0x636f6e74726163745f616464726573735f746f5f66656c74323532", + "0x66656c743235325f737562", + "0x27c", + "0x279", + "0x1b", + "0x278", + "0x276", + "0x26a", + "0x266", + "0x26e", + "0x272", + "0x274", + "0x270", + "0x263", + "0x26c", + "0x26b", + "0x25f", + "0x706564657273656e", + "0xad292db4ff05a993c318438c1b6c8a8303266af2da151aa28ccece6726f1f1", + "0x626f6f6c5f6e6f745f696d706c", + "0x25e", + "0x25d", + "0x25b", + "0x259", + "0x25c", + "0x255", + "0x251", + "0x61727261795f676574", + "0x250", + "0x24f", + "0x26", + "0x24d", + "0x24c", + "0x27", + "0x24b", + "0x249", + "0x248", + "0x246", + "0x28", + "0x247", + "0x244", + "0x7533325f6571", + "0x243", + "0x29", + "0x242", + "0x23f", + "0x23e", + "0x23d", + "0x7533325f6f766572666c6f77696e675f737562", + "0x23a", + "0x2a", + "0x239", + "0x238", + "0x237", + "0x236", + "0x234", + "0x2c", + "0x233", + "0x232", + "0x2e", + "0x22f", + "0x2f", + "0x22c", + "0x229", + "0x756e777261705f6e6f6e5f7a65726f", + "0x227", + "0x226", + "0x228", + "0x225", + "0x223", + "0x656d69745f6576656e745f73797363616c6c", + "0x21d", + "0x21c", + "0x21b", + "0x219", + "0x218", + "0x7374727563745f736e617073686f745f6465636f6e737472756374", + "0x216", + "0x636c6173735f686173685f746f5f66656c74323532", + "0x213", + "0x7265706c6163655f636c6173735f73797363616c6c", + "0x20f", + "0x20e", + "0x73746f726167655f77726974655f73797363616c6c", + "0x20b", + "0x20a", + "0x21adb5788e32c84f69a1863d85ef9394b7bf761a0ce1190f826984e5075c371", + "0x7536345f7472795f66726f6d5f66656c74323532", + "0x209", + "0x7533325f7472795f66726f6d5f66656c74323532", + "0x61727261795f736c696365", + "0x208", + "0x205", + "0x206", + "0x207", + "0x200", + "0x66656c743235325f616464", + "0x68616465735f7065726d75746174696f6e", + "0x1fc", + "0x1fb", + "0x1fa", + "0x1f9", + "0x1f8", + "0x3a", + "0x1f7", + "0x1f5", + "0x7536345f6f766572666c6f77696e675f737562", + "0x1f3", + "0x626f6f6c5f746f5f66656c74323532", + "0x1f2", + "0x1f1", + "0x1f0", + "0x75313238735f66726f6d5f66656c74323532", + "0x753132385f6f766572666c6f77696e675f737562", + "0x753132385f6571", + "0x1ee", + "0x1ed", + "0x1ec", + "0x1eb", + "0x3b", + "0x1ea", + "0x1e8", + "0x3c", + "0x1e7", + "0x1e4", + "0x1e0", + "0x1df", + "0x63616c6c5f636f6e74726163745f73797363616c6c", + "0x1dd", + "0x3e", + "0x1dc", + "0x1d9", + "0x1d7", + "0x1d5", + "0x7365637032353672315f6765745f78795f73797363616c6c", + "0x1d1", + "0x1d0", + "0x1cf", + "0x1ce", + "0x1cd", + "0x1cc", + "0x1cb", + "0x1c8", + "0x1c7", + "0x753235365f69735f7a65726f", + "0x1c5", + "0x1be", + "0x1b7", + "0x1c4", + "0x1b6", + "0x1b5", + "0x1b4", + "0x1b3", + "0x753132385f746f5f66656c74323532", + "0x1ae", + "0x1ad", + "0x1ac", + "0x1ab", + "0x1aa", + "0x7533325f6f766572666c6f77696e675f616464", + "0x1a9", + "0x1a8", + "0x1a7", + "0x753132385f69735f7a65726f", + "0x753132385f736166655f6469766d6f64", + "0x1a4", + "0x66656c743235325f6d756c", + "0x627974657333315f7472795f66726f6d5f66656c74323532", + "0x1a3", + "0x1a2", + "0x627974657333315f746f5f66656c74323532", + "0x1a0", + "0x19d", + "0x7536345f746f5f66656c74323532", + "0x19c", + "0x19b", + "0x198", + "0x197", + "0x194", + "0x19a", + "0x199", + "0x192", + "0x193", + "0x180", + "0x17f", + "0x17e", + "0x17d", + "0x17c", + "0x179", + "0x178", + "0x177", + "0x176", + "0x175", + "0x65635f706f696e745f66726f6d5f785f6e7a", + "0x174", + "0x173", + "0x172", + "0x65635f706f696e745f7472795f6e65775f6e7a", + "0x65635f73746174655f696e6974", + "0x171", + "0x65635f73746174655f6164645f6d756c", + "0x65635f73746174655f7472795f66696e616c697a655f6e7a", + "0x65635f706f696e745f756e77726170", + "0x65635f73746174655f616464", + "0x65635f6e6567", + "0x65635f706f696e745f69735f7a65726f", + "0x16d", + "0x16c", + "0x16b", + "0x167", + "0x164", + "0x163", + "0x162", + "0x161", + "0x160", + "0x15f", + "0x15b", + "0x757063617374", + "0x156", + "0x155", + "0x75385f6f766572666c6f77696e675f616464", + "0x62697477697365", + "0x154", + "0x153", + "0xa", + "0x152", + "0x14f", + "0x14d", + "0x14b", + "0x14a", + "0x146", + "0x151", + "0x38757fc6ad96fab837f69741024e18cbedcf9445933917989f3d1d58af02312", + "0x145", + "0x140", + "0x7365637032353672315f6e65775f73797363616c6c", + "0x13f", + "0x753235365f67756172616e7465655f696e765f6d6f645f6e", + "0x753132385f6d756c5f67756172616e7465655f766572696679", + "0x13d", + "0x7365637032353672315f6d756c5f73797363616c6c", + "0x7365637032353672315f6164645f73797363616c6c", + "0x13c", + "0x75385f7472795f66726f6d5f66656c74323532", + "0x13b", + "0x139", + "0x138", + "0x75385f746f5f66656c74323532", + "0x646f776e63617374", + "0x136", + "0x656e756d5f66726f6d5f626f756e6465645f696e74", + "0x135", + "0x134", + "0x130", + "0x12f", + "0x12e", + "0x12d", + "0x12c", + "0x12b", + "0x12a", + "0x129", + "0x128", + "0x127", + "0x126", + "0x125", + "0x5b", + "0x124", + "0x11b", + "0x5c", + "0x11a", + "0x119", + "0x118", + "0x117", + "0x116", + "0x5d", + "0x115", + "0x393d13543d6033e70e218aad8050e8de40a1dfbac0e80459811df56e3716ce6", + "0x10b", + "0x10a", + "0x736563703235366b315f6e65775f73797363616c6c", + "0x736563703235366b315f6d756c5f73797363616c6c", + "0x736563703235366b315f6164645f73797363616c6c", + "0x736563703235366b315f6765745f78795f73797363616c6c", + "0x5e", + "0x109", + "0x104", + "0x103", + "0x101", + "0x6b656363616b5f73797363616c6c", + "0x753132385f627974655f72657665727365", + "0xfe", + "0xfd", + "0xfc", + "0xfb", + "0xfa", + "0xf9", + "0xf8", + "0xf7", + "0xf6", + "0xf5", + "0xf4", + "0xf3", + "0xf2", + "0xf1", + "0xf0", + "0xef", + "0xee", + "0xed", + "0xec", + "0xeb", + "0xea", + "0xe9", + "0xe8", + "0xe7", + "0xe6", + "0xe5", + "0xe4", + "0xe3", + "0xe2", + "0xe1", + "0xe0", + "0xdf", + "0xde", + "0xdd", + "0xdc", + "0xdb", + "0xda", + "0xd9", + "0xd8", + "0xd7", + "0xd6", + "0xd5", + "0xd4", + "0xd3", + "0xd2", + "0xd1", + "0xd0", + "0xcf", + "0xce", + "0xcd", + "0xcc", + "0xcb", + "0xca", + "0xc9", + "0xc8", + "0xc7", + "0xc6", + "0xc5", + "0xc4", + "0xc3", + "0xc2", + "0xc1", + "0xc0", + "0xbf", + "0x753235365f736166655f6469766d6f64", + "0xbe", + "0x7533325f69735f7a65726f", + "0x7533325f736166655f6469766d6f64", + "0xbc", + "0x7533325f62697477697365", + "0x7533325f776964655f6d756c", + "0xbb", + "0x60", + "0xba", + "0xb8", + "0xb6", + "0x75385f6571", + "0xb2", + "0xb1", + "0xaf", + "0xae", + "0xad", + "0xac", + "0xaa", + "0x7536345f62697477697365", + "0xa9", + "0xa8", + "0xa7", + "0xb5", + "0xb3", + "0xb4", + "0xa5", + "0xa4", + "0xa3", + "0x7536345f69735f7a65726f", + "0x7536345f736166655f6469766d6f64", + "0xa0", + "0x9f", + "0x9e", + "0x9d", + "0x9c", + "0x9b", + "0x9a", + "0x99", + "0x98", + "0x97", + "0x96", + "0x95", + "0x94", + "0x93", + "0x8f", + "0x8e", + "0x8d", + "0x8c", + "0x8b", + "0x8a", + "0x89", + "0x88", + "0x87", + "0x85", + "0x61727261795f706f705f66726f6e74", + "0x7f", + "0x7d", + "0x7c", + "0x753132385f67756172616e7465655f6d756c", + "0x753132385f6f766572666c6f77696e675f616464", + "0x753531325f736166655f6469766d6f645f62795f75323536", + "0x7536345f6f766572666c6f77696e675f616464", + "0x61727261795f736e617073686f745f706f705f6261636b", + "0xe", + "0xd", + "0xc", + "0xb", + "0x9", + "0x64ff", + "0xffffffffffffffff", + "0x2f6", + "0x2e2", + "0x2d0", + "0x2c5", + "0x38f", + "0x384", + "0x371", + "0x32a", + "0x35f", + "0x354", + "0x3fd", + "0x3b6", + "0x3f0", + "0x3e3", + "0x3d4", + "0x47d", + "0x420", + "0x470", + "0x467", + "0x438", + "0x43d", + "0x448", + "0x44f", + "0x456", + "0x45c", + "0x565", + "0x499", + "0x49e", + "0x551", + "0x4a8", + "0x4ad", + "0x53c", + "0x4b7", + "0x4bc", + "0x526", + "0x4d6", + "0x511", + "0x506", + "0x62b", + "0x585", + "0x58a", + "0x61a", + "0x616", + "0x5a1", + "0x608", + "0x5f6", + "0x5ef", + "0x5e4", + "0x5dc", + "0x600", + "0x5fb", + "0x61e", + "0x6a7", + "0x647", + "0x64c", + "0x696", + "0x661", + "0x687", + "0x67f", + "0x740", + "0x6c4", + "0x6c9", + "0x72f", + "0x6de", + "0x720", + "0xa2", + "0xa6", + "0x718", + "0x707", + "0x70b", + "0x86e", + "0x85c", + "0x842", + "0x830", + "0x816", + "0x789", + "0xbd", + "0x7fe", + "0x7e4", + "0x7da", + "0x7cf", + "0x7f4", + "0x8f3", + "0x8eb", + "0x8db", + "0x8a6", + "0x8cc", + "0x8c4", + "0x992", + "0x910", + "0x915", + "0x981", + "0x92a", + "0x972", + "0x968", + "0x947", + "0x94c", + "0x957", + "0x95b", + "0xa21", + "0x9af", + "0x9b4", + "0xa11", + "0x9c8", + "0xa03", + "0x9dc", + "0x9ec", + "0x9e7", + "0x9f3", + "0x9f7", + "0xad5", + "0xacb", + "0xab9", + "0xaaf", + "0xa9d", + "0xa5c", + "0xa8c", + "0xa83", + "0xb1b", + "0xaf5", + "0xb13", + "0xb09", + "0xbfd", + "0xbed", + "0xb66", + "0xbb0", + "0xbac", + "0xb9c", + "0xbdc", + "0xbb2", + "0xbe2", + "0xc92", + "0xc82", + "0xc77", + "0xc40", + "0xc47", + "0xc66", + "0xc5e", + "0xce0", + "0xcab", + "0xcb0", + "0xcd5", + "0xcce", + "0xd28", + "0xcfe", + "0xd0a", + "0xd0f", + "0xd1d", + "0xda1", + "0xd9f", + "0xd4c", + "0xd51", + "0xd70", + "0xd66", + "0xd78", + "0xe8e", + "0x13e", + "0xd91", + "0xd8a", + "0xdf7", + "0xda2", + "0xe86", + "0xdba", + "0xdc3", + "0xdc8", + "0xe76", + "0xdd3", + "0xdd8", + "0xe65", + "0xdee", + "0xe48", + "0xe38", + "0xe2c", + "0xe1c", + "0xe20", + "0xe59", + "0x158", + "0x1078", + "0xed2", + "0xf46", + "0xf41", + "0xf2a", + "0xf1a", + "0x102d", + "0xf49", + "0xfba", + "0xfb8", + "0xf60", + "0xf65", + "0xf86", + "0xf7b", + "0xf8f", + "0x106c", + "0xfa9", + "0xfa2", + "0x1012", + "0xfbb", + "0x1062", + "0xfd5", + "0xfde", + "0xfe3", + "0x1051", + "0xfee", + "0xff3", + "0x103f", + "0x1009", + "0x1033", + "0x1095", + "0x109a", + "0x1155", + "0x10b7", + "0x10af", + "0x1142", + "0x10df", + "0x10d9", + "0x10d1", + "0x1133", + "0x1129", + "0x1111", + "0x110b", + "0x1103", + "0x1118", + "0x112e", + "0x1121", + "0x114a", + "0x13c6", + "0x13ae", + "0x1392", + "0x1197", + "0x119d", + "0x11a3", + "0x11a8", + "0x137a", + "0x11c8", + "0x11d3", + "0x11fe", + "0x1208", + "0x11e6", + "0x1366", + "0x1265", + "0x126a", + "0x1306", + "0x1a5", + "0x124b", + "0x123f", + "0x1272", + "0x1258", + "0x126e", + "0x12f7", + "0x12e0", + "0x12d7", + "0x12cb", + "0x12bd", + "0x12ea", + "0x1352", + "0x1348", + "0x134d", + "0x135a", + "0x13dc", + "0x1542", + "0x1422", + "0x1491", + "0x148f", + "0x143a", + "0x143f", + "0x145f", + "0x1455", + "0x1468", + "0x1536", + "0x1481", + "0x147a", + "0x14e8", + "0x1492", + "0x152d", + "0x14ab", + "0x14b4", + "0x14b9", + "0x151d", + "0x14c4", + "0x14c9", + "0x150c", + "0x14df", + "0x1501", + "0x1568", + "0x15a7", + "0x1597", + "0x1591", + "0x159e", + "0x16a0", + "0x1696", + "0x1688", + "0x167a", + "0x15ed", + "0x15fe", + "0x15fa", + "0x1666", + "0x1659", + "0x1648", + "0x1642", + "0x164f", + "0x16a8", + "0x1734", + "0x16c9", + "0x16da", + "0x16d6", + "0x16f7", + "0x170c", + "0x16eb", + "0x16f1", + "0x172c", + "0x1700", + "0x1706", + "0x1715", + "0x171c", + "0x1727", + "0x174d", + "0x1752", + "0x1834", + "0x182d", + "0x1764", + "0x1769", + "0x181f", + "0x1772", + "0x1777", + "0x180f", + "0x1808", + "0x1788", + "0x178d", + "0x17f8", + "0x17f1", + "0x179e", + "0x17a3", + "0x17d1", + "0x17c7", + "0x17bf", + "0x17da", + "0x17e5", + "0x1800", + "0x1817", + "0x183c", + "0x184b", + "0x1850", + "0x18a2", + "0x1899", + "0x188c", + "0x187d", + "0x1871", + "0x19f4", + "0x1925", + "0x1918", + "0x190f", + "0x197b", + "0x196e", + "0x1965", + "0x19e8", + "0x19da", + "0x19d1", + "0x19c9", + "0x1a19", + "0x1a2f", + "0x1bf1", + "0x1bd4", + "0x1bbc", + "0x1a52", + "0x1a61", + "0x1a72", + "0x1ba5", + "0x1a8a", + "0x1a8f", + "0x1b89", + "0x1b73", + "0x1aec", + "0x1ae8", + "0x1ad6", + "0x1b17", + "0x1b67", + "0x1aee", + "0x1b51", + "0x1b3f", + "0x1b32", + "0x1c14", + "0x1c19", + "0x1d09", + "0x1c4e", + "0x1c2a", + "0x1c2f", + "0x1c42", + "0x1c38", + "0x1c45", + "0x1cf6", + "0x1cc0", + "0x1c60", + "0x1c65", + "0x1cb4", + "0x1c71", + "0x23c", + "0x1c75", + "0x1c91", + "0x1c84", + "0x1c8b", + "0x1c8d", + "0x1cb7", + "0x1c98", + "0x1ca9", + "0x1ce8", + "0x1ce2", + "0x1cda", + "0x1cfe", + "0x1d1c", + "0x1d21", + "0x1d69", + "0x1d48", + "0x1d42", + "0x1d3a", + "0x1d56", + "0x1d5e", + "0x1d82", + "0x1d8e", + "0x1daa", + "0x1db5", + "0x1da0", + "0x1ddb", + "0x1dde", + "0x1de1", + "0x1dce", + "0x1e0e", + "0x1de3", + "0x1de9", + "0x1dee", + "0x1df3", + "0x1df7", + "0x1e1a", + "0x1e30", + "0x1e35", + "0x1e78", + "0x1e74", + "0x1e45", + "0x1e4a", + "0x1e6c", + "0x1e65", + "0x1e5c", + "0x1e7c", + "0x1f65", + "0x1f5c", + "0x1f4a", + "0x1f3b", + "0x1f25", + "0x1f11", + "0x1f03", + "0x1eee", + "0x1ee3", + "0x1ed5", + "0x1ed7", + "0x1f6c", + "0x1fea", + "0x1fe8", + "0x1f95", + "0x1f9a", + "0x1fb9", + "0x1faf", + "0x1fc1", + "0x2090", + "0x1fda", + "0x1fd3", + "0x2041", + "0x1feb", + "0x2088", + "0x2003", + "0x200d", + "0x2012", + "0x2078", + "0x201d", + "0x2022", + "0x2067", + "0x2038", + "0x205b", + "0x20e0", + "0x20a8", + "0x20ad", + "0x20d5", + "0x20c4", + "0x2119", + "0x20fb", + "0x2100", + "0x210e", + "0x215d", + "0x2136", + "0x2155", + "0x214b", + "0x217b", + "0x2181", + "0x2187", + "0x218c", + "0x219a", + "0x21a6", + "0x21c9", + "0x21d4", + "0x21b8", + "0x2209", + "0x220d", + "0x2390", + "0x21fc", + "0x21f0", + "0x223c", + "0x2376", + "0x23e6", + "0x2210", + "0x2216", + "0x221b", + "0x2220", + "0x2224", + "0x2383", + "0x236c", + "0x2254", + "0x2295", + "0x235c", + "0x225e", + "0x2262", + "0x228a", + "0x289", + "0x2279", + "0x227e", + "0x234e", + "0x2339", + "0x232c", + "0x2320", + "0x230d", + "0x22fa", + "0x22dd", + "0x22ee", + "0x22ea", + "0x23dc", + "0x23d0", + "0x23d5", + "0x2450", + "0x243d", + "0x2432", + "0x2424", + "0x246e", + "0x2473", + "0x24b9", + "0x247b", + "0x24bc", + "0x2485", + "0x248a", + "0x24a6", + "0x2494", + "0x2499", + "0x24a0", + "0x24aa", + "0x24b3", + "0x2b0", + "0x24ca", + "0x24cf", + "0x2518", + "0x24da", + "0x24de", + "0x24fa", + "0x24ed", + "0x24f4", + "0x24f6", + "0x251b", + "0x2501", + "0x2510", + "0x2b1", + "0x2b2", + "0x2b3", + "0x2b4", + "0x251f", + "0x2b5", + "0x2b6", + "0x2536", + "0x2b7", + "0x2b8", + "0x252e", + "0x2b9", + "0x2ba", + "0x2bb", + "0x2bc", + "0x2bd", + "0x2be", + "0x2545", + "0x254a", + "0x2573", + "0x2bf", + "0x2c0", + "0x2c1", + "0x2c2", + "0x256d", + "0x2c3", + "0x2c4", + "0x2565", + "0x2c6", + "0x2c7", + "0x2c8", + "0x2c9", + "0x257b", + "0x2ca", + "0x2cb", + "0x2cc", + "0x2cd", + "0x2645", + "0x2584", + "0x2589", + "0x25be", + "0x25b9", + "0x2597", + "0x259c", + "0x25af", + "0x25a9", + "0x2ce", + "0x2cf", + "0x25c6", + "0x25b3", + "0x25c1", + "0x2d1", + "0x2638", + "0x2d2", + "0x25cf", + "0x263c", + "0x25d7", + "0x25dc", + "0x2611", + "0x260c", + "0x25ea", + "0x25ef", + "0x2602", + "0x25fc", + "0x2619", + "0x2606", + "0x2614", + "0x262b", + "0x2621", + "0x262f", + "0x2d3", + "0x2d4", + "0x2d5", + "0x2d6", + "0x2d7", + "0x2d8", + "0x2658", + "0x265d", + "0x2687", + "0x2680", + "0x2678", + "0x268f", + "0x2d9", + "0x2da", + "0x2db", + "0x27e3", + "0x2dc", + "0x2699", + "0x269e", + "0x26c9", + "0x26c2", + "0x26ba", + "0x26d2", + "0x27da", + "0x27d0", + "0x26e2", + "0x26e7", + "0x27c1", + "0x27ba", + "0x26f8", + "0x26fd", + "0x27aa", + "0x27a2", + "0x270e", + "0x2713", + "0x2791", + "0x2788", + "0x2724", + "0x2729", + "0x2776", + "0x276c", + "0x273a", + "0x273f", + "0x275a", + "0x2750", + "0x2dd", + "0x2de", + "0x2df", + "0x2e0", + "0x2764", + "0x2e1", + "0x2780", + "0x279a", + "0x27b2", + "0x27c8", + "0x29c4", + "0x2e3", + "0x2e4", + "0x2e5", + "0x2e6", + "0x2e7", + "0x2e8", + "0x2e9", + "0x2ea", + "0x2eb", + "0x29b4", + "0x2ec", + "0x2ed", + "0x29a5", + "0x2ee", + "0x2993", + "0x287d", + "0x28b6", + "0x297b", + "0x2873", + "0x286b", + "0x2983", + "0x2914", + "0x296f", + "0x2887", + "0x288b", + "0x28ac", + "0x28a4", + "0x2963", + "0x2953", + "0x2947", + "0x293c", + "0x292e", + "0x2920", + "0x28ff", + "0x290e", + "0x2ef", + "0x2f0", + "0x2f1", + "0x29ea", + "0x29f9", + "0x2ad6", + "0x2f2", + "0x2add", + "0x2f3", + "0x2f4", + "0x2a11", + "0x2a20", + "0x2f5", + "0x2f7", + "0x2a31", + "0x2a3d", + "0x2f8", + "0x2f9", + "0x2fa", + "0x2fb", + "0x2acd", + "0x2fc", + "0x2fd", + "0x2fe", + "0x2a59", + "0x2a65", + "0x2a72", + "0x2a7e", + "0x2a8c", + "0x2a98", + "0x2aa5", + "0x2ab1", + "0x2abd", + "0x2ac7", + "0x2c9d", + "0x2ff", + "0x2b38", + "0x2b3c", + "0x2c44", + "0x2b28", + "0x2b6d", + "0x2b3f", + "0x2b45", + "0x2b4a", + "0x2b4f", + "0x2b53", + "0x2c35", + "0x2b97", + "0x2b9b", + "0x2bda", + "0x2b86", + "0x300", + "0x2bc5", + "0x2b9e", + "0x2ba4", + "0x2ba9", + "0x2bae", + "0x2bb2", + "0x2bca", + "0x2c2b", + "0x2c1c", + "0x2c21", + "0x2c93", + "0x2c84", + "0x2c89", + "0x301", + "0x2cb7", + "0x2cc1", + "0x2ccc", + "0x2cd8", + "0x2cda", + "0x2cdc", + "0x302", + "0x303", + "0x2ce8", + "0x304", + "0x305", + "0x306", + "0x307", + "0x308", + "0x309", + "0x30a", + "0x30b", + "0x30c", + "0x30d", + "0x30e", + "0x30f", + "0x310", + "0x311", + "0x312", + "0x313", + "0x314", + "0x2d01", + "0x2d0e", + "0x2d1a", + "0x2d13", + "0x2d63", + "0x2d55", + "0x2d5a", + "0x30c1", + "0x315", + "0x316", + "0x30b0", + "0x317", + "0x3036", + "0x2fd3", + "0x2fc3", + "0x318", + "0x2f33", + "0x2e54", + "0x2d96", + "0x2d9a", + "0x2e40", + "0x319", + "0x31a", + "0x2e34", + "0x31b", + "0x31c", + "0x2db4", + "0x31d", + "0x2e4e", + "0x31e", + "0x2e24", + "0x31f", + "0x320", + "0x2df4", + "0x2de5", + "0x2dd9", + "0x2dff", + "0x2e21", + "0x2e16", + "0x321", + "0x2e0a", + "0x322", + "0x2ed7", + "0x323", + "0x324", + "0x325", + "0x2e5d", + "0x2e61", + "0x2f22", + "0x2e77", + "0x2f2d", + "0x2f12", + "0x2f05", + "0x2ef4", + "0x2ec2", + "0x2eb3", + "0x2ea7", + "0x2ecd", + "0x2ef1", + "0x2ee6", + "0x2eda", + "0x326", + "0x2f8c", + "0x2f3b", + "0x2f3f", + "0x2faf", + "0x2f77", + "0x2f68", + "0x2f5c", + "0x2f82", + "0x2fac", + "0x2fa1", + "0x2f95", + "0x327", + "0x328", + "0x2fbd", + "0x3001", + "0x2ff5", + "0x2fec", + "0x300c", + "0x3030", + "0x3028", + "0x301c", + "0x30a6", + "0x306e", + "0x3060", + "0x3055", + "0x307a", + "0x30a0", + "0x3096", + "0x3086", + "0x329", + "0x30f5", + "0x32b", + "0x30d6", + "0x32c", + "0x32d", + "0x32e", + "0x30db", + "0x32f", + "0x330", + "0x30ea", + "0x331", + "0x332", + "0x333", + "0x334", + "0x335", + "0x311b", + "0x3130", + "0x310f", + "0x3115", + "0x3124", + "0x312a", + "0x3139", + "0x3140", + "0x314b", + "0x336", + "0x337", + "0x31ab", + "0x338", + "0x339", + "0x33a", + "0x31a3", + "0x319c", + "0x33b", + "0x33c", + "0x33d", + "0x31f1", + "0x326d", + "0x3205", + "0x320a", + "0x325b", + "0x3215", + "0x321a", + "0x3248", + "0x33e", + "0x3236", + "0x33f", + "0x340", + "0x341", + "0x342", + "0x343", + "0x344", + "0x32ce", + "0x3289", + "0x328e", + "0x32c3", + "0x345", + "0x329f", + "0x346", + "0x32bc", + "0x32ba", + "0x347", + "0x348", + "0x349", + "0x34a", + "0x34b", + "0x34c", + "0x34d", + "0x34e", + "0x34f", + "0x33a2", + "0x350", + "0x3398", + "0x338c", + "0x3382", + "0x3376", + "0x351", + "0x336c", + "0x3360", + "0x330d", + "0x3312", + "0x3340", + "0x352", + "0x353", + "0x3336", + "0x355", + "0x332e", + "0x356", + "0x357", + "0x3349", + "0x358", + "0x359", + "0x35a", + "0x35b", + "0x35c", + "0x3354", + "0x35d", + "0x35e", + "0x360", + "0x361", + "0x362", + "0x363", + "0x364", + "0x365", + "0x366", + "0x367", + "0x368", + "0x33fb", + "0x369", + "0x36a", + "0x36b", + "0x36c", + "0x36d", + "0x36e", + "0x36f", + "0x385b", + "0x370", + "0x343f", + "0x372", + "0x373", + "0x374", + "0x375", + "0x3832", + "0x3808", + "0x3536", + "0x376", + "0x3515", + "0x34a8", + "0x377", + "0x378", + "0x379", + "0x37a", + "0x34f9", + "0x34db", + "0x37b", + "0x37c", + "0x358f", + "0x37d", + "0x3566", + "0x37e", + "0x37eb", + "0x37c8", + "0x37f", + "0x35a9", + "0x35af", + "0x35b5", + "0x35ba", + "0x37b4", + "0x3799", + "0x3603", + "0x364a", + "0x377a", + "0x35f2", + "0x35ea", + "0x3789", + "0x36b6", + "0x376e", + "0x360d", + "0x3611", + "0x3639", + "0x362a", + "0x375b", + "0x3744", + "0x3731", + "0x371f", + "0x370a", + "0x36f5", + "0x369a", + "0x36b0", + "0x380", + "0x381", + "0x36e9", + "0x382", + "0x383", + "0x385", + "0x36d9", + "0x386", + "0x387", + "0x388", + "0x389", + "0x38a", + "0x3895", + "0x38b", + "0x38a9", + "0x38bd", + "0x38c", + "0x3961", + "0x38d", + "0x3954", + "0x38e", + "0x390", + "0x3946", + "0x391", + "0x392", + "0x393", + "0x394", + "0x395", + "0x3938", + "0x396", + "0x392d", + "0x397", + "0x398", + "0x38fa", + "0x38f7", + "0x399", + "0x39a", + "0x38fb", + "0x39b", + "0x39c", + "0x39d", + "0x39e", + "0x390d", + "0x3923", + "0x3920", + "0x3925", + "0x39f", + "0x3a0", + "0x3a1", + "0x3982", + "0x398b", + "0x3a60", + "0x3a2", + "0x39ae", + "0x399f", + "0x3a3", + "0x3a67", + "0x39aa", + "0x39b5", + "0x39c7", + "0x39d0", + "0x3a50", + "0x39f2", + "0x39e4", + "0x3a57", + "0x39ee", + "0x39f9", + "0x3a4", + "0x3a5", + "0x3a47", + "0x3a6", + "0x3a7", + "0x3a37", + "0x3a8", + "0x3a9", + "0x3aa", + "0x3a2e", + "0x3ab", + "0x3ac", + "0x3a22", + "0x3ad", + "0x3ae", + "0x3af", + "0x3b0", + "0x3b1", + "0x3b2", + "0x3b3", + "0x3b4", + "0x3b5", + "0x3b7", + "0x3b8", + "0x3b9", + "0x3b09", + "0x3ba", + "0x3bb", + "0x3bc", + "0x3b03", + "0x3bd", + "0x3af4", + "0x3be", + "0x3bf", + "0x3aed", + "0x3c0", + "0x3c1", + "0x3ae1", + "0x3c2", + "0x3c3", + "0x3c4", + "0x3c5", + "0x3c6", + "0x3c7", + "0x3c8", + "0x3c9", + "0x3ca", + "0x3ad2", + "0x3cb", + "0x3ac8", + "0x3cc", + "0x3cd", + "0x3ce", + "0x3cf", + "0x3d0", + "0x3d1", + "0x3d2", + "0x3d3", + "0x3d5", + "0x3d6", + "0x3b10", + "0x3d7", + "0x3d8", + "0x3d9", + "0x3bc3", + "0x3da", + "0x3db", + "0x3bba", + "0x3dc", + "0x3bb2", + "0x3dd", + "0x3de", + "0x3bab", + "0x3df", + "0x3ba4", + "0x3e0", + "0x3b90", + "0x3e1", + "0x3b80", + "0x3e2", + "0x3e4", + "0x3b78", + "0x3e5", + "0x3e6", + "0x3e8", + "0x3b9c", + "0x3e9", + "0x3ea", + "0x3eb", + "0x3ec", + "0x3ed", + "0x3cc3", + "0x3ee", + "0x3cb7", + "0x3ef", + "0x3f1", + "0x3ca7", + "0x3c99", + "0x3f2", + "0x3bf6", + "0x3f3", + "0x3f4", + "0x3f5", + "0x3f6", + "0x3f7", + "0x3c85", + "0x3f8", + "0x3f9", + "0x3fa", + "0x3c16", + "0x3c1c", + "0x3c24", + "0x3c36", + "0x3fb", + "0x3c2e", + "0x3c70", + "0x3fc", + "0x3c65", + "0x3c5b", + "0x3fe", + "0x3c52", + "0x3ff", + "0x401", + "0x402", + "0x3caf", + "0x403", + "0x3cd6", + "0x3cdb", + "0x3d10", + "0x3d0b", + "0x3ce9", + "0x3cee", + "0x3d01", + "0x3cfb", + "0x3d18", + "0x3d05", + "0x3d13", + "0x3d99", + "0x3d20", + "0x3d25", + "0x3d5a", + "0x3d55", + "0x3d33", + "0x3d38", + "0x3d4b", + "0x3d45", + "0x3d62", + "0x3d4f", + "0x3d5d", + "0x3d91", + "0x3d6a", + "0x3d6f", + "0x3d87", + "0x3d7b", + "0x3d80", + "0x404", + "0x405", + "0x406", + "0x407", + "0x3de3", + "0x3daf", + "0x408", + "0x409", + "0x40a", + "0x40b", + "0x3db9", + "0x3dbe", + "0x3dd6", + "0x40c", + "0x3dd1", + "0x3ddb", + "0x40d", + "0x40e", + "0x3ee9", + "0x40f", + "0x410", + "0x3e00", + "0x411", + "0x412", + "0x413", + "0x3e05", + "0x414", + "0x415", + "0x3ed6", + "0x416", + "0x417", + "0x3e2b", + "0x3e2f", + "0x3e80", + "0x3e1d", + "0x3e58", + "0x418", + "0x419", + "0x3e32", + "0x3e39", + "0x3e3e", + "0x3e43", + "0x3e47", + "0x3e72", + "0x3e65", + "0x41a", + "0x41b", + "0x3ecc", + "0x3ebd", + "0x3ec2", + "0x41c", + "0x41d", + "0x3f3f", + "0x41e", + "0x3f06", + "0x41f", + "0x3f0b", + "0x421", + "0x422", + "0x3f34", + "0x423", + "0x424", + "0x3f1f", + "0x3f2b", + "0x425", + "0x426", + "0x427", + "0x428", + "0x429", + "0x42a", + "0x42b", + "0x3f64", + "0x3f6e", + "0x3f86", + "0x42c", + "0x3f8c", + "0x42d", + "0x42e", + "0x3f7f", + "0x3f8f", + "0x42f", + "0x430", + "0x3ff0", + "0x431", + "0x432", + "0x433", + "0x3fa1", + "0x3fa6", + "0x3fab", + "0x3fb0", + "0x3fb5", + "0x3fba", + "0x3fbf", + "0x3fc4", + "0x3fc9", + "0x3fce", + "0x3fd3", + "0x3fd8", + "0x3fdd", + "0x3fe2", + "0x3fe7", + "0x3feb", + "0x434", + "0x435", + "0x436", + "0x437", + "0x439", + "0x43a", + "0x43b", + "0x43c", + "0x43e", + "0x43f", + "0x440", + "0x441", + "0x442", + "0x443", + "0x444", + "0x445", + "0x446", + "0x447", + "0x4038", + "0x4009", + "0x400e", + "0x449", + "0x402d", + "0x44a", + "0x4024", + "0x44b", + "0x44c", + "0x44d", + "0x44e", + "0x404f", + "0x4054", + "0x40b1", + "0x40ad", + "0x4067", + "0x406c", + "0x40a5", + "0x4076", + "0x407b", + "0x409c", + "0x4085", + "0x408a", + "0x4093", + "0x450", + "0x451", + "0x452", + "0x453", + "0x40b5", + "0x40ef", + "0x40c9", + "0x454", + "0x455", + "0x457", + "0x40e7", + "0x40dd", + "0x458", + "0x459", + "0x41d3", + "0x4133", + "0x45a", + "0x45b", + "0x4149", + "0x45d", + "0x45e", + "0x45f", + "0x41c7", + "0x41b9", + "0x460", + "0x41b0", + "0x41a8", + "0x424d", + "0x424b", + "0x41f8", + "0x41fd", + "0x421c", + "0x4212", + "0x4224", + "0x4311", + "0x423d", + "0x4236", + "0x42a4", + "0x424e", + "0x4309", + "0x4266", + "0x4270", + "0x4275", + "0x42f9", + "0x4280", + "0x4285", + "0x42e8", + "0x429b", + "0x42d3", + "0x42c0", + "0x43fe", + "0x4334", + "0x461", + "0x462", + "0x463", + "0x464", + "0x465", + "0x43ed", + "0x466", + "0x43e2", + "0x468", + "0x43d0", + "0x469", + "0x46a", + "0x46b", + "0x46c", + "0x43c5", + "0x46d", + "0x46e", + "0x4380", + "0x4385", + "0x46f", + "0x4390", + "0x4393", + "0x43b6", + "0x43a4", + "0x471", + "0x472", + "0x473", + "0x4505", + "0x474", + "0x44f9", + "0x475", + "0x476", + "0x477", + "0x44e9", + "0x44db", + "0x4438", + "0x478", + "0x479", + "0x47a", + "0x44c7", + "0x4458", + "0x445e", + "0x4466", + "0x4478", + "0x4470", + "0x44b2", + "0x47b", + "0x44a7", + "0x449d", + "0x47c", + "0x4494", + "0x47e", + "0x47f", + "0x44f1", + "0x480", + "0x481", + "0x458b", + "0x482", + "0x483", + "0x484", + "0x485", + "0x486", + "0x487", + "0x488", + "0x489", + "0x48a", + "0x48b", + "0x457b", + "0x48c", + "0x48d", + "0x48e", + "0x48f", + "0x490", + "0x4573", + "0x491", + "0x492", + "0x493", + "0x494", + "0x495", + "0x456d", + "0x496", + "0x455b", + "0x497", + "0x498", + "0x49a", + "0x49b", + "0x4582", + "0x49c", + "0x49d", + "0x49f", + "0x4a0", + "0x4a1", + "0x4a2", + "0x4a3", + "0x4a4", + "0x4a5", + "0x4a6", + "0x4a7", + "0x4a9", + "0x4aa", + "0x4ab", + "0x4ac", + "0x4ae", + "0x4af", + "0x4b0", + "0x4b1", + "0x4b2", + "0x4b3", + "0x4b4", + "0x4b5", + "0x4b6", + "0x4b8", + "0x4b9", + "0x4ba", + "0x4bb", + "0x4bd", + "0x4be", + "0x4bf", + "0x4c0", + "0x4c1", + "0x4c2", + "0x4c3", + "0x4c4", + "0x4c5", + "0x4c6", + "0x4c7", + "0x4c8", + "0x4c9", + "0x4ca", + "0x4cb", + "0x4cc", + "0x4cd", + "0x4ce", + "0x4cf", + "0x4d0", + "0x4d1", + "0x4d2", + "0x4d3", + "0x4d4", + "0x4d5", + "0x4d7", + "0x4d8", + "0x4d9", + "0x4660", + "0x4664", + "0x4678", + "0x4681", + "0x477f", + "0x4da", + "0x4696", + "0x4db", + "0x4dc", + "0x4dd", + "0x46a6", + "0x4773", + "0x4de", + "0x476c", + "0x4df", + "0x4e0", + "0x46c0", + "0x4e1", + "0x4e2", + "0x4e3", + "0x46e3", + "0x4e4", + "0x4e5", + "0x4758", + "0x4e6", + "0x4e7", + "0x4e8", + "0x4744", + "0x4e9", + "0x4732", + "0x4721", + "0x4786", + "0x4ea", + "0x4eb", + "0x4ec", + "0x47c1", + "0x4ed", + "0x4ee", + "0x4ef", + "0x47ba", + "0x4f0", + "0x4f1", + "0x47b3", + "0x4f2", + "0x4f3", + "0x4f4", + "0x486c", + "0x485a", + "0x47e0", + "0x4f5", + "0x4f6", + "0x4f7", + "0x4848", + "0x4837", + "0x4825", + "0x4f8", + "0x4806", + "0x4f9", + "0x4814", + "0x4fa", + "0x4fb", + "0x4fc", + "0x4fd", + "0x4fe", + "0x4af9", + "0x4ff", + "0x500", + "0x4ae5", + "0x501", + "0x4acb", + "0x502", + "0x503", + "0x4ab1", + "0x504", + "0x505", + "0x4a97", + "0x507", + "0x508", + "0x4a7b", + "0x509", + "0x50a", + "0x50b", + "0x50c", + "0x4a66", + "0x50d", + "0x50e", + "0x4a4d", + "0x4a34", + "0x4a1a", + "0x4a07", + "0x50f", + "0x49f1", + "0x49db", + "0x49c4", + "0x49b4", + "0x510", + "0x49a2", + "0x4990", + "0x497d", + "0x4971", + "0x512", + "0x513", + "0x514", + "0x515", + "0x516", + "0x517", + "0x4987", + "0x518", + "0x519", + "0x51a", + "0x49d2", + "0x4a2b", + "0x4a8e", + "0x51b", + "0x51c", + "0x4b3a", + "0x4b1d", + "0x4b22", + "0x4b30", + "0x51d", + "0x51e", + "0x51f", + "0x520", + "0x521", + "0x522", + "0x4d51", + "0x523", + "0x524", + "0x4d48", + "0x525", + "0x527", + "0x4b7a", + "0x528", + "0x529", + "0x52a", + "0x4d38", + "0x52b", + "0x52c", + "0x4ba0", + "0x4d28", + "0x52d", + "0x52e", + "0x4bc4", + "0x4d18", + "0x52f", + "0x530", + "0x4be8", + "0x4d08", + "0x531", + "0x532", + "0x4c0c", + "0x4cf8", + "0x533", + "0x534", + "0x4c30", + "0x4ce8", + "0x535", + "0x536", + "0x4c54", + "0x4cd8", + "0x537", + "0x4cca", + "0x538", + "0x539", + "0x53a", + "0x53b", + "0x4cc3", + "0x53d", + "0x53e", + "0x53f", + "0x540", + "0x541", + "0x542", + "0x543", + "0x544", + "0x545", + "0x546", + "0x547", + "0x548", + "0x549", + "0x54a", + "0x54b", + "0x54c", + "0x4cbc", + "0x54d", + "0x54e", + "0x54f", + "0x4cb5", + "0x550", + "0x4d85", + "0x552", + "0x4d6c", + "0x553", + "0x554", + "0x4d71", + "0x555", + "0x556", + "0x4d7b", + "0x557", + "0x558", + "0x559", + "0x55a", + "0x4e6b", + "0x4e5f", + "0x4e4c", + "0x4e3a", + "0x4e27", + "0x4e14", + "0x4e02", + "0x55b", + "0x55c", + "0x55d", + "0x4df6", + "0x55e", + "0x55f", + "0x4de4", + "0x560", + "0x561", + "0x562", + "0x563", + "0x564", + "0x4e8d", + "0x4e92", + "0x4e9c", + "0x4ea1", + "0x4ea8", + "0x4ead", + "0x4eb4", + "0x4eb7", + "0x4ebe", + "0x4ec3", + "0x4ec8", + "0x4ecb", + "0x4ed0", + "0x4ed3", + "0x4eda", + "0x4edf", + "0x4ee4", + "0x4ee7", + "0x566", + "0x567", + "0x568", + "0x569", + "0x56a", + "0x56b", + "0x56c", + "0x4f35", + "0x56d", + "0x56e", + "0x4f87", + "0x4f80", + "0x4fdd", + "0x4fd3", + "0x505c", + "0x4ff7", + "0x4ffc", + "0x5051", + "0x5009", + "0x500d", + "0x5016", + "0x501a", + "0x5039", + "0x5026", + "0x502b", + "0x5035", + "0x5049", + "0x5040", + "0x56f", + "0x570", + "0x571", + "0x572", + "0x50a7", + "0x573", + "0x574", + "0x5078", + "0x575", + "0x576", + "0x577", + "0x507d", + "0x578", + "0x579", + "0x509c", + "0x57a", + "0x57b", + "0x57c", + "0x5093", + "0x57d", + "0x57e", + "0x57f", + "0x580", + "0x581", + "0x50c9", + "0x582", + "0x583", + "0x584", + "0x5150", + "0x5121", + "0x511b", + "0x5115", + "0x510f", + "0x5109", + "0x586", + "0x5103", + "0x587", + "0x50ff", + "0x588", + "0x5107", + "0x589", + "0x510d", + "0x5113", + "0x5119", + "0x511f", + "0x5125", + "0x5138", + "0x5140", + "0x5156", + "0x58b", + "0x58c", + "0x51ac", + "0x518f", + "0x58d", + "0x517f", + "0x5171", + "0x58e", + "0x58f", + "0x519e", + "0x590", + "0x591", + "0x5301", + "0x51d3", + "0x51dc", + "0x52f6", + "0x592", + "0x51f0", + "0x593", + "0x594", + "0x51fe", + "0x52e9", + "0x52e4", + "0x595", + "0x5217", + "0x596", + "0x5232", + "0x597", + "0x5255", + "0x52d0", + "0x52bd", + "0x52ab", + "0x529a", + "0x598", + "0x599", + "0x532d", + "0x59a", + "0x5323", + "0x59b", + "0x59c", + "0x59d", + "0x59e", + "0x5363", + "0x59f", + "0x5346", + "0x534b", + "0x5359", + "0x53b7", + "0x53ae", + "0x539f", + "0x5390", + "0x5a0", + "0x5a2", + "0x5a3", + "0x5487", + "0x5a4", + "0x547a", + "0x5476", + "0x5a5", + "0x53e8", + "0x5a6", + "0x5a7", + "0x5444", + "0x5435", + "0x540c", + "0x542e", + "0x5422", + "0x5a8", + "0x5a9", + "0x5468", + "0x545e", + "0x5480", + "0x550f", + "0x5501", + "0x54b1", + "0x54f3", + "0x54e6", + "0x54d8", + "0x54d0", + "0x562d", + "0x5528", + "0x552d", + "0x5622", + "0x5537", + "0x553c", + "0x5611", + "0x5546", + "0x554b", + "0x55ff", + "0x5555", + "0x555a", + "0x55ec", + "0x5aa", + "0x55da", + "0x5ab", + "0x55c8", + "0x55b6", + "0x5ac", + "0x55a5", + "0x5594", + "0x5584", + "0x5ad", + "0x5ae", + "0x5af", + "0x5b0", + "0x5b1", + "0x5b2", + "0x5b3", + "0x5b4", + "0x5b5", + "0x5b6", + "0x5b7", + "0x5b8", + "0x5b9", + "0x5ba", + "0x5bb", + "0x5bc", + "0x5bd", + "0x5be", + "0x5bf", + "0x5c0", + "0x5c1", + "0x5c2", + "0x5c3", + "0x5c4", + "0x5c5", + "0x5c6", + "0x5c7", + "0x5c8", + "0x5c9", + "0x5ca", + "0x5cb", + "0x5cc", + "0x5cd", + "0x5ce", + "0x5cf", + "0x5d0", + "0x5d1", + "0x5d2", + "0x5d3", + "0x5d4", + "0x5d5", + "0x5d6", + "0x5d7", + "0x5d8", + "0x5d9", + "0x5da", + "0x5db", + "0x5dd", + "0x5de", + "0x5df", + "0x5e0", + "0x5e1", + "0x5e2", + "0x5e3", + "0x5e5", + "0x5e6", + "0x5e7", + "0x5e8", + "0x5e9", + "0x5ea", + "0x5eb", + "0x5ec", + "0x5ed", + "0x5ee", + "0x5f0", + "0x59e7", + "0x59d6", + "0x5f1", + "0x5f2", + "0x5f3", + "0x5719", + "0x5f4", + "0x5f5", + "0x5f7", + "0x5f8", + "0x59c7", + "0x5f9", + "0x5fa", + "0x59bd", + "0x59b2", + "0x5fc", + "0x5fd", + "0x5fe", + "0x599f", + "0x5ff", + "0x598b", + "0x5765", + "0x5768", + "0x5977", + "0x5962", + "0x5785", + "0x5788", + "0x594e", + "0x5939", + "0x57a5", + "0x57a8", + "0x5925", + "0x5910", + "0x57c5", + "0x57c8", + "0x58fc", + "0x58e7", + "0x57e5", + "0x57e8", + "0x58d3", + "0x58be", + "0x5805", + "0x5808", + "0x58aa", + "0x5895", + "0x5825", + "0x5828", + "0x5882", + "0x586f", + "0x5847", + "0x584a", + "0x585d", + "0x601", + "0x602", + "0x59d0", + "0x5ae0", + "0x603", + "0x5a04", + "0x604", + "0x605", + "0x606", + "0x5a09", + "0x607", + "0x5ad5", + "0x609", + "0x5a2c", + "0x60a", + "0x60b", + "0x60c", + "0x5ac4", + "0x60d", + "0x5a52", + "0x5ab3", + "0x60e", + "0x5a78", + "0x5aa2", + "0x60f", + "0x5a92", + "0x610", + "0x611", + "0x5c1b", + "0x5b09", + "0x5b12", + "0x5c0b", + "0x5b27", + "0x5b30", + "0x5c05", + "0x5b45", + "0x5b61", + "0x5b6a", + "0x5bcb", + "0x5bba", + "0x5b8a", + "0x5bb3", + "0x5ba5", + "0x612", + "0x5bf5", + "0x5bea", + "0x5c13", + "0x5c7e", + "0x5c3f", + "0x5c76", + "0x5c47", + "0x5c4b", + "0x5c72", + "0x5c5b", + "0x5c6f", + "0x5c67", + "0x5c6d", + "0x613", + "0x5c7a", + "0x5c88", + "0x5c8e", + "0x5c95", + "0x614", + "0x615", + "0x5cc5", + "0x5ca6", + "0x5cab", + "0x5cba", + "0x5ce5", + "0x5d3d", + "0x5d33", + "0x5d28", + "0x5cff", + "0x5d21", + "0x5d18", + "0x5d0e", + "0x5d74", + "0x5d68", + "0x5d5a", + "0x5df9", + "0x5d94", + "0x617", + "0x618", + "0x619", + "0x5de8", + "0x5dd6", + "0x5dc6", + "0x5db6", + "0x5f2e", + "0x5e1a", + "0x61b", + "0x5f1d", + "0x5f0e", + "0x61c", + "0x5f05", + "0x5ef3", + "0x5ee3", + "0x61d", + "0x5ed9", + "0x5ec6", + "0x5eb5", + "0x5e52", + "0x5e55", + "0x5ea1", + "0x5e8f", + "0x5e66", + "0x5e69", + "0x5e6e", + "0x5e71", + "0x5e7f", + "0x61f", + "0x6232", + "0x5f50", + "0x6221", + "0x620", + "0x6216", + "0x6204", + "0x61f1", + "0x61dd", + "0x61ca", + "0x5fa9", + "0x5fac", + "0x5fb1", + "0x5fb4", + "0x61b7", + "0x5fc3", + "0x5fc6", + "0x61a4", + "0x5fd5", + "0x5fd8", + "0x6191", + "0x621", + "0x6184", + "0x6170", + "0x615b", + "0x6145", + "0x6027", + "0x602a", + "0x6031", + "0x6034", + "0x6131", + "0x611d", + "0x6109", + "0x60f5", + "0x606d", + "0x6070", + "0x60e2", + "0x60cf", + "0x60bd", + "0x60ab", + "0x622", + "0x6254", + "0x623", + "0x62d3", + "0x624", + "0x6277", + "0x625", + "0x62c2", + "0x626", + "0x629b", + "0x62b6", + "0x627", + "0x628", + "0x62f4", + "0x629", + "0x6373", + "0x62a", + "0x6317", + "0x6362", + "0x62c", + "0x633b", + "0x6356", + "0x62d", + "0x6394", + "0x62e", + "0x6431", + "0x62f", + "0x63b7", + "0x630", + "0x6420", + "0x63db", + "0x640f", + "0x6403", + "0x631", + "0x6452", + "0x632", + "0x64ef", + "0x6475", + "0x64de", + "0x633", + "0x6499", + "0x64cd", + "0x64c1", + "0x639", + "0x6b6", + "0x74f", + "0x887", + "0x902", + "0x9a1", + "0xa2f", + "0xae6", + "0xb2a", + "0xc0c", + "0xc9d", + "0xcef", + "0xd37", + "0xe9a", + "0x1089", + "0x115f", + "0x13e8", + "0x1552", + "0x15b3", + "0x16b1", + "0x173e", + "0x1844", + "0x18ac", + "0x1a07", + "0x1c0a", + "0x1d12", + "0x1d72", + "0x1e27", + "0x1e82", + "0x1f7c", + "0x209c", + "0x20ef", + "0x2127", + "0x216c", + "0x23f2", + "0x2465", + "0x24c1", + "0x253d", + "0x264e", + "0x27ed", + "0x29d9", + "0x2ae4", + "0x2cab", + "0x2cef", + "0x2d6b", + "0x30ca", + "0x3103", + "0x3151", + "0x31b7", + "0x31f8", + "0x327d", + "0x32dc", + "0x33ae", + "0x3886", + "0x396d", + "0x3a70", + "0x3b16", + "0x3bcd", + "0x3ccf", + "0x3da0", + "0x3df2", + "0x3efa", + "0x3f4e", + "0x3f96", + "0x3ffb", + "0x4048", + "0x40ba", + "0x40fe", + "0x41e2", + "0x431d", + "0x440f", + "0x4511", + "0x4597", + "0x4654", + "0x47c8", + "0x487d", + "0x4b11", + "0x4b48", + "0x4d60", + "0x4d93", + "0x4e7d", + "0x4ef3", + "0x4f3c", + "0x4f8f", + "0x4feb", + "0x506c", + "0x50b6", + "0x51bd", + "0x5311", + "0x533a", + "0x5371", + "0x53c6", + "0x5495", + "0x551c", + "0x563b", + "0x56fe", + "0x59f8", + "0x5aef", + "0x5c29", + "0x5c9a", + "0x5cd3", + "0x5d44", + "0x5d82", + "0x5e09", + "0x5f3d", + "0x6243", + "0x62e3", + "0x6383", + "0x6441", + "0x34a00", + "0x7006005004003009007006005004003008007006005004003002001000", + "0x300d00700600500400300c00700600500400300b00700600500400300a", + "0x500400301000700600500400300f00700600500400300e007006005004", + "0x7014005004003013007006005004003012007006005004003011007006", + "0x3018007006005004003017007006005004003016007006005004003015", + "0x500400301c00701b00500400301a007006005004003019007006005004", + "0x701b00500400301f00701b00500400301e00701b00500400301d007014", + "0x502a02602902802702602502401b00502302202100701b005004003020", + "0x2402c00501b00503200502702603102403002f01b00502e02d02c00502b", + "0x503702603402803600503500502702603402401400502e02d033026025", + "0x701b00500400303b00701b00500400303a00701b005004003039005038", + "0x303f00701b00500400303e00701b00500400303d00701b00500400303c", + "0x500400304200701b00500400304100701b00500400304000701b005004", + "0x701b00500400304500701b00500400304400701b00500400304300701b", + "0x304900701b00500400304800701b00500400304700701b005004003046", + "0x500400304c00701b00500400304b00701b00500400304a00701b005004", + "0x701b00500400304f00701b00500400304e00701b00500400304d00701b", + "0x305300701b00500400305200701b00500400305100701b005004003050", + "0x500400305600701b00500400305500701b00500400305400701b005004", + "0x701b00500400305900701b00500400305800701b00500400305700701b", + "0x305d00701b00500400305c00701b00500400305b00701b00500400305a", + "0x500400306000701b00500400305f00701b00500400305e00701b005004", + "0x701b00500400306300701b00500400306200701b00500400306100701b", + "0x306700701b00500400306600701b00500400306500701b005004003064", + "0x500400306a00701b00500400306900701b00500400306800701b005004", + "0x701b00500400306d00701b00500400306c00701b00500400306b00701b", + "0x307100701b00500400307000701b00500400306f00701b00500400306e", + "0x500400307400701b00500400307300701b00500400307200701b005004", + "0x701b00500400307700701b00500400307600701b00500400307500701b", + "0x307b00701b00500400307a00701b00500400307900701b005004003078", + "0x500400302600707d00500400300700707d00500400307c00701b005004", + "0x701b00500400307f00701b00500400300e00701b00500400307e00701b", + "0x7084005004003085007084005004003083005082005081005080003018", + "0x308800701b005004003087007014005004003086007014005004003005", + "0x502302208b00701b00500400308a00701b00500400308900701b005004", + "0x2609002403008f08e00701400500400302c00508d00508c026029028081", + "0x26029028006005006005092026029024006005006005006005006005091", + "0x501a00508100508000309400508100502702602902402c00502c005093", + "0x502309700700700600500400302c00507d005096026029028030095083", + "0x509c00509b00502702603102407d00502e02d09a005099026098024032", + "0x509f02603402809b00502702609802403900509e00509d02603402802c", + "0x701b0050040030a200701b0050040030a100701b0050040030390050a0", + "0x30a600701b0050040030a500701b0050040030a400701b0050040030a3", + "0x50a902609802409c0050230970a800701b0050040030a700701b005004", + "0x30390050ad0050ac02603402802c0050320050ab0050270260310240aa", + "0x500400301f00708400500400307a00708400500400301e007084005004", + "0x708400500400307c00708400500400302000708400500400307b007084", + "0x30b00070840050040030af0070840050040030ae007084005004003021", + "0xb50300b40b30070840050040030b20070840050040030b1007084005004", + "0x707d0050040030b70070840050040030b6007084005004003084005023", + "0x50040030bb00701b0050040030ba00701b0050040030840050b90b801a", + "0x50be02603402801b0050270260980240bd00701b0050040030bc00701b", + "0x701b0050040030c000701b00500400301600701b0050040030390050bf", + "0x30390050c20050c102603402802c00501b00509c005027026031024039", + "0x500400307d0050b90b80c20050b90b801b0050b90b80c300701b005004", + "0x240390050c60050c502603402802c00509c0050270260340240c400707d", + "0x50040030390050c80050c702603402802c00508100509c005027026031", + "0x300f00701b00500400301b0050230b50ca00701b0050040030c9007014", + "0x30cd00707d0050040030cc00707d0050040030830050cb005081005080", + "0x50040030d000707d0050040030cf00707d0050040030ce00707d005004", + "0x707d0050040030d300707d0050040030d200707d0050040030d100707d", + "0x30d600707d00500400308100707d0050040030d500707d0050040030d4", + "0x50040030d800707d0050040030d700707d00500400300600707d005004", + "0x707d0050040030da00707d0050040030d900707d00500400308d00707d", + "0x30de00707d0050040030dd00707d0050040030dc00707d0050040030db", + "0x50040030e100707d0050040030e000707d0050040030df00707d005004", + "0x707d0050040030e400707d0050040030e300707d0050040030e200707d", + "0x30e800707d0050040030e700707d0050040030e600707d0050040030e5", + "0x50040030eb00707d0050040030ea00707d0050040030e900707d005004", + "0x707d0050040030ee00707d0050040030ed00707d0050040030ec00707d", + "0x30f200707d0050040030f100707d0050040030f000707d0050040030ef", + "0x50040030f500707d0050040030f400707d0050040030f300707d005004", + "0x707d0050040030f800707d0050040030f700707d0050040030f600707d", + "0x30fc00707d0050040030fb00707d0050040030fa00707d0050040030f9", + "0x50040030ff00707d0050040030fe00707d0050040030fd00707d005004", + "0x707d00500400310200707d00500400310100707d00500400310000707d", + "0x310600707d00500400310500707d00500400310400707d005004003103", + "0x2407a00510802609802401e00502309708400502e02d107007014005004", + "0x708400500400303900510a00510902603402802c00501e005027026034", + "0x502702603102410d00510c02609802410b00502309708100502e02d026", + "0x511100508100508000303900511000510f02603402802c00501e00510e", + "0x7006005004003115007006005004003114005113005081005080003112", + "0x26098024036005023097118007006005004003117007006005004003116", + "0x501400511e00511d00502702609002403011c11b02602502411a005119", + "0x701400500400312100701400500400303900512000511f02603402802c", + "0x51260051250051240031230070140050040030d4007014005004003122", + "0x312c00701400500400312b00512a005129005125005124003128005127", + "0x500400312f00701400500400312e00701400500400312d007014005004", + "0x50b90b813300502309713200502e02d131007014005004003130007014", + "0x3137007006005004003136007006005004003135007014005004003134", + "0x500400313a007006005004003139007006005004003138007006005004", + "0x700600500400313d00700600500400313c00700600500400313b007006", + "0x30ae0070060050040030b00070060050040030b20070060050040030b6", + "0x2613e02807a00700600500400307b00700600500400307c007006005004", + "0x502c00502c00502c00502c00502c00502c00502c00502c00502c00513f", + "0x2201c00702600709814002c00502c00502c00502c00502c00502c00502c", + "0x502302214300701400500400302c00514200514102602902807d005023", + "0x700600500400314700701400500400302c005146005145026029028144", + "0x314c00514b00508100508000314a005149005081005080003002148005", + "0x500400314f00700600500400314e00700600500400314d007006005004", + "0x5004003153007014005004003152005151005081005080003150007006", + "0x2802c00501b005081005027026156024155007006005004003154007006", + "0x509c00502702603102403600701b005004003039005158005157026034", + "0x509c0050ab00502702603102403900515a00515902603402802c00509c", + "0x315e0050b90b809c00502702615d02403900515c00515b02603402802c", + "0x500400316100701400500400316000701400500400315f007014005004", + "0x9701b00507d00509c00516202603102400500707d00500400300a00707d", + "0x2603402816500502702615d02402c005163005164026034028163005023", + "0x502c00502c00502c00502c00502c005169026168028039005167005166", + "0x516a02602902802c00502c00502c00502c00502c00502c00502c00502c", + "0x2803900516e00516d02603402816c00501b00502702602902416b00502c", + "0x317100707d00500400317000707d00500400303900515e00516f026034", + "0x26098024014005174026098024173007014005004003172007014005004", + "0x517a005179026029028030178039005177005176026034028175005027", + "0x508100508000303900517d00517c02603402817b00502702609802402c", + "0x500400318000700600500400308300508300508100508000317f00517e", + "0xb5185007014005004003184007014005004003030183030182181007006", + "0x7014005004003188007014005004003187007014005004003186005023", + "0x502c00518c02602902818b00701400500400318a007014005004003189", + "0x500400303900518f00518e02603402818d00501b00502702602902402c", + "0x7014005004003192007014005004003191007014005004003190007014", + "0x260980240140050230b5014005014005014005084005194026090024193", + "0x24199005198005027026029024014005014005197026029024196005195", + "0x502702602902409400508100508100519b02615602417500519a026098", + "0x261a002419f00519f0050ab00519e0261560240810050230b519d00519c", + "0x2602902401b00501b00501b00501b00501b00519d0050ab0050ab0051a1", + "0x502e02d02c0051a70051a60051a50051a40260900281a30051a2005027", + "0x511d0051ad0051ac0261ab0241aa0051a90260980241a800502309711d", + "0x51af0051b10260290281af0050b90b81b00050b90b81af0051ae0051ae", + "0x260340281b300511d00502702603402402c0051a80051b202603402802c", + "0x50b90b81ad0050b90b802c0051ad0051b60260290280390051b50051b4", + "0x241b90070140050040031b80070140050040031b70070140050040031ae", + "0x51bc02603402802c0050360051bb0050270260310241340051ba026098", + "0x701400500400302c0051c00051bf0260290281be0050230220390051bd", + "0x260340280060050270260980240060050230b51c20070140050040031c1", + "0x500400303500701b0050040031c500701b0050040030390051c40051c3", + "0x70140050040031c80070140050040031c70070140050040031c6007014", + "0x51cd0260900241cc0260230281cb0260230281ca0070140050040031c9", + "0x2603402802c0051ce0050ab005027026156024094005014005014005014", + "0x50040031d20070140050040031d10070140050040030390051d00051cf", + "0x260980241d500502309714400502e02d1d40070140050040031d3007014", + "0x51d902602902402c00502c00502c00502c0051d80260900281d70051d6", + "0x1de0390051dd0051dc0260340281db0051da005027026029024144005014", + "0x51e30261680241e20051e10260980241e00050230971df00502e02d030", + "0x511d0050060051e500501400501400501400511d0050060051e4005014", + "0x50140051e70261560240ab0050b90b81e60050b90b811d00501b00501b", + "0x2802c0050ab0051e902602902802c0050810051e8026029028006005084", + "0x51ec0260340281eb00511d00502702603402402c00509c0051ea026034", + "0x2802c00519c0051ef02602902802c00519d0051ee0260290280390051ed", + "0x31f20070140050040031f100701400500400302c0051990051f0026029", + "0x502702609802402c0051f60051f50260290280301f41f3007014005004", + "0x51fa0260340280810050270260980240390051f90051f80260340281f7", + "0x260290280390051fd0051fc02603402816c0050270260980240390051fb", + "0x30390052010052000260340281ff00502702609802401400502c0051fe", + "0x500400302c005204005203026029028132005023022202007014005004", + "0x520a005027026029024209005208026207024206026025024205007014", + "0x2602902402c0051b000520d02602902803900520c00520b0260340281ff", + "0x2400500701b00500400303900521000520f02603402820e00511d005027", + "0x701400500400303900521200521102603402802c0051bb005027026029", + "0x321500701400500400300a007014005004003214007014005004003213", + "0x3217007014005004003216005083005081005080003026007006005004", + "0x508400508400521a026156024219007014005004003218007014005004", + "0x521c02603402801400511d00502702602902421b0070140050040031e4", + "0x701400500400301400501400501400501400521e02609002403900521d", + "0x500400322300522200522100512500512400322000701400500400321f", + "0x7014005004003226007014005004003225007014005004003224007014", + "0x501400501400502702615602422a005229005228005125005124003227", + "0x322d00701400500400322c00701400500400322b007014005004003014", + "0x2822f0070140050040030360050b90b81e40050b90b822e007014005004", + "0x2423200701400500400323100701400500400302c0051bb005230026029", + "0x502c00502c005236026156028235005234026098028014005233026098", + "0x523b02609802823a005239026098024030238237007014005004003014", + "0x523f02609802423e0050230971be00502e02d23d00701400500400323c", + "0x701400500400324200502309701b00501400523e005241026031024240", + "0x500400303900524500524402603402802c005242005027026034024243", + "0x519c00519800524802609002803024724600701400500400302b00701b", + "0x2603102401400524b02609802424a00501400524902602902402c0051a2", + "0x524e02609802403900524d00524c02603402802c005036005036005027", + "0xb825700525600525500525400525300525200525100525002624f028014", + "0x2802c0051a70052580260290282420050b90b81db0050b90b81440050b9", + "0x525b02603402825a00511d00502702602902402c0051a3005259026029", + "0x2825e00511d00502702602902402c0051a200525d02602902803900525c", + "0x502702602902402c0051a600526102602902803900526000525f026034", + "0xb802c0051a500526502602902803900526400526302603402826200511d", + "0x500400303900526700526602603402802c0050270262070241a20050b9", + "0x2d1ae00502302226a007014005004003269007014005004003268007014", + "0x326d00701400500400326c00701400500400326b0050230971ae00502e", + "0x511d00502702603402402c00526b00526f02603402826e007014005004", + "0x701b00500400300a00701b005004003039005272005271026034028270", + "0x50040031aa0050b90b802c00527400527302602902811d005023022007", + "0x2802c0051a80051bb005027026031024276007014005004003275007014", + "0x2427a007014005004003279007014005004003039005278005277026034", + "0x701400500400303900527c00527b02603402801400520a005027026029", + "0x2602902811d0050140051e400527f02615602427e00701400500400327d", + "0x528300528202603402828100511d00502702602902402c005132005280", + "0x2602902402c00528600528502602902802c00524a005284026029028039", + "0x511d00502702602902403900528900528802603402828700511d005027", + "0x328c00701400500400324a0050b90b803900528b00528a026034028286", + "0x529002620702428f02602502428e00701400500400328d007014005004", + "0x260290280390052940052930260340281a8005292005027026034024291", + "0x529800529702603402829600511d00502702602902402c00511d005295", + "0x529a0260290281bb0050840050840050140051e40052990261ab024039", + "0xb803900529e00529d02603402829c00511d00502702602902402c00529b", + "0x2a32a20050b90b80022a12a00050b90b800229f11d0050b90b829b0050b9", + "0x260340280940050270260980242a60050b90b80022a52a40050b90b8002", + "0x52ab0052aa02603402802c00520a0050270262a90240390052a80052a7", + "0x2802c0052ae0050270262a90242ad0260250242ac007014005004003039", + "0x52b20261ab0242b10050230221e60050230220390052b00052af026034", + "0x32b60070140050040032b50050230220140051e40051e40052b40052b3", + "0x50040030050070140050040030070070140050040030c0007014005004", + "0x240302b90302b802600701b0050040032b7007014005004003026007014", + "0x52c00052bf0052be0262bd0242bc0260250242bb0260250242ba026025", + "0x52c302603402802c0052c20050270262a90242ae0052c100529200520a", + "0x282c600511d00502702602902402c0051ae0052c50260290280390052c4", + "0x280140050270260980242c90070140050040030390052c80052c7026034", + "0x502702603402402c0050360052cc0260340280390052cb0052ca026034", + "0xb802c0050140052d00260290280390052cf0052ce0260340282cd00511d", + "0x240390052d20052d102603402802c0050360050270260340240140050b9", + "0x50b90b80022d50390052d40052d30260340281a80052c2005027026034", + "0x2411d0050270260980242d80070140050040032d70070140050040032d6", + "0x50040030302db0390052da0052d90260340280140052c2005027026029", + "0x2402c0051330052df0260340280390052de0052dd0260340282dc007014", + "0x280140050230220390052e20052e10260340282e000511d005027026034", + "0x11d0050052ea0262e90262e80262e72e60022e502c0052e40052e3026029", + "0x11a0050052ec0260072ef0050072ee0140050052ed0260050052ec0262eb", + "0x2ef0050052f20050072ef0050072ee02c0050052f10262f02ef0050052ec", + "0x52ec0140050052f611d0050052f11320050052f50140050052f40262f3", + "0x52f21c50c00052f80140050052ec1330050052ec11d0050052ec2f7005", + "0x2a60050052ec0050072fa0050072ee2e00050052ec2e20050052ea2f9005", + "0x2fa0050052ec2d60050052ec2a20050052ec2a00050052ec2a40050052ec", + "0x52fb11a0050052fb2e00050052f20050072e00050072ee02c0050052fb", + "0x52f10140050052fe2fd0050052fc0140050052f51330050052fb2e4005", + "0x52f12bf0050052f10263013000050052ec0262ff0390050052f1035005", + "0x52f12920050052f12910050052f120a0050052f12090050052f12c0005", + "0x52ea3020050052f208b0c00052f82c20050052f12ae0050052f12c1005", + "0x72ee2de0050052f10360050052fb0360050053032c20050052fb2da005", + "0x2d600500530611d0050052fb3050050052fc3040050052fc0260072fa005", + "0x52ea30b0050052f22d600500530a3090c00052f83080050052fb026307", + "0x2630e11d00500530d1aa00500530c1a80050052fb1a80050053032d4005", + "0x3100050052f230f0c00052f80360050052ec1af0050052ec1af0050052f1", + "0x72ee3110050052ec0260073110050072ee0140050053062d20050052ea", + "0x3130050052f23120c00052f801400500530a3110050052f2005007311005", + "0x52f20050072cd0050072ee0140050052fb2cd0050052ec2cf0050052ea", + "0x52fc2cb0050052ea3150050052f23140c00052f82c20050053032cd005", + "0x52ea31a0050052f23190c00052f83180c00052f83170050052fb316005", + "0x52f231b0c00052f81ae0050052ec1ae0050052fb2c60050052f22c8005", + "0x1b0050052ec3200050052fc02631f31e00700531d2c40050052fb31c005", + "0x1960050052fb3240050052fc02632301400500530c0263223210050052ec", + "0x1440050053030260071440050072ee1440050052ec0070071440050072ee", + "0x3270050052fc3260050052fc3250050052fc1440050052f21440050052fb", + "0x2632b23a0050052fb02632a3290050052fc02b0c00052f83280050052fc", + "0x2b30050052fb2b50050052ea2b50050052ec2b50050052f432c0050052ec", + "0x2c0c00052f823a0050052ec02632e02632d1e40050052fb2b40050052fb", + "0x3300050052fc0350050052fb0390050052ea2b00050052fb32f0050052f2", + "0x2c20050052ea2ab0050052fb3320050052f23310c00052f82b50050052fb", + "0x2ae0050052fb2c10050052fb2920050052fb2c00050052fb2bf0050052fb", + "0x2a60050053060940050052f22a80050052ea3330050052f20320c00052f8", + "0x29b00500530611d0050053062a00050053062a20050053062a4005005306", + "0x380c00052f829c0050052f229e0050052ea3340050052f201b0c00052f8", + "0x11d00500530a2960050052f22980050052ea3350050052f229b00500530a", + "0x29b0050052fb3390050052fb3380050052fb3370050052fb3360050052fb", + "0x2a000500530a0360c00052f80350c00052f829b0050052ec29b005005303", + "0x2940050052ea33a0050052f22a200500530a2a600500530a2a400500530a", + "0x2633f02633e33d0050052fc33c0050052fb33b0050052fb0390050052ec", + "0x52fc0263400260070940050072ee0940050052ec0050070940050072ee", + "0x52ea3430050052f20390c00052f824a0050053063420050052fc341005", + "0x52ea3440050052f20bc0c00052f824a00500530a2860050052f228b005", + "0x52ec24a0050052ec24a0050052fb2860050052fb2870050052f2289005", + "0x2e20050052f10260072e00050072ee3450050052fb0bb0c00052f8286005", + "0x52ea3460050052f20ba0c00052f82f90050052ec0260072f90050072ee", + "0x2b40050052ec0050072f90050072ee1320050052fe2810050052f2283005", + "0x1b0050052fb1e50050052fb0060050052fb1e60050052ea1e60050052f4", + "0x534811d00500530c3020050052ec0050073020050072ee3470050052fc", + "0x52ec1bb0050052f11330050053033490050052fc2e40050052ec014005", + "0x52f62bf0050052f627c0050052ea34a0050052f20c30c00052f81bb005", + "0x52ec2ae0050052f62c10050052f62920050052f620a0050052f62c0005", + "0x72ee2da0050052f134c0050052fc2c40050052ea34b0c00052f81e4005", + "0x34e0c00052f81a80050052ec11d0050052f534d0050052fc026007302005", + "0x30b0050072ee2d40050052f11bb0050052fb2780050052ea34f0050052f2", + "0x3510050052fc3500050052fc00500730b0050072ee30b0050052ec026007", + "0x52ec0260073520050072ee11d0050052ed1af0050052ea1aa005005306", + "0x3520050052f21aa00500530a0050073520050072ee3520050052ec1aa005", + "0x1aa0050052fb3530c00052f801400500530d11d0050052f611d0050052f4", + "0x260073100050072ee2d20050052f13100050052ec0050073100050072ee", + "0x72ee2cf0050052f10260072cd0050072ee1af0050052fb3540050052fb", + "0x52fc11a00500530c0050073130050072ee3130050052ec026007313005", + "0x3580c00052f826b0050052ec1ae0050052f53570050052fc026356355005", + "0x52f20050072700050072ee2700050052ec2720050052ea3590050052f2", + "0x52f135c0050052fc35b0050052fc35a0050052fc26b0050052fb270005", + "0x1ae00500530c0260071ae0050072ee1a50050052f11990050052f1198005", + "0x52ec1ae00500534802635d1ae00500530d26b0050053031ae0050052fe", + "0x72ee2cb0050052f135f0c00052f81ae0050052f61ae0050052f435e005", + "0x52fb0050073150050072ee3600050052fc3150050052ec026007315005", + "0x52fb1320050052ec1320050052f13620050052fc3610050052fc198005", + "0x52fb1a20050053062670050052fb3630050052f207e0c00052f820a005", + "0x2c80050052f10050072c60050072ee3660050052f23650c00052f8364005", + "0x52ea3670050052f21710c00052f831a0050052ec02600731a0050072ee", + "0x52f800500731a0050072ee0050071ae0050072ee2620050052f2264005", + "0x52f81a200500530a25e0050052f22600050052ea3690050052f23680c0", + "0x72ee1a70050052f125a0050052f225c0050052ea36b0050052f236a0c0", + "0x52f200500736c0050072ee1a20050052fb36c0050052ec02600736c005", + "0x260072c60050072ee0c00071ae0050072ee0070071ae0050072ee36c005", + "0x1a50050052ea1ae0050052f21440050053061db005005306242005005306", + "0x72ee19d0050052fb1a60050052ea02600724a0050072ee1990050052fb", + "0x72ee00700724a0050072ee1a30050052fb1a70050052ea00500724a005", + "0x1980050052ea24a0050052f224a00500530c0d50c00052f80c000724a005", + "0x52f81750050052ea19c0050052ea0050071440050072ee01400500536d", + "0x500731c0050072ee3700050052fb36f0050052fb36e0050052fb0d40c0", + "0x52f114400500530c14400500530a0c00071440050072ee31c0050052ec", + "0x52f10d30c00052f81db0050052ec1db00500530c1db00500530a1db005", + "0x3710050052ec3710050052fb3710050053030260073710050072ee251005", + "0x52f81db0050052fb02637324d0050052ea3720050052f20d20c00052f8", + "0x3710050072ee2530050052f10050073710050072ee2520050052f10d10c0", + "0x3740050052fc1be0050052f502600731c0050072ee2c40050052f1007007", + "0x3760050052f20d00c00052f82420050052ec2420050052f13750050052fc", + "0x2420050052fb24200500530324200500530a2450050052ea3770050052fc", + "0x37a0050052f11be00500530d24000500530c24200500537937800500530c", + "0x3780050052fb01b0050052f62400050052fb0cf0c00052f837a0050052ec", + "0x32f0050052ec00500732f0050072ee37c0050052fc02637b23a00500530c", + "0x52f10890073710050072ee0260072570050072ee23c0050052f102637d", + "0x52ec02600737f0050072ee37e0050052fc02600732f0050072ee2b0005", + "0x52fb37f00500530300700737f0050072ee00500737f0050072ee37f005", + "0x72ee0260072540050072ee2350050052f10263800ce0c00052f837f005", + "0x72ee3320050052ec0260073320050072ee2ab0050052f10c0007371005", + "0x2a80050052f137f0050052f23820050052fc3810050052fc005007332005", + "0x263840263830050073330050072ee3330050052ec0260073330050072ee", + "0x840050052fb0050073850050072ee3850050052ec0260073850050072ee", + "0x72ee29b0050052f13850050052f23340050052ec0050073340050072ee", + "0x500729c0050072ee0260073340050072ee29e0050052f102600729c005", + "0x2980050052f10260072960050072ee01400500538701b00500530c026386", + "0x3880050052fc0050073350050072ee3350050052ec0260073350050072ee", + "0x52fb3890050052fc1e40050053060360050053060050072960050072ee", + "0x52fc0cd0c00052f829b0050052f61e400500530a38b0050052fb38a005", + "0x52fc3900050052fc38f0050052fc02638e02638d1250050052ea38c005", + "0x52ec3930050052fb3930050053033930050052f13920050052fc391005", + "0x52f81250050052ec1250050052f10cc0c00052f803600500530a393005", + "0x52fc1e400500530c29b0050052ea21d0050052ea3950050052f23940c0", + "0x530c0840050052ec2b10050052ea2b10050052f42b30050052ec396005", + "0x2639933a0050052ec00500733a0050072ee3980050052fc026397084005", + "0x33a0050072ee2940050052f127c0050052fb1bb00500530c2910050052fb", + "0x50072860050072ee39b0050052fc39a0050052fc2090050052fb026007", + "0x2639d39c0050052fc3430050052ec0260073430050072ee28b0050052f1", + "0x2639f02639e00600500530c0810050052ea0060050052ec0830050052fc", + "0x52f11750050052f10050073430050072ee3a00050052fc0260050052f6", + "0x72ee2890050052f10050072870050072ee0260072860050072ee19c005", + "0x260072870050072ee0050073440050072ee3440050052ec026007344005", + "0x52f10260072810050072ee3a30050052fc3a20050052fc3a10050052fc", + "0x72ee0050072810050072ee3460050052ec0260073460050072ee283005", + "0x3a60050052fc2120050052fb3a50050052f23a40c00052f8005007346005", + "0x1b00050052ec20e0050052f22100050052ea3a80050052f23a70c00052f8", + "0x27c0050052f11ff0050052f220c0050052ea3a90050052f20c40c00052f8", + "0x3aa0050052fc00500734a0050072ee34a0050052ec02600734a0050072ee", + "0x52ec0260073ab0050072ee1320050052ed1bb0050052ea0940050052fb", + "0x1320050052f43ab0050052f20050073ab0050072ee3ab0050052ec134005", + "0x72ee3ad0050052fc11d0050052fe0263ac1e40050052f61320050052ea", + "0x72ee02600734f0050072ee2780050052f134f0050052ec00500734f005", + "0x72ee3590050052ec0260073590050072ee2720050052f1026007270005", + "0x810050052ec0810050052f13ae0c00052f81990050052ea005007359005", + "0x2010050052ea3af0050052f20ca0c00052f81750050052ec19d0050052ec", + "0xab0050052ec1a30050052ea1a300500530c1ff0050052fb1ff005005303", + "0x1a30050052ec16c0050052f21fd0050052ea3b00050052f200e0c00052f8", + "0x3b20050052f21050c00052f81fb0050052ea3b10050052f21060c00052f8", + "0x52fb1a20050052ea0810050052fb0263b31f70050052f21f90050052ea", + "0x52f608100500530c08100500530308100500536d19f0050052fb0ab005", + "0x72ee3b60050052fc3b50050052fc16b0050052fb3b40050052fc006005", + "0x72ee0260073630050072ee2670050052f13630050052ec005007363005", + "0x72ee3b70050052f20050073b70050072ee3b70050052ec0260073b7005", + "0x50073670050072ee0050073660050072ee3660050052ec026007366005", + "0x50073b80050072ee3b80050052ec0260073b80050072ee3670050052ec", + "0x2620050072ee1a60050052f13b90050052f21040c00052f83b80050052f2", + "0x2620050072ee19c0050052fb0260073670050072ee2640050052f1026007", + "0x52ea3ba0050052f21030c00052f809c0050052ec07d0050052f5005007", + "0x72ee0ab0050052f109c0050052fb09c0050053031eb0050052f21ed005", + "0x50073690050072ee0050073bb0050072ee3bb0050052ec0260073bb005", + "0x72ee3bc0050052ec0260073bc0050072ee3bb0050052f23690050052ec", + "0x2600725e0050072ee1a20050052f10263bd3bc0050052f20050073bc005", + "0xab00500530600500725e0050072ee0260073690050072ee2600050052f1", + "0x52f10ab00500530a36b0050052ec00500736b0050072ee3be0050052fb", + "0x72ee02600736b0050072ee25c0050052f102600725a0050072ee1a3005", + "0x1d50050053031440050052fe1440050052f51e600500530600500725a005", + "0x1020c00052f81e600500530a1da0050052ec1da0050052f11d50050052fb", + "0x2cb0050052fb3c00050052fc1da0050052fb1dd0050052ea3bf0050052f2", + "0x3c40050052fc3c30050052fc3c20050052fc3c10050052fb1e60050052fb", + "0x1ce0050052ec1ce0050052f107d00500530d0ab0050052ea0ab00500530c", + "0x52ea1ce0050052ea1d00050052ea0263c63c50050052f21010c00052f8", + "0x52fc2510050052ea3c70050052fc3710050052f202c0050052f61db005", + "0x52f21000c00052f82530050052ec3c90050052fc2520050052ea3c8005", + "0x52f22560050052f22550050052f22350050052ea3ca0050052fc254005", + "0x72ee24d0050052f123a0050052f623c0050052ea3cb0050052fc257005", + "0x52fc3cd0050052fc0263cc2420050052ea3720050052ec026007372005", + "0x23e0050052fb0263d01c40050052ea3cf0050052f20ff0c00052f83ce005", + "0x72ee0360050052f61be0050052fe0263d40263d33d20050052fc0263d1", + "0x3760050072ee2450050052f12420050052f63760050052ec005007376005", + "0x260073d60050072ee1be0050052ed37a0050052ea3d50050052fc026007", + "0x52f43d60050052f20050073d60050072ee3d60050052ec2400050052ec", + "0xfe0c00052f837f0050052f637a0050052fb0263d71be0050052f61be005", + "0x530c3db0050052fc1bd0050052ea0263da3d90050052fc3d80050052f2", + "0x50073950050072ee3000050052fb30000500530c3930050052ea393005", + "0x530c1250050052fb0260073950050072ee21d0050052f13950050052ec", + "0x3a50050052ec0050073a50050072ee3dc0050052fc1320050052fb132005", + "0x52f81ad0050053061ae0050053060260073a50050072ee2120050052f1", + "0x52f20fc0c00052f81ae00500530a1ad00500530a3dd0050052f20fd0c0", + "0x3df0050052ec0260073df0050072ee1b30050052f21b50050052ea3de005", + "0x3a80050052ec0050073a80050072ee1ad0050052fb0050073df0050072ee", + "0x72ee2100050052f102600720e0050072ee1b00050052f13df0050052f2", + "0x53063e10050052fb3e00050052fb00500720e0050072ee0260073a8005", + "0x52fb13200500530d1af00500530c1b00050052ea1b00050053061af005", + "0x20c0050052f10050071ff0050072ee3e40050052fc3e30050052fb3e2005", + "0x52fc1ad0050052ea1ad00500530c3a90050052ec0260073a90050072ee", + "0x52fc0fa0c00052f80fb0c00052f81ad0050052ec1ad0050053033e5005", + "0x20a0050052ea1b00050053031b000500530a0050073a90050072ee3e6005", + "0xf90c00052f81af00500530a3e70050052fc1b00050052fb2090050052f6", + "0x18d0050052f218d0050052fb18d00500530318f0050052ea3e80050052f2", + "0x52fc3eb0050052fc3ea0050052fc3e90050052fc0260071ff0050072ee", + "0x3f10050052fc3f00050052fc3ef0050052ec0263ee3ed0050052fc3ec005", + "0x530c0263f70263f63f40050052ec0263f53f400500530c0263f30263f2", + "0x52ec0263f918600500536d3ef0050052fb3f40050052fb0263f83ef005", + "0x3fc0050052fc3fb0050052fc19d0050052ea19d00500530c0263fa186005", + "0x17b0050052f217d0050052ea3fd0050052f20f80c00052f81750050052fb", + "0x1750050053031770050052ea3fe0050052f20f70c00052f817a0050052ec", + "0x72ee3ff0050052fc3af0050052ec0260073af0050072ee2010050052f1", + "0x7d0050052ec4010050052fc0f60c00052f84000050052fc0050073af005", + "0x15e0050052ea4030050052f20f50c00052f84020050052fc07d0050052fe", + "0x4050050052f20f30c00052f816e0050052ea4040050052f20f40c00052f8", + "0x1630050053791630050052fb1630050053031650050052f21670050052ea", + "0x52fc4070050052fc00600507d00500740607d0050052f60aa0050052fb", + "0x3b00050052ec0050073b00050072ee40b0050052fc02640a026409408005", + "0x7d0050052fb0260073b00050072ee1fd0050052f102600716c0050072ee", + "0x40e0050052fc00500716c0050072ee40d00716b0050072ee40c0050052fc", + "0xf10c00052f815c0050052ea40f0050052f20f20c00052f815e005005306", + "0xaa00500530c15a0050052ea4100050052f20f00c00052f815e00500530a", + "0x1580050052ea4120050052f20ef0c00052f80aa0050052ec4110050052fc", + "0x72ee4130050052fc3b10050052ec0260073b10050072ee1fb0050052f1", + "0x52fc1f70050052ec0264154140050052fb15e0050052fb0050073b1005", + "0x3b20050072ee1f60050052fb4190050052fc0264184170050052fc416005", + "0x52f819f0050052ec02641b02641a19f00500530c3b20050052ec005007", + "0x260071f70050072ee02641e1f60050052ec02641d41c0050052fc0ee0c0", + "0x50071f70050072ee41f0050052fc0260073b20050072ee1f90050052f1", + "0x50073b90050072ee3b90050052ec0260073b90050072ee19d0050052f1", + "0x3ba0050052ec0260073ba0050072ee1ed0050052f10260071eb0050072ee", + "0x52ed1da0050052ea0050073ba0050072ee0050071eb0050072ee026420", + "0x4210050072ee4210050052ec1d70050052ec0260074210050072ee144005", + "0x50073bf0050072ee1440050052f61440050052f44210050052f2005007", + "0x52fc1d70050052fb0260073bf0050072ee1dd0050052f13bf0050052ec", + "0x4230050072ee4230050052ec0260074230050072ee07d0050052ed422005", + "0x3c50050072ee1d00050052f102642407d0050052f44230050052f2005007", + "0x25300500530c0050073c50050072ee1ce0050052fb3c50050052ec026007", + "0x3720050072ee0ed0c00052f81a20050052ec1960050052f62530050052ea", + "0x4280050052f24280050052ec42800500542742600501b005007425005007", + "0x42a0050052fc2160050052fc0820050052fc0cb0050052fc4290050052fc", + "0x42f0050052fc42e0050052fc42d0050052fc42c0050052fc42b0050052fc", + "0x4340050052fc4330050052fc4320050052fc4310050052fc4300050052fc", + "0x72ee4350050052fc3cf0050052ec0260073cf0050072ee1c40050052f1", + "0x3d80050072ee4360c00052f813400500530a1340050053060050073cf005", + "0x4370050052fb0260073d80050072ee1bd0050052f13d80050052ec005007", + "0x50073dd0050072ee3dd0050052ec0260073dd0050072ee1ad0050052f1", + "0x3de0050052ec0260073de0050072ee1b50050052f10260071b30050072ee", + "0x1ad0050052f64380050052fc0050073de0050072ee0050071b30050072ee", + "0x43d0050052fc43c0050052fc43b0050052fc43a0050052fc4390c00052f8", + "0x3e80050052ec0260073e80050072ee18f0050052f102600718d0050072ee", + "0x2740050052ec11d00500534843e0050052fc2040050052ec132005005348", + "0x11e0050052fb1200050052ea4400050052f243f0c00052f811e0050052f1", + "0x21d0050052fb00500718d0050072ee0050073e80050072ee094005005303", + "0x17a0050052fb0264444430050052fc4420050052fc17b0050052ec026441", + "0x2600717b0050072ee0264460264453fd0050052ec0050073fd0050072ee", + "0x52f502644700500717b0050072ee0260073fd0050072ee17d0050052f1", + "0x52f110b0050052fb10b0050053030840050052f50810050052fe081005", + "0x52ea4490050052f24480c00052f801e0050052ec10e0050052ec10e005", + "0x52ea44b0050052f21700c00052f844a0050052fc10e0050052fb110005", + "0x52fc02644e02644d44c0050052f101e0050052fb01e00500530310a005", + "0x3fe0050072ee1770050052f13fe0050052ec0050073fe0050072ee44f005", + "0x52fc4530050052fc4520050052fc4510050052fc4500050052fc026007", + "0x52fc4580050052fc4570050052fc4560050052fc4550050052fc454005", + "0x52fc45d0050052fc45c0050052fc45b0050052fc45a0050052fc459005", + "0x52fc4620050052fc4610050052fc4600050052fc45f0050052fc45e005", + "0x52fc4670050052fc4660050052fc4650050052fc4640050052fc463005", + "0x52fc46c0050052fc46b0050052fc46a0050052fc4690050052fc468005", + "0x52fc4710050052fc4700050052fc46f0050052fc46e0050052fc46d005", + "0x52fc4760050052fc4750050052fc4740050052fc4730050052fc472005", + "0x52fc47b0050052fc47a0050052fc4790050052fc4780050052fc477005", + "0x52fc4800050052fc47f0050052fc47e0050052fc47d0050052fc47c005", + "0x52fc4850050052fc4840050052fc4830050052fc4820050052fc481005", + "0x52fc48a0050052fc4890050052fc4880050052fc4870050052fc486005", + "0x50074030050072ee48e0050052fc48d0050052fc48c0050052fc48b005", + "0x264920264914900050052fc01b00500600500742502648f4030050052ec", + "0x52f60ab00500530301b0050840050074250264950264944930050052fc", + "0x52f24970c00052f84960050052fc1420050052ec07d0050053480aa005", + "0x52f80c60050052ea4990050052f20ec0c00052f80c80050052ea498005", + "0x16e0050052f10260074030050072ee15e0050052f149a0050052fc0eb0c0", + "0x72ee08900716b0050072ee02649b4040050052ec0260074040050072ee", + "0x49c0050052fc01b0050053060c200500530607d005005306005007404005", + "0x7d00500530a49e0050052fc0c200500530a49d0050052f20ea0c00052f8", + "0x52f20e90c00052f84a00050052fc49f0050052fc01b00507d005007406", + "0x52fc0264a30bf0050052ea08400501b0050074064a20050052fc4a1005", + "0x52f10c20050052ea4a60050052fc4a50050052fc01b00500530a4a4005", + "0x52ec0260074050050072ee1670050052f10260071650050072ee163005", + "0x4a80050052fb4a70050052fb0050074050050072ee0c20050052fb405005", + "0x2600740f0050072ee15c0050052f10050071650050072ee4a90050052fb", + "0x52fc08400500530a08400500530600500740f0050072ee40f0050052ec", + "0xc60050052fb0264ad4ac0050052fc4ab0050052fc0e80c00052f84aa005", + "0x4b10050052fc4b00050052fc4af0050052fc07d0050840050074250264ae", + "0x4b60050052fc4b50050052fc4b40050052fc4b30050052fc4b20050052fc", + "0x4bb0050052fc4ba0050052fc4b90050052fc4b80050052fc4b70050052fc", + "0x4bd0050052fc4bc0050052f20e70c00052f80320050052ec01b0050052f5", + "0x4c10050052fc4c00050052fc4bf0050052fc4be0050052fc01b0050052fe", + "0xad0050052ea0e60c00052f84c40050052fc4c30050052fc4c20050052fc", + "0xe50c00052f809b0050052ec09b0050052f10320050052fb032005005303", + "0x9e0050052ea4c60050052f20e40c00052f80a00050052ea4c50050052f2", + "0x72ee4c80050052ec0260074c80050072ee07d0050054c709b0050052fb", + "0x52ec0260074100050072ee15a0050052f14c80050052f20050074c8005", + "0x52f84c90050052fc00600501b0050074060050074100050072ee410005", + "0x4120050052ec0050074120050072ee4ca0050052ea0e20c00052f80e30c0", + "0x52ec0d60050052f10264cc0264cb0260074120050072ee1580050052f1", + "0xe10c00052f80ab0050052f61a200500530c0d60050052fb0264cd0d6005", + "0x52ec0260074400050072ee1200050052f10d70050052fc19f0050052f6", + "0xd80050072ee0810050052ed10e0050052ea0050074400050072ee440005", + "0xd80050052f20050070d80050072ee0d80050052ec10d0050052ec026007", + "0x52ec0050074490050072ee0e00c00052f80810050052f60810050052f4", + "0x44b0050072ee0d90050052fc0260074490050072ee1100050052f1449005", + "0x52fc0db0050052fc0da0050052fc08400500530d44b0050052ec005007", + "0xdf0050052fc0de0050052fc0264ce0840050052f60dd0050052fc0dc005", + "0x44b0050072ee10a0050052f10e00050052fc0df0c00052f80840050052fe", + "0xe20050052fc4980050052ec0050074980050072ee0e10050052fc026007", + "0x52fc0260074980050072ee0c80050052f10e40050052fc0e30050052fc", + "0x4990050072ee4990050052ec0260074990050072ee0c60050052f10e5005", + "0xc20050052f149d0050052ec00500749d0050072ee07d0050054cf005007", + "0x50074a10050072ee0e70050052fc0e60050052fc02600749d0050072ee", + "0x52fc0e80050052fc0260074a10050072ee0bf0050052f14a10050052ec", + "0xad0050052f14bc0050052ec0050074bc0050072ee0ea0050052fc0e9005", + "0x52fc4970050052fc0ec0050052fc0eb0050052fc0260074bc0050072ee", + "0x52fc4360050052fc4390050052fc43f0050052fc4480050052fc170005", + "0x52fc0f10050052fc0f00050052fc0ef0050052fc0ee0050052fc0ed005", + "0x52fc0f60050052fc0f50050052fc0f40050052fc0f30050052fc0f2005", + "0x52fc0fb0050052fc0fa0050052fc0f90050052fc0f80050052fc0f7005", + "0x52fc1000050052fc0ff0050052fc0fe0050052fc0fd0050052fc0fc005", + "0x52fc1050050052fc1040050052fc1030050052fc1020050052fc101005", + "0x52fc0c40050052fc3ae0050052fc0ca0050052fc00e0050052fc106005", + "0x52fc0cd0050052fc0cc0050052fc3940050052fc3a40050052fc3a7005", + "0x52fc0d20050052fc0d10050052fc0d00050052fc0cf0050052fc0ce005", + "0x52fc3680050052fc36a0050052fc0d50050052fc0d40050052fc0d3005", + "0x52fc3580050052fc35f0050052fc07e0050052fc3650050052fc171005", + "0x52fc0ba0050052fc0c30050052fc34b0050052fc34e0050052fc353005", + "0x72ee0a00050052f101b00500530d09b0050052ea09b00500530c0bb005", + "0x380050052ea0bc0050052f20de0c00052f84c50050052ec0260074c5005", + "0x1b00500534809a0050052f609b0050053030dc0c00052f80dd0c00052f8", + "0x52ed0a00050052fb0050074c50050072ee01b0050052f402b0050052ec", + "0x3310050072ee3310050052ec09a0050052ec0260073310050072ee01b005", + "0x4c60050052ec0050074c60050072ee31b0050052fc3310050052f2005007", + "0x52f13140050052fc3180050052fc3190050052fc07d00501b005007425", + "0x4ca0050052f10940050052f63120050052fc0260074c60050072ee09e005", + "0x260070bc0050072ee0380050052f10840050060050074254ca0050052ec", + "0x52f80db0c00052f830f0050052fc0050070bc0050072ee0bc0050052ec", + "0x52fc08d0c00052f80d90c00052f80bf0050052fb09a0050052fb0da0c0", + "0x52fc4d00050052fc01c0050052fc1c50050052fc08b0050052fc309005", + "0x52fc4d40050052fc40d0050052fc4d30050052fc4d20050052fc4d1005", + "0x52fc00a0050052fc08a0050052fc0890050052fc0880050052fc016005", + "0x70050260264d60050260260264d50050050052fc0070050052fc0c0005", + "0x50c00260264d60050260070264d340d00749f4d40160074d600708a005", + "0x260160054d600501600508a0260264d600502600a0264d20054d6005088", + "0x50880260264d600502600702601c0054d24d04d10074d60074d2005089", + "0x54d60051c50054d402608b0054d60054d10050160261c50054d60054d0", + "0x30f0054d60050264d30260264d600502600702602608b00502640d026309", + "0x3120054d402608b0054d600501c0050160263120054d600530f0054d2026", + "0x4d60050260070263180050d33140054d60073090054d10263090054d6005", + "0x4d60050261c50263190054d600531400501c0260264d60050264d0026026", + "0x8a02602c0054d600531900530902602b0054d600508b00508b02631b005", + "0x4d600502b0053120264d40054d60054d400530f0260160054d6005016005", + "0x31902602c0054d600502c00531802631b0054d600531b00531402602b005", + "0x380054d600701b00531b02601b0323310c04d600502c31b02b4d401608a", + "0xc00260390360074d600503800502b0260264d600502600702603500534e", + "0x4d600503200530f0260bb0054d600533100508a0260bc0054d6005036005", + "0x40d02634b0054d600503900502c0260c30054d60050bc0050160260ba005", + "0x3202634e0054d60050350053310260264d60050260070260263a4005026", + "0x4d600500700501b0263310054d600533100508a0260260054d6005026005", + "0x30f02600a0054d600500a0050350260c00054d60050c0005038026007005", + "0x4d600534e0050390260890054d60050890050360260320054d6005032005", + "0x4d00260264d600502600702634e08903200a0c000733102601600534e005", + "0xbb0263530054d60050264d30260264d60053180050bc0260264d6005026", + "0x4d60054d400530f0260bb0054d600501600508a0263580054d6005353005", + "0xba02634b0054d600535800502c0260c30054d600508b0050160260ba005", + "0x70c30050890260264d600502600702607e0054b435f0054d600734b005", + "0x264d60053650050c30260264d60050260070263680050f51713650074d6", + "0x54d60050263530260264d600535f00534e0260264d600517100534b026", + "0x36a00735f0260d50054d60050d50053180260d50054d600502635802636a", + "0x54d60050d40d30073650260d30054d600502607e0260d40054d60050d5", + "0x508a0260260054d60050260050320260d10054d60050d20053310260d2", + "0x54d60050c00050380260070054d600500700501b0260bb0054d60050bb", + "0x50360260ba0054d60050ba00530f02600a0054d600500a0050350260c0", + "0xa0c00070bb0260160050d10054d60050d10050390260890054d6005089", + "0x50261710260264d60053680050c30260264d60050260070260d10890ba", + "0x74d60070d00ba0bb0c036a0260d00054d60050d00053680260d00054d6", + "0x263940054d60050260d50260264d60050260070260cc0cd0074c30ce0cf", + "0x54d60053a70050d20263a70054d60050260d30263a40054d60050260d4", + "0x50260cf0260ca0054d60053ae0050d00263ae0054d60050260d10260c4", + "0x510600e0ca0c43a43940890cd0261060054d60050260ce02600e0054d6", + "0x260c00054d60050c00050380260cf0054d60050cf00508a0261050054d6", + "0x50260050320260070054d600500700501b0260ce0054d60050ce00530f", + "0x260890054d600508900503602600a0054d600500a0050350260260054d6", + "0x535f10508900a0260070ce0c00cf4d40cc02635f0054d600535f005314", + "0x507d0fc0054d60070fd0053940260fd0fe0ff1001011021031040164d6", + "0x4d60050fc0053a40260fa0054d60050263530260264d60050260070260fb", + "0x260f70054d60050f80fa00735f0260264d60050f90053a70260f80f9007", + "0x50f500508b0260264d60050f60053ae0260f50f60074d60050f70050c4", + "0x260f20054d60050f300500e0260f30054d60050f40050ca0260f40054d6", + "0x510100501b0261040054d600510400508a0261000054d6005100005032", + "0x260ff0054d60050ff0050350261030054d60051030050380261010054d6", + "0x50f20050390260fe0054d60050fe0050360261020054d600510200530f", + "0x260264d60050260070260f20fe1020ff1031011041000160050f20054d6", + "0x510400508a0261000054d60051000050320260f10054d60050fb005331", + "0x261030054d60051030050380261010054d600510100501b0261040054d6", + "0x50fe0050360261020054d600510200530f0260ff0054d60050ff005035", + "0xfe1020ff1031011041000160050f10054d60050f10050390260fe0054d6", + "0x54d60050263530260264d600535f00534e0260264d60050260070260f1", + "0xf000735f0260ef0054d60050ef0053180260ef0054d60050261060260f0", + "0x54d60050ee0ed0073650260ed0054d600502607e0260ee0054d60050ef", + "0x508a0260260054d60050260050320264390054d6005436005331026436", + "0x54d60050c00050380260070054d600500700501b0260cd0054d60050cd", + "0x50360260cc0054d60050cc00530f02600a0054d600500a0050350260c0", + "0xa0c00070cd0260160054390054d60054390050390260890054d6005089", + "0xc30050c30260264d600507e0050bc0260264d60050260070264390890cc", + "0x53180264480054d600502610502643f0054d60050263530260264d6005", + "0x54d600502607e0261700054d600544843f00735f0264480054d6005448", + "0x320260eb0054d60050ec0053310260ec0054d6005170497007365026497", + "0x4d600500700501b0260bb0054d60050bb00508a0260260054d6005026005", + "0x30f02600a0054d600500a0050350260c00054d60050c0005038026007005", + "0x4d60050eb0050390260890054d60050890050360260ba0054d60050ba005", + "0x1040260264d60050260070260eb0890ba00a0c00070bb0260160050eb005", + "0x260e90054d60050261060260ea0054d60050263530260264d6005088005", + "0x502607e0260e80054d60050e90ea00735f0260e90054d60050e9005318", + "0xe50054d60050e60053310260e60054d60050e80e70073650260e70054d6", + "0x700501b02640d0054d600540d00508a0260260054d6005026005032026", + "0xa0054d600500a0050350260c00054d60050c00050380260070054d6005", + "0xe50050390260890054d60050890050360264d30054d60054d300530f026", + "0x54d60050261030260e50894d300a0c000740d0260160050e50054d6005", + "0x4d60070050260070050260264d60050260260260264d600502610202608a", + "0x54d60050c00050c00260264d60050260070264d4016007186088089007", + "0x740d0050890260890054d600508900508a0260264d600502600a02640d", + "0x54d60054d20050880260264d60050260070264d100547f4d24d30074d6", + "0x2640d0261c50054d60054d00054d402601c0054d60054d30050160264d0", + "0x8b0054d202608b0054d60050264d30260264d600502600702602647a005", + "0x1c50054d60053090054d402601c0054d60054d10050160263090054d6005", + "0x264d00260264d600502600702631200545c30f0054d60071c50054d1026", + "0x8b0263180054d60050261c50263140054d600530f00501c0260264d6005", + "0x4d600508900508a02631b0054d60053140053090263190054d600501c005", + "0x3140263190054d60053190053120260880054d600508800530f026089005", + "0x31908808908a31902631b0054d600531b0053180263180054d6005318005", + "0x2601b0054640320054d600733100531b02633102c02b0c04d600531b318", + "0x4d60050380050c00260350380074d600503200502b0260264d6005026007", + "0x160260bc0054d600502c00530f0260390054d600502b00508a026036005", + "0x2645300502640d0260ba0054d600503500502c0260bb0054d6005036005", + "0x54d600501b0053310260264d600508a0051010260264d6005026007026", + "0x503602602c0054d600502c00530f02602b0054d600502b00508a0260c3", + "0x260c300702c02b00a0050c30054d60050c30050390260070054d6005007", + "0x4d30260264d60053120050bc0260264d60050264d00260264d6005026007", + "0x54d600508900508a02634e0054d600534b0050bb02634b0054d6005026", + "0x502c0260bb0054d600501c0050160260bc0054d600508800530f026039", + "0x50260070263580054033530054d60070ba0050ba0260ba0054d600534e", + "0x264d600502600702636500511307e35f0074d60070bb0050890260264d6", + "0x4d600508a0051010260264d600507e00534b0260264d600535f0050c3026", + "0x4d60050263580261710054d60050263530260264d600535300534e026026", + "0x2636a0054d600536817100735f0263680054d6005368005318026368005", + "0x50d40053310260d40054d600536a0d50073650260d50054d600502607e", + "0x260bc0054d60050bc00530f0260390054d600503900508a0260d30054d6", + "0x70bc03900a0050d30054d60050d30050390260070054d6005007005036", + "0x54d60050261710260264d60053650050c30260264d60050260070260d3", + "0xd00d10074d60070d20bc0390c036a0260d20054d60050d20053680260d2", + "0x260d40260cd0054d60050260d50260264d60050260070260ce0cf007414", + "0x263a40054d60053940050d20263940054d60050260d30260cc0054d6005", + "0x54d60050260cf0260c40054d60053a70050d00263a70054d60050260d1", + "0x54d60050ca3ae0c43a40cc0cd0890cd0260ca0054d60050260ce0263ae", + "0x50360260d00054d60050d000530f0260d10054d60050d100508a02600e", + "0xe0070d00d108a1000263530054d60053530053140260070054d6005007", + "0x50fe02600a0054d600500a08a0070ff02610400a10510600a4d6005353", + "0x54d60050263530260264d60050260070261020054121030054d6007104", + "0x50fc0260264d60051000053a70260ff1000074d60051030050fd026101", + "0x74d60050fd0050fa0260264d60050fe0050fb0260fd0fe0074d60050ff", + "0x3180260fa0054d60050fb0050f80260fb0054d60050fc0050f90260fc0fd", + "0x50fd0050f70260f90054d60050fa10100735f0260fa0054d60050fa005", + "0x261050054d600510500530f0261060054d600510600508a0260f80054d6", + "0x10510600a0f40260f90054d60050f90050f50260f80054d60050f80050f6", + "0x260f300514b0f40054d60070f50050f30260f50f60f70c04d60050f90f8", + "0x4d60050f10050bc0260f10f20074d60050f40050f20260264d6005026007", + "0x508b0260264d60050f00053ae0260ef0f00074d60050f20050c4026026", + "0x54d60050ed00500e0260ed0054d60050ee0050ca0260ee0054d60050ef", + "0x50360260f60054d60050f600530f0260f70054d60050f700508a026436", + "0x2643600a0f60f700a0054360054d600543600503902600a0054d600500a", + "0x54d60050f700508a0264390054d60050f30053310260264d6005026007", + "0x503902600a0054d600500a0050360260f60054d60050f600530f0260f7", + "0x53310260264d600502600702643900a0f60f700a0054390054d6005439", + "0x54d600510500530f0261060054d600510600508a02643f0054d6005102", + "0x10600a00543f0054d600543f00503902600a0054d600500a005036026105", + "0x35300534e0260264d600508a0051010260264d600502600702643f00a105", + "0x53180261700054d60050261060264480054d60050263530260264d6005", + "0x54d600502607e0264970054d600517044800735f0261700054d6005170", + "0x8a0260ea0054d60050eb0053310260eb0054d60054970ec0073650260ec", + "0x4d60050070050360260ce0054d60050ce00530f0260cf0054d60050cf005", + "0x50260070260ea0070ce0cf00a0050ea0054d60050ea005039026007005", + "0xbb0050c30260264d600508a0051010260264d60053580050bc0260264d6", + "0x53180260e80054d60050261050260e90054d60050263530260264d6005", + "0x54d600502607e0260e70054d60050e80e900735f0260e80054d60050e8", + "0x8a0260e40054d60050e50053310260e50054d60050e70e60073650260e6", + "0x4d60050070050360260bc0054d60050bc00530f0260390054d6005039005", + "0x50260070260e40070bc03900a0050e40054d60050e4005039026007005", + "0x50263530260264d60050c00051040260264d600508a0051010260264d6", + "0x35f0260e20054d60050e20053180260e20054d60050261060260e30054d6", + "0x50e10e00073650260e00054d600502607e0260e10054d60050e20e3007", + "0x260160054d600501600508a0260de0054d60050df0053310260df0054d6", + "0x50de0050390260070054d60050070050360264d40054d60054d400530f", + "0x50261020264d40054d60050260f10260de0074d401600a0050de0054d6", + "0x728b4d340d0074d600708a0050070050260264d60050260260260264d6", + "0x502600a0264d00054d60050880050c00260264d60050260070264d14d2", + "0x1aa1c501c0074d60074d000508902640d0054d600540d00508a0260264d6", + "0x3090053090263090054d60051c500501c0260264d600502600702608b005", + "0x3140054d600501c0050160263120054d600530f0050f002630f0054d6005", + "0x264d60050260070260263df00502640d0263180054d60053120050ef026", + "0x508b00501602631b0054d60053190050ee0263190054d60050264d3026", + "0x2740160054d60073180050ed0263180054d600531b0050ef0263140054d6", + "0x50890260160054d60050164d40074360260264d600502600702602b005", + "0x53310050880260264d60050260070260320053d933102c0074d6007314", + "0x260350054d600501b0054d40260380054d600502c00501602601b0054d6", + "0x4d20260360054d60050264d30260264d60050260070260263d600502640d", + "0x4d60050390054d40260380054d60050320050160260390054d6005036005", + "0x260264d60050260070260bb0053c10bc0054d60070350054d1026035005", + "0xc30054d60050263530260ba0054d60050bc00501c0260264d60050264d0", + "0x40d00508a02634e0054d60050ba00530902634b0054d600503800508b026", + "0x34b0054d600534b0053120264d30054d60054d300530f02640d0054d6005", + "0x40d08a43902634e0054d600534e0053180260c30054d60050c30050f5026", + "0x51d507e0054d600735f00543f02635f3583530c04d600534e0c334b4d3", + "0x1710050c00263681710074d600507e0054480260264d6005026007026365", + "0xd40054d600535800530f0260d50054d600535300508a02636a0054d6005", + "0x502640d0260d20054d60053680051700260d30054d600536a005016026", + "0x53650053310260264d60050160054970260264d60050260070260263b8", + "0x263530054d600535300508a0260260054d60050260050320260d10054d6", + "0x500a0050350260c00054d60050c00050380260070054d600500700501b", + "0x260890054d60050890050360263580054d600535800530f02600a0054d6", + "0x260070260d108935800a0c00073530260160050d10054d60050d1005039", + "0x50264d30260264d60050bb0050bc0260264d60050264d00260264d6005", + "0x260d50054d600540d00508a0260cf0054d60050d00050ec0260d00054d6", + "0x50cf0051700260d30054d60050380050160260d40054d60054d300530f", + "0x264d60050260070260cd0052640ce0054d60070d20050eb0260d20054d6", + "0xc30260264d60050260070263a400520e3940cc0074d60070d3005089026", + "0x260264d60050ce0053ae0260264d600539400534b0260264d60050cc005", + "0xc40054d60050263580263a70054d60050263530260264d6005016005497", + "0x2607e0263ae0054d60050c43a700735f0260c40054d60050c4005318026", + "0x54d600500e00533102600e0054d60053ae0ca0073650260ca0054d6005", + "0x501b0260d50054d60050d500508a0260260054d6005026005032026106", + "0x54d600500a0050350260c00054d60050c00050380260070054d6005007", + "0x50390260890054d60050890050360260d40054d60050d400530f02600a", + "0x4d60050260070261060890d400a0c00070d50260160051060054d6005106", + "0x51050053680261050054d60050261710260264d60053a40050c3026026", + "0x70261011020071be1031040074d60071050d40d50c036a0261050054d6", + "0xd30260ff0054d60050260d40261000054d60050260d50260264d6005026", + "0xfc0054d60050260d10260fd0054d60050fe0050d20260fe0054d6005026", + "0x4d60050260ce0260fa0054d60050260cf0260fb0054d60050fc0050d0026", + "0x50f80050ea0260f80054d60050f90fa0fb0fd0ff1000890cd0260f9005", + "0x261040054d600510400508a0260264d60050f70053a70260f60f70074d6", + "0x500700501b0261030054d600510300530f0260c00054d60050c0005038", + "0x2600a0054d600500a0050350260260054d60050260050320260070054d6", + "0x50ce0050f50260160054d60050160053180260890054d6005089005036", + "0xf50164d60050ce0160f608900a0260071030c010440d0e90260ce0054d6", + "0x702643600537c0ed0054d60070ee0050e80260ee0ef0f00f10f20f30f4", + "0x2643f0054d60050ed0050e70264390054d60050263530260264d6005026", + "0x53ae0264971700074d60054480050c40264480054d600543f43900735f", + "0xeb0054d60050ec0050ca0260ec0054d600549700508b0260264d6005170", + "0xf500508a0260f10054d60050f10050320260ea0054d60050eb00500e026", + "0xf40054d60050f40050380260f20054d60050f200501b0260f50054d6005", + "0xef0050360260f30054d60050f300530f0260f00054d60050f0005035026", + "0xf30f00f40f20f50f10160050ea0054d60050ea0050390260ef0054d6005", + "0xf10050320260e90054d60054360053310260264d60050260070260ea0ef", + "0xf20054d60050f200501b0260f50054d60050f500508a0260f10054d6005", + "0xf300530f0260f00054d60050f00050350260f40054d60050f4005038026", + "0xe90054d60050e90050390260ef0054d60050ef0050360260f30054d6005", + "0xce0053ae0260264d60050260070260e90ef0f30f00f40f20f50f1016005", + "0x261060260e80054d60050263530260264d60050160054970260264d6005", + "0x54d60050e70e800735f0260e70054d60050e70053180260e70054d6005", + "0x53310260e40054d60050e60e50073650260e50054d600502607e0260e6", + "0x54d600510200508a0260260054d60050260050320260e30054d60050e4", + "0x50350260c00054d60050c00050380260070054d600500700501b026102", + "0x54d60050890050360261010054d600510100530f02600a0054d600500a", + "0x260e308910100a0c00071020260160050e30054d60050e3005039026089", + "0x260264d60050d30050c30260264d60050cd0050bc0260264d6005026007", + "0xe10054d60050260e60260e20054d60050263530260264d6005016005497", + "0x2607e0260e00054d60050e10e200735f0260e10054d60050e1005318026", + "0x54d60050de0053310260de0054d60050e00df0073650260df0054d6005", + "0x501b0260d50054d60050d500508a0260260054d60050260050320260dd", + "0x54d600500a0050350260c00054d60050c00050380260070054d6005007", + "0x50390260890054d60050890050360260d40054d60050d400530f02600a", + "0x4d60050260070260dd0890d400a0c00070d50260160050dd0054d60050dd", + "0x4d60053140050c30260264d600502b0050bc0260264d60050264d0026026", + "0x4d60050261050260dc0054d60050263530260264d60054d40050e5026026", + "0x260da0054d60050db0dc00735f0260db0054d60050db0053180260db005", + "0x508d00533102608d0054d60050da0d90073650260d90054d600502607e", + "0x2640d0054d600540d00508a0260260054d60050260050320260d80054d6", + "0x500a0050350260c00054d60050c00050380260070054d600500700501b", + "0x260890054d60050890050360264d30054d60054d300530f02600a0054d6", + "0x260070260d80894d300a0c000740d0260160050d80054d60050d8005039", + "0x263530260264d60050880051040260264d60054d40050e50260264d6005", + "0x260060054d60050060053180260060054d60050261060260d70054d6005", + "0xd60810073650260810054d600502607e0260d60054d60050060d700735f", + "0x260054d60050260050320264ca0054d60050940053310260940054d6005", + "0xc00050380260070054d600500700501b0264d20054d60054d200508a026", + "0x4d10054d60054d100530f02600a0054d600500a0050350260c00054d6005", + "0x4d20260160054ca0054d60054ca0050390260890054d6005089005036026", + "0x74d600708a0050070050260264d60050260260264ca0894d100a0c0007", + "0x4d20054d60050880050c00260264d60050260070264d340d0074d74d4016", + "0x4d60074d20050890260160054d600501600508a0260264d600502600a026", + "0x1c50054d60054d000501c0260264d600502600702601c0052b04d04d1007", + "0x4d10050160263090054d600508b0050f002608b0054d60051c5005309026", + "0x702602632c00502640d0263120054d60053090050ef02630f0054d6005", + "0x263180054d60053140050ee0263140054d60050264d30260264d6005026", + "0x73120050ed0263120054d60053180050ef02630f0054d600501c005016", + "0x2b0074d600730f0050890260264d600502600702631b0054d83190054d6", + "0x2b0050c30260264d60050264d00260264d600502600702633100531302c", + "0x263530260264d60053190054970260264d600502c00534b0260264d6005", + "0x2601b0054d600501b00531802601b0054d60050263580260320054d6005", + "0x380350073650260350054d600502607e0260380054d600501b03200735f", + "0x260054d60050260050320260390054d60050360053310260360054d6005", + "0xc00050380260070054d600500700501b0260160054d600501600508a026", + "0x4d40054d60054d400530f02600a0054d600500a0050350260c00054d6005", + "0x160260160050390054d60050390050390260890054d6005089005036026", + "0xc30260264d60050264d00260264d60050260070260390894d400a0c0007", + "0xbc0054d60050bc0053680260bc0054d60050261710260264d6005331005", + "0x4d600502600702634b0c30074d90ba0bb0074d60070bc4d40160c036a026", + "0x4d60050260d30263530054d60050260d402634e0054d60050260d5026026", + "0x50d002607e0054d60050260d102635f0054d60053580050d2026358005", + "0x263680054d60050260ce0261710054d60050260cf0263650054d600507e", + "0xbb0054d60050bb00508a02636a0054d600536817136535f35334e0890cd", + "0x700501b0260ba0054d60050ba00530f0260c00054d60050c0005038026", + "0xa0054d600500a0050350260260054d60050260050320260070054d6005", + "0xbb4d40e40263190054d60053190053180260890054d6005089005036026", + "0x260ce0cf0d00d10d20d30d40d50164d600531936a08900a0260070ba0c0", + "0x50263530260264d60050260070260cc0054da0cd0054d60070ce005394", + "0x260264d60053a40053a70263a73a40074d60050cd0053a40263940054d6", + "0x53ae0260ca3ae0074d60050c40050c40260c40054d60053a739400735f", + "0x1060054d600500e0050ca02600e0054d60050ca00508b0260264d60053ae", + "0xd500508a0260d10054d60050d10050320261050054d600510600500e026", + "0xd40054d60050d40050380260d20054d60050d200501b0260d50054d6005", + "0xcf0050360260d30054d60050d300530f0260d00054d60050d0005035026", + "0xd30d00d40d20d50d10160051050054d60051050050390260cf0054d6005", + "0xd10050320261040054d60050cc0053310260264d60050260070261050cf", + "0xd20054d60050d200501b0260d50054d60050d500508a0260d10054d6005", + "0xd300530f0260d00054d60050d00050350260d40054d60050d4005038026", + "0x1040054d60051040050390260cf0054d60050cf0050360260d30054d6005", + "0x3190054970260264d60050260070261040cf0d30d00d40d20d50d1016005", + "0x53180261020054d60050261060261030054d60050263530260264d6005", + "0x54d600502607e0261010054d600510210300735f0261020054d6005102", + "0x320260fe0054d60050ff0053310260ff0054d6005101100007365026100", + "0x4d600500700501b0260c30054d60050c300508a0260260054d6005026005", + "0x30f02600a0054d600500a0050350260c00054d60050c0005038026007005", + "0x4d60050fe0050390260890054d600508900503602634b0054d600534b005", + "0x4d00260264d60050260070260fe08934b00a0c00070c30260160050fe005", + "0x3530260264d600530f0050c30260264d600531b0050bc0260264d6005026", + "0xfc0054d60050fc0053180260fc0054d60050261050260fd0054d6005026", + "0xfa0073650260fa0054d600502607e0260fb0054d60050fc0fd00735f026", + "0x54d60050260050320260f80054d60050f90053310260f90054d60050fb", + "0x50380260070054d600500700501b0260160054d600501600508a026026", + "0x54d60054d400530f02600a0054d600500a0050350260c00054d60050c0", + "0x260160050f80054d60050f80050390260890054d60050890050360264d4", + "0x264d60050880051040260264d60050260070260f80894d400a0c0007016", + "0x4d60050f60053180260f60054d60050261060260f70054d6005026353026", + "0x3650260f40054d600502607e0260f50054d60050f60f700735f0260f6005", + "0x50260050320260f20054d60050f30053310260f30054d60050f50f4007", + "0x260070054d600500700501b02640d0054d600540d00508a0260260054d6", + "0x54d300530f02600a0054d600500a0050350260c00054d60050c0005038", + "0x50f20054d60050f20050390260890054d60050890050360264d30054d6", + "0x8a0050070050260264d60050260260260f20894d300a0c000740d026016", + "0x501600508a0260264d60050260070264d340d0074db4d40160074d6007", + "0x260880054d60050880053120264d40054d60054d400530f0260160054d6", + "0x4dc01c0054d60074d00050e20264d04d14d20c04d60050884d40160c00e3", + "0x50e002630908b0074d600501c0050e10260264d60050260070261c5005", + "0x4d600508b0050c00260264d60050260070263120054dd30f0054d6007309", + "0x264d600502600702631b0054de3193180074d6007314005089026314005", + "0x4d600530f0050df0260264d600531900534b0260264d60053180050c3026", + "0x502c00531802602c0054d600502635802602b0054d6005026353026026", + "0x260320054d600502607e0263310054d600502c02b00735f02602c0054d6", + "0x260050320260380054d600501b00533102601b0054d6005331032007365", + "0x70054d600500700501b0264d20054d60054d200508a0260260054d6005", + "0x4d100530f02600a0054d600500a0050350260c00054d60050c0005038026", + "0x380054d60050380050390260890054d60050890050360264d10054d6005", + "0x31b0050c30260264d60050260070260380894d100a0c00074d2026016005", + "0x36a0260350054d60050350053680260350054d60050261710260264d6005", + "0x260264d60050260070260bb0bc0074df0390360074d60070354d14d20c0", + "0x34b0054d60050260d30260c30054d60050260d40260ba0054d60050260d5", + "0x53530050d00263530054d60050260d102634e0054d600534b0050d2026", + "0x890cd02607e0054d60050260ce02635f0054d60050260cf0263580054d6", + "0x380260360054d600503600508a0263650054d600507e35f35834e0c30ba", + "0x4d600500700501b0260390054d600503900530f0260c00054d60050c0005", + "0x3602600a0054d600500a0050350260260054d6005026005032026007005", + "0x390c00364d40dd02630f0054d600530f0050de0260890054d6005089005", + "0x50dc0260d10d20d30d40d536a3681710164d600530f36508900a026007", + "0x4d60050d00050db0260264d60050260070260cf0054e00d00054d60070d1", + "0x53ae0260cc0cd0074d60050ce0050c40260ce0054d6005026353026026", + "0x3a40054d60053940050ca0263940054d60050cc00508b0260264d60050cd", + "0x17100508a0260d40054d60050d40050320263a70054d60053a400500e026", + "0x3680054d60053680050380260d50054d60050d500501b0261710054d6005", + "0xd200503602636a0054d600536a00530f0260d30054d60050d3005035026", + "0x36a0d33680d51710d40160053a70054d60053a70050390260d20054d6005", + "0xd40050320260c40054d60050cf0053310260264d60050260070263a70d2", + "0xd50054d60050d500501b0261710054d600517100508a0260d40054d6005", + "0x36a00530f0260d30054d60050d30050350263680054d6005368005038026", + "0xc40054d60050c40050390260d20054d60050d200503602636a0054d6005", + "0x30f0050df0260264d60050260070260c40d236a0d33680d51710d4016005", + "0x53180260ca0054d60050261060263ae0054d60050263530260264d6005", + "0x54d600502607e02600e0054d60050ca3ae00735f0260ca0054d60050ca", + "0x320261040054d60051050053310261050054d600500e106007365026106", + "0x4d600500700501b0260bc0054d60050bc00508a0260260054d6005026005", + "0x30f02600a0054d600500a0050350260c00054d60050c0005038026007005", + "0x4d60051040050390260890054d60050890050360260bb0054d60050bb005", + "0xbc0260264d60050260070261040890bb00a0c00070bc026016005104005", + "0x261030054d60050263530260264d600508b0051040260264d6005312005", + "0x510210300735f0261020054d60051020053180261020054d6005026105", + "0x260ff0054d60051011000073650261000054d600502607e0261010054d6", + "0x54d200508a0260260054d60050260050320260fe0054d60050ff005331", + "0x260c00054d60050c00050380260070054d600500700501b0264d20054d6", + "0x50890050360264d10054d60054d100530f02600a0054d600500a005035", + "0x894d100a0c00074d20260160050fe0054d60050fe0050390260890054d6", + "0x50260050320260fd0054d60051c50053310260264d60050260070260fe", + "0x260070054d600500700501b0264d20054d60054d200508a0260260054d6", + "0x54d100530f02600a0054d600500a0050350260c00054d60050c0005038", + "0x50fd0054d60050fd0050390260890054d60050890050360264d10054d6", + "0x50880051040260264d60050260070260fd0894d100a0c00074d2026016", + "0xfb0053180260fb0054d60050261060260fc0054d60050263530260264d6", + "0xf90054d600502607e0260fa0054d60050fb0fc00735f0260fb0054d6005", + "0x50320260f70054d60050f80053310260f80054d60050fa0f9007365026", + "0x54d600500700501b02640d0054d600540d00508a0260260054d6005026", + "0x530f02600a0054d600500a0050350260c00054d60050c0005038026007", + "0x54d60050f70050390260890054d60050890050360264d30054d60054d3", + "0x70050260264d60050260260260f70894d300a0c000740d0260160050f7", + "0x50c00260264d60050260070260880890074e108a00a0074d6007005026", + "0x74d600701600508902600a0054d600500a00508a0260160054d60050c0", + "0x34b0260264d60054d40050c30260264d60050260070264d30054e240d4d4", + "0x264d10054d60050263580264d20054d60050263530260264d600540d005", + "0x502607e0264d00054d60054d14d200735f0264d10054d60054d1005318", + "0x8b0054d60051c50053310261c50054d60054d001c00736502601c0054d6", + "0x700503602608a0054d600508a00530f02600a0054d600500a00508a026", + "0x702608b00708a00a00a00508b0054d600508b0050390260070054d6005", + "0x3680263090054d60050261710260264d60054d30050c30260264d6005026", + "0x3140074e331230f0074d600730908a00a0c036a0263090054d6005309005", + "0x4d60053190050d90263190054d60050260da0260264d6005026007026318", + "0x502b0050d80260264d600502600a02602b0054d600502608d02631b005", + "0x2630f0054d600530f00508a02631b0054d600531b0050d702602b0054d6", + "0x2600702603503801b0c04e403233102c0c04d600731b02b00731200a006", + "0x360320074d60050320050d60260320054d60050320053180260264d6005", + "0x360050810263310054d600533100503602602c0054d600502c00530f026", + "0x260264d60050320054970260264d60050260070260390054e50264d6007", + "0x54d60050bb0053180260bb0054d60050260940260bc0054d6005026353", + "0x360260c30054d600502c00530f0260ba0054d60050bb0bc00735f0260bb", + "0x2621400502640d02634e0054d60050ba0050f502634b0054d6005331005", + "0x260264d60050390054ca0260264d60050264d00260264d6005026007026", + "0x53580050c40263580054d600503235300735f0263530054d6005026353", + "0x263650054d600507e00508b0260264d600535f0053ae02607e35f0074d6", + "0x530f00508a0263680054d600517100500e0261710054d60053650050ca", + "0x263310054d600533100503602602c0054d600502c00530f02630f0054d6", + "0x260264d600502600702636833102c30f00a0053680054d6005368005039", + "0x50350050f502634b0054d60050380050360260c30054d600501b00530f", + "0x36a00736502636a0054d600502607e0260264d60050264d002634e0054d6", + "0x54d600530f00508a0260d40054d60050d50053310260d50054d600534e", + "0x503902634b0054d600534b0050360260c30054d60050c300530f02630f", + "0x263530260264d60050260070260d434b0c330f00a0050d40054d60050d4", + "0x260d20054d60050d20053180260d20054d60050261060260d30054d6005", + "0xd10d00073650260d00054d600502607e0260d10054d60050d20d300735f", + "0x3140054d600531400508a0260ce0054d60050cf0053310260cf0054d6005", + "0xce0050390260070054d60050070050360263180054d600531800530f026", + "0xc00051040260264d60050260070260ce00731831400a0050ce0054d6005", + "0x53180260cc0054d60050261060260cd0054d60050263530260264d6005", + "0x54d600502607e0263940054d60050cc0cd00735f0260cc0054d60050cc", + "0x8a0260c40054d60053a70053310263a70054d60053943a40073650263a4", + "0x4d60050070050360260880054d600508800530f0260890054d6005089005", + "0x50260260260c400708808900a0050c40054d60050c4005039026007005", + "0x50260070260880890074e608a00a0074d60070050260070050260264d6", + "0x8902600a0054d600500a00508a0260160054d60050c00050c00260264d6", + "0x4d40050c30260264d60050260070264d30054e740d4d40074d6007016005", + "0x263580264d20054d60050263530260264d600540d00534b0260264d6005", + "0x54d60054d14d200735f0264d10054d60054d10053180264d10054d6005", + "0x53310261c50054d60054d001c00736502601c0054d600502607e0264d0", + "0x54d600508a00530f02600a0054d600500a00508a02608b0054d60051c5", + "0xa00a00508b0054d600508b0050390260070054d600500700503602608a", + "0x50261710260264d60054d30050c30260264d600502600702608b00708a", + "0x74d600730908a00a0c036a0263090054d60053090053680263090054d6", + "0x263190054d60050260da0260264d60050260070263183140074e831230f", + "0x4d600502b0050d802602b0054d600502608d02631b0054d60053190050d9", + "0x602630f0054d600530f00508a02631b0054d600531b0050d702602b005", + "0x502600702603503801b0c04e903233102c0c04d600731b02b00731200a", + "0x2c00530f0260320054d60050320053180260264d600502600a0260264d6", + "0x4ea0264d60070320050810263310054d600533100503602602c0054d6005", + "0x50390054c90260390054d60050264d30260264d6005026007026036005", + "0x260070260264eb00502640d0260bb0054d60050bc00507d0260bc0054d6", + "0x54c80260ba0054d60050264d30260264d60050360054ca0260264d6005", + "0x34b0054d60050263530260bb0054d60050c300507d0260c30054d60050ba", + "0x35300509b0260264d600534e00509a02635334e0074d60050bb00501a026", + "0x260264d60050260070263650054ee07e0054ed35f0054ec3580054d600a", + "0x54d60051710053180261710054d600502609c0260264d60053580050bc", + "0x40d02636a0054d60053680050f50263680054d600517134b00735f026171", + "0x2609e0260264d600535f0050bc0260264d60050260070260264ef005026", + "0x54d60050d534b00735f0260d50054d60050d50053180260d50054d6005", + "0x4d60050260070260264ef00502640d02636a0054d60050d40050f50260d4", + "0x50d30053180260d30054d60050264c60260264d600507e0050bc026026", + "0x36a0054d60050d20050f50260d20054d60050d334b00735f0260d30054d6", + "0x260264d60053650050bc0260264d60050260070260264ef00502640d026", + "0x50d134b00735f0260d10054d60050d10053180260d10054d60050260a0", + "0x50c40260264d60050264d002636a0054d60050d00050f50260d00054d6", + "0x54d60050ce00508b0260264d60050cf0053ae0260ce0cf0074d600536a", + "0x508a0263940054d60050cc00500e0260cc0054d60050cd0050ca0260cd", + "0x54d600533100503602602c0054d600502c00530f02630f0054d600530f", + "0x4d600502600702639433102c30f00a0053940054d6005394005039026331", + "0x53310263a70054d60050353a40073650263a40054d600502607e026026", + "0x54d600501b00530f02630f0054d600530f00508a0260c40054d60053a7", + "0x30f00a0050c40054d60050c40050390260380054d600503800503602601b", + "0x50261060263ae0054d60050263530260264d60050260070260c403801b", + "0xe0054d60050ca3ae00735f0260ca0054d60050ca0053180260ca0054d6", + "0x1050053310261050054d600500e1060073650261060054d600502607e026", + "0x3180054d600531800530f0263140054d600531400508a0261040054d6005", + "0x31831400a0051040054d60051040050390260070054d6005007005036026", + "0x4d60050263530260264d60050c00051040260264d6005026007026104007", + "0x735f0261020054d60051020053180261020054d6005026106026103005", + "0x4d60051011000073650261000054d600502607e0261010054d6005102103", + "0x30f0260890054d600508900508a0260fe0054d60050ff0053310260ff005", + "0x4d60050fe0050390260070054d60050070050360260880054d6005088005", + "0x708a0050070050260264d60050260260260fe00708808900a0050fe005", + "0x4d60050880050c00260264d60050260070264d340d0074f04d40160074d6", + "0x4d20050890260160054d600501600508a0260264d600502600a0264d2005", + "0x4d60054d000501c0260264d600502600702601c0054f14d04d10074d6007", + "0x160263090054d600508b0050f002608b0054d60051c50053090261c5005", + "0x264f200502640d0263120054d60053090050ef02630f0054d60054d1005", + "0x54d60053140050ee0263140054d60050264d30260264d6005026007026", + "0x50ed0263120054d60053180050ef02630f0054d600501c005016026318", + "0x4d600730f0050890260264d600502600702631b0054f33190054d6007312", + "0x320054d600502c00501c0260264d60050260070263310054f402c02b007", + "0x2b0050160260380054d600501b0050f002601b0054d6005032005309026", + "0x70260264f500502640d0260360054d60050380050ef0260350054d6005", + "0x260bc0054d60050390050ee0260390054d60050264d30260264d6005026", + "0x70360050ed0260360054d60050bc0050ef0260350054d6005331005016", + "0xc30074d60070350050890260264d60050260070260ba0054f60bb0054d6", + "0x3090263530054d600534b00501c0260264d600502600702634e0054f734b", + "0x4d60050c300501602635f0054d60053580050f00263580054d6005353005", + "0x50260070260264f800502640d0263650054d600535f0050ef02607e005", + "0x50160263680054d60051710050ee0261710054d60050264d30260264d6", + "0x54d60073650050ed0263650054d60053680050ef02607e0054d600534e", + "0x4fa0d30d40074d600707e0050890260264d60050260070260d50054f936a", + "0x4d60050d40050c30260264d60050264d00260264d60050260070260d2005", + "0x50bb0054970260264d600536a0054970260264d60050d300534b026026", + "0x50263580260d10054d60050263530260264d60053190054970260264d6", + "0xcf0054d60050d00d100735f0260d00054d60050d00053180260d00054d6", + "0xcd0053310260cd0054d60050cf0ce0073650260ce0054d600502607e026", + "0x160054d600501600508a0260260054d60050260050320260cc0054d6005", + "0xa0050350260c00054d60050c00050380260070054d600500700501b026", + "0x890054d60050890050360264d40054d60054d400530f02600a0054d6005", + "0x70260cc0894d400a0c00070160260160050cc0054d60050cc005039026", + "0x3680263940054d60050261710260264d60050d20050c30260264d6005026", + "0xc40074fb3a73a40074d60073944d40160c036a0263940054d6005394005", + "0xca0054d60050260d50260264d60050264d00260264d60050260070263ae", + "0x4d60051060050d20261060054d60050260d302600e0054d60050260d4026", + "0x260cf0261030054d60051040050d00261040054d60050260d1026105005", + "0x10110210310500e0ca0890cd0261010054d60050260ce0261020054d6005", + "0x264d60050ff0053a70260fe0ff0074d60051000050ea0261000054d6005", + "0x3a700530f0260c00054d60050c00050380263a40054d60053a400508a026", + "0x260054d60050260050320260070054d600500700501b0263a70054d6005", + "0x3190053180260890054d600508900503602600a0054d600500a005035026", + "0x36a0054d600536a0053180260bb0054d60050bb0053180263190054d6005", + "0xfb0fc0fd0164d600536a0bb3190fe08900a0260073a70c03a44d34c5026", + "0x50260070260f40054fc0f50054d60070f60050e80260f60f70f80f90fa", + "0x735f0260f20054d60050f50050e70260f30054d60050263530260264d6", + "0x50f00053ae0260ef0f00074d60050f10050c40260f10054d60050f20f3", + "0xe0260ed0054d60050ee0050ca0260ee0054d60050ef00508b0260264d6", + "0x4d60050fd00508a0260f90054d60050f90050320264360054d60050ed005", + "0x350260fc0054d60050fc0050380260fa0054d60050fa00501b0260fd005", + "0x4d60050f70050360260fb0054d60050fb00530f0260f80054d60050f8005", + "0x4360f70fb0f80fc0fa0fd0f90160054360054d60054360050390260f7005", + "0x4d60050f90050320264390054d60050f40053310260264d6005026007026", + "0x380260fa0054d60050fa00501b0260fd0054d60050fd00508a0260f9005", + "0x4d60050fb00530f0260f80054d60050f80050350260fc0054d60050fc005", + "0x160054390054d60054390050390260f70054d60050f70050360260fb005", + "0x264d60050264d00260264d60050260070264390f70fb0f80fc0fa0fd0f9", + "0x4d60053190054970260264d60050bb0054970260264d600536a005497026", + "0x54480053180264480054d600502610602643f0054d6005026353026026", + "0x264970054d600502607e0261700054d600544843f00735f0264480054d6", + "0x260050320260eb0054d60050ec0053310260ec0054d6005170497007365", + "0x70054d600500700501b0260c40054d60050c400508a0260260054d6005", + "0x3ae00530f02600a0054d600500a0050350260c00054d60050c0005038026", + "0xeb0054d60050eb0050390260890054d60050890050360263ae0054d6005", + "0x50264d00260264d60050260070260eb0893ae00a0c00070c4026016005", + "0xbb0054970260264d600507e0050c30260264d60050d50050bc0260264d6", + "0x264c40260ea0054d60050263530260264d60053190054970260264d6005", + "0x54d60050e90ea00735f0260e90054d60050e90053180260e90054d6005", + "0x53310260e60054d60050e80e70073650260e70054d600502607e0260e8", + "0x54d600501600508a0260260054d60050260050320260e50054d60050e6", + "0x50350260c00054d60050c00050380260070054d600500700501b026016", + "0x54d60050890050360264d40054d60054d400530f02600a0054d600500a", + "0x260e50894d400a0c00070160260160050e50054d60050e5005039026089", + "0x4970260264d60050ba0050bc0260264d60050264d00260264d6005026007", + "0x260e40054d60050263530260264d60050350050c30260264d6005319005", + "0x50e30e400735f0260e30054d60050e30053180260e30054d60050260e6", + "0x260e00054d60050e20e10073650260e10054d600502607e0260e20054d6", + "0x501600508a0260260054d60050260050320260df0054d60050e0005331", + "0x260c00054d60050c00050380260070054d600500700501b0260160054d6", + "0x50890050360264d40054d60054d400530f02600a0054d600500a005035", + "0x894d400a0c00070160260160050df0054d60050df0050390260890054d6", + "0x264d600531b0050bc0260264d60050264d00260264d60050260070260df", + "0x54d60050261050260de0054d60050263530260264d600530f0050c3026", + "0x7e0260dc0054d60050dd0de00735f0260dd0054d60050dd0053180260dd", + "0x4d60050da0053310260da0054d60050dc0db0073650260db0054d6005026", + "0x1b0260160054d600501600508a0260260054d60050260050320260d9005", + "0x4d600500a0050350260c00054d60050c00050380260070054d6005007005", + "0x390260890054d60050890050360264d40054d60054d400530f02600a005", + "0x50260070260d90894d400a0c00070160260160050d90054d60050d9005", + "0x502610602608d0054d60050263530260264d60050880051040260264d6", + "0xd70054d60050d808d00735f0260d80054d60050d80053180260d80054d6", + "0xd60053310260d60054d60050d70060073650260060054d600502607e026", + "0x40d0054d600540d00508a0260260054d60050260050320260810054d6005", + "0xa0050350260c00054d60050c00050380260070054d600500700501b026", + "0x890054d60050890050360264d30054d60054d300530f02600a0054d6005", + "0x260260810894d300a0c000740d0260160050810054d6005081005039026", + "0x70260880890074fd08a00a0074d60070050260070050260264d6005026", + "0x8a0260264d600502600a0260160054d60050c00050c00260264d6005026", + "0x70264d30054fe40d4d40074d600701600508902600a0054d600500a005", + "0x4d10054d60054d20053090264d20054d600540d00501c0260264d6005026", + "0x4d00050ef02601c0054d60054d40050160264d00054d60054d10050f0026", + "0x50264d30260264d60050260070260264ff00502640d0261c50054d6005", + "0x2601c0054d60054d30050160263090054d600508b0050ee02608b0054d6", + "0x702631200550030f0054d60071c50050ed0261c50054d60053090050ef", + "0x260070263190055013183140074d600730f00a0074c30260264d6005026", + "0x2b31b0074d600701c0050890263140054d600531400508a0260264d6005", + "0x531b0050c30260264d60050264d00260264d600502600702602c005502", + "0x50263530260264d60053180054c20260264d600502b00534b0260264d6", + "0x35f0260320054d60050320053180260320054d60050263580263310054d6", + "0x501b0380073650260380054d600502607e02601b0054d6005032331007", + "0x263140054d600531400508a0260360054d60050350053310260350054d6", + "0x50360050390260070054d600500700503602608a0054d600508a00530f", + "0x4d60050264d00260264d600502600702603600708a31400a0050360054d6", + "0x50390053680260390054d60050261710260264d600502c0050c3026026", + "0x70260c30ba0075030bb0bc0074d600703908a3140c036a0260390054d6", + "0x4c10260bc0054d60050bc00508a0260264d600502600a0260264d6005026", + "0x264d600502600702607e35f3580c050435334e34b0c04d60070070bb007", + "0x34b00530f0263650054d60053530054bf0263530054d60053530054c0026", + "0xc04d600734e34b0074c10263650054d60053650054be02634b0054d6005", + "0x4d600536a0054c00260264d60050260070260d30d40d50c050536a368171", + "0xcf0d00d108a4d60050d20054bd0260d20054d600536a0054bf02636a005", + "0xcf0050ad0260264d60050d00050ab0260264d60050d10050aa0260cd0ce", + "0x4bd0260cc0054d60050ce0054bc0260264d60050cd0054970260264d6005", + "0x50ab0260264d60053940050aa0263ae0c43a73a439408a4d6005365005", + "0x4bc0260264d60053ae0054970260264d60050c40050ad0260264d60053a4", + "0x50ca0cc0074bb0260cc0054d60050cc0053180260ca0054d60053a7005", + "0x261710054d600517100530f02600e0054d600500e00531802600e0054d6", + "0x260070261060055060264d600700e0050810263680054d6005368005036", + "0xbc00508a0261050054d60050260ce0260264d60050264d00260264d6005", + "0x3680054d60053680050360261710054d600517100530f0260bc0054d6005", + "0x10400a4d60053181053681710bc08a4b90263180054d60053180054ba026", + "0x264d60050260070260ff0055071000054d60071010054b8026101102103", + "0x4d60050fe0050c40260fe0054d60050263530260264d60051000054b7026", + "0xca0260fb0054d60050fc00508b0260264d60050fd0053ae0260fc0fd007", + "0x4d600510400508a0260f90054d60050fa00500e0260fa0054d60050fb005", + "0x390261020054d60051020050360261030054d600510300530f026104005", + "0x4b60260264d60050260070260f910210310400a0050f90054d60050f9005", + "0x4d600510400508a0260264d60050f80054b50260f70f80074d60050ff005", + "0xf50260f40054d60051020050360260f50054d600510300530f0260f6005", + "0x4ca0260264d600502600702602650800502640d0260f30054d60050f7005", + "0x260f20054d60050263530260264d60053180054c20260264d6005106005", + "0x50f10f200735f0260f10054d60050f10053180260f10054d60050264b4", + "0x260ee0054d60053680050360260ef0054d600517100530f0260f00054d6", + "0x260264d600502600702602650900502640d0260ed0054d60050f00050f5", + "0x54d60050d500530f0260264d60053650054b30260264d60053180054c2", + "0x2640d0260ed0054d60050d30050f50260ee0054d60050d40050360260ef", + "0x35800530f0260264d60053180054c20260264d6005026007026026509005", + "0xed0054d600507e0050f50260ee0054d600535f0050360260ef0054d6005", + "0x4d60050ef00530f0260f60054d60050bc00508a0260264d60050264d0026", + "0x7e0260f30054d60050ed0050f50260f40054d60050ee0050360260f5005", + "0x4d60054390053310264390054d60050f34360073650264360054d6005026", + "0x360260f50054d60050f500530f0260f60054d60050f600508a02643f005", + "0x43f0f40f50f600a00543f0054d600543f0050390260f40054d60050f4005", + "0x4480054d60050263530260264d60053180054c20260264d6005026007026", + "0x17044800735f0261700054d60051700053180261700054d6005026106026", + "0xeb0054d60054970ec0073650260ec0054d600502607e0264970054d6005", + "0xc300530f0260ba0054d60050ba00508a0260ea0054d60050eb005331026", + "0xea0054d60050ea0050390260070054d60050070050360260c30054d6005", + "0x260264d600501c0050c30260264d60050260070260ea0070c30ba00a005", + "0x260264d600502600702602650a00502640d0260e90054d600531900508a", + "0x54d600500a00508a0260264d600501c0050c30260264d60053120050bc", + "0x54d60050261050260e80054d60050263530260264d60050264d00260e9", + "0x7e0260e60054d60050e70e800735f0260e70054d60050e70053180260e7", + "0x4d60050e40053310260e40054d60050e60e50073650260e50054d6005026", + "0x3602608a0054d600508a00530f0260e90054d60050e900508a0260e3005", + "0xe300708a0e900a0050e30054d60050e30050390260070054d6005007005", + "0xe20054d60050263530260264d60050c00051040260264d6005026007026", + "0xe10e200735f0260e10054d60050e10053180260e10054d6005026106026", + "0xde0054d60050e00df0073650260df0054d600502607e0260e00054d6005", + "0x8800530f0260890054d600508900508a0260dd0054d60050de005331026", + "0xdd0054d60050dd0050390260070054d60050070050360260880054d6005", + "0x74d60070070050070050260264d60050260260260dd00708808900a005", + "0x4d40054d600500a0050c00260264d600502600702601608800750b08908a", + "0x4d60074d400508902608a0054d600508a00508a0260264d600502600a026", + "0x4d10054d60054d300501c0260264d60050260070264d200550c4d340d007", + "0x40d00501602601c0054d60054d00050f00264d00054d60054d1005309026", + "0x702602650d00502640d02608b0054d600501c0050ef0261c50054d6005", + "0x2630f0054d60053090050ee0263090054d60050264d30260264d6005026", + "0x708b0050ed02608b0054d600530f0050ef0261c50054d60054d2005016", + "0x3180074d60071c50050890260264d600502600702631400550e3120054d6", + "0x3180050c30260264d60050264d00260264d600502600702631b00550f319", + "0x263530260264d60053120054970260264d600531900534b0260264d6005", + "0x2602c0054d600502c00531802602c0054d600502635802602b0054d6005", + "0x3310320073650260320054d600502607e0263310054d600502c02b00735f", + "0x260054d60050260050320260380054d600501b00533102601b0054d6005", + "0xc00050360260890054d600508900530f02608a0054d600508a00508a026", + "0x260380c008908a02608a0050380054d60050380050390260c00054d6005", + "0x1710260264d600531b0050c30260264d60050264d00260264d6005026007", + "0x703508908a0c036a0260350054d60050350053680260350054d6005026", + "0x54d60050260d30260264d60050260070260bb0bc0075100390360074d6", + "0x530f0260360054d600503600508a0260c30054d60050ba0050d20260ba", + "0x54d60050c00050360260260054d60050260050320260390054d6005039", + "0x4d60053120c30c00260390360894b20263120054d60053120053180260c0", + "0x2600702636500551107e0054d600735f0054b102635f35835334e34b08a", + "0x50c40261710054d60050263530260264d600507e0054b00260264d6005", + "0x54d600536a00508b0260264d60053680053ae02636a3680074d6005171", + "0x50320260d30054d60050d400500e0260d40054d60050d50050ca0260d5", + "0x54d600534e00530f02634b0054d600534b00508a0263530054d6005353", + "0x35308a0050d30054d60050d30050390263580054d600535800503602634e", + "0x320260d20054d60053650053310260264d60050260070260d335834e34b", + "0x4d600534e00530f02634b0054d600534b00508a0263530054d6005353005", + "0x8a0050d20054d60050d20050390263580054d600535800503602634e005", + "0x3530260264d60053120054970260264d60050260070260d235834e34b353", + "0xd00054d60050d00053180260d00054d60050261060260d10054d6005026", + "0xce0073650260ce0054d600502607e0260cf0054d60050d00d100735f026", + "0x54d60050260050320260cc0054d60050cd0053310260cd0054d60050cf", + "0x50360260bb0054d60050bb00530f0260bc0054d60050bc00508a026026", + "0xcc0c00bb0bc02608a0050cc0054d60050cc0050390260c00054d60050c0", + "0x260264d60053140050bc0260264d60050264d00260264d6005026007026", + "0x3a40054d60050261050263940054d60050263530260264d60051c50050c3", + "0x2607e0263a70054d60053a439400735f0263a40054d60053a4005318026", + "0x54d60053ae0053310263ae0054d60053a70c40073650260c40054d6005", + "0x530f02608a0054d600508a00508a0260260054d60050260050320260ca", + "0x54d60050ca0050390260c00054d60050c00050360260890054d6005089", + "0x4d600500a0051040260264d60050260070260ca0c008908a02608a0050ca", + "0x51060053180261060054d600502610602600e0054d6005026353026026", + "0x261040054d600502607e0261050054d600510600e00735f0261060054d6", + "0x260050320261020054d60051030053310261030054d6005105104007365", + "0x160054d600501600530f0260880054d600508800508a0260260054d6005", + "0x8802608a0051020054d60051020050390260c00054d60050c0005036026", + "0x51208908a0074d60070070050070050260264d60050260260261020c0016", + "0x2600a0264d40054d600500a0050c00260264d6005026007026016088007", + "0x4d340d0074d60074d400508902608a0054d600508a00508a0260264d6005", + "0x53090264d10054d60054d300501c0260264d60050260070264d2005513", + "0x54d600540d00501602601c0054d60054d00050f00264d00054d60054d1", + "0x4d600502600702602651400502640d02608b0054d600501c0050ef0261c5", + "0x4d200501602630f0054d60053090050ee0263090054d60050264d3026026", + "0x3120054d600708b0050ed02608b0054d600530f0050ef0261c50054d6005", + "0x55163193180074d60071c50050890260264d6005026007026314005515", + "0x264d60053180050c30260264d60050264d00260264d600502600702631b", + "0x54d60050263530260264d60053120054970260264d600531900534b026", + "0x2b00735f02602c0054d600502c00531802602c0054d600502635802602b", + "0x54d60053310320073650260320054d600502607e0263310054d600502c", + "0x508a0260260054d60050260050320260380054d600501b00533102601b", + "0x54d60050c00050360260890054d600508900530f02608a0054d600508a", + "0x50260070260380c008908a02608a0050380054d60050380050390260c0", + "0x4d60050261710260264d600531b0050c30260264d60050264d00260264d6", + "0x360074d600703508908a0c036a0260350054d6005035005368026035005", + "0xd40260ba0054d60050260d50260264d60050260070260bb0bc007517039", + "0x34e0054d600534b0050d202634b0054d60050260d30260c30054d6005026", + "0x4d60050260cf0263580054d60053530050d00263530054d60050260d1026", + "0x4d600507e35f35834e0c30ba0890cd02607e0054d60050260ce02635f005", + "0x4af0260264d60051710053a70263681710074d60053650050ea026365005", + "0x5180260264d600536a0050840260d10d20d30d40d536a0894d6005368005", + "0x260264d60050d20054ab0260264d60050d30054ac0260264d60050d5005", + "0x4d600503900530f0260360054d600503600508a0260264d60050d10054aa", + "0x3180260c00054d60050c00050360260260054d6005026005032026039005", + "0xcf0d008a4d60053120d40c00260390360895190263120054d6005312005", + "0x264d60050260070263a400551a3940054d60070cc0054a60260cc0cd0ce", + "0x4d600502600a0260c40054d60053940054a50263a70054d6005026353026", + "0xbc0260264d60050260070260ca00551b3ae0054d60070c40054a4026026", + "0x1060054d600500e00531802600e0054d600502609c0260264d60053ae005", + "0x260264d60050ca0050bc0260264d600502600702602651c00502640d026", + "0x264d60050264d00261060054d60051050053180261050054d600502609e", + "0x3ae0261021030074d60051040050c40261040054d60051063a700735f026", + "0x54d60051010050ca0261010054d600510200508b0260264d6005103005", + "0x508a0260ce0054d60050ce0050320260ff0054d600510000500e026100", + "0x54d60050cd0050360260cf0054d60050cf00530f0260d00054d60050d0", + "0x50260070260ff0cd0cf0d00ce08a0050ff0054d60050ff0050390260cd", + "0x8a0260ce0054d60050ce0050320260fe0054d60053a40053310260264d6", + "0x4d60050cd0050360260cf0054d60050cf00530f0260d00054d60050d0005", + "0x260070260fe0cd0cf0d00ce08a0050fe0054d60050fe0050390260cd005", + "0x261060260fd0054d60050263530260264d60053120054970260264d6005", + "0x54d60050fc0fd00735f0260fc0054d60050fc0053180260fc0054d6005", + "0x53310260f90054d60050fb0fa0073650260fa0054d600502607e0260fb", + "0x54d60050bc00508a0260260054d60050260050320260f80054d60050f9", + "0x50390260c00054d60050c00050360260bb0054d60050bb00530f0260bc", + "0x4d00260264d60050260070260f80c00bb0bc02608a0050f80054d60050f8", + "0x3530260264d60051c50050c30260264d60053140050bc0260264d6005026", + "0xf60054d60050f60053180260f60054d60050261050260f70054d6005026", + "0xf40073650260f40054d600502607e0260f50054d60050f60f700735f026", + "0x54d60050260050320260f20054d60050f30053310260f30054d60050f5", + "0x50360260890054d600508900530f02608a0054d600508a00508a026026", + "0xf20c008908a02608a0050f20054d60050f20050390260c00054d60050c0", + "0xf10054d60050263530260264d600500a0051040260264d6005026007026", + "0xf00f100735f0260f00054d60050f00053180260f00054d6005026106026", + "0xed0054d60050ef0ee0073650260ee0054d600502607e0260ef0054d6005", + "0x8800508a0260260054d60050260050320264360054d60050ed005331026", + "0xc00054d60050c00050360260160054d600501600530f0260880054d6005", + "0x4d60050264a20264360c001608802608a0054360054d6005436005039026", + "0x50264a10264d10054d60050260bf0264d30054d60050261030264d4005", + "0x2649e02630f0054d600502649f02608b0054d60050264a002601c0054d6", + "0x50070050260264d60050260260260264d60050261020263140054d6005", + "0x31800508a0260264d600502600702602b31b00751d3193180074d600708a", + "0x880054d60050880053120263190054d600531900530f0263180054d6005", + "0x1b0054d600703200549d02603233102c0c04d60050883193180c00c2026", + "0x4a80260360350074d600501b00549c0260264d600502600702603800551e", + "0x502c00508a0260264d600502600702603900551f3120054d6007036005", + "0xbc0074d600503502c0074a90260350054d600503500531202602c0054d6", + "0x55200ba0054d60070bb00549a0263120054d60053123140074a70260bb", + "0x34e00549902634e34b0074d60050ba0050c60260264d60050260070260c3", + "0x54d600534b0050c00260264d60050260070263530055213090054d6007", + "0x52207e35f0074d60073580050890263090054d600530930f0070c8026358", + "0x507e00534b0260264d600535f0050c30260264d6005026007026365005", + "0x4d40054930260264d60054d10054960260264d600508b0054980260264d6", + "0x51040260264d60054d30051010260264d600501c0055230260264d6005", + "0x3580261710054d60050263530260264d60053120054900260264d6005309", + "0x4d600536817100735f0263680054d60053680053180263680054d6005026", + "0x3310260d40054d600536a0d50073650260d50054d600502607e02636a005", + "0x4d60050bc00508a0260260054d60050260050320260d30054d60050d4005", + "0x350260c00054d60050c00050380260070054d600500700501b0260bc005", + "0x4d60050890050360263310054d600533100530f02600a0054d600500a005", + "0xd308933100a0c00070bc0260160050d30054d60050d3005039026089005", + "0xd20054d60050261710260264d60053650050c30260264d6005026007026", + "0x5240d00d10074d60070d23310bc0c036a0260d20054d60050d2005368026", + "0x8a0260cc0cd0074d600531200548e0260264d60050260070260ce0cf007", + "0x4d600500a0050350260d00054d60050d000530f0260d10054d60050d1005", + "0x48c0260cc0054d60050cc00548d0260890054d600508900503602600a005", + "0x4d60073ae0050e80263ae0c43a73a439408a4d60050cc08900a0d00d108a", + "0x261060054d60050ca0050e70260264d600502600702600e0055250ca005", + "0x4d600539400508a0261040054d60051050050d00261050054d60050260d1", + "0x1b0263a40054d60053a400530f0260c00054d60050c0005038026394005", + "0x4d60053a70050350260260054d60050260050320260070054d6005007005", + "0x3180260cd0054d60050cd00548d0260c40054d60050c40050360263a7005", + "0x3a40c03944d348b0263090054d60053090053120261060054d6005106005", + "0x2610140d4d00164d21021c51030164d60053091060cd1040c43a7026007", + "0x74880264d20054d60054d24d10074890261c50054d60051c508b00748a", + "0x40d4d30070ff0264d00054d60054d001c0074870260160054d60050164d4", + "0x4d60050260070260ff0055261000054d600710100548602640d0054d6005", + "0x54ac0260fc0fd0074d60051000054850260fe0054d6005026353026026", + "0x264d60050fb0050fb0260fa0fb0074d60050fc0050fc0260264d60050fd", + "0x50f80260f80054d60050f90050f90260f90fa0074d60050fa0050fa026", + "0x4d60050f70fe00735f0260f70054d60050f70053180260f70054d60050f8", + "0x30f0261030054d600510300508a0260f50054d60050fa0050f70260f6005", + "0x4d60050f60050f50260f50054d60050f50050f60261020054d6005102005", + "0x70f20050f30260f20f30f40c04d60050f60f510210300a0f40260f6005", + "0xef0074d60050f10050f20260264d60050260070260f00055270f10054d6", + "0x53ae0264360ed0074d60050ef0050c40260264d60050ee0050bc0260ee", + "0x43f0054d60054390050ca0264390054d600543600508b0260264d60050ed", + "0xf400508a0260160054d60050160050320264480054d600543f00500e026", + "0x1c50054d60051c50050380264d20054d60054d200501b0260f40054d6005", + "0x40d0050360260f30054d60050f300530f0264d00054d60054d0005035026", + "0xf34d01c54d20f40160160054480054d600544800503902640d0054d6005", + "0x160050320261700054d60050f00053310260264d600502600702644840d", + "0x4d20054d60054d200501b0260f40054d60050f400508a0260160054d6005", + "0xf300530f0264d00054d60054d00050350261c50054d60051c5005038026", + "0x1700054d600517000503902640d0054d600540d0050360260f30054d6005", + "0x160050320260264d600502600702617040d0f34d01c54d20f4016016005", + "0xeb0054d60054d200501b0260ec0054d600510300508a0264970054d6005", + "0x10200530f0260e90054d60054d00050350260ea0054d60051c5005038026", + "0xe60054d60050ff0054840260e70054d600540d0050360260e80054d6005", + "0x260264d600508b0054980260264d600502600702602652800502640d026", + "0x264d600501c0055230260264d60054d40054930260264d60054d1005496", + "0x4d60050cd0054900260264d60053090051040260264d60054d3005101026", + "0x501b0260ec0054d600539400508a0264970054d6005026005032026026", + "0x54d60053a70050350260ea0054d60050c00050380260eb0054d6005007", + "0x54840260e70054d60050c40050360260e80054d60053a400530f0260e9", + "0x54d60054970050320260e50054d60050e60053310260e60054d600500e", + "0x50380260eb0054d60050eb00501b0260ec0054d60050ec00508a026497", + "0x54d60050e800530f0260e90054d60050e90050350260ea0054d60050ea", + "0x4970160050e50054d60050e50050390260e70054d60050e70050360260e8", + "0x264d600508b0054980260264d60050260070260e50e70e80e90ea0eb0ec", + "0x4d600501c0055230260264d60054d40054930260264d60054d1005496026", + "0x53120054900260264d60053090051040260264d60054d3005101026026", + "0xe30053180260e30054d60050261060260e40054d60050263530260264d6", + "0xe10054d600502607e0260e20054d60050e30e400735f0260e30054d6005", + "0x50320260df0054d60050e00053310260e00054d60050e20e1007365026", + "0x54d600500700501b0260cf0054d60050cf00508a0260260054d6005026", + "0x530f02600a0054d600500a0050350260c00054d60050c0005038026007", + "0x54d60050df0050390260890054d60050890050360260ce0054d60050ce", + "0x50bc0260264d60050260070260df0890ce00a0c00070cf0260160050df", + "0x4930260264d60054d10054960260264d600508b0054980260264d6005353", + "0x260264d60054d30051010260264d600501c0055230260264d60054d4005", + "0x264d600530f0054830260264d60053120054900260264d600534b005104", + "0x4d60050dd0053180260dd0054d60050260e60260de0054d6005026353026", + "0x3650260db0054d600502607e0260dc0054d60050dd0de00735f0260dd005", + "0x50260050320260d90054d60050da0053310260da0054d60050dc0db007", + "0x260070054d600500700501b0260bc0054d60050bc00508a0260260054d6", + "0x533100530f02600a0054d600500a0050350260c00054d60050c0005038", + "0x50d90054d60050d90050390260890054d60050890050360263310054d6", + "0x508b0054980260264d60050260070260d908933100a0c00070bc026016", + "0x1c0055230260264d60054d40054930260264d60054d10054960260264d6", + "0x54900260264d600530f0054830260264d60054d30051010260264d6005", + "0x260054d600502600503202608d0054d60050c30053310260264d6005312", + "0xc00050380260070054d600500700501b0260bc0054d60050bc00508a026", + "0x3310054d600533100530f02600a0054d600500a0050350260c00054d6005", + "0xbc02601600508d0054d600508d0050390260890054d6005089005036026", + "0x260264d60050390050bc0260264d600502600702608d08933100a0c0007", + "0x264d60054d40054930260264d60054d10054960260264d600508b005498", + "0x4d600530f0054830260264d60054d30051010260264d600501c005523026", + "0x4d60050263530260264d60053140054820260264d6005035005104026026", + "0x735f0260d70054d60050d70053180260d70054d60050261050260d8005", + "0x4d60050060d60073650260d60054d600502607e0260060054d60050d70d8", + "0x8a0260260054d60050260050320260940054d6005081005331026081005", + "0x4d60050c00050380260070054d600500700501b02602c0054d600502c005", + "0x360263310054d600533100530f02600a0054d600500a0050350260c0005", + "0xc000702c0260160050940054d60050940050390260890054d6005089005", + "0x54960260264d600508b0054980260264d600502600702609408933100a", + "0x1010260264d600501c0055230260264d60054d40054930260264d60054d1", + "0x260264d60053140054820260264d600530f0054830260264d60054d3005", + "0x502c00508a0260260054d60050260050320264ca0054d6005038005331", + "0x260c00054d60050c00050380260070054d600500700501b02602c0054d6", + "0x50890050360263310054d600533100530f02600a0054d600500a005035", + "0x8933100a0c000702c0260160054ca0054d60054ca0050390260890054d6", + "0x4d600530f0054830260264d60053140054820260264d60050260070264ca", + "0x54d40054930260264d60054d10054960260264d600508b005498026026", + "0x880051040260264d60054d30051010260264d600501c0055230260264d6", + "0x531802607d0054d60050261060264c90054d60050263530260264d6005", + "0x54d600502607e0264c80054d600507d4c900735f02607d0054d600507d", + "0x3202609b0054d600509a00533102609a0054d60054c801a00736502601a", + "0x4d600500700501b02631b0054d600531b00508a0260260054d6005026005", + "0x30f02600a0054d600500a0050350260c00054d60050c0005038026007005", + "0x4d600509b0050390260890054d600508900503602602b0054d600502b005", + "0x50260264d600502602602609b08902b00a0c000731b02601600509b005", + "0x8a0260264d600502600702601608800752908908a0074d6007007026007", + "0x4d600500a0053120260890054d600508900530f02608a0054d600508a005", + "0x4d60074d300549d0264d340d4d40c04d600500a08908a0c00c202600a005", + "0x1c4d00074d60054d200549c0260264d60050260070264d100552a4d2005", + "0x50c00260264d600502600702608b00552b1c50054d600701c0054a8026", + "0x2600702631400552c31230f0074d60073090050890263090054d60054d0", + "0x54900260264d600531200534b0260264d600530f0050c30260264d6005", + "0x3180263190054d60050263580263180054d60050263530260264d60051c5", + "0x4d600502607e02631b0054d600531931800735f0263190054d6005319005", + "0x263310054d600502c00533102602c0054d600531b02b00736502602b005", + "0x540d00530f0260050054d60050050050350264d40054d60054d400508a", + "0x53310054d60053310050390260c00054d60050c000503602640d0054d6", + "0x260264d60053140050c30260264d60050260070263310c040d0054d408a", + "0x3240d4d40c036a0260320054d60050320053680260320054d6005026171", + "0x51c500548e0260264d600502600702603603500752d03801b0074d6007", + "0x2601b0054d600501b00508a0260264d60050390054900260bc0390074d6", + "0x50c00050360260050054d60050050050350260380054d600503800530f", + "0x50bc0c000503801b08a48c0260bc0054d60050bc00548d0260c00054d6", + "0x702635800552e3530054d600734e0050e802634e34b0c30ba0bb08a4d6", + "0x2607e0054d60053530050e702635f0054d60050263530260264d6005026", + "0x53ae0263681710074d60053650050c40263650054d600507e35f00735f", + "0xd50054d600536a0050ca02636a0054d600536800508b0260264d6005171", + "0xc30050350260bb0054d60050bb00508a0260d40054d60050d500500e026", + "0x34b0054d600534b0050360260ba0054d60050ba00530f0260c30054d6005", + "0x4d60050260070260d434b0ba0c30bb08a0050d40054d60050d4005039026", + "0x50350260bb0054d60050bb00508a0260d30054d6005358005331026026", + "0x54d600534b0050360260ba0054d60050ba00530f0260c30054d60050c3", + "0x50260070260d334b0ba0c30bb08a0050d30054d60050d300503902634b", + "0x50261060260d20054d60050263530260264d60051c50054900260264d6", + "0xd00054d60050d10d200735f0260d10054d60050d10053180260d10054d6", + "0xce0053310260ce0054d60050d00cf0073650260cf0054d600502607e026", + "0x50054d60050050050350260350054d600503500508a0260cd0054d6005", + "0xcd0050390260c00054d60050c00050360260360054d600503600530f026", + "0x50bc0260264d60050260070260cd0c003600503508a0050cd0054d6005", + "0x1050260cc0054d60050263530260264d60054d00051040260264d600508b", + "0x4d60053940cc00735f0263940054d60053940053180263940054d6005026", + "0x3310260c40054d60053a43a70073650263a70054d600502607e0263a4005", + "0x4d60050050050350264d40054d60054d400508a0263ae0054d60050c4005", + "0x390260c00054d60050c000503602640d0054d600540d00530f026005005", + "0x260264d60050260070263ae0c040d0054d408a0053ae0054d60053ae005", + "0x50050050350264d40054d60054d400508a0260ca0054d60054d1005331", + "0x260c00054d60050c000503602640d0054d600540d00530f0260050054d6", + "0x264d60050260070260ca0c040d0054d408a0050ca0054d60050ca005039", + "0x54d600502610602600e0054d60050263530260264d600500a005104026", + "0x7e0261050054d600510600e00735f0261060054d6005106005318026106", + "0x4d60051030053310261030054d60051051040073650261040054d6005026", + "0x30f0260050054d60050050050350260880054d600508800508a026102005", + "0x4d60051020050390260c00054d60050c00050360260160054d6005016005", + "0x70050070050260264d60050260260261020c001600508808a005102005", + "0x500a0050c00260264d600502600702601608800752f08908a0074d6007", + "0x508902608a0054d600508a00508a0260264d600502600a0264d40054d6", + "0x54d300501c0260264d60050260070264d20055304d340d0074d60074d4", + "0x2601c0054d60054d00050f00264d00054d60054d10053090264d10054d6", + "0x53100502640d02608b0054d600501c0050ef0261c50054d600540d005016", + "0x4d60053090050ee0263090054d60050264d30260264d6005026007026026", + "0xed02608b0054d600530f0050ef0261c50054d60054d200501602630f005", + "0x71c50050890260264d60050260070263140055323120054d600708b005", + "0x260264d60050264d00260264d600502600702631b0055333193180074d6", + "0x264d60053120054970260264d600531900534b0260264d60053180050c3", + "0x4d600502c00531802602c0054d600502635802602b0054d6005026353026", + "0x3650260320054d600502607e0263310054d600502c02b00735f02602c005", + "0x50260050320260380054d600501b00533102601b0054d6005331032007", + "0x260890054d600508900530f02608a0054d600508a00508a0260260054d6", + "0x8908a02608a0050380054d60050380050390260c00054d60050c0005036", + "0x4d600531b0050c30260264d60050264d00260264d60050260070260380c0", + "0x8a0c036a0260350054d60050350053680260350054d6005026171026026", + "0x264810260264d60050260070260bb0bc0075340390360074d6007035089", + "0x4d60053120ba0260c04800260ba0054d60050ba0053180260ba0054d6005", + "0x34e0074d600534b03600747f02634b0054d600534b00531802634b0c3007", + "0x35f0050d802635f0054d600502608d0263580054d60053530050d9026353", + "0x34e0054d600534e00508a0260c30054d60050c300503202635f0054d6005", + "0x70260d536a3680c053517136507e0c04d600735835f0c003900a006026", + "0x30f0261710054d60051710053180260264d600502600a0260264d6005026", + "0x4d60071710050810263650054d600536500503602607e0054d600507e005", + "0x547e0260d30054d60050264d30260264d60050260070260d4005536026", + "0x2602653700502640d0260d10054d60050d200547d0260d20054d60050d3", + "0x260d00054d60050264d30260264d60050d40054ca0260264d6005026007", + "0x4d60050263530260d10054d60050cf00547d0260cf0054d60050d000547c", + "0x47b0260cd0054d60050cd00547d0260cd0054d60050d100547b0260ce005", + "0x4d60070cc0054a40260cc0054d60050cc00547d0260cc0054d60050cd005", + "0x9c0260264d60053940050bc0260264d60050260070263a4005538394005", + "0x2602653900502640d0260c40054d60053a70053180263a70054d6005026", + "0x263ae0054d600502609e0260264d60053a40050bc0260264d6005026007", + "0x4d60050c40ce00735f0260264d60050264d00260c40054d60053ae005318", + "0x8b0260264d600500e0053ae02610600e0074d60050ca0050c40260ca005", + "0x4d600510400500e0261040054d60051050050ca0261050054d6005106005", + "0x30f02634e0054d600534e00508a0260c30054d60050c3005032026103005", + "0x4d60051030050390263650054d600536500503602607e0054d600507e005", + "0x4d600502607e0260264d600502600702610336507e34e0c308a005103005", + "0x261000054d60051010053310261010054d60050d5102007365026102005", + "0x536800530f02634e0054d600534e00508a0260c30054d60050c3005032", + "0x51000054d600510000503902636a0054d600536a0050360263680054d6", + "0x260264d60053120054970260264d600502600702610036a36834e0c308a", + "0x54d60050fe0053180260fe0054d60050261060260ff0054d6005026353", + "0x73650260fc0054d600502607e0260fd0054d60050fe0ff00735f0260fe", + "0x4d60050260050320260fa0054d60050fb0053310260fb0054d60050fd0fc", + "0x360260bb0054d60050bb00530f0260bc0054d60050bc00508a026026005", + "0xc00bb0bc02608a0050fa0054d60050fa0050390260c00054d60050c0005", + "0x264d60053140050bc0260264d60050264d00260264d60050260070260fa", + "0x54d60050261050260f90054d60050263530260264d60051c50050c3026", + "0x7e0260f70054d60050f80f900735f0260f80054d60050f80053180260f8", + "0x4d60050f50053310260f50054d60050f70f60073650260f60054d6005026", + "0x30f02608a0054d600508a00508a0260260054d60050260050320260f4005", + "0x4d60050f40050390260c00054d60050c00050360260890054d6005089005", + "0x500a0051040260264d60050260070260f40c008908a02608a0050f4005", + "0xf20053180260f20054d60050261060260f30054d60050263530260264d6", + "0xf00054d600502607e0260f10054d60050f20f300735f0260f20054d6005", + "0x50320260ee0054d60050ef0053310260ef0054d60050f10f0007365026", + "0x54d600501600530f0260880054d600508800508a0260260054d6005026", + "0x2608a0050ee0054d60050ee0050390260c00054d60050c0005036026016", + "0x8a00a0074d60070050260070050260264d60050260260260ee0c0016088", + "0xa0260160054d60050c00050c00260264d600502600702608808900753a", + "0x4d40074d600701600508902600a0054d600500a00508a0260264d6005026", + "0x3090264d20054d600540d00501c0260264d60050260070264d300553b40d", + "0x4d60054d40050160264d00054d60054d10050f00264d10054d60054d2005", + "0x502600702602653c00502640d0261c50054d60054d00050ef02601c005", + "0x50160263090054d600508b0050ee02608b0054d60050264d30260264d6", + "0x54d60071c50050ed0261c50054d60053090050ef02601c0054d60054d3", + "0x53e3183140074d600701c0050890260264d600502600702631200553d30f", + "0x4d60053140050c30260264d60050264d00260264d6005026007026319005", + "0x4d60050263530260264d600530f0054970260264d600531800534b026026", + "0x735f02602b0054d600502b00531802602b0054d600502635802631b005", + "0x4d600502c3310073650263310054d600502607e02602c0054d600502b31b", + "0x30f02600a0054d600500a00508a02601b0054d6005032005331026032005", + "0x4d600501b0050390260070054d600500700503602608a0054d600508a005", + "0x264d60050264d00260264d600502600702601b00708a00a00a00501b005", + "0x4d60050380053680260380054d60050261710260264d60053190050c3026", + "0x260070260bc03900753f0360350074d600703808a00a0c036a026038005", + "0x260ba30f0074d600530f0050d60260bb0054d600502647a0260264d6005", + "0x4d60050c30053180260264d600502600a0260c30054d60050bb0ba0074bb", + "0x34b0055400264d60070c30050810260350054d600503500508a0260c3005", + "0x34e0054d60050264d30260264d600530f0054970260264d6005026007026", + "0x502640d0263580054d600535300547d0263530054d600534e00547e026", + "0x4d60050264790260264d600534b0054ca0260264d6005026007026026541", + "0x2607e0054d600507e00531802607e0054d600535f30f0074bb02635f005", + "0x4d60050264d30260264d60050260070263650055420264d600707e005081", + "0x40d0263580054d600536800547d0263680054d600517100547e026171005", + "0x264d30260264d60053650054ca0260264d6005026007026026541005026", + "0x3580054d60050d500547d0260d50054d600536a00547c02636a0054d6005", + "0x70260d20055430d30054d60073580054a40260d40054d6005026353026", + "0x3180260d10054d600502609c0260264d60050d30050bc0260264d6005026", + "0xbc0260264d600502600702602654400502640d0260d00054d60050d1005", + "0xd00054d60050cf0053180260cf0054d600502609e0260264d60050d2005", + "0x50ce0050c40260ce0054d60050d00d400735f0260264d60050264d0026", + "0x263940054d60050cc00508b0260264d60050cd0053ae0260cc0cd0074d6", + "0x503500508a0263a70054d60053a400500e0263a40054d60053940050ca", + "0x260070054d60050070050360260360054d600503600530f0260350054d6", + "0x260264d60050260070263a700703603500a0053a70054d60053a7005039", + "0x3ae0054d60050261060260c40054d60050263530260264d600530f005497", + "0x2607e0260ca0054d60053ae0c400735f0263ae0054d60053ae005318026", + "0x54d60051060053310261060054d60050ca00e00736502600e0054d6005", + "0x50360260bc0054d60050bc00530f0260390054d600503900508a026105", + "0x261050070bc03900a0051050054d60051050050390260070054d6005007", + "0xc30260264d60053120050bc0260264d60050264d00260264d6005026007", + "0x261030054d60050261050261040054d60050263530260264d600501c005", + "0x502607e0261020054d600510310400735f0261030054d6005103005318", + "0xff0054d60051000053310261000054d60051021010073650261010054d6", + "0x700503602608a0054d600508a00530f02600a0054d600500a00508a026", + "0x70260ff00708a00a00a0050ff0054d60050ff0050390260070054d6005", + "0x1060260fe0054d60050263530260264d60050c00051040260264d6005026", + "0x4d60050fd0fe00735f0260fd0054d60050fd0053180260fd0054d6005026", + "0x3310260fa0054d60050fc0fb0073650260fb0054d600502607e0260fc005", + "0x4d600508800530f0260890054d600508900508a0260f90054d60050fa005", + "0xa0050f90054d60050f90050390260070054d6005007005036026088005", + "0x260260260264d60050261020260880054d60050264780260f9007088089", + "0x260070264d340d0075454d40160074d60070c00050070050260264d6005", + "0x264d40054d60054d400530f0260160054d600501600508a0260264d6005", + "0x264d04d14d20c04d600508a4d40160c047702608a0054d600508a005312", + "0x1c0054750260264d60050260070261c500554601c0054d60074d0005476", + "0x502600702630f0055470890054d600730900547402630908b0074d6005", + "0x3120264d10054d60054d100530f0264d20054d60054d200508a0260264d6", + "0x4d14d20c04720260890054d600508908800747302608b0054d600508b005", + "0x702631b0055483190054d60073180054710263183143120c04d600508b", + "0x54d600702c00546f02602c02b0074d60053190054700260264d6005026", + "0x8902601b0054d600502b0050c00260264d6005026007026032005549331", + "0x380050c30260264d600502600702603600554a0350380074d600701b005", + "0x546d0260264d600533100546e0260264d600503500534b0260264d6005", + "0x3180260bc0054d60050263580260390054d60050263530260264d6005089", + "0x4d600502607e0260bb0054d60050bc03900735f0260bc0054d60050bc005", + "0x2634b0054d60050c30053310260c30054d60050bb0ba0073650260ba005", + "0x50070050350263120054d600531200508a0260260054d6005026005032", + "0x2600a0054d600500a0050360263140054d600531400530f0260070054d6", + "0x4d600502600702634b00a31400731202608900534b0054d600534b005039", + "0x534e00536802634e0054d60050261710260264d60050360050c3026026", + "0x702607e35f00754b3583530074d600734e3143120c036a02634e0054d6", + "0xd30261710054d60050260d40263650054d60050260d50260264d6005026", + "0xd50054d60050260d102636a0054d60053680050d20263680054d6005026", + "0x4d60050260ce0260d30054d60050260cf0260d40054d60050d50050d0026", + "0x535300508a0260d10054d60050d20d30d436a1713650890cd0260d2005", + "0x260260054d60050260050320263580054d600535800530f0263530054d6", + "0x508900546c02600a0054d600500a0050360260070054d6005007005035", + "0xd100a00702635835301646a0263310054d600533100546b0260890054d6", + "0x54c3a40054d60073940050dc0263940cc0cd0ce0cf0d00894d6005331089", + "0x4d60050263530260264d60053a40050db0260264d60050260070263a7005", + "0x8b0260264d60053ae0053ae0260ca3ae0074d60050c40050c40260c4005", + "0x4d600510600500e0261060054d600500e0050ca02600e0054d60050ca005", + "0x350260d00054d60050d000508a0260ce0054d60050ce005032026105005", + "0x4d60050cc0050360260cf0054d60050cf00530f0260cd0054d60050cd005", + "0x70261050cc0cf0cd0d00ce0890051050054d60051050050390260cc005", + "0xce0054d60050ce0050320261040054d60053a70053310260264d6005026", + "0xcf00530f0260cd0054d60050cd0050350260d00054d60050d000508a026", + "0x1040054d60051040050390260cc0054d60050cc0050360260cf0054d6005", + "0x4d600533100546e0260264d60050260070261040cc0cf0cd0d00ce089005", + "0x4d60050261060261030054d60050263530260264d600508900546d026026", + "0x261010054d600510210300735f0261020054d6005102005318026102005", + "0x50ff0053310260ff0054d60051011000073650261000054d600502607e", + "0x2635f0054d600535f00508a0260260054d60050260050320260fe0054d6", + "0x500a00503602607e0054d600507e00530f0260070054d6005007005035", + "0x260fe00a07e00735f0260890050fe0054d60050fe00503902600a0054d6", + "0x260264d600502b0051040260264d60050320050bc0260264d6005026007", + "0xfc0054d60050260e60260fd0054d60050263530260264d600508900546d", + "0x2607e0260fb0054d60050fc0fd00735f0260fc0054d60050fc005318026", + "0x54d60050f90053310260f90054d60050fb0fa0073650260fa0054d6005", + "0x50350263120054d600531200508a0260260054d60050260050320260f8", + "0x54d600500a0050360263140054d600531400530f0260070054d6005007", + "0x260070260f800a3140073120260890050f80054d60050f800503902600a", + "0x320260f70054d600531b0053310260264d600508900546d0260264d6005", + "0x4d60050070050350263120054d600531200508a0260260054d6005026005", + "0x3902600a0054d600500a0050360263140054d600531400530f026007005", + "0x264d60050260070260f700a3140073120260890050f70054d60050f7005", + "0x4d60050880054690260264d600508b0051040260264d600530f0050bc026", + "0x50f50053180260f50054d60050261050260f60054d6005026353026026", + "0x260f30054d600502607e0260f40054d60050f50f600735f0260f50054d6", + "0x260050320260f10054d60050f20053310260f20054d60050f40f3007365", + "0x70054d60050070050350264d20054d60054d200508a0260260054d6005", + "0xf100503902600a0054d600500a0050360264d10054d60054d100530f026", + "0x4690260264d60050260070260f100a4d10074d20260890050f10054d6005", + "0x54d60050260050320260f00054d60051c50053310260264d6005088005", + "0x530f0260070054d60050070050350264d20054d60054d200508a026026", + "0x54d60050f000503902600a0054d600500a0050360264d10054d60054d1", + "0x50880054690260264d60050260070260f000a4d10074d20260890050f0", + "0x50261060260ef0054d60050263530260264d600508a0051040260264d6", + "0xed0054d60050ee0ef00735f0260ee0054d60050ee0053180260ee0054d6", + "0x4390053310264390054d60050ed4360073650264360054d600502607e026", + "0x40d0054d600540d00508a0260260054d600502600503202643f0054d6005", + "0xa0050360264d30054d60054d300530f0260070054d6005007005035026", + "0x43f00a4d300740d02608900543f0054d600543f00503902600a0054d6005", + "0x1608800754d08908a0074d60070050260070050260264d60050264d0026", + "0x508a00508a0264d400a0074d600500a0050d60260264d6005026007026", + "0x260264d600502600702640d00554e0264d60074d400508102608a0054d6", + "0x54d30070074670264d30054d60050c00054680260264d600500a005497", + "0x2608a0054d600508a00508a0264d10054d60054d20054660264d20054d6", + "0x4d108908a0c00054d10054d60054d10054650260890054d600508900530f", + "0x54d600508a00508a0260264d600540d0054ca0260264d6005026007026", + "0x2601c4d00074d600500708a0074640260070054d600500700531202608a", + "0x1c50054620260264d600502600702608b00554f1c50054d600701c005463", + "0x50260070263140055503120054d600730f00546102630f3090074d6005", + "0x4bb0263190054d600502609e0263180054d60053120c00074600260264d6", + "0x508900530f0264d00054d60054d000508a02631b0054d600531900a007", + "0x263180054d60053180053140263090054d60053090053120260890054d6", + "0x2c02b0c04d600531b3183090894d008a31902631b0054d600531b005318", + "0x260264d600500a0054970260264d600502600702633102c02b0c0005331", + "0x50323090074670260320054d60053140050bb0260264d60050c000534e", + "0x264d00054d60054d000508a0260380054d600501b00546602601b0054d6", + "0x380894d00c00050380054d60050380054650260890054d600508900530f", + "0x264d60050c000534e0260264d600500a0054970260264d6005026007026", + "0x8900530f0264d00054d60054d000508a0260350054d600508b00545f026", + "0x260070260350894d00c00050350054d60050350054650260890054d6005", + "0x51040260264d60050c000534e0260264d600500a0054970260264d6005", + "0x3180260390054d60050261060260360054d60050263530260264d6005007", + "0x4d600502607e0260bc0054d600503903600735f0260390054d6005039005", + "0x260c30054d60050ba00545f0260ba0054d60050bc0bb0073650260bb005", + "0x50c30054650260160054d600501600530f0260880054d600508800508a", + "0x70890070074c10260264d60050264d00260c30160880c00050c30054d6", + "0x4d30054c00260264d60050260070264d04d14d20c05514d340d4d40c04d6", + "0x4d40054d60054d400530f02601c0054d60054d30054bf0264d30054d6005", + "0x55230908b1c50c04d600740d4d40074c102601c0054d600501c0054be026", + "0x4bf0263090054d60053090054c00260264d600502600702631431230f0c0", + "0xaa02633102c02b31b31908a4d60053180054bd0263180054d6005309005", + "0x260264d600502c0050ad0260264d600502b0050ad0260264d6005319005", + "0x4d600531b00545d02631b0054d600531b00545e0260264d6005331005497", + "0x34e34b0c30ba0bb0bc03903603503801b4d14d600503200545c026032005", + "0x3500545b0260264d60050380050ad0260264d600501b005497026358353", + "0x545a0260264d60050bb0054970260264d60050bc0054970260264d6005", + "0x4590260264d600534e0054590260264d60050c300545b0260264d60050ba", + "0x35f0054d600534b0050c00260264d60053580051040260264d6005353005", + "0x8b0050360261c50054d60051c500530f02635f0054d600535f005016026", + "0x390054d60050390053180260360054d600503600531202608b0054d6005", + "0xc30260264d600502600702617100555336507e0074d600735f005089026", + "0x260264d600501600534e0260264d600536500534b0260264d600507e005", + "0x264d60050360051040260264d600501c0054b30260264d6005039005497", + "0x54d60050264580263680054d60050263530260264d60050880053a7026", + "0x7e0260d50054d600536a36800735f02636a0054d600536a00531802636a", + "0x4d60050d30054570260d30054d60050d50d40073650260d40054d6005026", + "0x30f0260050054d60050050050380260260054d600502600508a0260d2005", + "0x4d600500a0050320260c00054d60050c000501b0261c50054d60051c5005", + "0x45602608b0054d600508b00503602608a0054d600508a00503502600a005", + "0x50260070260d208b08a00a0c01c50050260160050d20054d60050d2005", + "0xce0cf0d00d10894d60050880054af0260264d60051710050c30260264d6", + "0xc00263a40360074d60050360054550263940054d600502608d0260cc0cd", + "0x3940054d60053940050d80260264d600502600a0263a70054d60053a4005", + "0x264d60050260070260ca0055543ae0c40074d60073943a70260c0454026", + "0xe00530902600e0054d60053ae00501c0263ae0054d60053ae005453026", + "0x261060054d60051060053180261050054d60050264520261060054d6005", + "0xc400508a0261040054d60051040053180261040054d60051051060074bb", + "0x264d60050260070261030055550264d60071040050810260c40054d6005", + "0x74d60050160054510260264d600501c0054b30260264d60050264d0026", + "0x508a0261000054d60051010054500260264d600510200534e026101102", + "0x54d60051c500530f0260050054d60050050050380260c40054d60050c4", + "0x503502600a0054d600500a0050320260c00054d60050c000501b0261c5", + "0x54d600503600531202608b0054d600508b00503602608a0054d600508a", + "0x4d301e0260390054d60050390053180261000054d600510000544f026036", + "0xfa0fb0fc0fd0fe0ff0164d60050391000360cf08b08a00a0c01c50050c4", + "0x260264d60050260070260f60055560f70054d60070f800507a0260f80f9", + "0x50ff00508a0260264d60050f40054970260f40f50074d60050f700544c", + "0x260f10054d60050fd00530f0260f20054d60050fe0050380260f30054d6", + "0x50fa0050350260ef0054d60050fb0050320260f00054d60050fc00501b", + "0x264360054d60050d100510a0260ed0054d60050f90050360260ee0054d6", + "0x50ce00510b02643f0054d60050f500544a0264390054d60050d000544b", + "0x264970054d60050cc00510e0261700054d60050cd00510d0264480054d6", + "0x5180260264d60050d10050840260264d600502600702602655700502640d", + "0x260264d60050cd0054ab0260264d60050cc0054aa0260264d60050d0005", + "0x4d60050ff00508a0260ec0054d60050f60054570260264d60050ce0054ac", + "0x1b0260fd0054d60050fd00530f0260fe0054d60050fe0050380260ff005", + "0x4d60050fa0050350260fb0054d60050fb0050320260fc0054d60050fc005", + "0x160050ec0054d60050ec0054560260f90054d60050f90050360260fa005", + "0x4d60051030054ca0260264d60050260070260ec0f90fa0fb0fc0fd0fe0ff", + "0x4d600502600702602655800502640d0260eb0054d60050c400508a026026", + "0x50160054510260264d60050264d00260eb0054d60050ca00508a026026", + "0x47c0260e80054d60050264d30260264d60050ea00534e0260e90ea0074d6", + "0xaa0260e20e30e40e50e608a4d600501c0054bd0260e70054d60050e8005", + "0x260264d60050e40050ad0260264d60050e50050ab0260264d60050e6005", + "0x260e10054d60050cc0cd0ce0cf0d00d10890cd0260264d60050e2005497", + "0x51c500530f0260050054d60050050050380260e00054d60050e9005450", + "0x2600a0054d600500a0050320260c00054d60050c000501b0261c50054d6", + "0x50e000544f02608b0054d600508b00503602608a0054d600508a005035", + "0x260360054d60050360053120260390054d60050390053180260e00054d6", + "0x50eb4d14490260e30054d60050e30051100260e70054d60050e700547d", + "0xda0db0dc0dd0de0df0164d60050e30e70360390e00e108b08a00a0c01c5", + "0x260264d60050260070260d70055590d80054d600708d0050dc02608d0d9", + "0x50060054af0260264d60050d60050bc0260d60060074d60050d8005443", + "0xde0050380260f30054d60050df00508a0264c807d4c94ca0940810894d6", + "0xf00054d60050dc00501b0260f10054d60050dd00530f0260f20054d6005", + "0xd90050360260ee0054d60050da0050350260ef0054d60050db005032026", + "0x4390054d600509400544b0264360054d600508100510a0260ed0054d6005", + "0x7d00510d0264480054d60054c900510b02643f0054d60054ca00544a026", + "0x2601a0054d60050264420264970054d60054c800510e0261700054d6005", + "0x54d600501a09a00711202609a0054d600549717044843f4394360890cd", + "0xf301600509c0054d600509c00545602609c0054d600509b00511402609b", + "0x54d60050d70054570260264d600502600702609c0ed0ee0ef0f00f10f2", + "0x530f0260de0054d60050de0050380260df0054d60050df00508a02609e", + "0x54d60050db0050320260dc0054d60050dc00501b0260dd0054d60050dd", + "0x54560260d90054d60050d90050360260da0054d60050da0050350260db", + "0x4d600502600702609e0d90da0db0dc0dd0de0df01600509e0054d600509e", + "0x501600534e0260264d60050880053a70260264d600501c0054b3026026", + "0x4570260a00054d60053144c60073650264c60054d600502607e0260264d6", + "0x4d60050050050380260260054d600502600508a0264c50054d60050a0005", + "0x320260c00054d60050c000501b02630f0054d600530f00530f026005005", + "0x4d600531200503602608a0054d600508a00503502600a0054d600500a005", + "0x4c531208a00a0c030f0050260160054c50054d60054c5005456026312005", + "0x264d60050880053a70260264d600501600534e0260264d6005026007026", + "0x4c30054570264c30054d60054d04c40073650264c40054d600502607e026", + "0x50054d60050050050380260260054d600502600508a0264c20054d6005", + "0xa0050320260c00054d60050c000501b0264d20054d60054d200530f026", + "0x4d10054d60054d100503602608a0054d600508a00503502600a0054d6005", + "0x4d00264c24d108a00a0c04d20050260160054c20054d60054c2005456026", + "0x40d4d40160c055a08808908a0c04d60070070050074c10260264d6005026", + "0x4d60050880054bf0260880054d60050880054c00260264d6005026007026", + "0x4d60054d20050aa0261c501c4d04d14d208a4d60054d30054bd0264d3005", + "0x51c50054970260264d600501c0050ad0260264d60054d10050ab026026", + "0x30f02608b0054d600508b00531802608b0054d60054d00054bc0260264d6", + "0x4d600708b0050810260890054d600508900503602608a0054d600508a005", + "0x31230f0c04d600708908a0074c10260264d600502600702630900555b026", + "0x3140054d60053140054c00260264d600502600702631b3193180c055c314", + "0x3801b03233102c08a4d600502b0054bd02602b0054d60053140054bf026", + "0x4d600501b0050ad0260264d60050320050ad0260264d600502c0050aa026", + "0x33100545d0263310054d600533100545e0260264d6005038005497026026", + "0x35334e34b0c30ba0bb0bc0390364d14d600503500545c0260350054d6005", + "0x1040260264d60050bc00545b0260264d60050390050ad02636507e35f358", + "0x260264d60050c30054970260264d60050ba0054970260264d60050bb005", + "0x264d600535300545b0260264d600534e00545a0260264d600534b005497", + "0x4d600507e0054590260264d600535f0054590260264d6005358005104026", + "0x50360053180261710054d600502609e0260264d6005365005104026026", + "0x54d60051713680074bb0263680360074d60050360050d60260360054d6", + "0x530f00530f02636a0054d600536a0053180260264d600502600a02636a", + "0x555d0264d600736a0050810263120054d600531200503602630f0054d6", + "0x2655e00502640d0260264d60050360054970260264d60050260070260d5", + "0xd40054d60050261130260264d60050d50054ca0260264d6005026007026", + "0x50810260d30054d60050d30053180260d30054d60050d40360074bb026", + "0x260264d60050264d00260264d60050260070260d200555f0264d60070d3", + "0x50d000534e0260cf0d00074d600500a0054510260d10054d6005026111", + "0x30f0260260054d600502600508a0260ce0054d60050cf0054500260264d6", + "0x4d60050ce00544f0263120054d600531200503602630f0054d600530f005", + "0x4d60050d10ce31230f02608a11d0260d10054d60050d100511a0260ce005", + "0x50260070260c40055603a70054d60073a400511e0263a43940cc0cd00a", + "0x260264d60053ae00512002600e0ca3ae0c04d60053a70050140260264d6", + "0x510600543e0261060054d60050ca0c00074400260264d600500e0050bc", + "0x260cc0054d60050cc00530f0260cd0054d60050cd00508a0261050054d6", + "0x3940cc0cd00a0051050054d600510500543d0263940054d6005394005036", + "0x4d60050c400543c0260264d60050c00053a70260264d6005026007026105", + "0x360260cc0054d60050cc00530f0260cd0054d60050cd00508a026104005", + "0x1043940cc0cd00a0051040054d600510400543d0263940054d6005394005", + "0x260264d60050d20054ca0260264d60050264d00260264d6005026007026", + "0x1030054d60050263530260264d600500a00534e0260264d60050c00053a7", + "0x10210300735f0261020054d60051020053180261020054d600502643b026", + "0xff0054d60051011000073650261000054d600502607e0261010054d6005", + "0x30f00530f0260260054d600502600508a0260fe0054d60050ff00543c026", + "0xfe0054d60050fe00543d0263120054d600531200503602630f0054d6005", + "0x260264d60050c00053a70260264d60050260070260fe31230f02600a005", + "0x4d600531b0fd0073650260fd0054d600502607e0260264d600500a00534e", + "0x30f0260260054d600502600508a0260fb0054d60050fc00543c0260fc005", + "0x4d60050fb00543d0263190054d60053190050360263180054d6005318005", + "0x4d60053090054ca0260264d60050260070260fb31931802600a0050fb005", + "0x4d60050263530260264d600500a00534e0260264d60050c00053a7026026", + "0x735f0260f90054d60050f90053180260f90054d600502643a0260fa005", + "0x4d60050f80f70073650260f70054d600502607e0260f80054d60050f90fa", + "0x30f0260260054d600502600508a0260f50054d60050f600543c0260f6005", + "0x4d60050f500543d0260890054d600508900503602608a0054d600508a005", + "0x4d60050c00053a70260264d60050260070260f508908a02600a0050f5005", + "0x40d0f40073650260f40054d600502607e0260264d600500a00534e026026", + "0x260054d600502600508a0260f20054d60050f300543c0260f30054d6005", + "0xf200543d0264d40054d60054d40050360260160054d600501600530f026", + "0x2610202608a0054d60050264380260f24d401602600a0050f20054d6005", + "0x5610880890074d60070050260070050260264d60050264d00260264d6005", + "0x2600a02640d0054d60050070051280260264d60050260070264d4016007", + "0x4d24d30074d600740d00512b0260890054d600508900508a0260264d6005", + "0x51290264d00054d60054d200512a0260264d60050260070264d1005562", + "0x2602656300502640d02601c0054d60054d000512702600a0054d60054d3", + "0x8b0054d60051c50051260261c50054d60050264d30260264d6005026007", + "0x8a00713302601c0054d600508b00512702600a0054d60054d1005129026", + "0x502600702630f0055643090054d600701c00513402600a0054d600500a", + "0x3120053120263120054d60053090054370260264d60050264d00260264d6", + "0x54d60053140054350263143120074d60053120054550263120054d6005", + "0x50f802631b0054d60053190054340263190054d60053180050c0026318", + "0x4d600502b0c000735f02602b0054d600502b00531802602b0054d600531b", + "0x30f0260890054d600508900508a0263310054d600531200543502602c005", + "0x4d600502c0050f50263310054d60053310053120260880054d6005088005", + "0x70380050f302603801b0320c04d600502c33108808900a43302602c005", + "0x390054d600500a0050f70260264d60050260070260360055650350054d6", + "0x3200508a0260264d60050bb0050bc0260bb0bc0074d60050350050f2026", + "0x390054d60050390050f602601b0054d600501b00530f0260320054d6005", + "0xc30ba0c04d60050bc03901b03200a0f40260bc0054d60050bc0050f5026", + "0x260264d600500a0054320260264d600502600702634b0c30ba0c000534b", + "0x501b00530f0260320054d600503200508a02634e0054d6005036005431", + "0x502600702634e01b0320c000534e0054d600534e00543002601b0054d6", + "0x500a0054320260264d600530f0050bc0260264d60050264d00260264d6", + "0x42e0263580054d60053530c000742f0263530054d60050264d30260264d6", + "0x4d600508800530f0260890054d600508900508a02635f0054d6005358005", + "0x4d600502600702635f0880890c000535f0054d600535f005430026088005", + "0x500700542c0260264d60050c00053ae0260264d600508a00542d026026", + "0x3650053180263650054d600502610602607e0054d60050263530260264d6", + "0x3680054d600502607e0261710054d600536507e00735f0263650054d6005", + "0x508a0260d50054d600536a00543102636a0054d6005171368007365026", + "0x54d60050d50054300264d40054d60054d400530f0260160054d6005016", + "0x74d60070050260070050260264d60050264d00260d54d40160c00050d5", + "0xa0074d600500a0050d60260264d600502600702601608800756608908a", + "0x2640d0055670264d60074d400508102608a0054d600508a00508a0264d4", + "0x4d30054d60050c000542b0260264d600500a0054970260264d6005026007", + "0x508a0264d10054d60054d20052160264d20054d60054d300700742a026", + "0x54d60054d10050820260890054d600508900530f02608a0054d600508a", + "0x260264d600540d0054ca0260264d60050260070264d108908a0c00054d1", + "0x74d60074d00050890260264d600502600a0264d00054d60050070050c0", + "0x263090054d60051c500501c0260264d600502600702608b0055681c501c", + "0x501c0050160263120054d600530f0050f002630f0054d6005309005309", + "0x2600702602656900502640d0263180054d60053120050ef0263140054d6", + "0x1602631b0054d60053190050ee0263190054d60050264d30260264d6005", + "0x4d600531400508b0263180054d600531b0050ef0263140054d600508b005", + "0x260264d600502600702633100556a02c0054d60073180050ed02602b005", + "0x54d600502609e0260320054d600502c0c000735f0260264d60050264d0", + "0x30f02608a0054d600508a00508a0260380054d600501b00a0074bb02601b", + "0x4d60050320050f502602b0054d600502b0053120260890054d6005089005", + "0x4d600503803202b08908a08a4390260380054d6005038005318026032005", + "0x4d60050264d00260264d60050260070260390360350c00050390360350c0", + "0x53310050ec0260264d60050c00053ae0260264d600500a005497026026", + "0xba0054d60050bb0052160260bb0054d60050bc02b00742a0260bc0054d6", + "0xba0050820260890054d600508900530f02608a0054d600508a00508a026", + "0x500a0054970260264d60050260070260ba08908a0c00050ba0054d6005", + "0x50263530260264d60050070051040260264d60050c00053ae0260264d6", + "0x35f02634b0054d600534b00531802634b0054d60050261060260c30054d6", + "0x534e3530073650263530054d600502607e02634e0054d600534b0c3007", + "0x260880054d600508800508a02635f0054d60053580050cb0263580054d6", + "0x35f0160880c000535f0054d600535f0050820260160054d600501600530f", + "0x540d0053ae0264d340d0074d60054d40050c40260264d60050264d0026", + "0x264d10054d60054d20054340264d24d30074d60054d30054290260264d6", + "0x74d04d10074260264d10054d60054d10050d80264d00054d6005026428", + "0x2601c4d30074d60054d30054290260264d600502600702602656b0264d6", + "0x4d60051c50050d802608b0054d60050261420261c50054d600501c005434", + "0x890260264d600502600702602656c0264d600708b1c50074260261c5005", + "0x30f0050880260264d600502600702631200556d30f3090074d60074d3005", + "0x3190054d60053140054d40263180054d60053090050160263140054d6005", + "0x2631b0054d60050264d30260264d600502600702602656e00502640d026", + "0x502b0054d40263180054d600531200501602602b0054d600531b0054d2", + "0x264d600502600702633100556f02c0054d60073190054d10263190054d6", + "0x503200530902601b0054d60050264230260320054d600502c00501c026", + "0x260260054d600502600508a0260350054d600531800508b0260380054d6", + "0x501b0054220260350054d60050350053120260070054d600500700530f", + "0x503801b03500702608a1460260380054d600503800531802601b0054d6", + "0x50260070260ba0055700bb0054d60070bc0054210260bc0390360c04d6", + "0x2634e0054d60050c30050c002634b0c30074d60050bb00541f0260264d6", + "0x534e0050160263580054d600503900530f0263530054d600503600508a", + "0x2600702602657100502640d02607e0054d600534b00541c02635f0054d6", + "0x54b60260264d60050880053a70260264d60050160054970260264d6005", + "0x54d600503600508a0260264d60053650054b50261713650074d60050ba", + "0x50f50260d50054d600508900503602636a0054d600503900530f026368", + "0x50bc0260264d600502600702602657200502640d0260d40054d6005171", + "0x260d20054d60050d30055730260d30054d60050264d30260264d6005331", + "0x53180050160263580054d600500700530f0263530054d600502600508a", + "0x5740d10054d600707e00541902607e0054d60050d200541c02635f0054d6", + "0xcd0055750ce0cf0074d600735f0050890260264d60050260070260d0005", + "0x264d60050ce00534b0260264d60050cf0050c30260264d6005026007026", + "0x4d60050d10054170260264d60050880053a70260264d6005016005497026", + "0x53940053180263940054d600502614a0260cc0054d6005026353026026", + "0x3680054d600535300508a0263a40054d60053940cc00735f0263940054d6", + "0x3a40050f50260d50054d600508900503602636a0054d600535800530f026", + "0xcd0050c30260264d600502600702602657200502640d0260d40054d6005", + "0x260c40054d600535800530f0263a70054d600535300508a0260264d6005", + "0x57600502640d0260ca0054d60050d10054220263ae0054d6005089005036", + "0x4d60050160054970260264d60050d00050bc0260264d6005026007026026", + "0x4d60050263530260264d600535f0050c30260264d60050880053a7026026", + "0x735f0261060054d60051060053180261060054d600502614c02600e005", + "0x4d600535800530f0263680054d600535300508a0261050054d600510600e", + "0x40d0260d40054d60051050050f50260d50054d600508900503602636a005", + "0x502600702602657700502640d0260264d6005026007026026572005026", + "0x2608d0261030054d60051040050d90261040054d60050260da0260264d6", + "0x1030054d60051030050d70261020054d60051020050d80261020054d6005", + "0x70260fc0fd0fe0c05780ff1001010c04d600710310208900700a006026", + "0x1010054d600510100530f0260ff0054d60050ff0053180260264d6005026", + "0x70260fb0055790264d60070ff0050810261000054d6005100005036026", + "0xc30260264d60050880053a70260264d60050160054970260264d6005026", + "0x260f90054d600502614b0260fa0054d60050263530260264d60054d3005", + "0x2600508a0260f80054d60050f90fa00735f0260f90054d60050f9005318", + "0xd50054d600510000503602636a0054d600510100530f0263680054d6005", + "0x264d600502600702602657200502640d0260d40054d60050f80050f5026", + "0x4d60074d30050890260264d600502600a0260f70054d60050fb005149026", + "0xf30054d60050f50050880260264d60050260070260f400557a0f50f6007", + "0x502640d0260f10054d60050f30054d40260f20054d60050f6005016026", + "0x50f00054d20260f00054d60050264d30260264d600502600702602657b", + "0x260f10054d60050ef0054d40260f20054d60050f40050160260ef0054d6", + "0xee00501c0260264d60050260070260ed00557c0ee0054d60070f10054d1", + "0x4390054d60054390053180264390054d60054360053090264360054d6005", + "0x880260264d600502600702617000557d44843f0074d60070f2005089026", + "0x4d60054970054d40260ec0054d600543f0050160264970054d6005448005", + "0x54d60050264d30260264d600502600702602657e00502640d0260eb005", + "0x54d40260ec0054d60051700050160260e90054d60050ea0054d20260ea", + "0x50260070260e700557f0e80054d60070eb0054d10260eb0054d60050e9", + "0x4160260e50054d60050e60053090260e60054d60050e800501c0260264d6", + "0xe30051520260e30054d60050e40f70074130260e40054d60050e5439007", + "0xe10074d60070ec0050890260e20054d60050e20050de0260e20054d6005", + "0xe10050c30260264d60050264d00260264d60050260070260df0055800e0", + "0x51510260de0054d60050264230260264d60050e000534b0260264d6005", + "0xe20dc0071580260dc0054d60050dd0de0071580260dd0e20074d60050e2", + "0xc40054d600510100530f0263a70054d600502600508a0260db0054d6005", + "0x502640d0260ca0054d60050db0054220263ae0054d6005100005036026", + "0x4d60050df0050c30260264d60050264d00260264d6005026007026026576", + "0x508a0260d90054d60050e20da0071580260da0054d6005026423026026", + "0x54d60051000050360260c40054d600510100530f0263a70054d6005026", + "0x4110260d808d0074d60050ca0054120260ca0054d60050d90054220263ae", + "0x54d60050060050d80260060054d60050264280260d70054d60050d8005", + "0x810d60074d60070d70063a70c015a0260d70054d60050d70050d8026006", + "0x54120260264d60050810054590260264d60050260070264ca094007581", + "0x4c80054d600502608d0260264d60054c900541702607d4c90074d600508d", + "0x58209a01a0074d60074c807d0d60c04100264c80054d60054c80050d8026", + "0x9a00540f02609a0054d600509a00515c0260264d600502600702609b005", + "0x1a0054d600501a00508a02609e0054d600509c00515e02609c0054d6005", + "0xc000501b0260c40054d60050c400530f0260050054d6005005005038026", + "0x8a0054d600508a00503502600a0054d600500a0050320260c00054d6005", + "0x9e0050de0260160054d60050160053180263ae0054d60053ae005036026", + "0x164d600509e0160883ae08a00a0c00c400501a40d41402609e0054d6005", + "0x264be0055834bf0054d60074c00054a60264c04c14c24c34c44c50a04c6", + "0x260264d600502600a0264bd0054d60054bf0054a50260264d6005026007", + "0xaa0050bc0260264d60050260070260ab0055840aa0054d60074bd0054a4", + "0x40d0264bc0054d60050ad0053180260ad0054d600502609c0260264d6005", + "0x264420260264d60050ab0050bc0260264d6005026007026026585005026", + "0x40e0260264d60050264d00264bc0054d60054bb0053180264bb0054d6005", + "0x4d60054c600508a0264b90054d60054ba00540c0264ba0054d60054bc005", + "0x1b0264c50054d60054c500530f0260a00054d60050a00050380264c6005", + "0x4d60054c20050350264c30054d60054c30050320264c40054d60054c4005", + "0x160054b90054d60054b900540b0264c10054d60054c10050360264c2005", + "0x4d60054be0054b60260264d60050260070264b94c14c24c34c44c50a04c6", + "0x380264b60054d60054c600508a0260264d60054b80054b50264b74b8007", + "0x4d60054c400501b0264b40054d60054c500530f0264b50054d60050a0005", + "0x360264b10054d60054c20050350264b20054d60054c30050320264b3005", + "0x2658600502640d0264af0054d60054b70050f50264b00054d60054c1005", + "0x264d60050880053a70260264d60050160054970260264d6005026007026", + "0x4d60055180053180265180054d60050264080260840054d6005026353026", + "0x264b60054d600509b00508a0264ac0054d600551808400735f026518005", + "0x50c000501b0264b40054d60050c400530f0264b50054d6005005005038", + "0x264b10054d600508a0050350264b20054d600500a0050320264b30054d6", + "0x58600502640d0264af0054d60054ac0050f50264b00054d60053ae005036", + "0x4d60050160054970260264d60054ca0054590260264d6005026007026026", + "0x4d60050263530260264d600508d0054170260264d60050880053a7026026", + "0x735f0264aa0054d60054aa0053180264aa0054d600502614a0264ab005", + "0x4d60050050050380264b60054d600509400508a0265190054d60054aa4ab", + "0x320264b30054d60050c000501b0264b40054d60050c400530f0264b5005", + "0x4d60053ae0050360264b10054d600508a0050350264b20054d600500a005", + "0x73650264a60054d600502607e0264af0054d60055190050f50264b0005", + "0x4d60054b600508a0264a40054d60054a50054070264a50054d60054af4a6", + "0x1b0264b40054d60054b400530f0264b50054d60054b50050380264b6005", + "0x4d60054b10050350264b20054d60054b20050320264b30054d60054b3005", + "0x160054a40054d60054a400540b0264b00054d60054b00050360264b1005", + "0x264d60050264d00260264d60050260070264a44b04b14b24b34b44b54b6", + "0x4d60050880053a70260264d60050160054970260264d60050e70050bc026", + "0x54390054970260264d60050f70051630260264d60050ec0050c3026026", + "0xbf0053180260bf0054d60050265870264a20054d60050263530260264d6", + "0x54d600502600508a0264a10054d60050bf4a200735f0260bf0054d6005", + "0x50f50260d50054d600510000503602636a0054d600510100530f026368", + "0x264d00260264d600502600702602657200502640d0260d40054d60054a1", + "0x53a70260264d60050160054970260264d60050ed0050bc0260264d6005", + "0x3530260264d60050f70051630260264d60050f20050c30260264d6005088", + "0x49f0054d600549f00531802649f0054d60050265870264a00054d6005026", + "0x530f0263680054d600502600508a02649e0054d600549f4a000735f026", + "0x54d600549e0050f50260d50054d600510000503602636a0054d6005101", + "0x264d60050880053a70260264d600502600702602657200502640d0260d4", + "0x4d600502600508a0260264d60050160054970260264d60054d30050c3026", + "0xf50260d50054d60050fd00503602636a0054d60050fe00530f026368005", + "0x4d60050d40c20073650260c20054d600502607e0260d40054d60050fc005", + "0x380263680054d600536800508a02649c0054d600549d00540702649d005", + "0x4d60050c000501b02636a0054d600536a00530f0260050054d6005005005", + "0x3602608a0054d600508a00503502600a0054d600500a0050320260c0005", + "0xc036a00536801600549c0054d600549c00540b0260d50054d60050d5005", + "0x1020264d20054d600502610302640d0054d60050260f102649c0d508a00a", + "0x4d34d10c04d60070890070074c10260264d60050264d00260264d6005026", + "0x4d00054d60054d00054c00260264d600502600702608b1c501c0c05884d0", + "0x31931831431230f08a4d60053090054bd0263090054d60054d00054bf026", + "0x4d60053180050ad0260264d60053140050ad0260264d600530f0050aa026", + "0x31200545d0263120054d600531200545e0260264d6005319005497026026", + "0x3603503801b4d403233102c02b4d14d600531b00545c02631b0054d6005", + "0x45b0260264d600502c0050ad0260264d600502b0054970260ba0bb0bc039", + "0x260264d60050380054970260264d600501b0054970260264d6005331005", + "0x264d60050bc0054590260264d600503600545b0260264d600503500545a", + "0x4d60050390050c00260264d60050ba0051040260264d60050bb005459026", + "0xff0264d10054d60054d100530f0260c30054d60050c30050160260c3005", + "0x4d440d0074360260320054d60050320053120264d30054d60054d34d2007", + "0x502600702635300558934e34b0074d60070c30050890264d40054d6005", + "0x4d40054970260264d600534e00534b0260264d600534b0050c30260264d6", + "0x53a70260264d60050160054970260264d60050320051040260264d6005", + "0x31802635f0054d60050264580263580054d60050263530260264d6005088", + "0x4d600502607e02607e0054d600535f35800735f02635f0054d600535f005", + "0x263680054d60051710054570261710054d600507e365007365026365005", + "0x54d100530f0260050054d60050050050380260260054d600502600508a", + "0x2600a0054d600500a0050320260c00054d60050c000501b0264d10054d6", + "0x53680054560264d30054d60054d300503602608a0054d600508a005035", + "0x260264d60050260070263684d308a00a0c04d10050260160053680054d6", + "0x260d10d20d30d40d536a0894d60050880054af0260264d60053530050c3", + "0x50cf0050c00260cf0320074d60050320054550260d00054d600502608d", + "0xc04540260d00054d60050d00050d80260264d600502600a0260ce0054d6", + "0x54530260264d600502600702639400558a0cc0cd0074d60070d00ce026", + "0x54d60053a40053090263a40054d60050cc00501c0260cc0054d60050cc", + "0x3a70074bb0263a70054d60053a70053180260c40054d60050264520263a7", + "0x54d60050cd00508a0263ae0054d60053ae0053180263ae0054d60050c4", + "0x74c10260264d60050260070260ca00558b0264d60073ae0050810260cd", + "0x260264d60050260070261021031040c058c10510600e0c04d60074d34d1", + "0x54d60051050054bf0261050054d60051050054c00260264d60050264d0", + "0x261c50260ff0054d600501610000735f0261000054d6005026353026101", + "0xfd0050aa0260f90fa0fb0fc0fd08a4d60051010054bd0260fe0054d6005", + "0x54970260264d60050fb0050ad0260264d60050fc0050ab0260264d6005", + "0xf60f70074d60050ff0050c40260f80054d60050261650260264d60050f9", + "0xf80fa0c01670260f50054d60050f600508b0260264d60050f70053ae026", + "0x4d60050f40fe0074600260f40054d60050f40054050260f40054d60050f5", + "0x4500260264d60050f200534e0260f10f20074d60050f30054510260f3005", + "0x4d60050050050380260cd0054d60050cd00508a0260f00054d60050f1005", + "0x320260c00054d60050c000501b02600e0054d600500e00530f026005005", + "0x4d600510600503602608a0054d600508a00503502600a0054d600500a005", + "0x3180260f00054d60050f000544f0260320054d6005032005312026106005", + "0x4d40f00320d410608a00a0c000e0050cd4d301e0264d40054d60054d4005", + "0x58d4970054d600717000507a02617044843f4394360ed0ee0ef0164d6005", + "0x54970260ea0eb0074d600549700544c0260264d60050260070260ec005", + "0xe80054d60050ee0050380260e90054d60050ef00508a0260264d60050ea", + "0x4390050320260e60054d600543600501b0260e70054d60050ed00530f026", + "0xe30054d60054480050360260e40054d600543f0050350260e50054d6005", + "0xeb00544a0260e10054d60050d500544b0260e20054d600536a00510a026", + "0xde0054d60050d200510d0260df0054d60050d300510b0260e00054d6005", + "0x264d600502600702602658e00502640d0260dd0054d60050d100510e026", + "0x4d60050d10054aa0260264d60050d50055180260264d600536a005084026", + "0x50ec0054570260264d60050d30054ac0260264d60050d20054ab026026", + "0x260ee0054d60050ee0050380260ef0054d60050ef00508a0260dc0054d6", + "0x54390050320264360054d600543600501b0260ed0054d60050ed00530f", + "0x264480054d600544800503602643f0054d600543f0050350264390054d6", + "0x260070260dc44843f4394360ed0ee0ef0160050dc0054d60050dc005456", + "0x36a0050840260264d60050d30054ac0260264d60050264d00260264d6005", + "0x54aa0260264d60050d50055180260264d60050d20054ab0260264d6005", + "0x16b0260264d60050320051040260264d60054d40054970260264d60050d1", + "0x260db0054d600502607e0260264d60050160054970260264d60050d4005", + "0xcd00508a0260d90054d60050da0054570260da0054d60051020db007365", + "0x1040054d600510400530f0260050054d60050050050380260cd0054d6005", + "0x8a00503502600a0054d600500a0050320260c00054d60050c000501b026", + "0xd90054d60050d90054560261030054d600510300503602608a0054d6005", + "0xca0054ca0260264d60050260070260d910308a00a0c01040050cd016005", + "0x40d02608d0054d60050cd00508a0260264d60050160054970260264d6005", + "0x508a0260264d60050160054970260264d600502600702602658f005026", + "0x4d60050d80050c00260d80320074d600503200545502608d0054d6005394", + "0x50d10d20d30d40d536a0890cd0260060054d60050d70054340260d7005", + "0x264ca0054d60050264280260940810074d60050d60050ea0260d60054d6", + "0x260070260265900264d60074ca0060074260260060054d60050060050d8", + "0x7d0054d60054c90050c00264c90320074d60050320054550260264d6005", + "0x54c80050d802601a0054d60050261420264c80054d600507d005434026", + "0x260264d60050260070260265910264d600701a4c80074260264c80054d6", + "0x2609e00559209c09b0074d600709a00508902609a0054d60050320050c0", + "0x54d600509b0050160264c60054d600509c0050880260264d6005026007", + "0x4d600502600702602659300502640d0264c50054d60054c60054d40260a0", + "0x9e0050160264c30054d60054c40054d20264c40054d60050264d3026026", + "0x4c20054d60074c50054d10264c50054d60054c30054d40260a00054d6005", + "0x54c200501c0260264d60050264d00260264d60050260070264c1005594", + "0x8b0264be0054d60054c00053090264bf0054d60050264230264c00054d6", + "0x4d60054d100530f02608d0054d600508d00508a0264bd0054d60050a0005", + "0x3180264bf0054d60054bf0054220264bd0054d60054bd0053120264d1005", + "0xad0ab0aa0c04d60054be4bf4bd4d108d08a1460264be0054d60054be005", + "0x541f0260264d60050260070264bb0055954bc0054d60070ad005421026", + "0x4d60050aa00508a0264b80054d60054ba0050c00264b94ba0074d60054bc", + "0x41c0264b50054d60054b80050160264b60054d60050ab00530f0264b7005", + "0x3a70260264d600502600702602659600502640d0264b40054d60054b9005", + "0x260264d60050940053a70260264d60054d40054970260264d6005081005", + "0x50aa00508a0260264d60054b30054b50264b24b30074d60054bb0054b6", + "0x264af0054d60054d30050360264b00054d60050ab00530f0264b10054d6", + "0x260264d600502600702602659700502640d0260840054d60054b20050f5", + "0x265180054d60050264d30260264d60054c10050bc0260264d60050264d0", + "0x54d100530f0264b70054d600508d00508a0264ac0054d6005518005573", + "0x264b40054d60054ac00541c0264b50054d60050a00050160264b60054d6", + "0x4b50050890260264d60050260070264aa0055984ab0054d60074b4005419", + "0x4d60055190050c30260264d60050260070264a50055994a65190074d6007", + "0x54d40054970260264d60050810053a70260264d60054a600534b026026", + "0x50263530260264d60054ab0054170260264d60050940053a70260264d6", + "0x35f0264a20054d60054a20053180264a20054d600502614a0264a40054d6", + "0x54b600530f0264b10054d60054b700508a0260bf0054d60054a24a4007", + "0x260840054d60050bf0050f50264af0054d60054d30050360264b00054d6", + "0x8a0260264d60054a50050c30260264d600502600702602659700502640d", + "0x4d60054d30050360264a00054d60054b600530f0264a10054d60054b7005", + "0x502600702602659a00502640d02649e0054d60054ab00542202649f005", + "0x4d40054970260264d60050810053a70260264d60054aa0050bc0260264d6", + "0x263530260264d60054b50050c30260264d60050940053a70260264d6005", + "0x2649d0054d600549d00531802649d0054d600502614c0260c20054d6005", + "0x4b600530f0264b10054d60054b700508a02649c0054d600549d0c200735f", + "0x840054d600549c0050f50264af0054d60054d30050360264b00054d6005", + "0x702602659b00502640d0260264d600502600702602659700502640d026", + "0x264a90054d60054a80050d90264a80054d60050260da0260264d6005026", + "0x4d60054a90050d70264a70054d60054a70050d80264a70054d600502608d", + "0x4964980c80c059c4990c649a0c04d60074a94a74d34d100a0060264a9005", + "0x4d600549a00530f0264990054d60054990053180260264d6005026007026", + "0x49300559d0264d60074990050810260c60054d60050c600503602649a005", + "0x260264d60050810053a70260264d60050264d00260264d6005026007026", + "0x264d60050320051040260264d60050940053a70260264d60054d4005497", + "0x4d60054900053180264900054d600502614b0265230054d6005026353026", + "0x264b10054d600508d00508a02648e0054d600549052300735f026490005", + "0x548e0050f50264af0054d60050c60050360264b00054d600549a00530f", + "0x50320050c00260264d600502600702602659700502640d0260840054d6", + "0x48a48b0074d600748d00508902648c0054d600549300514902648d0054d6", + "0x50160264880054d600548a0050880260264d600502600702648900559e", + "0x2602659f00502640d0264860054d60054880054d40264870054d600548b", + "0x4840054d60054850054d20264850054d60050264d30260264d6005026007", + "0x4860054d10264860054d60054840054d40264870054d6005489005016026", + "0x54d600548300501c0260264d60050260070264820055a04830054d6007", + "0x50890264800054d60054800053180264800054d6005481005309026481", + "0x547e0050880260264d600502600702647d0055a147e47f0074d6007487", + "0x2647a0054d600547c0054d402647b0054d600547f00501602647c0054d6", + "0x4d20264790054d60050264d30260264d60050260070260265a200502640d", + "0x4d60054780054d402647b0054d600547d0050160264780054d6005479005", + "0x260264d60050260070264760055a34770054d600747a0054d102647a005", + "0x4744800074160264740054d60054750053090264750054d600547700501c", + "0x54d60054720051520264720054d600547348c0074130264730054d6005", + "0x55a446f4700074d600747b0050890264710054d60054710050de026471", + "0x264d60054700050c30260264d60050264d00260264d600502600702646e", + "0x4d600547100515102646d0054d60050264230260264d600546f00534b026", + "0x54d600547146b00715802646b0054d600546c46d00715802646c471007", + "0x50360264a00054d600549a00530f0264a10054d600508d00508a02646a", + "0x2602659a00502640d02649e0054d600546a00542202649f0054d60050c6", + "0x4230260264d600546e0050c30260264d60050264d00260264d6005026007", + "0x4d600508d00508a0264680054d60054714690071580264690054d6005026", + "0x42202649f0054d60050c60050360264a00054d600549a00530f0264a1005", + "0x4d60050050050380264a10054d60054a100508a02649e0054d6005468005", + "0x320260c00054d60050c000501b0264a00054d60054a000530f026005005", + "0x4d600549f00503602608a0054d600508a00503502600a0054d600500a005", + "0x16c02649e0054d600549e0054220264d40054d60054d400531802649f005", + "0x4624634644654664670164d600549e4d409449f08a00a0c04a00054a140d", + "0x260264d600502600702645e0055a545f0054d600746000516e026460461", + "0x2645845945a45b45c45d0894d60050810054af0260264d600545f005404", + "0x546500530f0260e80054d60054660050380260e90054d600546700508a", + "0x260e50054d60054630050320260e60054d600546400501b0260e70054d6", + "0x545d00510a0260e30054d60054610050360260e40054d6005462005035", + "0x260e00054d600545b00544a0260e10054d600545c00544b0260e20054d6", + "0x545800510e0260de0054d600545900510d0260df0054d600545a00510b", + "0x50dd0de0df0e00e10e20890cd0264570054d60050264420260dd0054d6", + "0x4540054d60054550051140264550054d60054574560071120264560054d6", + "0x70264540e30e40e50e60e70e80e90160054540054d6005454005456026", + "0x264530054d600545e0054570260264d60050810053a70260264d6005026", + "0x546500530f0264660054d60054660050380264670054d600546700508a", + "0x264630054d60054630050320264640054d600546400501b0264650054d6", + "0x54530054560264610054d60054610050360264620054d6005462005035", + "0x260264d60050260070264534614624634644654664670160054530054d6", + "0x260264d60050810053a70260264d60054760050bc0260264d60050264d0", + "0x264d600547b0050c30260264d60050940053a70260264d60054d4005497", + "0x54d60050263530260264d60054800054970260264d600548c005163026", + "0x45200735f0264510054d60054510053180264510054d6005026587026452", + "0x54d600549a00530f0264b10054d600508d00508a0264500054d6005451", + "0x2640d0260840054d60054500050f50264af0054d60050c60050360264b0", + "0x54820050bc0260264d60050264d00260264d6005026007026026597005", + "0x940053a70260264d60054d40054970260264d60050810053a70260264d6", + "0x263530260264d600548c0051630260264d60054870050c30260264d6005", + "0x2601e0054d600501e00531802601e0054d600502658702644f0054d6005", + "0x49a00530f0264b10054d600508d00508a02607a0054d600501e44f00735f", + "0x840054d600507a0050f50264af0054d60050c60050360264b00054d6005", + "0x3a70260264d60050264d00260264d600502600702602659700502640d026", + "0x260264d60050810053a70260264d60050320051040260264d6005094005", + "0x4d60050c800530f0264b10054d600508d00508a0260264d60054d4005497", + "0x7e0260840054d60054960050f50264af0054d60054980050360264b0005", + "0x4d600510a00545702610a0054d600508444c00736502644c0054d6005026", + "0x30f0260050054d60050050050380264b10054d60054b100508a02644b005", + "0x4d600500a0050320260c00054d60050c000501b0264b00054d60054b0005", + "0x4560264af0054d60054af00503602608a0054d600508a00503502600a005", + "0x502600702644b4af08a00a0c04b00054b101600544b0054d600544b005", + "0x880053a70260264d60050160054970260264d600540d0050e50260264d6", + "0x736502644a0054d600502607e0260264d60054d20051010260264d6005", + "0x4d600502600508a02610d0054d600510b00545702610b0054d600508b44a", + "0x1b02601c0054d600501c00530f0260050054d6005005005038026026005", + "0x4d600508a00503502600a0054d600500a0050320260c00054d60050c0005", + "0x1600510d0054d600510d0054560261c50054d60051c500503602608a005", + "0x4d600502610202600a0054d600502640302610d1c508a00a0c001c005026", + "0x708a00508902608a0054d60050070050c00260264d60050264d0026026", + "0x54d600508800501c0260264d60050260070260160055a60880890074d6", + "0x50160264d30054d600540d0050f002640d0054d60054d40053090264d4", + "0x260265a700502640d0264d10054d60054d30050ef0264d20054d6005089", + "0x1c0054d60054d00050ee0264d00054d60050264d30260264d6005026007", + "0x4d20054290264d10054d600501c0050ef0264d20054d6005016005016026", + "0x54d60074d10050ed02608b0054d60051c500508b0261c54d20074d6005", + "0x263123090074d60053090050d60260264d600502600702630f0055a8309", + "0x500a0054020260264d60050260070263140055a90264d6007312005081", + "0x8b0053120260264d60053090054970260264d60054d20050c30260264d6", + "0x54d60073190054000263193180074d600508b00540102608b0054d6005", + "0xc002602c0054d600531b0051520260264d600502600702602b0055aa31b", + "0x4d600500500530f0260320054d600502600508a0263310054d6005318005", + "0x40d0260350054d600502c0050de0260380054d600533100501602601b005", + "0x1750260360054d600502b0053ff0260264d60050260070260265ab005026", + "0x502600508a0260bc0054d60050390051770260390054d6005036318007", + "0x50bc0054d60050bc0053fe0260050054d600500500530f0260260054d6", + "0x2609e0260264d60053140054ca0260264d60050260070260bc0050260c0", + "0x4d60050bb0ba0074bb0260ba3090074d60053090050d60260bb0054d6005", + "0x34b0055ac0264d60070c30050810260c30054d60050c30053180260c3005", + "0x264d60054d20050c30260264d600500a0054020260264d6005026007026", + "0x508b0053120260260054d600502600508a0260264d6005309005497026", + "0x54d600735300517b02635334e0074d600508b02600717a02608b0054d6", + "0x2636507e0074d600535800517d0260264d600502600702635f0055ad358", + "0x1710053fc0260264d60050260070263680055ae1710054d60073650053fd", + "0x320054d600534e00508a0260d50054d600507e0050c002636a0054d6005", + "0x36a0050de0260380054d60050d500501602601b0054d600500500530f026", + "0x3680053ff0260264d60050260070260265ab00502640d0260350054d6005", + "0x54d60050d30051770260d30054d60050d407e0071750260d40054d6005", + "0x53fe0260050054d600500500530f02634e0054d600534e00508a0260d2", + "0x35f0053fb0260264d60050260070260d200534e0c00050d20054d60050d2", + "0x50054d600500500530f02634e0054d600534e00508a0260d10054d6005", + "0x260264d60050260070260d100534e0c00050d10054d60050d10053fe026", + "0x74d60053090050d60260d00054d60050264c60260264d600534b0054ca", + "0x260ce0054d60050ce0053180260ce0054d60050d00cf0074bb0260cf309", + "0x54d20050c30260264d60050260070260cd0055af0264d60070ce005081", + "0x530f0260260054d600502600508a0260264d60053090054970260264d6", + "0x508b0050260c017f02608b0054d600508b0053120260050054d6005005", + "0x50260070260c40055b03a70054d60073a400517e0263a43940cc0c04d6", + "0x5b10c00054d60070ca0053f40260ca3ae0074d60053a70051860260264d6", + "0x39400530f0260cc0054d60050cc00508a0260264d600502600702600e005", + "0x54d60050c000a0073f10263ae0054d60053ae0053120263940054d6005", + "0x54d60071040053ef0261041051060c04d60053ae3940cc0c03f00260c0", + "0x261001010074d60051030053ed0260264d60050260070261020055b2103", + "0xc00073eb0260264d60050260070260fe0055b30ff0054d60071000053ec", + "0x54d600510600508a0260fc0054d60050fd0053ea0260fd0054d60050ff", + "0x53e90260f90054d60051010053120260fa0054d600510500530f0260fb", + "0x518d0260264d60050260070260265b400502640d0260f80054d60050fc", + "0xfb0054d600510600508a0260f70054d60050fe00518f0260264d60050c0", + "0xf70053e90260f90054d60051010053120260fa0054d600510500530f026", + "0xc000518d0260264d60050260070260265b400502640d0260f80054d6005", + "0x260f50054d600510500530f0260f60054d600510600508a0260264d6005", + "0x260264d60050260070260265b500502640d0260f40054d6005102005484", + "0x4d60050cc00508a0260f30054d600500e00518f0260264d600500a005402", + "0x3e90260f90054d60053ae0053120260fa0054d600539400530f0260fb005", + "0x260070260f10055b60f20054d60070f80053e80260f80054d60050f3005", + "0x260ef0054d60050f90050c00260f00054d60050f20053e70260264d6005", + "0x50ef00501602601b0054d60050fa00530f0260320054d60050fb00508a", + "0x260070260265ab00502640d0260350054d60050f00050de0260380054d6", + "0xed0054d60050ee0f90071750260ee0054d60050f10053ff0260264d6005", + "0xfa00530f0260fb0054d60050fb00508a0264360054d60050ed005177026", + "0x260070264360fa0fb0c00054360054d60054360053fe0260fa0054d6005", + "0x30f0260f60054d60050cc00508a0260264d600500a0054020260264d6005", + "0x4d60050f40053fb0260f40054d60050c40054840260f50054d6005394005", + "0x3fe0260f50054d60050f500530f0260f60054d60050f600508a026439005", + "0x54ca0260264d60050260070264390f50f60c00054390054d6005439005", + "0x4bb02643f0054d60050260a00260264d600500a0054020260264d60050cd", + "0x74480050810264480054d60054480053180264480054d600543f309007", + "0x4d30260264d600508b0051040260264d60050260070261700055b70264d6", + "0x54d600502600508a0260ec0054d60054970053e60264970054d6005026", + "0x50de0260380054d60054d200501602601b0054d600500500530f026032", + "0x54d600503800508b0260eb0054d60050350053e50260350054d60050ec", + "0x8a0260e80054d60050e90051770260e90054d60050eb0ea0071750260ea", + "0x4d60050e80053fe02601b0054d600501b00530f0260320054d6005032005", + "0x264d60051700054ca0260264d60050260070260e801b0320c00050e8005", + "0x4d60050e70053ff0260e70054d60050264d30260264d60054d20050c3026", + "0x260e40054d60050e50051770260e50054d60050e608b0071750260e6005", + "0x50e40053fe0260050054d600500500530f0260260054d600502600508a", + "0x4d600500a0054020260264d60050260070260e40050260c00050e40054d6", + "0x8b0071750260e30054d600530f0053ff0260264d60054d20050c3026026", + "0x54d600502600508a0260e10054d60050e20051770260e20054d60050e3", + "0x260c00050e10054d60050e10053fe0260050054d600500500530f026026", + "0x50264a10264d20054d600502610302640d0054d60050263e40260e1005", + "0x264a00263090054d60050260bf0261c50054d60050264a20264d00054d6", + "0x10302631b0054d60050264a10263180054d60050261030263120054d6005", + "0x260380054d60050264780260320054d60050260f102602c0054d6005026", + "0xba0054d60050261960260bc0054d60050260f10260360054d60050261ad", + "0x264d60050261020263530054d600502610302634b0054d60050264a2026", + "0x3650c05b807e35f3580c04d60070890070074c10260264d60050264d0026", + "0x7e0054bf02607e0054d600507e0054c00260264d6005026007026368171", + "0x36a0054d600536a0054be0263580054d600535800530f02636a0054d6005", + "0x50260070260d00d10d20c05b90d30d40d50c04d600735f3580074c1026", + "0x4bd0260cf0054d60050d30054bf0260d30054d60050d30054c00260264d6", + "0x50ab0260264d60050ce0050aa0263a43940cc0cd0ce08a4d60050cf005", + "0x4bc0260264d60053a40054970260264d60050cc0050ad0260264d60050cd", + "0xaa02610600e0ca3ae0c408a4d600536a0054bd0263a70054d6005394005", + "0x260264d600500e0050ad0260264d60053ae0050ab0260264d60050c4005", + "0x4d60053a70053180261050054d60050ca0054bc0260264d6005106005497", + "0x261040054d60051040053180261040054d60051053a70074bb0263a7005", + "0x71040050810260d40054d60050d40050360260d50054d60050d500530f", + "0x51510260264d600502600a0260264d60050260070261030055ba0264d6", + "0xff0055bc1000055bb1010054d600a1020051980261020160074d6005016", + "0x1a50260fc0fd0074d60051010051990260264d60050260070260fe0055bd", + "0x54d60050fb00546c0260fb0054d60050fd00519c0260264d60050fc005", + "0x74d600510000519d0260264d60050260070260265be00502640d02601b", + "0x546c0260f80054d60050fa00519f0260264d60050f90051a60260f90fa", + "0x51a20260264d60050260070260265be00502640d02601b0054d60050f8", + "0x54d60050f70051a70260264d60050f60051a30260f60f70074d60050ff", + "0x4d60050260070260265be00502640d02601b0054d60050f500546c0260f5", + "0x50f40051ae0260f40054d60050264d30260264d60050fe0050bc026026", + "0x50ea0260264d60050264d002601b0054d60050f300546c0260f30054d6", + "0x4d60050050050380260260054d600502600508a0260f10f20074d6005088", + "0x320260c00054d60050c000501b0260d50054d60050d500530f026005005", + "0x4d60050d400503602608a0054d600508a00503502600a0054d600500a005", + "0x2601b0054d600501b0380074730260160054d60050160050de0260d4005", + "0xee0c308b0ef30f0f00164d60050160f10d408a00a0c00d50050264d41a8", + "0x8b0054d600508b30900748902630f0054d600530f31200748a0260ed34e", + "0x16e02634e0054d600534e3530070ff0260c30054d60050c334b007488026", + "0x54360054040260264d60050260070264390055bf4360054d60070ed005", + "0x5c04480054d600a43f0051af02643f01b0074d600501b0051aa0260264d6", + "0x4d60054480051b00260264d60050260070260ec0055c24970055c1170005", + "0x54c80260e90054d60050264d30260ea0054d60050eb0053e20260eb005", + "0x54d60050ef00530f0260e70054d60050f000508a0260e80054d60050e9", + "0x507d0260390054d60050ea0053180264d10054d60050ee0050350260e6", + "0x264d30260264d60050260070260265c300502640d0260bb0054d60050e8", + "0xe30054d60051700053df0260e40054d60050e50053e30260e50054d6005", + "0xef00530f0260e70054d60050f000508a0260e20054d60050e30051b3026", + "0x390054d60050e20053180264d10054d60050ee0050350260e60054d6005", + "0x264d60050260070260265c300502640d0260bb0054d60050e400507d026", + "0x50ef00530f0260f00054d60050f000508a0260264d600549700518d026", + "0xe101b0074d600501b0051aa0260ee0054d60050ee0050350260ef0054d6", + "0xdf0e000a4d60050e10ee0ef0f000a1b50260e10054d60050e100546c026", + "0x260264d60050260070260db0055c40dc0054d60070dd0050e80260dd0de", + "0x4d60050dc0050e70260d90054d60050da0054c90260da0054d60050264d3", + "0x350260e60054d60050df00530f0260e70054d60050e000508a02608d005", + "0x4d60050d900507d0260390054d600508d0053180264d10054d60050de005", + "0x4d600502c0051010260264d60050260070260265c300502640d0260bb005", + "0x50360053de0260264d60050bc0050e50260264d6005318005101026026", + "0x31b0055230260264d600501b00546d0260264d60050320050e50260264d6", + "0x54930260264d600540d0053e10260264d60050ba0053dd0260264d6005", + "0x5230260264d60050f20053a70260264d60054d20051010260264d60051c5", + "0x54d60050e000508a0260d80054d60050db0053e00260264d60054d0005", + "0x501b0260df0054d60050df00530f02630f0054d600530f0050380260e0", + "0x54d60050de0050350260c30054d60050c300503202608b0054d600508b", + "0xe00160050d80054d60050d80053dc02634e0054d600534e0050360260de", + "0x264d60050ec0050bc0260264d60050260070260d834e0de0c308b0df30f", + "0x4d600502609c0260060054d60050d70053db0260d70054d60050264d3026", + "0x350260e60054d60050ef00530f0260e70054d60050f000508a0260d6005", + "0x4d600500600507d0260390054d60050d60053180264d10054d60050ee005", + "0x810390074d60050390050d60260390054d60050390bc0074360260bb005", + "0x1bd0260940bb0074d60050bb0051bb0260bb0054d60050bb0ba0073d9026", + "0x50e600530f0260e70054d60050e700508a0260350054d6005094081007", + "0x2634e0054d600534e0050360260c30054d60050c30050320260e60054d6", + "0x53d60264ca0350074d60050350051c00260350054d60050350360073d8", + "0xc30e60e70893d50264d10054d60054d14d00074870264ca0054d60054ca", + "0x1c0054d600501c1c50074880264c84d301c07d4c908a4d60054ca0f234e", + "0x9a0055c501a0054d60074c80050dc0264d30054d60054d34d20070ff026", + "0x509c0050bc02609c09b0074d600501a0054430260264d6005026007026", + "0x5c74c60055c609e0054d600a0bb00509b0260264d600502600a0260264d6", + "0x3e10260264d600509e0050bc0260264d60050260070264c50055c80a0005", + "0x264c30054d60050263530264c40054d60050263530260264d600540d005", + "0x54c10051c40264c10054d60054c20055c90264c20054d60050390053d2", + "0x264c90054d60054c900508a0260264d60054c00053cf0264bf4c00074d6", + "0x54c40050f50264bf0054d60054bf0053ce02607d0054d600507d00530f", + "0x54c34c44bf07d4c908a3cd0264c30054d60054c30050f50264c40054d6", + "0x5ca0ab0054d60070aa0053cb0260264d600502600a0260aa4bd4be0c04d6", + "0xbc0264ba4bb4bc0c04d60050ab0053ca0260264d60050260070260ad005", + "0x4d60054b90053ae0264b84b90074d60054bc0050c40260264d60054ba005", + "0x508b0260264d60054b70053ae0264b64b70074d60054bb0050c4026026", + "0x4b44b54d34bd00a3c90264b40054d60054b600508b0264b50054d60054b8", + "0x50264d00260264d60050260070264af4b04b10c05cb4b24b30074d6007", + "0x360265180054d60054b300530f0260840054d60054be00508a0260264d6", + "0x1010260264d60050260070260265cc00502640d02602b0054d60054b2005", + "0x260264d600509b0053a70260264d60053180051010260264d600502c005", + "0x264d600531b0055230260264d600501b00546d0260264d60050320050e5", + "0x54b00050360264ac0054d60054b100530f0260264d60050350053c8026", + "0x260070260265cd00502640d0264aa0054d60054af0050f50264ab0054d6", + "0x53a70260264d60053180051010260264d600502c0051010260264d6005", + "0x5230260264d600501b00546d0260264d60050320050e50260264d600509b", + "0x5190074d60050ad0054b60260264d60050350053c80260264d600531b005", + "0x4d30050360264ac0054d60054bd00530f0260264d60055190054b50264a6", + "0x7e0260264d60050264d00264aa0054d60054a60050f50264ab0054d6005", + "0x4d60054a40053e00264a40054d60054aa4a50073650264a50054d6005026", + "0x30f02630f0054d600530f0050380264be0054d60054be00508a0264a2005", + "0x4d600501c00503202608b0054d600508b00501b0264ac0054d60054ac005", + "0x3dc0264ab0054d60054ab0050360264d10054d60054d100503502601c005", + "0x50260070264a24ab4d101c08b4ac30f4be0160054a20054d60054a2005", + "0x40d0053e10260264d60050390054970260264d60054c60050bc0260264d6", + "0x50a00050bc0260264d60050260070260265ce00502640d0260264d6005", + "0x50264d00260264d600540d0053e10260264d60050390054970260264d6", + "0x360265180054d600507d00530f0260840054d60054c900508a0260264d6", + "0x4d600551800530f0260840054d600508400508a02602b0054d60054d3005", + "0xff0260350054d60050350053d60264d10054d60054d1005035026518005", + "0x3194a10bf00a4d60050354d151808400a3c702602b0054d600502b02c007", + "0x55cf49f0054d60074a00050e80263190054d600531931b0074870264a0", + "0x54d60050263530260c20054d60050263530260264d600502600702649e", + "0xd60263310054d60053310320074360263310054d600549f0050e702649d", + "0x54a80052550264a80054d600549c00525602649c3310074d6005331005", + "0x260264d60054a70053cf02649a4a70074d60054a90051c40264a90054d6", + "0x549a0053ce0264a10054d60054a100530f0260bf0054d60050bf00508a", + "0x2649d0054d600549d0050f50260c20054d60050c20050f502649a0054d6", + "0x260264d600502600a0260c84990c60c04d600549d0c249a4a10bf08a3cd", + "0x4980053ca0260264d60050260070264960055d04980054d60070c80053cb", + "0x74d60054930050c40260264d60054900050bc0264905234930c04d6005", + "0x3ae02648b48c0074d60055230050c40260264d600548e0053ae02648d48e", + "0x54d600548b00508b02648a0054d600548d00508b0260264d600548c005", + "0x70264854864870c05d13144880074d600748948a02b49900a3c9026489", + "0x263530264840054d60050263530260264d60050264d00260264d6005026", + "0x54d60054820051d00264820054d600501b3310071ce0264830054d6005", + "0x508a0260264d60054800053cf02647f4800074d60054810051c4026481", + "0x54d600547f0053ce0264880054d600548800530f0260c60054d60050c6", + "0x70ff0264830054d60054830050f50264840054d60054840050f502647f", + "0x47c47d47e0c04d600548348447f4880c608a3cd0263140054d6005314318", + "0x53ca0260264d600502600702647a0055d247b0054d600747c0053cb026", + "0x4d60054790050c40260264d60054770050bc0264774784790c04d600547b", + "0x264734740074d60054780050c40260264d60054760053ae026475476007", + "0x4d600547300508b0264720054d600547500508b0260264d60054740053ae", + "0x2646c46d46e0c05d346f4700074d600747147231447d00a3c9026471005", + "0x54d600546b09b0073c502646b0054d60050264d30260264d6005026007", + "0x503802647e0054d600547e00508a0264690054d600546a0053c402646a", + "0x54d600508b00501b0264700054d600547000530f02630f0054d600530f", + "0x50360263190054d600531900503502601c0054d600501c00503202608b", + "0x1c08b47030f47e0160054690054d60054690053dc02646f0054d600546f", + "0x502607e0260264d600509b0053a70260264d600502600702646946f319", + "0x4660054d60054670053e00264670054d600546c4680073650264680054d6", + "0x46e00530f02630f0054d600530f00503802647e0054d600547e00508a026", + "0x1c0054d600501c00503202608b0054d600508b00501b02646e0054d6005", + "0x4660053dc02646d0054d600546d0050360263190054d6005319005035026", + "0x264d600502600702646646d31901c08b46e30f47e0160054660054d6005", + "0x547e00508a0264650054d600547a0053e00260264d600509b0053a7026", + "0x2647d0054d600547d00530f02630f0054d600530f00503802647e0054d6", + "0x531900503502601c0054d600501c00503202608b0054d600508b00501b", + "0x54650054d60054650053dc0263140054d60053140050360263190054d6", + "0x509b0053a70260264d600502600702646531431901c08b47d30f47e016", + "0x3180051010260264d600501b00546d0260264d60053310054970260264d6", + "0x264630054d60054860050360264640054d600548700530f0260264d6005", + "0x260264d60050260070260265d400502640d0264620054d60054850050f5", + "0x264d600501b00546d0260264d60053310054970260264d600509b0053a7", + "0x4610054b50264604610074d60054960054b60260264d6005318005101026", + "0x264630054d600502b0050360264640054d600549900530f0260264d6005", + "0x45f0054d600502607e0260264d60050264d00264620054d60054600050f5", + "0x508a02645d0054d600545e0053e002645e0054d600546245f007365026", + "0x54d600546400530f02630f0054d600530f0050380260c60054d60050c6", + "0x503502601c0054d600501c00503202608b0054d600508b00501b026464", + "0x54d600545d0053dc0264630054d60054630050360263190054d6005319", + "0x53a70260264d600502600702645d46331901c08b46430f0c601600545d", + "0xe50260264d60053180051010260264d600501b00546d0260264d600509b", + "0x54d60050bf00508a02645c0054d600549e0053e00260264d6005032005", + "0x501b0264a10054d60054a100530f02630f0054d600530f0050380260bf", + "0x54d600531900503502601c0054d600501c00503202608b0054d600508b", + "0xbf01600545c0054d600545c0053dc02602b0054d600502b005036026319", + "0x264d60054c50050bc0260264d600502600702645c02b31901c08b4a130f", + "0x4d600509b0053a70260264d60053180051010260264d600502c005101026", + "0x531b0055230260264d600501b00546d0260264d60050320050e5026026", + "0x50263c30260264d60050390054970260264d60050350053c80260264d6", + "0x263c20264590054d600502608d02645a0054d600502609c02645b0054d6", + "0x54d600545945a45b0c01d50264570054d60050263c00264580054d6005", + "0x53180264560054d60054560051d70264c90054d60054c900508a026456", + "0x4574584564c900a1da0264570054d60054570050d80264580054d6005458", + "0x50260070264520055d54530054d60074540051440264544550074d6005", + "0x4500053180264500054d60050261db0264510054d60050263530260264d6", + "0x74d60054530051dd02644f0054d600545045100735f0264500054d6005", + "0x1e40264d40054d60054d440d0073bf0260264d600501e0050bc02601e4d4", + "0x4d600544c0051e20260264d600507a0051e002644c07a0074d60054d4005", + "0x264d600544a00549702610b44a44b0c04d600510a0051e502610a44c007", + "0x10d0053c102610d44b0074d600544b0051e60260264d600510b005459026", + "0x1100054d60051100053180261100054d600510e0050f802610e0054d6005", + "0x508a0264430054d600544b0053be0264490054d600511044f00735f026", + "0x54d60054430051df02607d0054d600507d00530f0264550054d6005455", + "0x4420c04d600544944307d45500a3bc0264490054d60054490050f5026443", + "0x261110055d61130054d60071140050f30260264d600502600a026114112", + "0x4d600511d0050bc02611d11a0074d60051130050f20260264d6005026007", + "0x4401200140c04d600511e0051e502611e44c0074d600544c0051e2026026", + "0x4d60051200053090260264d60054400054590260264d60050140053bb026", + "0x43b43c0c04d600544c0051e502643d0054d600543e11a00735f02643e005", + "0x543a0051eb0260264d600543b0054970260264d600543c0053bb02643a", + "0x12b0054d600512843d00735f0261280054d60054380050f80264380054d6", + "0x264d60050260070260265d700502640d02612a0054d600512b0050f5026", + "0x1290054b50261271290074d60051110054b60260264d600544c0051ed026", + "0x508a0260264d60050264d002612a0054d60051270050f50260264d6005", + "0x54d600512a0050f50261330054d600511200530f0261260054d6005442", + "0x260264d60050264d00260264d60050260070260265d800502640d026134", + "0x54370054b50264354370074d60054520054b60260264d600540d0053e1", + "0xf50261330054d600507d00530f0261260054d600545500508a0260264d6", + "0x4d60051344340073650264340054d600502607e0261340054d6005435005", + "0x380261260054d600512600508a0264320054d60054330053e0026433005", + "0x4d600508b00501b0261330054d600513300530f02630f0054d600530f005", + "0x360264d10054d60054d100503502601c0054d600501c00503202608b005", + "0x8b13330f1260160054320054d60054320053dc0264d30054d60054d3005", + "0x51010260264d600502c0051010260264d60050260070264324d34d101c", + "0x46d0260264d60050320050e50260264d60050bb00509a0260264d6005318", + "0x260264d60050350053c80260264d600531b0055230260264d600501b005", + "0x54d600509a0053e00260264d600540d0053e10260264d6005039005497", + "0x530f02630f0054d600530f0050380264c90054d60054c900508a026431", + "0x54d600501c00503202608b0054d600508b00501b02607d0054d600507d", + "0x53dc0264d30054d60054d30050360264d10054d60054d100503502601c", + "0x4d60050260070264314d34d101c08b07d30f4c90160054310054d6005431", + "0x50ba0053dd0260264d60053180051010260264d600502c005101026026", + "0x1b00546d0260264d60050320050e50260264d60050360053de0260264d6", + "0x53e10260264d60050bc0050e50260264d600531b0055230260264d6005", + "0x3a70260264d60054d20051010260264d60051c50054930260264d600540d", + "0x4300054d60054390053e00260264d60054d00055230260264d60050f2005", + "0xef00530f02630f0054d600530f0050380260f00054d60050f000508a026", + "0xc30054d60050c300503202608b0054d600508b00501b0260ef0054d6005", + "0x4300053dc02634e0054d600534e0050360260ee0054d60050ee005035026", + "0x264d600502600702643034e0ee0c308b0ef30f0f00160054300054d6005", + "0x4d60054d00055230260264d600502c0051010260264d60051030054ca026", + "0x50360053de0260264d60050ba0053dd0260264d6005318005101026026", + "0x31b0055230260264d60050880053a70260264d60050320050e50260264d6", + "0x53e10260264d60050bc0050e50260264d60054d20051010260264d6005", + "0x4960260264d60053120054980260264d60051c50054930260264d600540d", + "0x260264d60053530051010260264d600534b0054930260264d6005309005", + "0x42f0054d60050263530260264d60050380054690260264d60050160050df", + "0x42e42f00735f02642e0054d600542e00531802642e0054d60050264b4026", + "0x42b0054d60050d400503602642c0054d60050d500530f02642d0054d6005", + "0x264d60050260070260265d900502640d02642a0054d600542d0050f5026", + "0x4d60053180051010260264d60054d00055230260264d600502c005101026", + "0x50320050e50260264d60050360053de0260264d60050ba0053dd026026", + "0x4d20051010260264d600531b0055230260264d60050880053a70260264d6", + "0x54930260264d600540d0053e10260264d60050bc0050e50260264d6005", + "0x4930260264d60053090054960260264d60053120054980260264d60051c5", + "0x260264d60050160050df0260264d60053530051010260264d600534b005", + "0x54d60050d200530f0260264d60050380054690260264d600536a0054b3", + "0x2640d02642a0054d60050d00050f502642b0054d60050d100503602642c", + "0x4d00055230260264d600502c0051010260264d60050260070260265d9005", + "0x53de0260264d60050ba0053dd0260264d60053180051010260264d6005", + "0x5230260264d60050880053a70260264d60050320050e50260264d6005036", + "0x260264d60050bc0050e50260264d60054d20051010260264d600531b005", + "0x264d60053120054980260264d60051c50054930260264d600540d0053e1", + "0x4d60053530051010260264d600534b0054930260264d6005309005496026", + "0x536500530f0260264d60050380054690260264d60050160050df026026", + "0x2642a0054d60053680050f502642b0054d600517100503602642c0054d6", + "0x50820053e00260820054d600542a2160073650262160054d600502607e", + "0x260050054d60050050050380260260054d600502600508a0260cb0054d6", + "0x500a0050320260c00054d60050c000501b02642c0054d600542c00530f", + "0x2642b0054d600542b00503602608a0054d600508a00503502600a0054d6", + "0x260f10260cb42b08a00a0c042c0050260160050cb0054d60050cb0053dc", + "0x264d00260264d60050261020264d00054d60050261030264d20054d6005", + "0x54970260264d60054d40054970260264d60050160054970260264d6005", + "0x30f30908b0c05da1c54d101c0c04d60070890070074c10260264d600540d", + "0x4d60051c50054bf0261c50054d60051c50054c00260264d6005026007026", + "0x4d60053140050aa02602b31b31931831408a4d60053120054bd026312005", + "0x502b0054970260264d600531b0050ad0260264d60053190050ad026026", + "0x45c02602c0054d600531800545d0263180054d600531800545e0260264d6", + "0x49702634b0c30ba0bb0bc0390360354d303801b0323314d14d600502c005", + "0x260264d600501b00545b0260264d60050320050ad0260264d6005331005", + "0x264d600503900545a0260264d60050360054970260264d6005035005497", + "0x4d60050c30054590260264d60050ba0054590260264d60050bc00545b026", + "0x34e00501602634e0054d60050bb0050c00260264d600534b005104026026", + "0x54d60054d14d00070ff02601c0054d600501c00530f02634e0054d6005", + "0x890264d30054d60054d34d20074360260380054d60050380053120264d1", + "0x3530050c30260264d600502600702635f0055db3583530074d600734e005", + "0x53a70260264d60054d30054970260264d600535800534b0260264d6005", + "0x45802607e0054d60050263530260264d60050380051040260264d6005088", + "0x4d600536507e00735f0263650054d60053650053180263650054d6005026", + "0x40702636a0054d60051713680073650263680054d600502607e026171005", + "0x4d60050050050380260260054d600502600508a0260d50054d600536a005", + "0x320260c00054d60050c000501b02601c0054d600501c00530f026005005", + "0x4d60054d100503602608a0054d600508a00503502600a0054d600500a005", + "0xd54d108a00a0c001c0050260160050d50054d60050d500540b0264d1005", + "0x74d60050380054550260264d600535f0050c30260264d6005026007026", + "0x4280260d20054d60050d30054340260d30054d60050d40050c00260d4038", + "0x260d20054d60050d20050d80260264d600502600a0260d10054d6005026", + "0x50380054550260264d60050260070260265dc0264d60070d10d2007426", + "0xce0054d60050cf0054340260cf0054d60050d00050c00260d00380074d6", + "0xcd0ce0074260260ce0054d60050ce0050d80260cd0054d6005026142026", + "0x260cc0054d60050380050c00260264d60050260070260265dd0264d6007", + "0x50880260264d60050260070263a70055de3a43940074d60070cc005089", + "0x54d60050c40054d40263ae0054d60053940050160260c40054d60053a4", + "0xe0054d60050264d30260264d60050260070260265df00502640d0260ca", + "0x1060054d40263ae0054d60053a70050160261060054d600500e0054d2026", + "0x4d60050260070261040055e01050054d60070ca0054d10260ca0054d6005", + "0x4d60050264230261030054d600510500501c0260264d60050264d0026026", + "0x8a0261000054d60053ae00508b0261010054d6005103005309026102005", + "0x4d600510000531202601c0054d600501c00530f0260260054d6005026005", + "0x1460261010054d60051010053180261020054d6005102005422026100005", + "0xfc0054d60070fd0054210260fd0fe0ff0c04d600510110210001c02608a", + "0xc00260f90fa0074d60050fc00541f0260264d60050260070260fb0055e1", + "0x4d60050fe00530f0260f70054d60050ff00508a0260f80054d60050fa005", + "0x40d0260f40054d60050f900541c0260f50054d60050f80050160260f6005", + "0x53a70260264d60054d30054970260264d60050260070260265e2005026", + "0x264d60050f30054b50260f20f30074d60050fb0054b60260264d6005088", + "0x4d10050360260f00054d60050fe00530f0260f10054d60050ff00508a026", + "0x70260265e300502640d0260ee0054d60050f20050f50260ef0054d6005", + "0x264d30260264d60051040050bc0260264d60050264d00260264d6005026", + "0xf70054d600502600508a0264360054d60050ed0055730260ed0054d6005", + "0x43600541c0260f50054d60053ae0050160260f60054d600501c00530f026", + "0x4d600502600702643f0055e44390054d60070f40054190260f40054d6005", + "0x260264d60050260070264970055e51704480074d60070f5005089026026", + "0x264d60054d30054970260264d600517000534b0260264d60054480050c3", + "0x54d60050263530260264d60054390054170260264d60050880053a7026", + "0xec00735f0260eb0054d60050eb0053180260eb0054d600502614a0260ec", + "0x54d60050f600530f0260f10054d60050f700508a0260ea0054d60050eb", + "0x2640d0260ee0054d60050ea0050f50260ef0054d60054d10050360260f0", + "0xf700508a0260264d60054970050c30260264d60050260070260265e3005", + "0xe70054d60054d10050360260e80054d60050f600530f0260e90054d6005", + "0x264d60050260070260265e600502640d0260e60054d6005439005422026", + "0x4d60050880053a70260264d60054d30054970260264d600543f0050bc026", + "0x4d600502614c0260e50054d60050263530260264d60050f50050c3026026", + "0x260e30054d60050e40e500735f0260e40054d60050e40053180260e4005", + "0x54d10050360260f00054d60050f600530f0260f10054d60050f700508a", + "0x260070260265e300502640d0260ee0054d60050e30050f50260ef0054d6", + "0x4d60050260da0260264d60050260070260265e700502640d0260264d6005", + "0x50d80260e00054d600502608d0260e10054d60050e20050d90260e2005", + "0xe10e04d101c00a0060260e10054d60050e10050d70260e00054d60050e0", + "0x53180260264d60050260070260da0db0dc0c05e80dd0de0df0c04d6007", + "0x54d60050de0050360260df0054d60050df00530f0260dd0054d60050dd", + "0x264d00260264d60050260070260d90055e90264d60070dd0050810260de", + "0x51040260264d60050880053a70260264d60054d30054970260264d6005", + "0x3180260d80054d600502614b02608d0054d60050263530260264d6005038", + "0x502600508a0260d70054d60050d808d00735f0260d80054d60050d8005", + "0x260ef0054d60050de0050360260f00054d60050df00530f0260f10054d6", + "0x260264d60050260070260265e300502640d0260ee0054d60050d70050f5", + "0x70060050890260d60054d60050d90051490260060054d60050380050c0", + "0x54d60050940050880260264d60050260070264ca0055ea0940810074d6", + "0x2640d0264c80054d60054c90054d402607d0054d60050810050160264c9", + "0x1a0054d202601a0054d60050264d30260264d60050260070260265eb005", + "0x4c80054d600509a0054d402607d0054d60054ca00501602609a0054d6005", + "0x501c0260264d600502600702609c0055ec09b0054d60074c80054d1026", + "0x54d60054c60053180264c60054d600509e00530902609e0054d600509b", + "0x260264d60050260070264c40055ed4c50a00074d600707d0050890264c6", + "0x54c30054d40264c20054d60050a00050160264c30054d60054c5005088", + "0x4d60050264d30260264d60050260070260265ee00502640d0264c10054d6", + "0x4d40264c20054d60054c40050160264bf0054d60054c00054d20264c0005", + "0x260070264bd0055ef4be0054d60074c10054d10264c10054d60054bf005", + "0x260ab0054d60050aa0053090260aa0054d60054be00501c0260264d6005", + "0x51520264bc0054d60050ad0d60074130260ad0054d60050ab4c6007416", + "0x74d60074c20050890264bb0054d60054bb0050de0264bb0054d60054bc", + "0x50c30260264d60050264d00260264d60050260070264b80055f04b94ba", + "0x1510264b70054d60050264230260264d60054b900534b0260264d60054ba", + "0x4b50071580264b50054d60054b64b70071580264b64bb0074d60054bb005", + "0x54d60050df00530f0260e90054d600502600508a0264b40054d60054bb", + "0x2640d0260e60054d60054b40054220260e70054d60050de0050360260e8", + "0x54b80050c30260264d60050264d00260264d60050260070260265e6005", + "0x8a0264b20054d60054bb4b30071580264b30054d60050264230260264d6", + "0x4d60050de0050360260e80054d60050df00530f0260e90054d6005026005", + "0x380260e90054d60050e900508a0260e60054d60054b20054220260e7005", + "0x4d60050c000501b0260e80054d60050e800530f0260050054d6005005005", + "0x3602608a0054d600508a00503502600a0054d600500a0050320260c0005", + "0x4d60050e60054220264d30054d60054d30053180260e70054d60050e7005", + "0x4b04b10164d60050e64d30880e708a00a0c00e80050e940d16c0260e6005", + "0x260070264a60055f15190054d60074aa00516e0264aa4ab4ac5180844af", + "0x540e0264a50054d60050264420260264d60055190054040260264d6005", + "0x54d60054b100508a0264a20054d60054a400540c0264a40054d60054a5", + "0x501b0264af0054d60054af00530f0264b00054d60054b00050380264b1", + "0x54d60054ac0050350265180054d60055180050320260840054d6005084", + "0x4b10160054a20054d60054a200540b0264ab0054d60054ab0050360264ac", + "0x54d60054a60054070260264d60050260070264a24ab4ac5180844af4b0", + "0x530f0264b00054d60054b00050380264b10054d60054b100508a0260bf", + "0x54d60055180050320260840054d600508400501b0264af0054d60054af", + "0x540b0264ab0054d60054ab0050360264ac0054d60054ac005035026518", + "0x4d60050260070260bf4ab4ac5180844af4b04b10160050bf0054d60050bf", + "0x4d60054d30054970260264d60054bd0050bc0260264d60050264d0026026", + "0x50d60051630260264d60054c20050c30260264d60050880053a7026026", + "0x50265870264a10054d60050263530260264d60054c60054970260264d6", + "0x49f0054d60054a04a100735f0264a00054d60054a00053180264a00054d6", + "0xde0050360260f00054d60050df00530f0260f10054d600502600508a026", + "0x70260265e300502640d0260ee0054d600549f0050f50260ef0054d6005", + "0x54970260264d600509c0050bc0260264d60050264d00260264d6005026", + "0x1630260264d600507d0050c30260264d60050880053a70260264d60054d3", + "0x260c20054d600502658702649e0054d60050263530260264d60050d6005", + "0x2600508a02649d0054d60050c249e00735f0260c20054d60050c2005318", + "0xef0054d60050de0050360260f00054d60050df00530f0260f10054d6005", + "0x264d60050260070260265e300502640d0260ee0054d600549d0050f5026", + "0x264d60050380051040260264d60050880053a70260264d60050264d0026", + "0x50dc00530f0260f10054d600502600508a0260264d60054d3005497026", + "0x260ee0054d60050da0050f50260ef0054d60050db0050360260f00054d6", + "0x54a80054070264a80054d60050ee49c00736502649c0054d600502607e", + "0x260050054d60050050050380260f10054d60050f100508a0264a90054d6", + "0x500a0050320260c00054d60050c000501b0260f00054d60050f000530f", + "0x260ef0054d60050ef00503602608a0054d600508a00503502600a0054d6", + "0x260070264a90ef08a00a0c00f00050f10160054a90054d60054a900540b", + "0x51010260264d60050880053a70260264d60054d20050e50260264d6005", + "0x49a0054d600530f4a70073650264a70054d600502607e0260264d60054d0", + "0x50050380260260054d600502600508a0260c60054d600549a005407026", + "0xc00054d60050c000501b02608b0054d600508b00530f0260050054d6005", + "0x30900503602608a0054d600508a00503502600a0054d600500a005032026", + "0x8a00a0c008b0050260160050c60054d60050c600540b0263090054d6005", + "0x4d60050264d00260264d60050261020260890054d60050261030260c6309", + "0x810260160054d60050880053b902608800a0074d600500a0053ba026026", + "0x4d60050c00054aa0260264d60050260070264d40055f20264d6007016005", + "0x4d60050263530260264d60050890051010260264d600500a0054c2026026", + "0x735f0264d30054d60054d30053180264d30054d60050263b802640d005", + "0x4d60054d24d10073650264d10054d600502607e0264d20054d60054d340d", + "0x30f0260260054d600502600508a02601c0054d60054d00053b70264d0005", + "0x4d600501c0053b60260070054d60050070050360260050054d6005005005", + "0x4d60054d40054ca0260264d600502600702601c00700502600a00501c005", + "0x8b0074d60071c50070050c03b50261c500a0074d600500a0053ba026026", + "0x263140054d60050263530260264d600502600702631230f3090c05f308a", + "0x4d60053190051f60263190054d600500a0053b40263180054d6005026353", + "0x2633102c0074d600502b0051c402602b0054d600531b0051f702631b005", + "0x4d600508b00530f0260260054d600502600508a0260264d600502c0053cf", + "0xf50263140054d60053140050f50263310054d60053310053ce02608b005", + "0x8b02608a3cd02608a0054d600508a0890070ff0263180054d6005318005", + "0x70380053cb0260264d600502600a02603801b0320c04d6005318314331", + "0x390c04d60050350053ca0260264d60050260070260360055f40350054d6", + "0x3ae0260c30ba0074d60050390050c40260264d60050bb0050bc0260bb0bc", + "0x4d600534b0053ae02634e34b0074d60050bc0050c40260264d60050ba005", + "0xa3c90263580054d600534e00508b0263530054d60050c300508b026026", + "0x264d60050260070263681713650c05f507e35f0074d600735835308a01b", + "0x4d600536a0c00071f902636a0054d60050264d30260264d60050264d0026", + "0x30f0260320054d600503200508a0260d40054d60050d50053b20260d5005", + "0x4d60050d40053b602607e0054d600507e00503602635f0054d600535f005", + "0x4d60050c00054aa0260264d60050260070260d407e35f03200a0050d4005", + "0x50f50260d20054d60051710050360260d30054d600536500530f026026", + "0x54aa0260264d60050260070260265f600502640d0260d10054d6005368", + "0x264d60050d00054b50260cf0d00074d60050360054b60260264d60050c0", + "0xcf0050f50260d20054d600508a0050360260d30054d600501b00530f026", + "0x73650260ce0054d600502607e0260264d60050264d00260d10054d6005", + "0x4d600503200508a0260cc0054d60050cd0053b70260cd0054d60050d10ce", + "0x3b60260d20054d60050d20050360260d30054d60050d300530f026032005", + "0x4aa0260264d60050260070260cc0d20d303200a0050cc0054d60050cc005", + "0x260264d60050890051010260264d600500a0054c20260264d60050c0005", + "0x53a40053b70263a40054d60053123940073650263940054d600502607e", + "0x263090054d600530900530f0260260054d600502600508a0263a70054d6", + "0x30f30902600a0053a70054d60053a70053b602630f0054d600530f005036", + "0x4d60050261020264d40054d60050264a20260880054d60050261030263a7", + "0xc05f74d24d340d0c04d60070c00050074c10260264d60050264d0026026", + "0x54bf0264d20054d60054d20054c00260264d600502600702601c4d04d1", + "0x54d60051c50054be02640d0054d600540d00530f0261c50054d60054d2", + "0x260070263183143120c05f830f30908b0c04d60074d340d0074c10261c5", + "0x263190054d600530f0054bf02630f0054d600530f0054c00260264d6005", + "0xab0260264d600531b0050aa02603233102c02b31b08a4d60051c50054bd", + "0x260264d60050320054970260264d600502c0050ad0260264d600502b005", + "0x260bc03903603503808a4d60053190054bd02601b0054d60053310054bc", + "0x264d60050390050ad0260264d60050350050ab0260264d60050380050aa", + "0x50bb0053180260bb0054d60050360054bc0260264d60050bc005497026", + "0xba0054d60050ba0053180260ba0054d60050bb01b0074bb0260bb0054d6", + "0xba0050810263090054d600530900503602608b0054d600508b00530f026", + "0x2634b0054d60050261fb0260264d60050260070260c30055f90264d6007", + "0x70c048002634b0054d600534b00531802634e08a0074d600508a0050d6", + "0x35802600747f0263580054d60053580053180263583530074d600534e34b", + "0x1710054d600502608d0263650054d600507e0050d902607e35f0074d6005", + "0x35f00508a0263530054d60053530050320261710054d60051710050d8026", + "0xd40c05fa0d536a3680c04d600736517130908b00a00602635f0054d6005", + "0x4d60050d50053180260264d600502600a0260264d60050260070260d20d3", + "0x263680054d600536800530f0260d10d50074d60050d50050d60260d5005", + "0x260070260d00055fb0264d60070d100508102636a0054d600536a005036", + "0x53b10260cf0054d60050264d30260264d60050d50054970260264d6005", + "0x260265fc00502640d0260cd0054d60050ce0051fd0260ce0054d60050cf", + "0x260cc0054d600502609e0260264d60050d00054ca0260264d6005026007", + "0x53180263a40054d60050cc3940074bb0263940d50074d60050d50050d6", + "0x4d60050260070263a70055fd0264d60073a40050810263a40054d60053a4", + "0x50c40053b00260c40054d60050264d30260264d60050d5005497026026", + "0x260070260265fc00502640d0260cd0054d60053ae0051fd0263ae0054d6", + "0x1fd0260ca0054d60050d50051ff0260264d60053a70054ca0260264d6005", + "0x500e0053af02610600e0074d60050cd0052010260cd0054d60050ca005", + "0x52010261040054d60051050053b00261050054d60050264d30260264d6", + "0x74d60051060052010260264d60051030053af0261021030074d6005104", + "0x3af0260fe0ff0074d60051020052010260264d60051010053af026100101", + "0x4d60050fe1000073ad0260fe0054d60050fe0051fd0260264d60050ff005", + "0x260264d60050260070260fb0055fe0fc0054d60070fd0054a40260fd005", + "0x260fa0054d60050261fb0260264d60050fc0050bc0260264d60050264d0", + "0x3530c04800260fa0054d60050fa0053180260f908a0074d600508a0050d6", + "0xf835f00747f0260f80054d60050f80053180260f80160074d60050f90fa", + "0xf40054d600502609e0260f50054d60050f60050d90260f60f70074d6005", + "0x50f40053180260f30054d60050f30050d80260f30054d600502608d026", + "0xf70054d60050f700508a0260160054d60050164d40074880260f40054d6", + "0x70260ef0f00f10c05ff0890f20074d60070f40f50f336a36808a204026", + "0x3ab0260ed0054d60050263530260ee0054d60050263530260264d6005026", + "0x4d60054390052090264390054d60054360053aa0264360054d600508a005", + "0x8a0260264d60054480053cf0261704480074d600543f0051c402643f005", + "0x4d60051700053ce0260f20054d60050f200530f0260f70054d60050f7005", + "0xff0260ed0054d60050ed0050f50260ee0054d60050ee0050f5026170005", + "0xec4970c04d60050ed0ee1700f20f708a3cd0260890054d6005089088007", + "0x70260e90056000ea0054d60070eb0053cb0260264d600502600a0260eb", + "0x4d60050e60050bc0260e60e70e80c04d60050ea0053ca0260264d6005026", + "0x50c40260264d60050e50053ae0260e40e50074d60050e80050c4026026", + "0x54d60050e400508b0260264d60050e30053ae0260e20e30074d60050e7", + "0xdf0074d60070e00e10890ec00a3c90260e00054d60050e200508b0260e1", + "0x4d30260264d60050264d00260264d60050260070260db0dc0dd0c06010de", + "0x4d60050d900520c0260d90054d60050da00a00720a0260da0054d6005026", + "0x320260df0054d60050df00530f0264970054d600549700508a02608d005", + "0x4d600508d0053a90260de0054d60050de0050360260160054d6005016005", + "0x500a00516b0260264d600502600702608d0de0160df49708a00508d005", + "0xf50260d70054d60050dc0050360260d80054d60050dd00530f0260264d6", + "0x16b0260264d600502600702602660200502640d0260060054d60050db005", + "0x4d60050d60054b50260810d60074d60050e90054b60260264d600500a005", + "0x50f50260d70054d60050890050360260d80054d60050ec00530f026026", + "0x3650260940054d600502607e0260264d60050264d00260060054d6005081", + "0x549700508a0264c90054d60054ca00520e0264ca0054d6005006094007", + "0x260160054d60050160050320260d80054d60050d800530f0264970054d6", + "0x160d849708a0054c90054d60054c90053a90260d70054d60050d7005036", + "0x508a0054970260264d600500a00516b0260264d60050260070264c90d7", + "0x7d00736502607d0054d600502607e0260264d60050880051010260264d6", + "0x54d60050f700508a02601a0054d60054c800520e0264c80054d60050ef", + "0x50360260160054d60050160050320260f10054d60050f100530f0260f7", + "0x1a0f00160f10f708a00501a0054d600501a0053a90260f00054d60050f0", + "0x260264d60050fb0050bc0260264d60050264d00260264d6005026007026", + "0x264d60050880051010260264d600508a0054970260264d600500a00516b", + "0x54d600502621002609a0054d60050263530260264d60054d4005493026", + "0x7e02609c0054d600509b09a00735f02609b0054d600509b00531802609b", + "0x4d60054c600520e0264c60054d600509c09e00736502609e0054d6005026", + "0x320263680054d600536800530f02635f0054d600535f00508a0260a0005", + "0x4d60050a00053a902636a0054d600536a0050360263530054d6005353005", + "0x54d40054930260264d60050260070260a036a35336835f08a0050a0005", + "0x880051010260264d600508a0054970260264d600500a00516b0260264d6", + "0x264c40054d60050d24c50073650264c50054d600502607e0260264d6005", + "0x50d400530f02635f0054d600535f00508a0264c30054d60054c400520e", + "0x260d30054d60050d30050360263530054d60053530050320260d40054d6", + "0x264d60050260070264c30d33530d435f08a0054c30054d60054c30053a9", + "0x4d600500a00516b0260264d60054d40054930260264d60050c30054ca026", + "0x4d60050263530260264d60050880051010260264d600508a005497026026", + "0x735f0264c10054d60054c10053180264c10054d60050263a80264c2005", + "0x4d60053090050360264bf0054d600508b00530f0264c00054d60054c14c2", + "0x502600702602660300502640d0264bd0054d60054c00050f50264be005", + "0x8a0054970260264d600500a00516b0260264d60054d40054930260264d6", + "0x530f0260264d60051c50054b30260264d60050880051010260264d6005", + "0x54d60053180050f50264be0054d60053140050360264bf0054d6005312", + "0x264d60054d40054930260264d600502600702602660300502640d0264bd", + "0x4d60050880051010260264d600508a0054970260264d600500a00516b026", + "0x50f50264be0054d60054d00050360264bf0054d60054d100530f026026", + "0x54d60054bd0aa0073650260aa0054d600502607e0264bd0054d600501c", + "0x530f0260260054d600502600508a0260ad0054d60050ab00520e0260ab", + "0x54d60054be0050360260070054d60050070050320264bf0054d60054bf", + "0xa00516b0260ad4be0074bf02608a0050ad0054d60050ad0053a90264be", + "0x4800260890054d60050890053180260890054d60050261fb0260264d6005", + "0x747f0260160054d60050160053180260160880074d600508a0890070c0", + "0x4d600502608d0264d30054d600540d0050d902640d4d40074d6005016026", + "0x8a0260880054d60050880050320264d20054d60054d20050d80264d2005", + "0x60401c4d04d10c04d60074d34d20c000500a0060264d40054d60054d4005", + "0xd602601c0054d600501c0053180260264d600502600702630908b1c50c0", + "0x54d00050360264d10054d60054d100530f02630f01c0074d600501c005", + "0x260264d60050260070263120056050264d600730f0050810264d00054d6", + "0x54d60053140053b10263140054d60050264d30260264d600501c005497", + "0x4d600502600702602660600502640d0263190054d60053180051fd026318", + "0x501c0050d602631b0054d600502609e0260264d60053120054ca026026", + "0x54d600502c00531802602c0054d600531b02b0074bb02602b01c0074d6", + "0x54970260264d60050260070263310056070264d600702c00508102602c", + "0x2601b0054d60050320053b00260320054d60050264d30260264d600501c", + "0x260264d600502600702602660600502640d0263190054d600501b0051fd", + "0x4d60050380051fd0260380054d600501c0051ff0260264d60053310054ca", + "0x4d30260264d60050350053af0260360350074d6005319005201026319005", + "0x74d60050bc0052010260bc0054d60050390053b00260390054d6005026", + "0x53a60260ba0054d60050ba0051fd0260264d60050bb0053af0260ba0bb", + "0x50bc0260264d600502600702634e00560934b0056080c30054d60c0036", + "0x702635f00560b35800560a3530054d60c00ba0053a60260264d60050c3", + "0x47e02607e0054d60050264d30260264d60053530050bc0260264d6005026", + "0x2660c00502640d0261710054d600536500547d0263650054d600507e005", + "0x3680054d60050264d30260264d60053580050bc0260264d6005026007026", + "0x502640d0261710054d600536a00547d02636a0054d600536800547c026", + "0x4d60050264d30260264d600535f0054970260264d600502600702602660c", + "0x40d0261710054d60050d400547d0260d40054d60050d500547c0260d5005", + "0x53a60260264d600534b0050bc0260264d600502600702602660c005026", + "0x50bc0260264d60050260070260d100560e0d200560d0d30054d60c00ba", + "0x260cf0054d60050d000547c0260d00054d60050264d30260264d60050d3", + "0x260264d600502600702602660c00502640d0261710054d60050cf00547d", + "0x54d60050ce00547e0260ce0054d60050264d30260264d60050d20050bc", + "0x4d600502600702602660c00502640d0261710054d60050cd00547d0260cd", + "0x50cc00547c0260cc0054d60050264d30260264d60050d1005497026026", + "0x2600702602660c00502640d0261710054d600539400547d0263940054d6", + "0x260070260c40056103a700560f3a40054d60c00ba0053a60260264d6005", + "0x264d30260264d600534e0054970260264d60053a40050bc0260264d6005", + "0x1710054d60050ca00547d0260ca0054d60053ae00547c0263ae0054d6005", + "0x260264d60053a70050bc0260264d600502600702602660c00502640d026", + "0x54d600500e00547c02600e0054d60050264d30260264d600534e005497", + "0x4d600502600702602660c00502640d0261710054d600510600547d026106", + "0x74bb0261040054d60050c40053090261050054d600534e005309026026", + "0x4d60071030050810261030054d60051030053180261030054d6005104105", + "0x547e0261010054d60050264d30260264d6005026007026102005611026", + "0x2602660c00502640d0261710054d600510000547d0261000054d6005101", + "0x260ff0054d60050264d30260264d60051020054ca0260264d6005026007", + "0x51710052120261710054d60050fe00547d0260fe0054d60050ff00547c", + "0x264d40054d60054d400508a0260fc0054d60050fd0053a50260fd0054d6", + "0x54d00050360260880054d60050880050320264d10054d60054d100530f", + "0x70260fc4d00884d14d408a0050fc0054d60050fc0053a30264d00054d6", + "0xfa0054d60053090fb0073650260fb0054d600502607e0260264d6005026", + "0x1c500530f0264d40054d60054d400508a0260f90054d60050fa0053a2026", + "0x8b0054d600508b0050360260880054d60050880050320261c50054d6005", + "0x4d60050260f10260f908b0881c54d408a0050f90054d60050f90053a3026", + "0x50260f10260160054d60050260f10260890054d60050260f102600a005", + "0x50070050c00260264d60050264d00260264d600502610202640d0054d6", + "0x4d60050260070264d00056124d14d20074d60074d30050890264d30054d6", + "0x50f00261c50054d600501c00530902601c0054d60054d100501c026026", + "0x54d600508b0050ef0263090054d60054d200501602608b0054d60051c5", + "0x3120054d60050264d30260264d600502600702602661300502640d02630f", + "0x3140050ef0263090054d60054d00050160263140054d60053120050ee026", + "0x54d600531800508b0263183090074d600530900542902630f0054d6005", + "0x702631b0056144d40054d600730f0050ed0260264d600502600a026319", + "0x4d60074d40260073a10264d40054d60054d440d0074360260264d6005026", + "0x260264d60053190051040260264d600502600702633100561502c02b007", + "0x2603800561601b0320074d600730900508902602b0054d600502b00508a", + "0x54d60050350053090260350054d600501b00501c0260264d6005026007", + "0x50ef0260bc0054d60050320050160260390054d60050360050f0026036", + "0x264d30260264d600502600702602661700502640d0260bb0054d6005039", + "0xbc0054d60050380050160260c30054d60050ba0050ee0260ba0054d6005", + "0x2634b0056180880054d60070bb0050ed0260bb0054d60050c30050ef026", + "0x4d60070bc0050890260880054d60050880160074360260264d6005026007", + "0x35f0054d60053530050880260264d600502600702635800561935334e007", + "0x502640d0263650054d600535f0054d402607e0054d600534e005016026", + "0x51710054d20261710054d60050264d30260264d600502600702602661a", + "0x263650054d60053680054d402607e0054d60053580050160263680054d6", + "0x3650054d10260d50054d600536a00508b02636a07e0074d600507e005429", + "0x54d60050d400501c0260264d60050260070260d300561b0d40054d6007", + "0x3a00260d20054d60050c00053090260c00054d60050c000a0074360260c0", + "0x51040260264d60050260070260cf00561c0d00d10074d60070d202b007", + "0xce0074d600707e0050890260d10054d60050d100508a0260264d60050d5", + "0x160263940054d60050cd0050880260264d60050260070260cc00561d0cd", + "0x2661e00502640d0263a70054d60053940054d40263a40054d60050ce005", + "0x54d60050c40054d20260c40054d60050264d30260264d6005026007026", + "0x54290263a70054d60053ae0054d40263a40054d60050cc0050160263ae", + "0x4d60073a70054d102600e0054d60050ca00508b0260ca3a40074d60053a4", + "0x2608a0054d600510600501c0260264d600502600702610500561f106005", + "0xd10073a00261040054d600508a00530902608a0054d600508a089007436", + "0x500e0051040260264d60050260070261010056201021030074d6007104", + "0x6210ff1000074d60073a40050890261030054d600510300508a0260264d6", + "0x1000050160260fd0054d60050ff0050880260264d60050260070260fe005", + "0x702602662200502640d0260fb0054d60050fd0054d40260fc0054d6005", + "0x260f90054d60050fa0054d20260fa0054d60050264d30260264d6005026", + "0x70fb0054d10260fb0054d60050f90054d40260fc0054d60050fe005016", + "0x1c0260264d60050264d00260264d60050260070260f70056230f80054d6", + "0x54d60050fc00508b0260f50054d60050261c50260f60054d60050f8005", + "0x530f0261030054d600510300508a0260f30054d60050f60053090260f4", + "0x54d60050f50053140260f40054d60050f40053120260050054d6005005", + "0xc04d60050f30f50f400510308a3190260f30054d60050f30053180260f5", + "0x264d60050260070260ee0056240ef0054d60070f000531b0260f00f10f2", + "0x43f0056254390054d60074360050ba0264360ed0074d60050ef00502b026", + "0x544800534e0261704480074d60054390054510260264d6005026007026", + "0xc00260ec0054d60054970050830264970054d60051700054500260264d6", + "0x4d60050f100530f0260ea0054d60050f200508a0260eb0054d60050ed005", + "0x40d0260e70054d60050ec00539c0260e80054d60050eb0050160260e9005", + "0xc00260e60054d600543f00539b0260264d6005026007026026626005026", + "0x4d60050f100530f0260ea0054d60050f200508a0260e50054d60050ed005", + "0x40d0260e70054d60050e600539c0260e80054d60050e50050160260e9005", + "0x50ad0260264d60050880054970260264d6005026007026026626005026", + "0x3980260264d60050d000539a0260264d600510200539a0260264d600502c", + "0x4d60050f100530f0260f20054d60050f200508a0260e40054d60050ee005", + "0x4d60050260070260e40f10f20c00050e40054d60050e40052b10260f1005", + "0x54d60050264d30260264d60050f70050bc0260264d60050264d0026026", + "0x530f0260ea0054d600510300508a0260e20054d60050e300539b0260e3", + "0x54d60050e200539c0260e80054d60050fc0050160260e90054d6005005", + "0xdf0056270e00054d60070e70053960260e10054d60050e800508b0260e7", + "0x3950260de0054d60050e01020d008802c08a21d0260264d6005026007026", + "0x50dc0053920260dc0054d60050dd0e10073930260dd0054d60050de005", + "0x260e90054d60050e900530f0260ea0054d60050ea00508a0260db0054d6", + "0xad0260264d60050260070260db0e90ea0c00050db0054d60050db0052b1", + "0x260264d60050d000539a0260264d600510200539a0260264d600502c005", + "0x50da0e10073930260da0054d60050df0053910260264d6005088005497", + "0x260ea0054d60050ea00508a02608d0054d60050d90053920260d90054d6", + "0x8d0e90ea0c000508d0054d600508d0052b10260e90054d60050e900530f", + "0x264d60050880054970260264d60050d000539a0260264d6005026007026", + "0x4d600510100508a0260264d60053a40050c30260264d600502c0050ad026", + "0x4d60051050050bc0260264d600502600702602662800502640d0260d8005", + "0x502c0050ad0260264d60050880054970260264d60050d000539a026026", + "0xd100508a0260264d60050890050e50260264d60053a40050c30260264d6", + "0x53910260d70054d60050264d30260264d60050264d00260d80054d6005", + "0x4d60050d60053920260d60054d600500600e0073930260060054d60050d7", + "0xc00050810054d60050810052b10260050054d600500500530f026081005", + "0x880054970260264d60050890050e50260264d60050260070260810050d8", + "0x508a0260264d600507e0050c30260264d600502c0050ad0260264d6005", + "0x50bc0260264d600502600702602662900502640d0260940054d60050cf", + "0xad0260264d60050880054970260264d60050890050e50260264d60050d3", + "0x260264d600500a0050e50260264d600507e0050c30260264d600502c005", + "0x4ca0054d60050264d30260264d60050264d00260940054d600502b00508a", + "0x539202607d0054d60054c90d50073930264c90054d60054ca005391026", + "0x54d60054c80052b10260050054d600500500530f0264c80054d600507d", + "0xe50260264d60050264d00260264d60050260070264c80050940c00054c8", + "0x260264d600500a0050e50260264d600502c0050ad0260264d6005089005", + "0x4d600534b00539102601a0054d60050bc00508b0260264d60050160050e5", + "0x2609c0054d600509b00539202609b0054d600509a01a00739302609a005", + "0x509c0052b10260050054d600500500530f02602b0054d600502b00508a", + "0x4d60050890050e50260264d600502600702609c00502b0c000509c0054d6", + "0x53090050c30260264d600500a0050e50260264d60050160050e5026026", + "0x502600702602662a00502640d02609e0054d600533100508a0260264d6", + "0x160050e50260264d60050890050e50260264d600531b0050bc0260264d6", + "0x50e50260264d60053090050c30260264d600500a0050e50260264d6005", + "0x4d30260264d60050264d002609e0054d600502600508a0260264d600540d", + "0x4d60050a03190073930260a00054d60054c60053910264c60054d6005026", + "0x2b10260050054d600500500530f0264c40054d60054c50053920264c5005", + "0x260070054d60050050050c00264c400509e0c00054c40054d60054c4005", + "0x50880260264d600502600702608a00562b00a0c00074d6007007005089", + "0x54d60050890054d40260880054d60050c00050160260890054d600500a", + "0x4d40054d60050264d30260264d600502600702602662c00502640d026016", + "0x40d0054d40260880054d600508a00501602640d0054d60054d40054d2026", + "0x54d60054d300508b0264d30880074d60050880054290260160054d6005", + "0x1c0260264d60050260070264d000562d4d10054d60070160054d10264d2", + "0x4d60051c50053180261c50054d600501c00530902601c0054d60054d1005", + "0x4d600502600702630f00562e30908b0074d60071c50260073900261c5005", + "0x50880054290263120054d600502608d0260264d60054d2005104026026", + "0x54d60053120050d80263183090074d600530900538f0263140880074d6", + "0x502600702602b00562f31b3190074d600731831231408b00a223026312", + "0x263310054d600502c00543402602c0880074d60050880054290260264d6", + "0x31b0050160263310054d60053310050d80260323090074d600530900538f", + "0x2603603500763003801b0074d60070323313190c015a02631b0054d6005", + "0xbb0056310bc0390074d600703830908801b00a2230260264d6005026007", + "0x4d60050ba0052220260ba0054d600531b00508b0260264d6005026007026", + "0x2634e0054d60050c334b00722102634b0054d60050bc00508b0260c3005", + "0x53530051250260390054d600503900508a0263530054d600534e00538c", + "0x264d600531b0050c30260264d60050260070263530390070053530054d6", + "0x4d600535f00531802635f0054d60050264080263580054d6005026353026", + "0x3650263650054d600502607e02607e0054d600535f35800735f02635f005", + "0x50bb00508a0263680054d600517100522a0261710054d600507e365007", + "0x4d60050260070263680bb0070053680054d60053680051250260bb0054d6", + "0x50880050c30260264d600531b0050c30260264d6005036005459026026", + "0x502622902636a0054d60050263530260264d60053090054590260264d6", + "0xd40054d60050d536a00735f0260d50054d60050d50053180260d50054d6", + "0xd200522a0260d20054d60050d40d30073650260d30054d600502607e026", + "0xd10054d60050d10051250260350054d600503500508a0260d10054d6005", + "0x50c30260264d60053090054590260264d60050260070260d1035007005", + "0x3180260cf0054d60050264080260d00054d60050263530260264d6005088", + "0x4d600502607e0260ce0054d60050cf0d000735f0260cf0054d60050cf005", + "0x263940054d60050cc00522a0260cc0054d60050ce0cd0073650260cd005", + "0x2639402b0070053940054d600539400512502602b0054d600502b00508a", + "0x263a40054d60050264d30260264d60050880050c30260264d6005026007", + "0xc400538c0260c40054d60053a74d20072210263a70054d60053a4005228", + "0x3ae0054d60053ae00512502630f0054d600530f00508a0263ae0054d6005", + "0x50c30260264d60054d00050bc0260264d60050260070263ae30f007005", + "0x2600e0054d60050ca0052280260ca0054d60050264d30260264d6005088", + "0x2600508a0261050054d600510600538c0261060054d600500e4d2007221", + "0x50261030261050260070051050054d60051050051250260260054d6005", + "0x2610302640d0054d60050263890260160054d60050263890260890054d6", + "0x38a0261c50054d60050261030264d00054d600502638a0264d20054d6005", + "0x4d00260264d60050261020263120054d60050261030263090054d6005026", + "0x2b31b3190c06323184d33140c04d60070c00050074c10260264d6005026", + "0x4d60053180054bf0263180054d60053180054c00260264d6005026007026", + "0x4d60053310050aa02603503801b03233108a4d600502c0054bd02602c005", + "0x50350054970260264d60050380050ad0260264d600501b0050ad026026", + "0x45c0260360054d600503200545d0260320054d600503200545e0260264d6", + "0x49702617136507e35f35835334e34b0c30ba0bb0bc0394d14d6005036005", + "0x260264d60050bb00545b0260264d60050bc0050ad0260264d6005039005", + "0x264d600534e0054970260264d60050c30054970260264d60050ba005104", + "0x4d600535f0051040260264d600535800545b0260264d600535300545a026", + "0x51710051040260264d60053650054590260264d600507e005459026026", + "0x50d602634b0054d600534b0053180263680054d600502638b0260264d6", + "0x50d50053180260d50054d600536836a0074bb02636a34b0074d600534b", + "0x4d30054d60054d34d20070ff0263140054d600531400530f0260d50054d6", + "0x4d00053880260264d60050260070260d40056330264d60070d5005081026", + "0x51010260264d600534b0054970260264d60051c50051010260264d6005", + "0x4c10260264d600540d0053850260264d60050160053850260264d6005089", + "0x264d60050260070260cf0d00d10c06340d230f0d30c04d60074d3314007", + "0xce0054bd0260ce0054d60050d20054bf0260d20054d60050d20054c0026", + "0x50cc0050ab0260264d60050cd0050aa0263a408b3940cc0cd08a4d6005", + "0x3090073820260264d60053a40054970260264d60053940050ad0260264d6", + "0x54d600500a0053810263a70054d600508b0054bc02608b0054d600508b", + "0x508a0260264d60053ae0054900260ca3ae0074d60050c400548e0260c4", + "0x54d60050070050350260d30054d60050d300530f0260260054d6005026", + "0x23502630f0054d600530f3120070ff0260ca0054d60050ca00548d026007", + "0x1030054d60071040050e802610410510600e00a4d60050ca0070d302600a", + "0x10100537f0261010054d60050262540260264d6005026007026102005635", + "0x53a710000737e0261000054d60051000053180260fe0ff1000c04d6005", + "0x260ff0054d60050ff0053180260fc0054d60051030050e70260fd0054d6", + "0xfb0053180260fd0054d60050fd0053180260fb0054d60050fc0ff00737e", + "0x50fe0fb0fd10500a23a0260fe0054d60050fe0053180260fb0054d6005", + "0x54d60050f90053180260f60054d600502609e0260f70f80f90fa00a4d6", + "0x3180260f50054d60050f50053180260f50054d60050f60f900737e0260f9", + "0xf80f50fa00a23a0260f70054d60050f70053180260f80054d60050f8005", + "0x50f10054970260264d60050f20054970260f10f20f30f400a4d60050f7", + "0x8a0260ef0054d60050f000540c0260f00054d60050f300540e0260264d6", + "0x4d60050f40050350261060054d600510600530f02600e0054d600500e005", + "0x8a0050ef0054d60050ef00540b02630f0054d600530f0050360260f4005", + "0x4070260264d60053a70054970260264d60050260070260ef30f0f410600e", + "0x4d600510600530f02600e0054d600500e00508a0260ee0054d6005102005", + "0x40b02630f0054d600530f0050360261050054d6005105005035026106005", + "0x260264d60050260070260ee30f10510600e08a0050ee0054d60050ee005", + "0x264d60053120051010260264d60053090053880260264d600500a005490", + "0x4360054070264360054d60050cf0ed0073650260ed0054d600502607e026", + "0xd10054d60050d100530f0260260054d600502600508a0264390054d6005", + "0x43900540b0260d00054d60050d00050360260070054d6005007005035026", + "0x54ca0260264d60050260070264390d00070d102608a0054390054d6005", + "0x23c0260264d60053120051010260264d60053090053880260264d60050d4", + "0x543f4480074bb02644834b0074d600534b0050d602643f0054d6005026", + "0x56360264d60071700050810261700054d60051700053180261700054d6", + "0x4d60050890051010260264d600534b0054970260264d6005026007026497", + "0x4d33140074c10260264d600540d0053850260264d6005016005385026026", + "0x54c00260264d60050260070260e80e90ea0c06370eb01c0ec0c04d6007", + "0x8a4d60050e70054bd0260e70054d60050eb0054bf0260eb0054d60050eb", + "0x260264d60050e50050ab0260264d60050e60050aa0260e34d10e40e50e6", + "0x4d60054d14d00073820260264d60050e30054970260264d60050e40050ad", + "0x48e0260e10054d600500a0053810260e20054d60054d10054bc0264d1005", + "0x4d600502600508a0260264d60050e00054900260df0e00074d60050e1005", + "0x48d0260070054d60050070050350260ec0054d60050ec00530f026026005", + "0xec02600a23502601c0054d600501c1c50070ff0260df0054d60050df005", + "0xd90056380da0054d60070db0050e80260db0dc0dd0de00a4d60050df007", + "0xc04d600508d00537f02608d0054d60050262570260264d6005026007026", + "0xd60054d60050e20d800737e0260d80054d60050d80053180260060d70d8", + "0xd700737e0260d70054d60050d70053180260810054d60050da0050e7026", + "0x54d60050940053180260d60054d60050d60053180260940054d6005081", + "0x4ca00a4d60050060940d60dc00a23a0260060054d6005006005318026094", + "0x37e0264c90054d60054c900531802601a0054d600502609e0264c807d4c9", + "0x507d00531802609a0054d600509a00531802609a0054d600501a4c9007", + "0x4d60054c807d09a4ca00a23a0264c80054d60054c800531802607d0054d6", + "0x260264d60054c60054970260264d600509e0054970264c609e09c09b00a", + "0x50de00508a0264c50054d60050a000540c0260a00054d600509c00540e", + "0x2609b0054d600509b0050350260dd0054d60050dd00530f0260de0054d6", + "0x9b0dd0de08a0054c50054d60054c500540b02601c0054d600501c005036", + "0x50d90054070260264d60050e20054970260264d60050260070264c501c", + "0x260dd0054d60050dd00530f0260de0054d60050de00508a0264c40054d6", + "0x54c400540b02601c0054d600501c0050360260dc0054d60050dc005035", + "0xa0054900260264d60050260070264c401c0dc0dd0de08a0054c40054d6", + "0x2607e0260264d60051c50051010260264d60054d00053880260264d6005", + "0x54d60054c20054070264c20054d60050e84c30073650264c30054d6005", + "0x50350260ea0054d60050ea00530f0260260054d600502600508a0264c1", + "0x54d60054c100540b0260e90054d60050e90050360260070054d6005007", + "0x4d60054970054ca0260264d60050260070264c10e90070ea02608a0054c1", + "0x4d60050263530260264d60051c50051010260264d60054d0005388026026", + "0x735f0264bf0054d60054bf0053180264bf0054d600502637c0264c0005", + "0x4bd0054d600502609e0264be0054d600502623e0264d40054d60054bf4c0", + "0x37a0260ab0054d60050aa34b4bd4be00a2400260aa0054d600502609e026", + "0x4d600502600508a0260264d60050ad0052420264bc0ad0074d60050ab005", + "0x3780260070054d60050070050350263140054d600531400530f026026005", + "0x31402600a2450264d40054d60054d440d0073770264bc0054d60054bc005", + "0x4b60056394b70054d60074b80050e80264b84b94ba4bb00a4d60054bc007", + "0x54b54d400735f0264b50054d60054b70050e70260264d6005026007026", + "0x4b30c04d60074d34ba0074c10264b40054d60054b40050f50264b40054d6", + "0x54d60054b20054c00260264d60050260070264af4b04b10c063a4b208a", + "0x4aa4ab4ac51808a4d60050840054bd0260840054d60054b20054bf0264b2", + "0x54ab0050ad0260264d60054ac0050ab0260264d60055180050aa026519", + "0x53180264a60054d60054aa0054bc0260264d60055190054970260264d6", + "0x4d600500a0053810260880054d60054a64b400735f0264a60054d60054a6", + "0x8a0260264d60054a40054900264a24a40074d60054a500548e0264a5005", + "0x4d60054b90050350264b30054d60054b300530f0264bb0054d60054bb005", + "0x2608a0054d600508a0890070ff0264a20054d60054a200548d0264b9005", + "0x4a10bf00a4d60054a24b94b34bb00a2350260880054d6005088016007377", + "0x260264d60050260070260c200563b49e0054d600749f0050e802649f4a0", + "0x502617102649c0054d600549d08800735f02649d0054d600549e0050e7", + "0x260264d60054a90053ae0264a74a90074d600549c0050c40264a80054d6", + "0x4990054d600502609c0260c60054d600502609c02649a0054d600502609c", + "0x8a0264980054d60054a700508b0260c80054d60054990c649a0c0376026", + "0x4d60054a00050350264a10054d60054a100530f0260bf0054d60050bf005", + "0x3120260c80054d60050c80053750264a80054d60054a80053680264a0005", + "0x49349600a4d60054980c84a84a04a10bf0893740264980054d6005498005", + "0x260264d600502600702648d00563c48e0054d60074900051be026490523", + "0x548b00540e0260264d600548c00510402648b48c0074d600548e00524a", + "0x264960054d600549600508a0264890054d600548a00540c02648a0054d6", + "0x508a0050360265230054d60055230050350264930054d600549300530f", + "0x702648908a52349349608a0054890054d600548900540b02608a0054d6", + "0x4960054d600549600508a0264880054d600548d0054070260264d6005026", + "0x8a0050360265230054d60055230050350264930054d600549300530f026", + "0x2648808a52349349608a0054880054d600548800540b02608a0054d6005", + "0x4870054d60050c20054070260264d60050880053ae0260264d6005026007", + "0x4a00050350264a10054d60054a100530f0260bf0054d60050bf00508a026", + "0x4870054d600548700540b02608a0054d600508a0050360264a00054d6005", + "0x264d60054b40053ae0260264d600502600702648708a4a04a10bf08a005", + "0x4d60050890051010260264d60050160053850260264d600500a005490026", + "0x54070264850054d60054af4860073650264860054d600502607e026026", + "0x54d60054b100530f0264bb0054d60054bb00508a0264840054d6005485", + "0x540b0264b00054d60054b00050360264b90054d60054b90050350264b1", + "0x4900260264d60050260070264844b04b94b14bb08a0054840054d6005484", + "0x260264d60050890051010260264d60050160053850260264d600500a005", + "0x4d60054bb00508a0264830054d60054b60054070260264d60054d40053ae", + "0x360264b90054d60054b90050350264ba0054d60054ba00530f0264bb005", + "0x4d34b94ba4bb08a0054830054d600548300540b0264d30054d60054d3005", + "0x4d60053090053880260264d600500a0054900260264d6005026007026483", + "0x50890051010260264d60050160053850260264d6005312005101026026", + "0x40d0053850260264d60051c50051010260264d60054d00053880260264d6", + "0x73650264820054d600502607e0260264d60054d20051010260264d6005", + "0x4d600502600508a0264800054d60054810054070264810054d600502b482", + "0x360260070054d60050070050350263190054d600531900530f026026005", + "0x31b00731902608a0054800054d600548000540b02631b0054d600531b005", + "0x4d60050264a20264d00054d60050264a10264d20054d60050264a0026480", + "0x4d60050264d00260264d60050261020263090054d60050260bf0261c5005", + "0x74d600530f00525202631931831431230f08a4d6005016005253026026", + "0x74bb02602c0054d600502624d02602b0054d600531b0054bc02631b30f", + "0x4d60073310050810263310054d60053310053180263310054d600502c02b", + "0x530f0260264d600530f0050ad0260264d600502600702603200563d026", + "0x2602663e00502640d0260380054d600508900503602601b0054d6005007", + "0xc04d60070890070074c10260264d60050320054ca0260264d6005026007", + "0x4d60050390054c00260264d60050260070260ba0bb0bc0c063f039036035", + "0x35334e34b08a4d60050c30054bd0260c30054d60050390054bf026039005", + "0x3580050ad0260264d600534e0050ab0260264d600534b0050aa02635f358", + "0x4bc02607e0054d60053530054bc0260264d600535f0054970260264d6005", + "0x536507e0074bb02607e0054d600507e0053180263650054d600530f005", + "0x260350054d600503500530f0261710054d60051710053180261710054d6", + "0x260070263680056400264d60071710050810260360054d6005036005036", + "0x260380054d600503600503602601b0054d600503500530f0260264d6005", + "0x4d60050260070260d10d20d30c06410d40d536a0c04d600703801b0074c1", + "0x54bd0260d00054d60050d40054bf0260d40054d60050d40054c0026026", + "0xcd0050ad0260264d60050ce0050ab0263940cc0cd0ce0cf08a4d60050d0", + "0x53720260264d60053940054970260264d60050cc0050ad0260264d6005", + "0xc04d60053a40053710263a40054d60050cf0052510260cf0054d60050cf", + "0x2600a0260264d60053ae0050ad0260264d60053a700539a0263ae0c43a7", + "0xca0c40074d60050c400536e0260c40054d60050c400536f0260264d6005", + "0x260c03700260d50054d60050d500503602636a0054d600536a00530f026", + "0x539a0260264d600502600702610410500764210600e0074d60070ca314", + "0x4960260264d60051c50054930260264d60050880054ac0260264d6005106", + "0x260264d60054d20054980260264d60053190051200260264d6005309005", + "0x264d600540d0051040260264d60054d40054970260264d60054d0005523", + "0x4d60050c400539a0260264d600531800539a0260264d6005312005497026", + "0x4d600502600702602664300502640d0261030054d600500e00508a026026", + "0x6441011020074d60073180c41050c03700260264d600510400539a026026", + "0x880054ac0260264d600510100539a0260264d60050260070260ff100007", + "0x51200260264d60053090054960260264d60051c50054930260264d6005", + "0x4970260264d60054d00055230260264d60054d20054980260264d6005319", + "0x260264d60053120054970260264d600540d0051040260264d60054d4005", + "0xfe0054d60050263530260264d60050264d00261030054d600510200508a", + "0xfd0fe00735f0260fd0054d60050fd0053180260fd0054d600502636c026", + "0xfa0054d60050fc0fb0073650260fb0054d600502607e0260fc0054d6005", + "0x50050380261030054d600510300508a0260f90054d60050fa00525a026", + "0xc00054d60050c000501b02636a0054d600536a00530f0260050054d6005", + "0xd500503602608a0054d600508a00503502600a0054d600500a005032026", + "0x8a00a0c036a0051030160050f90054d60050f900525c0260d50054d6005", + "0x4d60050264810260264d60050ff00539a0260264d60050260070260f90d5", + "0x260f80054d60050f80053180260f73120074d60053120050d60260f8005", + "0x47f0260f50054d60050f50053180260f50f60074d60050f70f800a0c0480", + "0x502608d0260f20054d60050f30050d90260f30f40074d60050f5100007", + "0x260f60054d60050f60050320260f10054d60050f10050d80260f10054d6", + "0xee0ef0f00c04d60070f20f10d536a00a0060260f40054d60050f400508a", + "0x260ee0054d60050ee0053180260264d60050260070264394360ed0c0645", + "0x70ee0050810260ef0054d60050ef0050360260f00054d60050f000530f", + "0x47e0264480054d60050264d30260264d600502600702643f0056460264d6", + "0x2664700502640d0264970054d600517000547d0261700054d6005448005", + "0xec0054d60050264d30260264d600543f0054ca0260264d6005026007026", + "0x49700547b0264970054d60050eb00547d0260eb0054d60050ec00547c026", + "0xe90054d60070ea0054a40260ea0054d60050ea00547d0260ea0054d6005", + "0x50264810260264d60050e90050bc0260264d60050260070260e8005648", + "0x74d60053120e70f60c04800260e70054d60050e70053180260e70054d6", + "0xe30e40074d60050e50f400747f0260e50054d60050e50053180260e50e6", + "0x50e100536b0260e10054d60050e200547e0260e20054d60050264d3026", + "0xd80260de0054d600502608d0260df0054d60050e30050d90260e00054d6", + "0x4d60050e60050320260e00054d60050e00053180260de0054d60050de005", + "0x4d60070e00df0de0ef0f008a2040260e40054d60050e400508a0260e6005", + "0x54d600502608d0260264d60050260070260d90da0db0c06490dc0dd007", + "0xd50260d70054d60050d80050c00260d840d0074d600540d00545502608d", + "0x260810054d60050260d30260d60054d60050260d40260060054d6005026", + "0x4d60050dd00530f02608d0054d600508d0050d80260940054d60050260d1", + "0x4ca0074d600708d0d70e40c04540260dc0054d60050dc0050360260dd005", + "0x1c0264c90054d60054c90054530260264d600502600702607d00564a4c9", + "0x54d600502645202601a0054d60054c80053090264c80054d60054c9005", + "0x31802609b0054d600509a01a0074bb02601a0054d600501a00531802609a", + "0x4d600709b0050810264ca0054d60054ca00508a02609b0054d600509b005", + "0x9400525e0260264d60050264d00260264d600502600702609c00564b026", + "0x50d20260264d60050060050840260264d60050d60055180260264d6005", + "0x54d60050050050380264ca0054d60054ca00508a02609e0054d6005081", + "0x50320260c00054d60050c000501b0260dd0054d60050dd00530f026005", + "0x54d60050dc00503602608a0054d600508a0050350260e60054d60050e6", + "0x44f0264c63190074d600531900526002640d0054d600540d0053120260dc", + "0xdd0054ca4d301e0264d40054d60054d40053180264c60054d60054c6005", + "0x264bf4c04c14c24c34c44c50a00164d60054d44c640d09e0dc08a0e60c0", + "0x4be0053690260264d60050260070264bd00564c4be0054d60074bf00507a", + "0x264d30054d60054c50050380260aa0054d60050a000508a0260264d6005", + "0x54c200503202608b0054d60054c300501b0260ab0054d60054c400530f", + "0x260ad0054d60054c00050360264d10054d60054c100503502601c0054d6", + "0x1200260264d60050880054ac0260264d600502600702602664d00502640d", + "0x260264d60053090054960260264d60054d20054980260264d6005319005", + "0x74d60054bd0054b60260264d60054d00055230260264d60051c5005493", + "0x50380264ba0054d60050a000508a0260264d60054bc0054b50264bb4bc", + "0x54d60054c300501b0264b80054d60054c400530f0264b90054d60054c5", + "0x50360264b50054d60054c10050350264b60054d60054c20050320264b7", + "0x2602664e00502640d0264b30054d60054bb0050f50264b40054d60054c0", + "0x4b20054d60054ca00508a0260264d600509c0054ca0260264d6005026007", + "0x4b20054d600507d00508a0260264d600502600702602664f00502640d026", + "0x50260070264ac5180840c06504af4b04b10c04d60070dc0dd0074c1026", + "0x4af0054bf0264af0054d60054af0054c00260264d60050264d00260264d6", + "0x265190054d60054aa00547e0264aa0054d60050264d30264ab0054d6005", + "0xab0260264d60054a60050aa0260bf4a24a44a54a608a4d60054ab0054bd", + "0x260264d60050bf0054970260264d60054a40050ad0260264d60054a5005", + "0x4d60050260cf0264a00054d60050940050d00264a10054d60050810050d2", + "0x4d600549e49f4a04a10d60060890cd02649e0054d60050260ce02649f005", + "0x30f0260050054d60050050050380264b20054d60054b200508a0260c2005", + "0x4d60050e60050320260c00054d60050c000501b0264b10054d60054b1005", + "0x2600264b00054d60054b000503602608a0054d600508a0050350260e6005", + "0x54d400531802649d0054d600549d00544f02649d3190074d6005319005", + "0x265190054d600551900547d02640d0054d600540d0053120264d40054d6", + "0x4d449d0c24b008a0e60c04b10054b24d14490264a20054d60054a2005110", + "0x4d60070c80050dc0260c84990c649a4a74a94a849c0164d60054a251940d", + "0x8a0260264d60054980050db0260264d6005026007026496005651498005", + "0x4d60054a900530f0264d30054d60054a80050380260aa0054d600549c005", + "0x3502601c0054d600549a00503202608b0054d60054a700501b0260ab005", + "0x54d60050261110260ad0054d60054990050360264d10054d60050c6005", + "0x50360260ab0054d60050ab00530f0260aa0054d60050aa00508a026493", + "0x54d600549300511a0263190054d600531900544f0260ad0054d60050ad", + "0x2608b0054d600508b3090074890264d30054d60054d34d200748a026493", + "0x8a11d0264d10054d60054d14d000748702601c0054d600501c1c5007488", + "0x48c0054d600748d00511e02648d48e49052300a4d60054933190ad0ab0aa", + "0x2648848948a0c04d600548c0050140260264d600502600702648b005652", + "0x4d60054890880072620260264d60054880050bc0260264d600548a005120", + "0x380265230054d600552300508a0264860054d6005487005264026487005", + "0x4d600508b00501b0264900054d600549000530f0264d30054d60054d3005", + "0x360264d10054d60054d100503502601c0054d600501c00503202608b005", + "0x8b4904d35230160054860054d600548600525c02648e0054d600548e005", + "0x54b60260264d60050880054ac0260264d600502600702648648e4d101c", + "0x54d600552300508a0260264d60054850054b50264844850074d600548b", + "0x501b0264b80054d600549000530f0264b90054d60054d30050380264ba", + "0x54d60054d10050350264b60054d600501c0050320264b70054d600508b", + "0x2640d0264b30054d60054840050f50264b40054d600548e0050360264b5", + "0x3190051200260264d60050880054ac0260264d600502600702602664e005", + "0x54930260264d60053090054960260264d60054d20054980260264d6005", + "0x4824830074d60054960054b60260264d60054d00055230260264d60051c5", + "0x54a80050380264ba0054d600549c00508a0260264d60054830054b5026", + "0x264b70054d60054a700501b0264b80054d60054a900530f0264b90054d6", + "0x54990050360264b50054d60050c60050350264b60054d600549a005032", + "0x2600702602664e00502640d0264b30054d60054820050f50264b40054d6", + "0x1c50054930260264d60050880054ac0260264d60050264d00260264d6005", + "0x54980260264d60053190051200260264d60053090054960260264d6005", + "0x25e0260264d60050810053670260264d60054d00055230260264d60054d2", + "0x260264d60054d40054970260264d600540d0051040260264d6005094005", + "0x54d60054b200508a0260264d60050060050840260264d60050d6005518", + "0x501b0264b80054d600508400530f0264b90054d60050050050380264ba", + "0x54d600508a0050350264b60054d60050e60050320264b70054d60050c0", + "0x2607e0264b30054d60054ac0050f50264b40054d60055180050360264b5", + "0x54d600548000525a0264800054d60054b34810073650264810054d6005", + "0x530f0264b90054d60054b90050380264ba0054d60054ba00508a02647f", + "0x54d60054b60050320264b70054d60054b700501b0264b80054d60054b8", + "0x525c0264b40054d60054b40050360264b50054d60054b50050350264b6", + "0x4d600502600702647f4b44b54b64b74b84b94ba01600547f0054d600547f", + "0x4d60051c50054930260264d60050880054ac0260264d60050264d0026026", + "0x54d20054980260264d60053190051200260264d6005309005496026026", + "0x40d0051040260264d60054d40054970260264d60054d00055230260264d6", + "0x2647d0054d60050d947e00736502647e0054d600502607e0260264d6005", + "0x50050050380260e40054d60050e400508a02647c0054d600547d00525a", + "0x260c00054d60050c000501b0260db0054d60050db00530f0260050054d6", + "0x50da00503602608a0054d600508a0050350260e60054d60050e6005032", + "0xda08a0e60c00db0050e401600547c0054d600547c00525c0260da0054d6", + "0x264d60050e80050bc0260264d60050264d00260264d600502600702647c", + "0x4d60053090054960260264d60051c50054930260264d60050880054ac026", + "0x54d00055230260264d60054d20054980260264d6005319005120026026", + "0x3120054970260264d600540d0051040260264d60054d40054970260264d6", + "0x531802647a0054d600502636602647b0054d60050263530260264d6005", + "0x54d600502607e0264790054d600547a47b00735f02647a0054d600547a", + "0x8a0264760054d600547700525a0264770054d6005479478007365026478", + "0x4d60050f000530f0260050054d60050050050380260f40054d60050f4005", + "0x350260f60054d60050f60050320260c00054d60050c000501b0260f0005", + "0x4d600547600525c0260ef0054d60050ef00503602608a0054d600508a005", + "0x4d00260264d60050260070264760ef08a0f60c00f00050f4016005476005", + "0x4960260264d60051c50054930260264d60050880054ac0260264d6005026", + "0x260264d60054d20054980260264d60053190051200260264d6005309005", + "0x264d600540d0051040260264d60054d40054970260264d60054d0005523", + "0x54394750073650264750054d600502607e0260264d6005312005497026", + "0x260f40054d60050f400508a0264730054d600547400525a0264740054d6", + "0x50c000501b0260ed0054d60050ed00530f0260050054d6005005005038", + "0x2608a0054d600508a0050350260f60054d60050f60050320260c00054d6", + "0xed0050f40160054730054d600547300525c0264360054d6005436005036", + "0x4ac0260264d600531400539a0260264d600502600702647343608a0f60c0", + "0x260264d60053090054960260264d60051c50054930260264d6005088005", + "0x264d60054d00055230260264d60054d20054980260264d6005319005120", + "0x4d60053120054970260264d600540d0051040260264d60054d4005497026", + "0xd14720073650264720054d600502607e0260264d600531800539a026026", + "0x260054d600502600508a0264700054d600547100525a0264710054d6005", + "0xc000501b0260d30054d60050d300530f0260050054d6005005005038026", + "0x8a0054d600508a00503502600a0054d600500a0050320260c00054d6005", + "0x50260160054700054d600547000525c0260d20054d60050d2005036026", + "0x260264d60053680054ca0260264d60050260070264700d208a00a0c00d3", + "0x264d60051c50054930260264d60050880054ac0260264d600531400539a", + "0x4d60054d20054980260264d60053190051200260264d6005309005496026", + "0x540d0051040260264d60054d40054970260264d60054d0005523026026", + "0x50263530260264d600531800539a0260264d60053120054970260264d6", + "0x35f02646e0054d600546e00531802646e0054d600502636402646f0054d6", + "0x546d46c00736502646c0054d600502607e02646d0054d600546e46f007", + "0x260260054d600502600508a02646a0054d600546b00525a02646b0054d6", + "0x50c000501b0260350054d600503500530f0260050054d6005005005038", + "0x2608a0054d600508a00503502600a0054d600500a0050320260c00054d6", + "0x3500502601600546a0054d600546a00525c0260360054d6005036005036", + "0x4ac0260264d600531400539a0260264d600502600702646a03608a00a0c0", + "0x260264d60053090054960260264d60051c50054930260264d6005088005", + "0x264d60054d00055230260264d60054d20054980260264d6005319005120", + "0x4d60053120054970260264d600540d0051040260264d60054d4005497026", + "0x4d600502607e0260264d600530f0050ad0260264d600531800539a026026", + "0x264670054d600546800525a0264680054d60050ba469007365026469005", + "0x50bc00530f0260050054d60050050050380260260054d600502600508a", + "0x2600a0054d600500a0050320260c00054d60050c000501b0260bc0054d6", + "0x546700525c0260bb0054d60050bb00503602608a0054d600508a005035", + "0x260264d60050264d00264670bb08a00a0c00bc0050260160054670054d6", + "0x2608900565308a00a0074d60070c00050890260c00054d60050070050c0", + "0x54d60050880053090260880054d600508a00501c0260264d6005026007", + "0x50ef02640d0054d600500a0050160264d40054d60050160050f0026016", + "0x264d30260264d600502600702602665400502640d0264d30054d60054d4", + "0x40d0054d60050890050160264d10054d60054d20050ee0264d20054d6005", + "0x508b0264d040d0074d600540d0054290264d30054d60054d10050ef026", + "0x502600702608b0056551c50054d60074d30050ed02601c0054d60054d0", + "0x56560264d60073090050810263091c50074d60051c50050d60260264d6", + "0x4d60051c50054970260264d600501c0051040260264d600502600702630f", + "0x260264d60050260070263180056573143120074d600740d005089026026", + "0x531b0050f002631b0054d60053190053090263190054d600531400501c", + "0x263310054d600502b0050ef02602c0054d600531200501602602b0054d6", + "0xee0260320054d60050264d30260264d600502600702602665800502640d", + "0x4d600501b0050ef02602c0054d600531800501602601b0054d6005032005", + "0x260350054d600503800508b02603802c0074d600502c005429026331005", + "0x50260070260390056590360054d60073310050ed0260264d600502600a", + "0xc30260264d60050260070260bc00565a0264d60070360050810260264d6", + "0x264d00260264d600502600702602665b00502640d0260264d600502c005", + "0x19c0260bb0054d60050bc0051490260264d60050350051040260264d6005", + "0x4d600500500530f0260c30054d600502600508a0260ba0054d60050bb005", + "0x40d0263530054d60050ba00546c02634e0054d600502c00501602634b005", + "0x50c30260264d60050390050bc0260264d600502600702602665c005026", + "0x52670263580054d60050264d30260264d60050264d00260264d600502c", + "0x4d600507e00536202607e0054d600535f03500736302635f0054d6005358", + "0x3610260050054d600500500530f0260260054d600502600508a026365005", + "0x54ca0260264d60050260070263650050260c00053650054d6005365005", + "0x3681c50074d60051c50050d60261710054d600502609e0260264d600530f", + "0x508102636a0054d600536a00531802636a0054d60051713680074bb026", + "0x264d600501c0051040260264d60050260070260d500565d0264d600736a", + "0x260d200565e0d30d40074d600740d0050890260264d60051c5005497026", + "0x54d60050d10053090260d10054d60050d300501c0260264d6005026007", + "0x50ef0260ce0054d60050d40050160260cf0054d60050d00050f00260d0", + "0x264d30260264d600502600702602665f00502640d0260cd0054d60050cf", + "0xce0054d60050d20050160263940054d60050cc0050ee0260cc0054d6005", + "0x4d60070cd0050ed0260264d600502600a0260cd0054d60053940050ef026", + "0xd60260c40054d60050263600260264d60050260070263a70056603a4005", + "0x1060c066100e0ca0074d60073ae02600735e0263ae3a40074d60053a4005", + "0x50ca00508a0261030054d600502626b0260264d6005026007026104105", + "0x261000054d60051030056620261010054d600500e0056620261020054d6", + "0x261020054d600510600508a0260264d600502600702602666300502640d", + "0x50c400535c0261000054d60051050056620261010054d6005104005662", + "0x74d60050fe00535b0260fd1000074d600510000535b0260fe0ff0074d6", + "0xfb0074d60070fc0fd1020c035a0260fc0054d60050fc0056620260fc0fe", + "0x8a0260264d60050fa00545b0260264d60050260070260f80f90076640fa", + "0x50260070260266650264d60070fe1000072700260fb0054d60050fb005", + "0x10100545b0260264d60050ff00545b0260264d60053a40054970260264d6", + "0x2600702602666600502640d0260f70054d60050fb00508a0260264d6005", + "0x74d60070ff1010fb0c035a0260ff0054d60050ff0056620260264d6005", + "0x260264d60050f500545b0260264d60050260070260f30f40076670f50f6", + "0x4d60050f70052720260f70054d60050f600508a0260264d60053a4005497", + "0x4d60050f300545b0260264d600502600702602666800502640d0260f2005", + "0x4d600502600702602666900502640d0260f10054d60050f400508a026026", + "0x50ff00545b0260264d600510000545b0260264d60050f800545b026026", + "0xf900508a0260264d60050fe00545b0260264d600510100545b0260264d6", + "0x264d60070f00050810260f03a40074d60053a40050d60260f10054d6005", + "0x50ce0050c30260264d60050264d00260264d60050260070260ef00566a", + "0x50263590260ee0054d60050263530260264d60053a40054970260264d6", + "0x4360054d60050ed0ee00735f0260ed0054d60050ed0053180260ed0054d6", + "0x43f00535702643f0054d60054364390073650264390054d600502607e026", + "0x50054d600500500530f0260f10054d60050f100508a0264480054d6005", + "0x260264d60050260070264480050f10c00054480054d6005448005361026", + "0x1700054d60053a40053550260264d60050ef0054ca0260264d60050264d0", + "0xf100508a0260ec0054d600549700519f0264970054d6005170005274026", + "0x34e0054d60050ce00501602634b0054d600500500530f0260c30054d6005", + "0x264d600502600702602665c00502640d0263530054d60050ec00546c026", + "0x4d60050264d00260f20054d600502600508a0260264d60053a70050bc026", + "0xeb0052670260ea0054d60050ce00508b0260eb0054d60050264d3026026", + "0x54d60050e80053620260e80054d60050e90ea0073630260e90054d6005", + "0xf20c00050e70054d60050e70053610260050054d600500500530f0260e7", + "0x4d60050264c60260264d60050d50054ca0260264d60050260070260e7005", + "0xe40054d60050e60e50074bb0260e51c50074d60051c50050d60260e6005", + "0x70260e300566b0264d60070e40050810260e40054d60050e4005318026", + "0x8a0260264d60051c50054970260264d600540d0050c30260264d6005026", + "0x4d600501c0053120260050054d600500500530f0260260054d6005026005", + "0x4d60070e000517e0260e00e10e20c04d600501c0050260c017f02601c005", + "0xdc0dd0074d60050df0051860260264d60050260070260de00566c0df005", + "0x51a70260264d60050260070260da00566d0db0054d60070dc0053f4026", + "0x54d60050e200508a02608d0054d60050dd0050c00260d90054d60050db", + "0x546c02634e0054d600508d00501602634b0054d60050e100530f0260c3", + "0x52670260264d600502600702602665c00502640d0263530054d60050d9", + "0x4d60050d70053620260d70054d60050d80dd0073630260d80054d60050da", + "0x3610260e10054d60050e100530f0260e20054d60050e200508a026006005", + "0x53570260264d60050260070260060e10e20c00050060054d6005006005", + "0x54d60050e100530f0260e20054d60050e200508a0260d60054d60050de", + "0x264d60050260070260d60e10e20c00050d60054d60050d60053610260e1", + "0x50811c50074bb0260810054d60050260a00260264d60050e30054ca026", + "0x566e0264d60070940050810260940054d60050940053180260940054d6", + "0x54d60050264d30260264d600501c0051040260264d60050260070264ca", + "0x530f0260c30054d600502600508a02607d0054d60054c90051ae0264c9", + "0x54d600507d00546c02634e0054d600540d00501602634b0054d6005005", + "0x736302601a0054d600534e00508b0264c80054d6005353005352026353", + "0x4d60050c300508a02609b0054d600509a00536202609a0054d60054c801a", + "0xc000509b0054d600509b00536102634b0054d600534b00530f0260c3005", + "0x40d0050c30260264d60054ca0054ca0260264d600502600702609b34b0c3", + "0x36302609e0054d600509c00526702609c0054d60050264d30260264d6005", + "0x502600508a0260a00054d60054c60053620264c60054d600509e01c007", + "0x50a00054d60050a00053610260050054d600500500530f0260260054d6", + "0x52670260264d600540d0050c30260264d60050260070260a00050260c0", + "0x4d60054c40053620264c40054d60054c501c0073630264c50054d600508b", + "0x3610260050054d600500500530f0260260054d600502600508a0264c3005", + "0x50c00260264d60050264d00264c30050260c00054c30054d60054c3005", + "0x2600702608900566f08a00a0074d60070c00050890260c00054d6005007", + "0x260160054d60050880053090260880054d600508a00501c0260264d6005", + "0x54d40050ef02640d0054d600500a0050160264d40054d60050160050f0", + "0x4d60050264d30260264d600502600702602667000502640d0264d30054d6", + "0xef02640d0054d60050890050160264d10054d60054d20050ee0264d2005", + "0x54d000508b0264d040d0074d600540d0054290264d30054d60054d1005", + "0x264d600502600702608b0056711c50054d60074d30050ed02601c0054d6", + "0x2630f0056720264d60073090050810263091c50074d60051c50050d6026", + "0x260264d60051c50054970260264d600540d0050c30260264d6005026007", + "0x501c0053120260050054d600500500530f0260260054d600502600508a", + "0x73180054760263183143120c04d600501c0050260c047702601c0054d6", + "0x2b0074d60053190054750260264d600502600702631b0056733190054d6", + "0x3520260264d60050260070260320056743310054d600702c00547402602c", + "0x4d600531200508a0260380054d600502b0050c002601b0054d6005331005", + "0x46b0260390054d60050380050160260360054d600531400530f026035005", + "0x3540260264d600502600702602667500502640d0260bc0054d600501b005", + "0x50ba0053500260ba0054d60050bb02b0073510260bb0054d6005032005", + "0x263140054d600531400530f0263120054d600531200508a0260c30054d6", + "0x34f0260264d60050260070260c33143120c00050c30054d60050c3005278", + "0x4d600531400530f0263120054d600531200508a02634b0054d600531b005", + "0x4d600502600702634b3143120c000534b0054d600534b005278026314005", + "0x34e1c50074bb02634e0054d600502609e0260264d600530f0054ca026026", + "0x6760264d60073530050810263530054d60053530053180263530054d6005", + "0x4d60050264d30260264d600501c0051040260264d6005026007026358005", + "0x30f0260350054d600502600508a02607e0054d600535f00526702635f005", + "0x4d600507e00546b0260390054d600540d0050160260360054d6005005005", + "0x3510261710054d600503900508b0263650054d60050bc00534d0260bc005", + "0x503500508a02636a0054d60053680053500263680054d6005365171007", + "0x536a0054d600536a0052780260360054d600503600530f0260350054d6", + "0x50c30260264d60053580054ca0260264d600502600702636a0360350c0", + "0x260d40054d60050d50053540260d50054d60050264d30260264d600540d", + "0x2600508a0260d20054d60050d30053500260d30054d60050d401c007351", + "0xd20054d60050d20052780260050054d600500500530f0260260054d6005", + "0x3540260264d600540d0050c30260264d60050260070260d20050260c0005", + "0x50d00053500260d00054d60050d101c0073510260d10054d600508b005", + "0x260050054d600500500530f0260260054d600502600508a0260cf0054d6", + "0x46e0260264d60050264d00260cf0050260c00050cf0054d60050cf005278", + "0x4d600a0160051af0260160890074d60050890051aa0260264d6005088005", + "0x546d0260264d60050260070264d20056794d300567840d0056774d4005", + "0x4d00054d60054d10053e20264d10054d60054d40051b00260264d6005089", + "0x502600508a0261c50054d600501c0054c802601c0054d60050264d3026", + "0x2630f0054d60050c00050350263090054d600500500530f02608b0054d6", + "0x67a00502640d0263140054d60051c500507d0263120054d60054d0005318", + "0x54d60050264d30260264d600508900546d0260264d6005026007026026", + "0x51b302631b0054d600540d0053df0263190054d60053180053e3026318", + "0x54d600500500530f02608b0054d600502600508a02602b0054d600531b", + "0x507d0263120054d600502b00531802630f0054d60050c0005035026309", + "0x518d0260264d600502600702602667a00502640d0263140054d6005319", + "0x50054d600500500530f0260260054d600502600508a0260264d60054d3", + "0x2600a1b50260890054d600508900546c0260c00054d60050c0005035026", + "0x567b0380054d600701b0050e802601b03233102c00a4d60050890c0005", + "0x4d60050360054c90260360054d60050264d30260264d6005026007026035", + "0x30f02608b0054d600502c00508a0260bc0054d60050380050e7026039005", + "0x4d60050bc00531802630f0054d60050320050350263090054d6005331005", + "0x502600702602667a00502640d0263140054d600503900507d026312005", + "0x508a0260bb0054d60050350053e00260264d600508a0053a70260264d6", + "0x54d60050070050320263310054d600533100530f02602c0054d600502c", + "0x53dc02600a0054d600500a0050360260320054d6005032005035026007", + "0x260264d60050260070260bb00a03200733102c0890050bb0054d60050bb", + "0xba0054d60050264d30260264d600508900546d0260264d60054d20050bc", + "0x502600508a02634b0054d600502609c0260c30054d60050ba0053db026", + "0x2630f0054d60050c00050350263090054d600500500530f02608b0054d6", + "0x4d600502600a0263140054d60050c300507d0263120054d600534b005318", + "0x567c3530054d600a34e00509b02634e3140074d60053140051bb026026", + "0x264d60053530050bc0260264d600502600702607e00567e35f00567d358", + "0x4d60053650050d90263650054d60050260da0260264d600531400509a026", + "0x50d70263680054d60053680050d80263680054d600502608d026171005", + "0xc067f0d536a0074d600731217136800a30908a2040261710054d6005171", + "0xce0cf0d00d10894d600508a0054af0260264d60050260070260d20d30d4", + "0x320263a40054d600536a00530f0263940054d600508b00508a0260cc0cd", + "0x4d60050d100510a0260c40054d60050d50050360263a70054d6005007005", + "0x10b02600e0054d60050cf00544a0260ca0054d60050d000544b0263ae005", + "0x4d60050cc00510e0261050054d60050cd00510d0261060054d60050ce005", + "0x264d60050264d00260264d600502600702602668000502640d026104005", + "0x50d21030073650261030054d600502607e0260264d600508a0053a7026", + "0x2608b0054d600508b00508a0261010054d60051020053e00261020054d6", + "0x530f0050350260070054d60050070050320260d40054d60050d400530f", + "0x51010054d60051010053dc0260d30054d60050d300503602630f0054d6", + "0x264d60053580050bc0260264d60050260070261010d330f0070d408b089", + "0x260264d600535f0050bc0260264d600502600702602668100502640d026", + "0x9b0260264d600507e0050bc0260264d600502600702602668100502640d", + "0x4d60050260070260fd0056840fe0056830ff0056821000054d600a314005", + "0x50fc0053180260fc0054d600502609c0260264d60051000050bc026026", + "0x50ff0050bc0260264d600502600702602668500502640d0260fb0054d6", + "0x2640d0260fb0054d60050fa0053180260fa0054d600502609e0260264d6", + "0x502634c0260264d60050fe0050bc0260264d6005026007026026685005", + "0x2600702602668500502640d0260fb0054d60050f90053180260f90054d6", + "0x53180260f80054d600502627c0260264d60050fd0050bc0260264d6005", + "0xf70054d60050f70053180260f70054d600502634a0260fb0054d60050f8", + "0x260f50054d60050f50053180260f50f60074d60050fb0f70070c0480026", + "0x2608d0260f20054d60050f30050d90260f30f40074d60050f508b00747f", + "0xf60054d60050f60050320260f10054d60050f10050d80260f10054d6005", + "0xf00074d60073120f20f100a30908a2040260f40054d60050f400508a026", + "0x4390894d600508a0054af0260264d60050260070264360ed0ee0c06860ef", + "0x54d60050f000530f0263940054d60050f400508a0260ec49717044843f", + "0x510a0260c40054d60050ef0050360263a70054d60050f60050320263a4", + "0x54d600544800544a0260ca0054d600543f00544b0263ae0054d6005439", + "0x510e0261050054d600549700510d0261060054d600517000510b02600e", + "0x10410510600e0ca3ae0890cd0260264d60050264d00261040054d60050ec", + "0xe90054d60050ea0eb0073c50260ea0054d60050264d30260eb0054d6005", + "0x3a400530f0263940054d600539400508a0260e80054d60050e90053c4026", + "0x30f0054d600530f0050350263a70054d60053a70050320263a40054d6005", + "0x3a43940890050e80054d60050e80053dc0260c40054d60050c4005036026", + "0x8a0053a70260264d60050264d00260264d60050260070260e80c430f3a7", + "0x260e60054d60054360e70073650260e70054d600502607e0260264d6005", + "0x50ee00530f0260f40054d60050f400508a0260e50054d60050e60053e0", + "0x2630f0054d600530f0050350260f60054d60050f60050320260ee0054d6", + "0xf60ee0f40890050e50054d60050e50053dc0260ed0054d60050ed005036", + "0xa0c00074d60070070050890260070054d60050050050c00260e50ed30f", + "0x53090260890054d600500a00501c0260264d600502600702608a005687", + "0x54d60050c00050160260160054d60050880050f00260880054d6005089", + "0x4d600502600702602668800502640d02640d0054d60050160050ef0264d4", + "0x8a0050160264d20054d60054d30050ee0264d30054d60050264d3026026", + "0x4d40074d60054d400542902640d0054d60054d20050ef0264d40054d6005", + "0x1c500568901c0054d600740d0050ed0264d00054d60054d100508b0264d1", + "0x2630f00568a30908b0074d600701c0260073a10260264d6005026007026", + "0x8b0054d600508b00508a0260264d60054d00051040260264d6005026007", + "0x1c0260264d600502600702631800568b3143120074d60074d4005089026", + "0x4d600531b0050f002631b0054d60053190053090263190054d6005314005", + "0x40d0263310054d600502b0050ef02602c0054d600531200501602602b005", + "0x50ee0260320054d60050264d30260264d600502600702602668c005026", + "0x54d600501b0050ef02602c0054d600531800501602601b0054d6005032", + "0x3600568d0350054d60073310050ed0260380054d600502c00508b026331", + "0x4d600503800531202608b0054d600508b00508a0260264d6005026007026", + "0xbb0054d60070bc00549a0260bc0390074d600503808b0074a9026038005", + "0x49902634b0c30074d60050bb0050c60260264d60050260070260ba00568e", + "0x353090c01670260264d600502600702635300568f34e0054d600734b005", + "0x4d600535f0c300734702635f0054d60053580053490263580054d600534e", + "0x2810260390054d600503900508a0263650054d600507e00513202607e005", + "0x3090050ad0260264d60050260070263650390070053650054d6005365005", + "0x3470261710054d60053530052830260264d60050350054970260264d6005", + "0x503900508a02636a0054d60053680051320263680054d60051710c3007", + "0x4d600502600702636a03900700536a0054d600536a0052810260390054d6", + "0x50ba0053460260264d60053090050ad0260264d6005035005497026026", + "0x50d50054d60050d50052810260390054d600503900508a0260d50054d6", + "0x360052830260264d60053090050ad0260264d60050260070260d5039007", + "0x54d60050d30051320260d30054d60050d40380073470260d40054d6005", + "0x8b0070050d20054d60050d200528102608b0054d600508b00508a0260d2", + "0x4d600530f00508a0260264d60054d40050c30260264d60050260070260d2", + "0x4d60051c50050bc0260264d600502600702602669000502640d0260d1005", + "0x50264d30260d10054d600502600508a0260264d60054d40050c3026026", + "0xce0054d60050cf4d00073470260cf0054d60050d00052830260d00054d6", + "0xcd0d10070050cd0054d60050cd0052810260cd0054d60050ce005132026", + "0x260264d60050264d00260264d60050261020264d20054d6005026103026", + "0x54d00050c00264d00160074d60050160054550264d10054d600502608d", + "0x74d60074d101c0260c04540264d10054d60054d10050d802601c0054d6", + "0x2608b0054d600508b0054530260264d600502600702630900569108b1c5", + "0x4d60050264520263120054d600530f00530902630f0054d600508b00501c", + "0x263180054d60053143120074bb0263120054d6005312005318026314005", + "0x73180050810261c50054d60051c500508a0263180054d6005318005318", + "0x31b0c04d60070890070074c10260264d60050260070263190056920264d6", + "0x54d600502b0054c00260264d600502600702603233102c0c069302b4d3", + "0x3903603503808a4d600501b0054bd02601b0054d600502b0054bf02602b", + "0x50360050ad0260264d60050350050ab0260264d60050380050aa0260bc", + "0x530f0261c50054d60051c500508a0260264d60050bc0054970260264d6", + "0x4d60050bb00544f0260bb4d40074d60054d400526002631b0054d600531b", + "0x264d30054d60054d34d20070ff0260390054d60050390051100260bb005", + "0x34e0054d600734b00528702634b0c30ba0c04d60050390bb31b1c500a286", + "0x160054550260264d600534e0052890260264d6005026007026353005694", + "0x54d600535f00543402635f0054d60053580050c00263580160074d6005", + "0x3650050d802607e0054d600507e0050d80263650054d600502634402607e", + "0x260d536a0076953681710074d600736507e0ba0c015a0263650054d6005", + "0xd30054d60050160050c00260d40054d60050263440260264d6005026007", + "0xd10d20074d60073680d40d317100a2230260d40054d60050d40050d8026", + "0x508a0260cf0054d60050d100508b0260264d60050260070260d0005696", + "0x54d60050cf0053120260c30054d60050c300530f0260d20054d60050d2", + "0x54d60070cc0053430260cc0cd0ce0c04d60050cf0c30d20c028b0260cf", + "0x260c43a70074d60053940053450260264d60050260070263a4005697394", + "0x260070260ca0056983ae0054d60070c40053420260264d60053a7005104", + "0x260050054d60050050050380260ce0054d60050ce00508a0260264d6005", + "0x500a0050320260c00054d60050c000501b0260cd0054d60050cd00530f", + "0x264d30054d60054d300503602608a0054d600508a00503502600a0054d6", + "0x540d0053180264d40054d60054d400544f0263ae0054d60053ae005341", + "0x164d600540d4d43ae0884d308a00a0c00cd0050ce4d333d02640d0054d6", + "0x260fe0056990ff0054d600710000529102610010110210310410510600e", + "0x264d600502600a0260fc0fd0074d60050ff0052920260264d6005026007", + "0x50bc0260264d60050260070260fa00569a0fb0054d60070fc005294026", + "0x260f80054d60050f90053180260f90054d60050264420260264d60050fb", + "0x260f80054d60050fa0053180260264d600502600702602669b00502640d", + "0x4d60050f70052960260f70054d60050f80fd00733a0260264d60050264d0", + "0x30f0261060054d600510600503802600e0054d600500e00508a0260f6005", + "0x4d60051030050320261040054d600510400501b0261050054d6005105005", + "0x2980261010054d60051010050360261020054d6005102005035026103005", + "0x50260070260f610110210310410510600e0160050f60054d60050f6005", + "0x3802600e0054d600500e00508a0260f50054d60050fe0053350260264d6", + "0x4d600510400501b0261050054d600510500530f0261060054d6005106005", + "0x360261020054d60051020050350261030054d6005103005032026104005", + "0x10410510600e0160050f50054d60050f50052980261010054d6005101005", + "0x54970260264d60050ca0050bc0260264d60050260070260f5101102103", + "0x3530260264d600508800516b0260264d60054d40051200260264d600540d", + "0xf30054d60050f30053180260f30054d60050265870260f40054d6005026", + "0xf10073650260f10054d600502607e0260f20054d60050f30f400735f026", + "0x54d60050ce00508a0260ef0054d60050f00053350260f00054d60050f2", + "0x501b0260cd0054d60050cd00530f0260050054d60050050050380260ce", + "0x54d600508a00503502600a0054d600500a0050320260c00054d60050c0", + "0xce0160050ef0054d60050ef0052980264d30054d60054d300503602608a", + "0x264d600540d0054970260264d60050260070260ef4d308a00a0c00cd005", + "0x4d60053a40053350260264d600508800516b0260264d60054d4005120026", + "0x30f0260050054d60050050050380260ce0054d60050ce00508a0260ee005", + "0x4d600500a0050320260c00054d60050c000501b0260cd0054d60050cd005", + "0x2980264d30054d60054d300503602608a0054d600508a00503502600a005", + "0x50260070260ee4d308a00a0c00cd0050ce0160050ee0054d60050ee005", + "0x8800516b0260264d60054d40051200260264d600540d0054970260264d6", + "0x53180264360054d60050264080260ed0054d60050263530260264d6005", + "0x54d600502607e0264390054d60054360ed00735f0264360054d6005436", + "0x8a0261700054d60054480053350264480054d600543943f00736502643f", + "0x4d60050c300530f0260050054d60050050050380260d00054d60050d0005", + "0x3502600a0054d600500a0050320260c00054d60050c000501b0260c3005", + "0x4d60051700052980264d30054d60054d300503602608a0054d600508a005", + "0x4590260264d60050260070261704d308a00a0c00c30050d0016005170005", + "0x260264d60054d40051200260264d600540d0054970260264d60050d5005", + "0x4970054d60050263530260264d60050160051040260264d600508800516b", + "0xec49700735f0260ec0054d60050ec0053180260ec0054d6005026229026", + "0xe90054d60050eb0ea0073650260ea0054d600502607e0260eb0054d6005", + "0x500503802636a0054d600536a00508a0260e80054d60050e9005335026", + "0xc00054d60050c000501b0260c30054d60050c300530f0260050054d6005", + "0x4d300503602608a0054d600508a00503502600a0054d600500a005032026", + "0x8a00a0c00c300536a0160050e80054d60050e80052980264d30054d6005", + "0x54d40051200260264d600540d0054970260264d60050260070260e84d3", + "0x3530053350260264d60050160051040260264d600508800516b0260264d6", + "0x50054d60050050050380260ba0054d60050ba00508a0260e70054d6005", + "0xa0050320260c00054d60050c000501b0260c30054d60050c300530f026", + "0x4d30054d60054d300503602608a0054d600508a00503502600a0054d6005", + "0x70260e74d308a00a0c00c30050ba0160050e70054d60050e7005298026", + "0x16b0260264d60054d40051200260264d600540d0054970260264d6005026", + "0x260264d60054d20051010260264d60050160051040260264d6005088005", + "0x50e50053350260e50054d60050320e60073650260e60054d600502607e", + "0x260050054d60050050050380261c50054d60051c500508a0260e40054d6", + "0x500a0050320260c00054d60050c000501b02602c0054d600502c00530f", + "0x263310054d600533100503602608a0054d600508a00503502600a0054d6", + "0x260070260e433108a00a0c002c0051c50160050e40054d60050e4005298", + "0x51200260264d600540d0054970260264d60053190054ca0260264d6005", + "0x1010260264d60050160051040260264d600508800516b0260264d60054d4", + "0x2602669c00502640d0260e30054d60051c500508a0260264d60054d2005", + "0x260264d60054d40051200260264d600540d0054970260264d6005026007", + "0x264d60054d20051010260264d60050160051040260264d600508800516b", + "0x4d600502629b0260e20054d60050263530260e30054d600530900508a026", + "0x260e00054d60050e10e200735f0260e10054d60050e10053180260e1005", + "0x50de0053350260de0054d60050e00df0073650260df0054d600502607e", + "0x260050054d60050050050380260e30054d60050e300508a0260dd0054d6", + "0x500a0050320260c00054d60050c000501b0260070054d600500700530f", + "0x260890054d600508900503602608a0054d600508a00503502600a0054d6", + "0x264d00260dd08908a00a0c00070050e30160050dd0054d60050dd005298", + "0x50ad0260264d60054d300529c0260264d60050160051200260264d6005", + "0x54d60054d10050c00264d140d0074d600540d0054550260264d60054d2", + "0x1c0050d80261c50054d600502642802601c0054d60054d00054340264d0", + "0x264d600502600702602669d0264d60071c501c00742602601c0054d6005", + "0x54340263090054d600508b0050c002608b40d0074d600540d005455026", + "0x30f0054d600530f0050d80263120054d600502614202630f0054d6005309", + "0x40d0050c00260264d600502600702602669e0264d600731230f007426026", + "0x502600702631b00569f3193180074d60073140050890263140054d6005", + "0x4d402602c0054d600531800501602602b0054d60053190050880260264d6", + "0x4d30260264d60050260070260266a000502640d0263310054d600502b005", + "0x54d600531b00501602601b0054d60050320054d20260320054d6005026", + "0x350056a10380054d60073310054d10263310054d600501b0054d402602c", + "0x54d60050264230260360054d600503800501c0260264d6005026007026", + "0x508a0260bb0054d600502c00508b0260bc0054d6005036005309026039", + "0x54d60050bb0053120260070054d600500700530f0260260054d6005026", + "0x8a1460260bc0054d60050bc0053180260390054d60050390054220260bb", + "0x6a234e0054d600734b00542102634b0c30ba0c04d60050bc0390bb007026", + "0x50c002635f3580074d600534e00541f0260264d6005026007026353005", + "0x54d60050c300530f0263650054d60050ba00508a02607e0054d6005358", + "0x2640d02636a0054d600535f00541c0263680054d600507e005016026171", + "0x4d40054970260264d60050880053a70260264d60050260070260266a3005", + "0x260264d60050d50054b50260d40d50074d60053530054b60260264d6005", + "0x50890050360260d20054d60050c300530f0260d30054d60050ba00508a", + "0x260070260266a400502640d0260d00054d60050d40050f50260d10054d6", + "0x55730260cf0054d60050264d30260264d60050350050bc0260264d6005", + "0x54d600500700530f0263650054d600502600508a0260ce0054d60050cf", + "0x541902636a0054d60050ce00541c0263680054d600502c005016026171", + "0x4d60073680050890260264d60050260070260cc0056a50cd0054d600736a", + "0x260264d60053940050c30260264d60050260070263a70056a63a4394007", + "0x264d60054d40054970260264d60050880053a70260264d60053a400534b", + "0x54d600502614a0260c40054d60050263530260264d60050cd005417026", + "0x8a0260ca0054d60053ae0c400735f0263ae0054d60053ae0053180263ae", + "0x4d60050890050360260d20054d600517100530f0260d30054d6005365005", + "0x50260070260266a400502640d0260d00054d60050ca0050f50260d1005", + "0x530f02600e0054d600536500508a0260264d60053a70050c30260264d6", + "0x54d60050cd0054220261050054d60050890050360261060054d6005171", + "0x264d60050cc0050bc0260264d60050260070260266a700502640d026104", + "0x4d60053680050c30260264d60054d40054970260264d60050880053a7026", + "0x51020053180261020054d600502614c0261030054d6005026353026026", + "0xd30054d600536500508a0261010054d600510210300735f0261020054d6", + "0x1010050f50260d10054d60050890050360260d20054d600517100530f026", + "0x502640d0260264d60050260070260266a400502640d0260d00054d6005", + "0x51000050d90261000054d60050260da0260264d60050260070260266a8", + "0xd70260fe0054d60050fe0050d80260fe0054d600502608d0260ff0054d6", + "0x6a90fb0fc0fd0c04d60070ff0fe08900700a0060260ff0054d60050ff005", + "0x30f0260fb0054d60050fb0053180260264d60050260070260f80f90fa0c0", + "0x4d60070fb0050810260fc0054d60050fc0050360260fd0054d60050fd005", + "0x54970260264d60050880053a70260264d60050260070260f70056aa026", + "0x14b0260f60054d60050263530260264d600540d0051040260264d60054d4", + "0x4d60050f50f600735f0260f50054d60050f50053180260f50054d6005026", + "0x360260d20054d60050fd00530f0260d30054d600502600508a0260f4005", + "0x266a400502640d0260d00054d60050f40050f50260d10054d60050fc005", + "0x4d60050f70051490260f30054d600540d0050c00260264d6005026007026", + "0xef0056ab0f00f10074d60070f30050890260264d600502600a0260f2005", + "0x4d60050f10050160260ee0054d60050f00050880260264d6005026007026", + "0x50260070260266ac00502640d0264360054d60050ee0054d40260ed005", + "0x501602643f0054d60054390054d20264390054d60050264d30260264d6", + "0x54d60074360054d10264360054d600543f0054d40260ed0054d60050ef", + "0x3090264970054d600544800501c0260264d60050260070261700056ad448", + "0x4d60070ed0050890260ec0054d60050ec0053180260ec0054d6005497005", + "0xe80054d60050ea0050880260264d60050260070260e90056ae0ea0eb007", + "0x502640d0260e60054d60050e80054d40260e70054d60050eb005016026", + "0x50e50054d20260e50054d60050264d30260264d60050260070260266af", + "0x260e60054d60050e40054d40260e70054d60050e90050160260e40054d6", + "0xe300501c0260264d60050260070260e20056b00e30054d60070e60054d1", + "0x54d60050e00ec0074160260e00054d60050e10053090260e10054d6005", + "0xde0260dd0054d60050de0051520260de0054d60050df0f20074130260df", + "0x70260da0056b10db0dc0074d60070e70050890260dd0054d60050dd005", + "0x534b0260264d60050dc0050c30260264d60050264d00260264d6005026", + "0x8d0dd0074d60050dd0051510260d90054d60050264230260264d60050db", + "0x8a0260d70054d60050dd0d80071580260d80054d600508d0d9007158026", + "0x4d60050fc0050360261060054d60050fd00530f02600e0054d6005026005", + "0x50260070260266a700502640d0261040054d60050d7005422026105005", + "0x4d60050264230260264d60050da0050c30260264d60050264d00260264d6", + "0x2600e0054d600502600508a0260d60054d60050dd006007158026006005", + "0x50d60054220261050054d60050fc0050360261060054d60050fd00530f", + "0xe0054d600500e00508a0260940810074d60050880050ea0261040054d6", + "0xc000501b0261060054d600510600530f0260050054d6005005005038026", + "0x8a0054d600508a00503502600a0054d600500a0050320260c00054d6005", + "0x1040054220264d40054d60054d40053180261050054d6005105005036026", + "0x164d60051044d409410508a00a0c010600500e40d16c0261040054d6005", + "0x264c60056b209e0054d600709c00516e02609c09b09a01a4c807d4c94ca", + "0x260a00054d60050264d30260264d600509e0054040260264d6005026007", + "0x4ca00508a0264c40054d60054c50053c40264c50054d60050a00810073c5", + "0x7d0054d600507d00530f0264c90054d60054c90050380264ca0054d6005", + "0x9a00503502601a0054d600501a0050320264c80054d60054c800501b026", + "0x4c40054d60054c40053dc02609b0054d600509b00503602609a0054d6005", + "0x810053a70260264d60050260070264c409b09a01a4c807d4c94ca016005", + "0x264ca0054d60054ca00508a0264c30054d60054c60053e00260264d6005", + "0x54c800501b02607d0054d600507d00530f0264c90054d60054c9005038", + "0x2609a0054d600509a00503502601a0054d600501a0050320264c80054d6", + "0x7d4c94ca0160054c30054d60054c30053dc02609b0054d600509b005036", + "0x50bc0260264d60050264d00260264d60050260070264c309b09a01a4c8", + "0xc30260264d60054d40054970260264d60050880053a70260264d60050e2", + "0x260264d60050ec0054970260264d60050f20051630260264d60050e7005", + "0x54d60054c10053180264c10054d60050265870264c20054d6005026353", + "0x30f0260d30054d600502600508a0264c00054d60054c14c200735f0264c1", + "0x4d60054c00050f50260d10054d60050fc0050360260d20054d60050fd005", + "0x264d60050264d00260264d60050260070260266a400502640d0260d0005", + "0x4d60054d40054970260264d60050880053a70260264d60051700050bc026", + "0x4d60050263530260264d60050f20051630260264d60050ed0050c3026026", + "0x735f0264be0054d60054be0053180264be0054d60050265870264bf005", + "0x4d60050fd00530f0260d30054d600502600508a0264bd0054d60054be4bf", + "0x40d0260d00054d60054bd0050f50260d10054d60050fc0050360260d2005", + "0x51040260264d60054d40054970260264d60050260070260266a4005026", + "0x260d30054d600502600508a0260264d60050880053a70260264d600540d", + "0x50f80050f50260d10054d60050f90050360260d20054d60050fa00530f", + "0x260ab0054d60050d00aa0073650260aa0054d600502607e0260d00054d6", + "0x50050050380260d30054d60050d300508a0260ad0054d60050ab0053e0", + "0x260c00054d60050c000501b0260d20054d60050d200530f0260050054d6", + "0x50d100503602608a0054d600508a00503502600a0054d600500a005032", + "0xd108a00a0c00d20050d30160050ad0054d60050ad0053dc0260d10054d6", + "0x880076b308908a0074d60070050260070050260264d60050264d00260ad", + "0x4d600502600a0264d40054d60050c000529e0260264d6005026007026016", + "0x56b44d340d0074d60074d400533402608a0054d600508a00508a026026", + "0x540d00533b0264d10054d60054d300533c0260264d60050260070264d2", + "0x260070260266b500502640d02601c0054d60054d10052a00264d00054d6", + "0x33b02608b0054d60051c50053360261c50054d60050264d30260264d6005", + "0x4d60054d000545002601c0054d600508b0052a00264d00054d60054d2005", + "0x260264d60050260070263120056b630f0054d600701c0052a2026309005", + "0x533702631b3193180c04d60053140052a40263140054d600530f005339", + "0x54d600531b00543502602c0054d600531900530902602b0054d6005318", + "0x531202602c0054d600502c00531802602b0054d600502b005110026331", + "0x6b703801b0320c04d600733102c02b00708908a2a60263310054d6005331", + "0x380053120260264d60050264d00260264d60050260070260390360350c0", + "0x54d600508a00508a0260bc0054d600503800a0073380260380054d6005", + "0x544f02601b0054d600501b0050360260320054d600503200530f02608a", + "0x30901b03208a08a11d0260bc0054d60050bc00511a0263090054d6005309", + "0x264d600502600702634b0c30ba0bb00a00534b0c30ba0bb00a4d60050bc", + "0x264d60053090051200260264d60050390053ae0260264d60050264d0026", + "0x54d60050262a802634e0054d60050263530260264d600500a0050fb026", + "0x7e0263580054d600535334e00735f0263530054d6005353005318026353", + "0x4d600507e00533302607e0054d600535835f00736502635f0054d6005026", + "0x360260350054d600503500530f02608a0054d600508a00508a026365005", + "0x36503603508a00a0053650054d60053650052ab0260360054d6005036005", + "0x260264d60053120050bc0260264d60050264d00260264d6005026007026", + "0x3680053300263680054d600517100a3090c03320261710054d60050264d3", + "0x890054d600508900530f02608a0054d600508a00508a02636a0054d6005", + "0x8908a00a00536a0054d600536a0052ab0260070054d6005007005036026", + "0x500a0050fb0260264d60050c00051200260264d600502600702636a007", + "0xd40053180260d40054d60050261060260d50054d60050263530260264d6", + "0xd20054d600502607e0260d30054d60050d40d500735f0260d40054d6005", + "0x508a0260d00054d60050d10053330260d10054d60050d30d2007365026", + "0x54d60050070050360260160054d600501600530f0260880054d6005088", + "0x4d60050264d00260d000701608800a0050d00054d60050d00052ab026007", + "0x4d60050260070260880890076b808a00a0074d6007005026007005026026", + "0x500a00508a0260264d600502600a0260160054d60050070050c0026026", + "0x4d60050260070264d30056b940d4d40074d600701600508902600a0054d6", + "0x54d40264d10054d60054d40050160264d20054d600540d005088026026", + "0x264d30260264d60050260070260266ba00502640d0264d00054d60054d2", + "0x4d10054d60054d30050160261c50054d600501c0054d202601c0054d6005", + "0x263090056bb08b0054d60074d00054d10264d00054d60051c50054d4026", + "0x2630f0054d600508b00501c0260264d60050264d00260264d6005026007", + "0x3120c000735f0263120054d60053120053180263120054d600530f005309", + "0xa0054d600500a00508a0263180054d60054d100508b0263140054d6005", + "0x3140050f50263180054d600531800531202608a0054d600508a00530f026", + "0x3190c000502b31b3190c04d600531431808a00a00a4330263140054d6005", + "0x4d60053090050bc0260264d60050264d00260264d600502600702602b31b", + "0x2c0c000742f02602c0054d60050264d30260264d60054d10050c3026026", + "0xa0054d600500a00508a0260320054d600533100542e0263310054d6005", + "0x8a00a0c00050320054d600503200543002608a0054d600508a00530f026", + "0x4d60050070051040260264d60050c00053ae0260264d6005026007026032", + "0x50380053180260380054d600502610602601b0054d6005026353026026", + "0x260360054d600502607e0260350054d600503801b00735f0260380054d6", + "0x8900508a0260bc0054d60050390054310260390054d6005035036007365", + "0xbc0054d60050bc0054300260880054d600508800530f0260890054d6005", + "0x8a0074d60070050260070050260264d60050264d00260bc0880890c0005", + "0x4d400a0074d600500a0050d60260264d60050260070260160880076bc089", + "0x702640d0056bd0264d60074d400508102608a0054d600508a00508a026", + "0x264d30054d60050c00052ae0260264d600500a0054970260264d6005026", + "0x8a00508a0264d10054d60054d200532f0264d20054d60054d30070072b0", + "0x4d10054d60054d10052b40260890054d600508900530f02608a0054d6005", + "0x8a0260264d600540d0054ca0260264d60050260070264d108908a0c0005", + "0x4d60050070053120260890054d600508900530f02608a0054d600508a005", + "0x4d60071c50050e20261c501c4d00c04d600500708908a0c00e3026007005", + "0x31230f0074d600508b0050e10260264d60050260070263090056be08b005", + "0x71580260264d60050260070263180056bf3140054d60073120050e0026", + "0x4d600531b00a0074bb02631b0054d600502609e0263190054d60053140c0", + "0x31202601c0054d600501c00530f0264d00054d60054d000508a02602b005", + "0x4d600502b0053180263190054d600531900542202630f0054d600530f005", + "0x33102c0c000503233102c0c04d600502b31930f01c4d008a14602602b005", + "0x4d60050c00054170260264d600500a0054970260264d6005026007026032", + "0x32f0260380054d600501b30f0072b002601b0054d6005318005573026026", + "0x4d600501c00530f0264d00054d60054d000508a0260350054d6005038005", + "0x4d600502600702603501c4d00c00050350054d60050350052b402601c005", + "0x53090052b30260264d60050c00054170260264d600500a005497026026", + "0x2601c0054d600501c00530f0264d00054d60054d000508a0260360054d6", + "0x4970260264d600502600702603601c4d00c00050360054d60050360052b4", + "0x260264d60050070051040260264d60050c00054170260264d600500a005", + "0x54d60050bc0053180260bc0054d60050261060260390054d6005026353", + "0x73650260ba0054d600502607e0260bb0054d60050bc03900735f0260bc", + "0x4d600508800508a02634b0054d60050c30052b30260c30054d60050bb0ba", + "0xc000534b0054d600534b0052b40260160054d600501600530f026088005", + "0x264a20264d10054d60050264a10264d30054d60050263e402634b016088", + "0x264d00260264d600502610202608b0054d600502610302601c0054d6005", + "0x263094d40074d60054d40051510260264d60050880053a70260264d6005", + "0x50260070263180056c23140056c13120056c030f0054d600a309005198", + "0x19c0260264d600531b0051a502631b3190074d600530f0051990260264d6", + "0x266c300502640d02602c0054d600502b00546c02602b0054d6005319005", + "0x50320051a60260323310074d600531200519d0260264d6005026007026", + "0x40d02602c0054d600501b00546c02601b0054d600533100519f0260264d6", + "0x260350380074d60053140051a20260264d60050260070260266c3005026", + "0x4d600503600546c0260360054d60050380051a70260264d60050350051a3", + "0x4d60053180050bc0260264d60050260070260266c300502640d02602c005", + "0xbc00546c0260bc0054d60050390051ae0260390054d60050264d3026026", + "0x54d600a0bb0051af0260bb02c0074d600502c0051aa02602c0054d6005", + "0x2c00546d0260264d600502600702634e0056c634b0056c50c30056c40ba", + "0x263580054d60053530053e20263530054d60050ba0051b00260264d6005", + "0x4d600502600508a02607e0054d600535f0054c802635f0054d60050264d3", + "0x3180264d20054d600508a0050350261710054d600500700530f026365005", + "0x266c700502640d02636a0054d600507e00507d0263680054d6005358005", + "0xd50054d60050264d30260264d600502c00546d0260264d6005026007026", + "0xd30051b30260d30054d60050c30053df0260d40054d60050d50053e3026", + "0x1710054d600500700530f0263650054d600502600508a0260d20054d6005", + "0xd400507d0263680054d60050d20053180264d20054d600508a005035026", + "0x34b00518d0260264d60050260070260266c700502640d02636a0054d6005", + "0x260070054d600500700530f0260260054d600502600508a0260264d6005", + "0x702600a1b502602c0054d600502c00546c02608a0054d600508a005035", + "0xcc0056c80cd0054d60070ce0050e80260ce0cf0d00d100a4d600502c08a", + "0x54d60053940054c90263940054d60050264d30260264d6005026007026", + "0x530f0263650054d60050d100508a0263a70054d60050cd0050e70263a4", + "0x54d60053a70053180264d20054d60050cf0050350261710054d60050d0", + "0x4d60050260070260266c700502640d02636a0054d60053a400507d026368", + "0x508b0051010260264d60054d10055230260264d60054d40050df026026", + "0x4d30053e10260264d600501c0054930260264d60050160054970260264d6", + "0x260d10054d60050d100508a0260c40054d60050cc0053a20260264d6005", + "0x50c000501b0260d00054d60050d000530f0260050054d6005005005038", + "0x260cf0054d60050cf00503502600a0054d600500a0050320260c00054d6", + "0xd00050d10160050c40054d60050c40053a30260890054d6005089005036", + "0x46d0260264d600534e0050bc0260264d60050260070260c40890cf00a0c0", + "0xca0054d60053ae0053db0263ae0054d60050264d30260264d600502c005", + "0x500700530f0263650054d600502600508a02600e0054d600502609c026", + "0x263680054d600500e0053180264d20054d600508a0050350261710054d6", + "0x74d600536a0051bb0260264d600502600a02636a0054d60050ca00507d", + "0x6c91050054d600a10600509b0264d20054d60054d24d100748702610636a", + "0x4d60051050050bc0260264d60050260070261020056cb1030056ca104005", + "0x4d60050260da0260264d60054d30053e10260264d600536a00509a026026", + "0x50d80260ff0054d600502608d0261000054d60051010050d9026101005", + "0x1000ff08917100a0060261000054d60051000050d70260ff0054d60050ff", + "0x53180260264d60050260070260f90fa0fb0c06cc0fc0fd0fe0c04d6007", + "0x4d60050f80053180260f80054d60053680fc0074bb0260fc0054d60050fc", + "0x810260fd0054d60050fd0050360260fe0054d60050fe00530f0260f8005", + "0x264d60050264d00260264d60050260070260f70056cd0264d60070f8005", + "0xa0050320260f50054d60050fe00530f0260f60054d600536500508a026", + "0x70260266ce00502640d0261c50054d60050fd0050360264d00054d6005", + "0x50df0260264d60050f70054ca0260264d60050264d00260264d6005026", + "0x1010260264d600501c0054930260264d60050160054970260264d60054d4", + "0x54d60050fe00530f0260f40054d600536500508a0260264d600508b005", + "0x2640d0260f10054d60050fd0050360260f20054d600500a0050320260f3", + "0x54d40050df0260264d60050264d00260264d60050260070260266cf005", + "0x160054970260264d600508b0051010260264d60053680054970260264d6", + "0x30f0260f00054d600536500508a0260264d600501c0054930260264d6005", + "0x4d60050fa0050360260ee0054d600500a0050320260ef0054d60050fb005", + "0x50260070260266d000502640d0264360054d60050f90050f50260ed005", + "0x502640d0260264d60054d30053e10260264d60051040050bc0260264d6", + "0x54d30053e10260264d60051030050bc0260264d60050260070260266d1", + "0x261700056d44480056d343f0056d24390054d600a36a00509b0260264d6", + "0x264970054d600502609c0260264d60054390050bc0260264d6005026007", + "0x260264d60050260070260266d500502640d0260ec0054d6005497005318", + "0x54d60050eb0053180260eb0054d600502609e0260264d600543f0050bc", + "0x264d60054480050bc0260264d60050260070260266d500502640d0260ec", + "0x6d500502640d0260ec0054d60050ea0053180260ea0054d600502634c026", + "0x54d600502627c0260264d60051700050bc0260264d6005026007026026", + "0xe80053180260e80054d600502634a0260ec0054d60050e90053180260e9", + "0x50e60053180260e60e70074d60050ec0e800a0c04800260e80054d6005", + "0x54d60050e40050d90260e40e50074d60050e636500747f0260e60054d6", + "0xe70050320260e20054d60050e20050d80260e20054d600502608d0260e3", + "0x70e30e208917100a0060260e50054d60050e500508a0260e70054d6005", + "0x50264d00260264d60050260070260dc0dd0de0c06d60df0e00e10c04d6", + "0x260db0054d60053680df0074bb0260df0054d60050df0053180260264d6", + "0x50e00050360260e10054d60050e100530f0260db0054d60050db005318", + "0x260264d60050260070260da0056d70264d60070db0050810260e00054d6", + "0x50e70050320260f50054d60050e100530f0260f60054d60050e500508a", + "0x4d00054d60054d001c0074880261c50054d60050e00050360264d00054d6", + "0x8d0056d80d90054d600a4d40051980261c50054d60051c508b0070ff026", + "0x60074d60050d90051990260264d60050260070260d70056da0d80056d9", + "0x52b50260940054d60050810053e20260810054d60050060051b00260d6", + "0x4d60050050050380260f60054d60050f600508a0264c94ca0074d60050d6", + "0x3180260940054d60050940053180260160054d6005016005318026005005", + "0x160050f608932c0264c90054d60054c90053180264ca0054d60054ca005", + "0x503802607d0054d600507d00508a02601a4c807d0c04d60054c94ca094", + "0x54d60050c000501b0260f50054d60050f500530f0264c80054d60054c8", + "0x50360264d20054d60054d20050350264d00054d60054d00050320260c0", + "0x4d00c00f54c807d01600501a0054d600501a0053a30261c50054d60051c5", + "0xa02609b09a0074d600508d00519d0260264d600502600702601a1c54d2", + "0x264c50a04c60c06db09e09c0074d60070160f600735e0260264d6005026", + "0x4c30054d600509c00508a0264c40054d600502626b0260264d6005026007", + "0x502640d0264c10054d60054c40056620264c20054d600509e005662026", + "0x4c50056620264c30054d60054c600508a0260264d60050260070260266dc", + "0x4c00054d600509a0053df0264c10054d60050a00056620264c20054d6005", + "0x530f0264c30054d60054c300508a0264bf0054d60054c14c2007329026", + "0x54d60051c50050360260c00054d60050c000501b0260f50054d60050f5", + "0x532602609b0054d600509b0053270264bf0054d60054bf0053280261c5", + "0x4bd4be08a4d60054c009b4bf1c50c00f54c30883250264c00054d60054c0", + "0x264d60050260070264bb0056dd4bc0054d60070ad0053240260ad0ab0aa", + "0x56de0264b84b90074d60054ba0053210264ba0054d60054bc005320026", + "0x56df4b70054d60074b80052940260264d600502600a0260264d60054b9", + "0x54d60050264d30260264d60054b70050bc0260264d60050260070264b6", + "0x2640d0264b30054d60054b400547d0264b40054d60054b500547e0264b5", + "0x50264d30260264d60054b60054970260264d60050260070260266e0005", + "0x264b30054d60054b100547d0264b10054d60054b200547c0264b20054d6", + "0x54d60054b00053a50264b00054d60054b30052120260264d60050264d0", + "0x530f0260050054d60050050050380264be0054d60054be00508a0264af", + "0x54d60054d00050320260aa0054d60050aa00501b0264bd0054d60054bd", + "0x53a30260ab0054d60050ab0050360264d20054d60054d20050350264d0", + "0x4d60050260070264af0ab4d24d00aa4bd0054be0160054af0054d60054af", + "0x50380264be0054d60054be00508a0260840054d60054bb0053a2026026", + "0x54d60050aa00501b0264bd0054d60054bd00530f0260050054d6005005", + "0x50360264d20054d60054d20050350264d00054d60054d00050320260aa", + "0x4d00aa4bd0054be0160050840054d60050840053a30260ab0054d60050ab", + "0x2bf0264ac5180074d60050d80051a20260264d60050260070260840ab4d2", + "0x4a24a44a54a65194aa0164d60054ab0052c00264ab4ac0074d60054ac005", + "0xf600508a0260264d60054a10054590260264d60054a20054590264a10bf", + "0xc00054d60050c000501b0260f50054d60050f500530f0260f60054d6005", + "0xbf0050d80264a40054d60054a40050d80264a50054d60054a50050d8026", + "0x160054d60050160053180265190054d60055190052c10260bf0054d6005", + "0x4aa0165190bf4a44a50c00f50f64d42c20264aa0054d60054aa0052c1026", + "0x702649c0056e149d0054d60070c20052c40260c249e49f4a000a4d6005", + "0x4a90054d60074a80052c60264a80054d600549d00531c0260264d6005026", + "0x4a000508a0260264d60054a90050bc0260264d60050260070264a70056e2", + "0x49e0054d600549e00501b02649f0054d600549f00530f0264a00054d6005", + "0xc649a00a4d60054ac49e49f4a000a31a0264ac0054d60054ac0052c8026", + "0x260264d60050260070264960056e34980054d60070c80053160260c8499", + "0x50c600530f02649a0054d600549a00508a0264930054d60054980052cb", + "0x264930054d60054930053280261c50054d60051c50050360260c60054d6", + "0x49052300a4d60054a64931c50c649a08a3150264a60054d60054a6005327", + "0x260264d600502600702648b0056e448c0054d600748d0052cd02648d48e", + "0x70264880056e54890054d600748a00531302648a0054d600548c0052cf", + "0x4830c06e648448548648700a4d600748948e4900c03110260264d6005026", + "0x55180052d20260264d60054840053170260264d6005026007026481482", + "0x260264d600547f0052d40260264d600548000531002647e47f4800c04d6", + "0x47c00531702647b47c0074d60054850052d602647d0054d600547e00530b", + "0x260264d600547a00531702647947a0074d600547d0052d60260264d6005", + "0x47800535c02647847b0074d600547b00530802647b0054d600547b005328", + "0x4790074d60054790053080260264d600547600545b0264764770074d6005", + "0x53050260264d600547300545b0264734740074d600547500535c026475", + "0x260264d600502600a0264710054d60054740053050264720054d6005477", + "0x4714720072700264860054d60054860050360264870054d600548700530f", + "0x3170260264d60054790053170260264d60050260070260266e70264d6007", + "0x46f0054d600547000547c0264700054d60050264d30260264d600547b005", + "0x264d60050260070260266e800502640d02646e0054d600546f00547d026", + "0x47900535c0260264d600546d00545b02646c46d0074d600547b00535c026", + "0x4690054d600546c0053050260264d600546b00545b02646a46b0074d6005", + "0x70260266e90264d60074684690072700264680054d600546a005305026", + "0x264660054d600546700547c0264670054d60050264d30260264d6005026", + "0x260264d60050260070260266e800502640d02646e0054d600546600547d", + "0x4d600546400547d0264640054d600546500547e0264650054d60050264d3", + "0x4630053a50264630054d600546e0052120260264d60050264d002646e005", + "0x50054d60050050050380265230054d600552300508a0264620054d6005", + "0x4d00050320264990054d600549900501b0264870054d600548700530f026", + "0x4860054d60054860050360264d20054d60054d20050350264d00054d6005", + "0x70264624864d24d04994870055230160054620054d60054620053a3026", + "0x3530260264d600551800518d0260264d60054810053ae0260264d6005026", + "0x4600054d60054600053180264600054d60050263040264610054d6005026", + "0x45e00736502645e0054d600502607e02645f0054d600546046100735f026", + "0x54d600552300508a02645c0054d600545d0053a202645d0054d600545f", + "0x501b0264830054d600548300530f0260050054d6005005005038026523", + "0x54d60054d20050350264d00054d60054d00050320264990054d6005499", + "0x52301600545c0054d600545c0053a30264820054d60054820050360264d2", + "0x264d60054880050bc0260264d600502600702645c4824d24d0499483005", + "0x54d600502630402645b0054d60050263530260264d600551800518d026", + "0x7e0264590054d600545a45b00735f02645a0054d600545a00531802645a", + "0x4d60054570053a20264570054d60054594580073650264580054d6005026", + "0x30f0260050054d60050050050380265230054d600552300508a026456005", + "0x4d60054d00050320264990054d600549900501b0264900054d6005490005", + "0x3a302648e0054d600548e0050360264d20054d60054d20050350264d0005", + "0x502600702645648e4d24d04994900055230160054560054d6005456005", + "0x508a0264550054d600548b0053a20260264d600551800518d0260264d6", + "0x54d600549000530f0260050054d60050050050380265230054d6005523", + "0x50350264d00054d60054d00050320264990054d600549900501b026490", + "0x54d60054550053a302648e0054d600548e0050360264d20054d60054d2", + "0x518d0260264d600502600702645548e4d24d0499490005523016005455", + "0x264540054d60054960053a20260264d60054a60051a60260264d6005518", + "0x50c600530f0260050054d600500500503802649a0054d600549a00508a", + "0x264d00054d60054d00050320264990054d600549900501b0260c60054d6", + "0x54540053a30261c50054d60051c50050360264d20054d60054d2005035", + "0x260264d60050260070264541c54d24d04990c600549a0160054540054d6", + "0x264d60054a60051a60260264d600551800518d0260264d60054a70052de", + "0x54d60050262da0264530054d60050263530260264d60054ac0051a3026", + "0x7e0264510054d600545245300735f0264520054d6005452005318026452", + "0x4d600544f0053a202644f0054d60054514500073650264500054d6005026", + "0x30f0260050054d60050050050380264a00054d60054a000508a02601e005", + "0x4d60054d000503202649e0054d600549e00501b02649f0054d600549f005", + "0x3a30261c50054d60051c50050360264d20054d60054d20050350264d0005", + "0x502600702601e1c54d24d049e49f0054a001600501e0054d600501e005", + "0x4ac0051a30260264d60054a60051a60260264d600551800518d0260264d6", + "0x264a00054d60054a000508a02607a0054d600549c0053a20260264d6005", + "0x549e00501b02649f0054d600549f00530f0260050054d6005005005038", + "0x264d20054d60054d20050350264d00054d60054d000503202649e0054d6", + "0x49f0054a001600507a0054d600507a0053a30261c50054d60051c5005036", + "0x4970260264d60050d70050bc0260264d600502600702607a1c54d24d049e", + "0x10a0054d600544c00547c02644c0054d60050264d30260264d6005016005", + "0xf600508a02644a0054d600544b0053a502644b0054d600510a005212026", + "0xf50054d60050f500530f0260050054d60050050050380260f60054d6005", + "0x4d20050350264d00054d60054d00050320260c00054d60050c000501b026", + "0x44a0054d600544a0053a30261c50054d60051c50050360264d20054d6005", + "0xda0054ca0260264d600502600702644a1c54d24d00c00f50050f6016005", + "0x54930260264d60050160054970260264d60054d40050df0260264d6005", + "0x260f40054d60050e500508a0260264d600508b0051010260264d600501c", + "0x50e00050360260f20054d60050e70050320260f30054d60050e100530f", + "0x21202610d0054d600510b00547c02610b0054d60050264d30260f10054d6", + "0x4d60050f400508a0261100054d600510e0053a502610e0054d600510d005", + "0x1b0260f30054d60050f300530f0260050054d60050050050380260f4005", + "0x4d60054d20050350260f20054d60050f20050320260c00054d60050c0005", + "0x160051100054d60051100053a30260f10054d60050f10050360264d2005", + "0x264d60050264d00260264d60050260070261100f14d20f20c00f30050f4", + "0x4d600508b0051010260264d60053680054970260264d60054d40050df026", + "0x50e500508a0260264d600501c0054930260264d6005016005497026026", + "0x260ee0054d60050e70050320260ef0054d60050de00530f0260f00054d6", + "0x6d000502640d0264360054d60050dc0050f50260ed0054d60050dd005036", + "0x4d60054d40050df0260264d60051020050bc0260264d6005026007026026", + "0x50160054970260264d600508b0051010260264d6005368005497026026", + "0x50263c30260264d600536a00509a0260264d600501c0054930260264d6", + "0x263c20264420054d600502608d0264430054d600502609c0264490054d6", + "0x54d60054424434490c01d50261140054d60050263c00261120054d6005", + "0x53180261130054d60051130051d70263650054d600536500508a026113", + "0x11411211336500a1da0261140054d60051140050d80261120054d6005112", + "0x502600702611e0056ea11d0054d600711a00514402611a1110074d6005", + "0x1200053180261200054d60050261db0260140054d60050263530260264d6", + "0x74d600511d0051dd0264400054d600512001400735f0261200054d6005", + "0x1e402640d0054d600540d4d30073bf0260264d600543e0050bc02643e40d", + "0x4d600543c0051e20260264d600543d0051e002643c43d0074d600540d005", + "0x264d600543800549702612843843a0c04d600543b0051e502643b43c007", + "0x12b0053c102612b43a0074d600543a0051e60260264d6005128005459026", + "0x1290054d60051290053180261290054d600512a0050f802612a0054d6005", + "0x508a0261260054d600543a0053be0261270054d600512944000735f026", + "0x54d60051260051df0261710054d600517100530f0261110054d6005111", + "0x1330c04d600512712617111100a3bc0261270054d60051270050f5026126", + "0x264340056eb4350054d60074370050f30260264d600502600a026437134", + "0x4d60054320050bc0264324330074d60054350050f20260264d6005026007", + "0x42e42f4300c04d60054310051e502643143c0074d600543c0051e2026026", + "0x4d600542f0053090260264d600542e0054590260264d60054300053bb026", + "0x42a42b0c04d600543c0051e502642c0054d600542d43300735f02642d005", + "0x52160051eb0260264d600542a0054970260264d600542b0053bb026216", + "0x4290054d60050cb42c00735f0260cb0054d60050820050f80260820054d6", + "0x264d60050260070260266ec00502640d0264280054d60054290050f5026", + "0x4260054b50261424260074d60054340054b60260264d600543c0051ed026", + "0x508a0260264d60050264d00264280054d60051420050f50260264d6005", + "0x54d600500a0050320260ef0054d600513400530f0260f00054d6005133", + "0x2640d0264360054d60054280050f50260ed0054d60050890050360260ee", + "0x54d30053e10260264d60050264d00260264d60050260070260266d0005", + "0x8a0260264d60054230054b50264224230074d600511e0054b60260264d6", + "0x4d600500a0050320260ef0054d600517100530f0260f00054d6005111005", + "0x7e0264360054d60054220050f50260ed0054d60050890050360260ee005", + "0x4d60054210053a20264210054d60054361460073650261460054d6005026", + "0x30f0260050054d60050050050380260f00054d60050f000508a02641f005", + "0x4d60050ee0050320260c00054d60050c000501b0260ef0054d60050ef005", + "0x3a30260ed0054d60050ed0050360264d20054d60054d20050350260ee005", + "0x50264d002641f0ed4d20ee0c00ef0050f001600541f0054d600541f005", + "0x264d20054d60054d30054110264d340d0074d60054d40054120260264d6", + "0x4d60054d20050d80264d10054d60054d10050d80264d10054d6005026428", + "0x2600702608b1c50076ed01c4d00074d60074d24d10260c015a0264d2005", + "0x2630f3090074d600540d0054120260264d600501c0054590260264d6005", + "0x54d60053120050d80263120054d600502608d0260264d6005309005417", + "0x4d60050260070263190056ee3183140074d600731230f4d00c0410026312", + "0x515e02631b0054d600531800540f0263180054d600531800515c026026", + "0x54d60050050050380263140054d600531400508a02602b0054d600531b", + "0x50320260c00054d60050c000501b0260070054d600500700530f026005", + "0x54d600508900503602608a0054d600508a00503502600a0054d600500a", + "0x40d41402602b0054d600502b0050de0260160054d6005016005318026089", + "0x3603503801b03233102c0164d600502b01608808908a00a0c0007005314", + "0x4a50260264d60050260070260bb0056ef0bc0054d60070390054a6026039", + "0x2600702634b0056f00c30054d60070ba0054a40260ba0054d60050bc005", + "0x2630202634e0054d60050263530260264d60050c30050bc0260264d6005", + "0x54d600535334e00735f0263530054d60053530053180263530054d6005", + "0x530002607e0054d600535835f00736502635f0054d600502607e026358", + "0x54d600533100503802602c0054d600502c00508a0263650054d600507e", + "0x503202601b0054d600501b00501b0260320054d600503200530f026331", + "0x54d60050360050360260350054d60050350050350260380054d6005038", + "0x2636503603503801b03233102c0160053650054d60053650052fd026036", + "0x261710054d60050264d30260264d600534b0050bc0260264d6005026007", + "0x502c00508a02636a0054d60053680052e00263680054d60051710052fa", + "0x260320054d600503200530f0263310054d600533100503802602c0054d6", + "0x50350050350260380054d600503800503202601b0054d600501b00501b", + "0x536a0054d600536a0052fd0260360054d60050360050360260350054d6", + "0x50bb0053000260264d600502600702636a03603503801b03233102c016", + "0x263310054d600533100503802602c0054d600502c00508a0260d50054d6", + "0x503800503202601b0054d600501b00501b0260320054d600503200530f", + "0x260360054d60050360050360260350054d60050350050350260380054d6", + "0x260070260d503603503801b03233102c0160050d50054d60050d50052fd", + "0x263530260264d60050880053a70260264d60050160054970260264d6005", + "0x260d30054d60050d30053180260d30054d60050264080260d40054d6005", + "0xd20d10073650260d10054d600502607e0260d20054d60050d30d400735f", + "0x3190054d600531900508a0260cf0054d60050d00053000260d00054d6005", + "0xc000501b0260070054d600500700530f0260050054d6005005005038026", + "0x8a0054d600508a00503502600a0054d600500a0050320260c00054d6005", + "0x53190160050cf0054d60050cf0052fd0260890054d6005089005036026", + "0x260264d600508b0054590260264d60050260070260cf08908a00a0c0007", + "0x264d600540d0054170260264d60050880053a70260264d6005016005497", + "0x4d60050cd0053180260cd0054d600502614a0260ce0054d6005026353026", + "0x3650263940054d600502607e0260cc0054d60050cd0ce00735f0260cd005", + "0x51c500508a0263a70054d60053a40053000263a40054d60050cc394007", + "0x260070054d600500700530f0260050054d60050050050380261c50054d6", + "0x508a00503502600a0054d600500a0050320260c00054d60050c000501b", + "0x53a70054d60053a70052fd0260890054d600508900503602608a0054d6", + "0x50890260050054d60050260050c00263a708908a00a0c00070051c5016", + "0x50c000501c0260264d600502600702600a0056f10c00070074d6007005", + "0x260880054d60050890050f00260890054d600508a00530902608a0054d6", + "0x6f200502640d0264d40054d60050880050ef0260160054d6005007005016", + "0x4d600540d0050ee02640d0054d60050264d30260264d6005026007026026", + "0x4290264d40054d60054d30050ef0260160054d600500a0050160264d3005", + "0x74d40050ed0264d10054d60054d200508b0264d20160074d6005016005", + "0x6f40264d60074d00050810260264d600502600702601c0056f34d00054d6", + "0x6f500502640d0260264d60050160050c30260264d60050260070261c5005", + "0x4d60070160050890260264d60054d10051040260264d6005026007026026", + "0x3120054d600530900501c0260264d600502600702630f0056f630908b007", + "0x8b0050160263180054d60053140050f00263140054d6005312005309026", + "0x70260266f700502640d02631b0054d60053180050ef0263190054d6005", + "0x2602c0054d600502b0050ee02602b0054d60050264d30260264d6005026", + "0x731b0050ed02631b0054d600502c0050ef0263190054d600530f005016", + "0x1b0074d60073190050890260264d60050260070260320056f83310054d6", + "0x3090260360054d600503800501c0260264d60050260070260350056f9038", + "0x4d600501b0050160260bc0054d60050390050f00260390054d6005036005", + "0x50260070260266fa00502640d0260ba0054d60050bc0050ef0260bb005", + "0x501602634b0054d60050c30050ee0260c30054d60050264d30260264d6", + "0x54d60070ba0050ed0260ba0054d600534b0050ef0260bb0054d6005035", + "0x263580054d600534e3310074160260264d60050260070263530056fb34e", + "0x535f0052f902607e0054d60050bb00501602635f0054d60053580052e2", + "0x53310054970260264d60050260070260266fc00502640d0263650054d6", + "0x2f902607e0054d60050bb0050160261710054d60053530052e40260264d6", + "0x2e40260264d60050260070260266fc00502640d0263650054d6005171005", + "0x4d60053680052f902607e0054d60053190050160263680054d6005032005", + "0x56fd0d50054d60073650052ef02636a0054d600507e00508b026365005", + "0xd50d30074130260d30054d60051c50051490260264d60050260070260d4", + "0x36a0054d600536a0053120260d10054d60050d20052f70260d20054d6005", + "0x4ca0260264d60050260070260d136a0070050d10054d60050d1005000026", + "0x54d600536a0053120260d00054d60050d40056fe0260264d60051c5005", + "0x260264d60050260070260d036a0070050d00054d60050d000500002636a", + "0xcf0054d60050264d30260264d60050160050c30260264d600501c0050bc", + "0xce0050000264d10054d60054d10053120260ce0054d60050cf0056fe026", + "0x70050890260070054d60050050050c00260ce4d10070050ce0054d6005", + "0x4d600500a00501c0260264d600502600702608a0056ff00a0c00074d6007", + "0x160260160054d60050880050f00260880054d6005089005309026089005", + "0x2670000502640d02640d0054d60050160050ef0264d40054d60050c0005", + "0x54d60054d30050ee0264d30054d60050264d30260264d6005026007026", + "0x50ed02640d0054d60054d20050ef0264d40054d600508a0050160264d2", + "0x54d60050263600260264d60050260070264d00057014d10054d600740d", + "0x30908b0074d60071c502600735e0261c54d10074d60054d10050d602601c", + "0x8a0263180054d600502626b0260264d600502600702631431230f0c0702", + "0x4d600531800566202631b0054d60053090056620263190054d600508b005", + "0x4d600530f00508a0260264d600502600702602670300502640d02602b005", + "0x35c02602b0054d600531200566202631b0054d6005314005662026319005", + "0x33100535b02603202b0074d600502b00535b02633102c0074d600501c005", + "0x701b0323190c035a02601b0054d600501b00566202601b3310074d6005", + "0x4d600503500545b0260264d60050260070260390360077040350380074d6", + "0x260267050264d600733102b0072700260380054d600503800508a026026", + "0x260264d600502c00545b0260264d60054d10054970260264d6005026007", + "0x2670600502640d0260bc0054d600503800508a0260264d600531b00545b", + "0x2c31b0380c035a02602c0054d600502c0056620260264d6005026007026", + "0x50ba00545b0260264d600502600702634b0c30077070ba0bb0074d6007", + "0x52720260bc0054d60050bb00508a0260264d60054d10054970260264d6", + "0x545b0260264d600502600702602670800502640d02634e0054d60050bc", + "0x702602670900502640d0263530054d60050c300508a0260264d600534b", + "0x45b0260264d600502b00545b0260264d600503900545b0260264d6005026", + "0x260264d600533100545b0260264d600531b00545b0260264d600502c005", + "0x3580050810263584d10074d60054d10050d60263530054d600503600508a", + "0x260264d60054d40050c30260264d600502600702635f00570a0264d6007", + "0x3650054d600502635902607e0054d60050263530260264d60054d1005497", + "0x2607e0261710054d600536507e00735f0263650054d6005365005318026", + "0x54d600536a00570b02636a0054d60051713680073650263680054d6005", + "0x3530070050d50054d60050d500570c0263530054d600535300508a0260d5", + "0x4d60054d10053550260264d600535f0054ca0260264d60050260070260d5", + "0x8a0260d20054d60050d300570d0260d30054d60050d40052740260d4005", + "0x2670f00502640d0260d00054d60050d200570e0260d10054d6005353005", + "0x54d600502600508a0260264d60054d00050bc0260264d6005026007026", + "0x34e0052720260ce0054d60050cf0057100260cf0054d60050264d302634e", + "0xcd0054d60054d400508b0260d00054d60050ce00570e0260d10054d6005", + "0x508a0260264d60050260070263940057120cc0054d60070d0005711026", + "0x4d60050cd0d10077130260cd0054d60050cd0053120260d10054d60050d1", + "0x4d60050260070260ca0057153ae0054d60070c40057140260c43a73a40c0", + "0x7180261060054d600500e00571702600e0054d60053ae0cc007716026026", + "0x53a400508a0261040054d60051050057190261050054d60051063a7007", + "0x4d60050260070261043a40070051040054d600510400570c0263a40054d6", + "0x3a70077180261030054d60050ca00571b0260264d60050cc00571a026026", + "0x54d60053a400508a0261010054d60051020057190261020054d6005103", + "0x260264d60050260070261013a40070051010054d600510100570c0263a4", + "0xff0057190260ff0054d60051000cd0077180261000054d600539400571b", + "0xfe0054d60050fe00570c0260d10054d60050d100508a0260fe0054d6005", + "0x890260c00054d60050070050c00260264d60050264d00260fe0d1007005", + "0x8a0050880260264d600502600702608900571c08a00a0074d60070c0005", + "0x4d40054d60050880054d40260160054d600500a0050160260880054d6005", + "0x2640d0054d60050264d30260264d600502600702602671d00502640d026", + "0x54d30054d40260160054d60050890050160264d30054d600540d0054d2", + "0x264d60050260070264d100571e4d20054d60074d40054d10264d40054d6", + "0x501600508b02601c0054d600502671f0264d00054d60054d200501c026", + "0x260260054d600502600508a02608b0054d60054d00053090261c50054d6", + "0x501c0057200261c50054d60051c50053120260050054d600500500530f", + "0x508b01c1c500502608a72102608b0054d600508b00531802601c0054d6", + "0x50260070263180057233140054d600731200572202631230f3090c04d6", + "0x72602b0054d600731b00572502631b3190074d60053140057240260264d6", + "0x57270260323310074d600502b0054da0260264d600502600702602c005", + "0x380054d600501b00572902601b0054d60050320057280260264d6005331", + "0x30f00530f0260360054d600530900508a0260350054d60053190050c0026", + "0xbb0054d600503800572a0260bc0054d60050350050160260390054d6005", + "0xba0054d600502c00572c0260264d600502600702602672b00502640d026", + "0x30f00530f0260360054d600530900508a0260c30054d60053190050c0026", + "0xbb0054d60050ba00572a0260bc0054d60050c30050160260390054d6005", + "0x34b0054d600531800572d0260264d600502600702602672b00502640d026", + "0x34b00572e02630f0054d600530f00530f0263090054d600530900508a026", + "0x54d10050bc0260264d600502600702634b30f3090c000534b0054d6005", + "0x508a0263530054d600534e00572c02634e0054d60050264d30260264d6", + "0x54d60050160050160260390054d600500500530f0260360054d6005026", + "0x35f0057303580054d60070bb00572f0260bb0054d600535300572a0260bc", + "0x7e0074d60070bc0050890260264d600502600a0260264d6005026007026", + "0x160263680054d60053650050880260264d6005026007026171005731365", + "0x2673200502640d0260d50054d60053680054d402636a0054d600507e005", + "0x54d60050d40054d20260d40054d60050264d30260264d6005026007026", + "0x54d10260d50054d60050d30054d402636a0054d60051710050160260d3", + "0x4d60050d200501c0260264d60050260070260d10057330d20054d60070d5", + "0x35e0260cf0054d60050cf0053180260cf0054d60050d00053090260d0005", + "0x260264d60050260070263a43940cc0c07340cd0ce0074d60070cf036007", + "0x263ae0057350c43a70074d600736a0050890260ce0054d60050ce00508a", + "0x54d60053a70050160260ca0054d60050c40050880260264d6005026007", + "0x4d600502600702602673600502640d0261060054d60050ca0054d402600e", + "0x3ae0050160261040054d60051050054d20261050054d60050264d3026026", + "0x1030054d60071060054d10261060054d60051040054d402600e0054d6005", + "0x53090261010054d600510300501c0260264d6005026007026102005737", + "0x4d60071000ce00735e0261000054d60051000053180261000054d6005101", + "0x50fe0cd0073290260264d60050260070260fb0fc0fd0c07380fe0ff007", + "0x260f80054d60050ff00508a0260f90054d60050fa0057390260fa0054d6", + "0x73b00502640d0260f60054d60050f900573a0260f70054d600500e005016", + "0x4d60050fb00545b0260264d60050fc00545b0260264d6005026007026026", + "0x502640d0260f50054d60050fd00508a0260264d60050cd00545b026026", + "0x50cd00545b0260264d60051020050bc0260264d600502600702602673c", + "0x54d90260f40054d60050264d30260f50054d60050ce00508a0260264d6", + "0x54d600500e0050160260f80054d60050f50052720260f30054d60050f4", + "0x4d600502600702602673b00502640d0260f60054d60050f300573a0260f7", + "0x50cc00508a0260264d60053a400545b0260264d600539400545b026026", + "0x50d10050bc0260264d600502600702602673d00502640d0260f20054d6", + "0x54d90260f10054d60050264d30260f20054d600503600508a0260264d6", + "0x54d600536a0050160260f80054d60050f20052720260f00054d60050f1", + "0x8b0260ef0f70074d60050f70054290260f60054d60050f000573a0260f7", + "0x2600702643600573f0ed0054d60070f600573e0260ee0054d60050ef005", + "0x260264d60050260070264390057410264d60070ed0057400260264d6005", + "0x2602674200502640d0260264d60053580053100260264d60050f70050c3", + "0x43f0074d60070f70050890260264d60050ee0051040260264d6005026007", + "0x160264970054d60054480050880260264d6005026007026170005743448", + "0x2674400502640d0260eb0054d60054970054d40260ec0054d600543f005", + "0x54d60050ea0054d20260ea0054d60050264d30260264d6005026007026", + "0x54d10260eb0054d60050e90054d40260ec0054d60051700050160260e9", + "0x4d60050e800501c0260264d60050260070260e70057450e80054d60070eb", + "0x35e0260e50054d60050e50053180260e50054d60050e60053090260e6005", + "0x260264d60050260070260e00e10e20c07460e30e40074d60070e50f8007", + "0x260dd0057470de0df0074d60070ec0050890260e40054d60050e400508a", + "0x54d60050df0050160260dc0054d60050de0050880260264d6005026007", + "0x4d600502600702602674800502640d0260da0054d60050dc0054d40260db", + "0xdd00501602608d0054d60050d90054d20260d90054d60050264d3026026", + "0xd80054d60070da0054d10260da0054d600508d0054d40260db0054d6005", + "0x53090260060054d60050d800501c0260264d60050260070260d7005749", + "0x4d60070d60e400735e0260d60054d60050d60053180260d60054d6005006", + "0x50940e30073290260264d600502600702607d4c94ca0c074a094081007", + "0x2609a0054d600508100508a02601a0054d60054c80057390264c80054d6", + "0x74b00502640d02609c0054d600501a00573a02609b0054d60050db005016", + "0x4d600507d00545b0260264d60054c900545b0260264d6005026007026026", + "0x502640d02609e0054d60054ca00508a0260264d60050e300545b026026", + "0x50e300545b0260264d60050d70050bc0260264d600502600702602674c", + "0x54d90264c60054d60050264d302609e0054d60050e400508a0260264d6", + "0x54d60050db00501602609a0054d600509e0052720260a00054d60054c6", + "0x4d600502600702602674b00502640d02609c0054d60050a000573a02609b", + "0x50e200508a0260264d60050e000545b0260264d60050e100545b026026", + "0x50e70050bc0260264d600502600702602674d00502640d0264c50054d6", + "0x54d90264c40054d60050264d30264c50054d60050f800508a0260264d6", + "0x54d60050ec00501602609a0054d60054c50052720264c30054d60054c4", + "0x573e0264c20054d600509b00508b02609c0054d60054c300573a02609b", + "0x4d60074c10057400260264d60050260070264c000574e4c10054d600709c", + "0x52d40260264d60053580053100260264d60050260070264bf00574f026", + "0x50264d00260264d600502600702602675000502640d0260264d6005439", + "0x4bd0054d60054be0057520264be0054d60054bf4393580c07510260264d6", + "0x508a0260ab0054d60050aa0057540260aa0054d60054bd4c2007753026", + "0x54d60050ab00572e0260390054d600503900530f02609a0054d600509a", + "0x260264d60054c00050bc0260264d60050260070260ab03909a0c00050ab", + "0x260264d60050264d00260264d60054390052d40260264d6005358005310", + "0x54bc4c20077530264bc0054d60050ad0057550260ad0054d60050264d3", + "0x2609a0054d600509a00508a0264ba0054d60054bb0057540264bb0054d6", + "0x4ba03909a0c00054ba0054d60054ba00572e0260390054d600503900530f", + "0x264d60050f70050c30260264d60054360050bc0260264d6005026007026", + "0x4b90054d60050264d30260264d60050264d00260264d6005358005310026", + "0x57540264b70054d60054b80ee0077530264b80054d60054b9005755026", + "0x54d600503900530f0260f80054d60050f800508a0264b60054d60054b7", + "0x264d60050260070264b60390f80c00054b60054d60054b600572e026039", + "0x4b50077530264b40054d600535f0057550264b50054d60050bc00508b026", + "0x54d600503600508a0264b20054d60054b30057540264b30054d60054b4", + "0x360c00054b20054d60054b200572e0260390054d600503900530f026036", + "0x4d60050264d00260264d600502610202600a0054d60050267560264b2039", + "0x57570880890074d600708a00508902608a0054d60050070050c0026026", + "0x50890050160264d40054d60050880050880260264d6005026007026016", + "0x2600702602675800502640d0264d30054d60054d40054d402640d0054d6", + "0x160264d10054d60054d20054d20264d20054d60050264d30260264d6005", + "0x4d60074d30054d10264d30054d60054d10054d402640d0054d6005016005", + "0x261c50054d60054d000501c0260264d600502600702601c0057594d0005", + "0x4d60051c50053090263090054d600540d00508b02608b0054d600502671f", + "0x3120260050054d600500500530f0260260054d600502600508a02630f005", + "0x4d600530f00531802608b0054d600508b0057200263090054d6005309005", + "0x3180057220263183143120c04d600530f08b30900502608a72102630f005", + "0x74d60053190057240260264d600502600702631b00575a3190054d6007", + "0x260264d600502600702603200575b3310054d600702c00572502602c02b", + "0x50380057280260264d600501b00572702603801b0074d60053310054da", + "0x260390054d600502b0050c00260360054d60050350057290260350054d6", + "0x50390050160260bb0054d600531400530f0260bc0054d600531200508a", + "0x2600702602675c00502640d0260c30054d600503600572a0260ba0054d6", + "0x2634e0054d600502b0050c002634b0054d600503200572c0260264d6005", + "0x534e0050160260bb0054d600531400530f0260bc0054d600531200508a", + "0x2600702602675c00502640d0260c30054d600534b00572a0260ba0054d6", + "0x8a0263530054d600531b00575e0260264d600500a00575d0260264d6005", + "0x4d600535300575f0263140054d600531400530f0263120054d6005312005", + "0x264d600501c0050bc0260264d60050260070263533143120c0005353005", + "0x502600508a02635f0054d600535800572c0263580054d60050264d3026", + "0x260ba0054d600540d0050160260bb0054d600500500530f0260bc0054d6", + "0x702607e0057600c00054d60070c300572f0260c30054d600535f00572a", + "0x260c00054d60050c000a0077610260264d600502600a0260264d6005026", + "0x50880260264d60050260070263680057621713650074d60070ba005089", + "0x54d600536a0054d40260d50054d600536500501602636a0054d6005171", + "0xd30054d60050264d30260264d600502600702602676300502640d0260d4", + "0xd20054d40260d50054d60053680050160260d20054d60050d30054d2026", + "0x4d60050260070260d00057640d10054d60070d40054d10260d40054d6005", + "0x4d600502671f0260cf0054d60050d100501c0260264d60050264d0026026", + "0x8a0260cc0054d60050cf0053090260cd0054d60050d500508b0260ce005", + "0x4d60050cd0053120260bb0054d60050bb00530f0260bc0054d60050bc005", + "0x7210260cc0054d60050cc0053180260ce0054d60050ce0057200260cd005", + "0xc40054d60073a70057220263a73a43940c04d60050cc0ce0cd0bb0bc08a", + "0x72502600e0ca0074d60050c40057240260264d60050260070263ae005765", + "0x51060054da0260264d60050260070261050057661060054d600700e005", + "0x261020054d60051030057280260264d60051040057270261031040074d6", + "0x539400508a0261000054d60050ca0050c00261010054d6005102005729", + "0x260fd0054d60051000050160260fe0054d60053a400530f0260ff0054d6", + "0x260264d600502600702602676700502640d0260fc0054d600510100572a", + "0x539400508a0260fa0054d60050ca0050c00260fb0054d600510500572c", + "0x260fd0054d60050fa0050160260fe0054d60053a400530f0260ff0054d6", + "0x260264d600502600702602676700502640d0260fc0054d60050fb00572a", + "0x4d600539400508a0260f90054d60053ae00575e0260264d60050c0005310", + "0xc00050f90054d60050f900575f0263a40054d60053a400530f026394005", + "0x50d00050bc0260264d60050264d00260264d60050260070260f93a4394", + "0x508a0260f70054d60050f800572c0260f80054d60050264d30260264d6", + "0x54d60050d50050160260fe0054d60050bb00530f0260ff0054d60050bc", + "0x572f0260f60054d60050fd00508b0260fc0054d60050f700572a0260fd", + "0x4d60050ff00508a0260264d60050260070260f40057680f50054d60070fc", + "0xf20f30c04d60050f60ff0077130260f60054d60050f60053120260ff005", + "0xc00260264d60050260070260ef0057690f00054d60070f10057140260f1", + "0xed0074d60070ee0050890260264d600502600a0260ee0054d60050f2005", + "0x1602643f0054d60054360050880260264d600502600702643900576a436", + "0x2676b00502640d0261700054d600543f0054d40264480054d60050ed005", + "0x54d60054970054d20264970054d60050264d30260264d6005026007026", + "0x54290261700054d60050ec0054d40264480054d60054390050160260ec", + "0x4d60071700054d10260ea0054d60050eb00508b0260eb4480074d6005448", + "0x260e70054d60050e900501c0260264d60050260070260e800576c0e9005", + "0xe60f30073900260e60054d60050e60053180260e60054d60050e7005309", + "0x4d60050ea0051040260264d60050260070260e300576d0e40e50074d6007", + "0x576e0e10e20074d60074480050890260e50054d60050e500508a026026", + "0x50e20050160260df0054d60050e10050880260264d60050260070260e0", + "0x2600702602676f00502640d0260dd0054d60050df0054d40260de0054d6", + "0x160260db0054d60050dc0054d20260dc0054d60050264d30260264d6005", + "0x4d60050de0054290260dd0054d60050db0054d40260de0054d60050e0005", + "0x77008d0054d60070dd0054d10260d90054d60050da00508b0260da0de007", + "0xd70053090260d70054d600508d00501c0260264d60050260070260d8005", + "0x74d60070060e50073900260060054d60050060053180260060054d6005", + "0x8a0260264d60050d90051040260264d60050260070260940057710810d6", + "0x702607d0057724c94ca0074d60070de0050890260d60054d60050d6005", + "0x1a0054d60054ca0050160264c80054d60054c90050880260264d6005026", + "0x264d600502600702602677300502640d02609a0054d60054c80054d4026", + "0x507d00501602609c0054d600509b0054d202609b0054d60050264d3026", + "0x9e01a0074d600501a00542902609a0054d600509c0054d402601a0054d6", + "0x264c50057740a00054d600709a0054d10264c60054d600509e00508b026", + "0x54d60054c40053090264c40054d60050a000501c0260264d6005026007", + "0x7754c14c20074d60074c30d60073900264c30054d60054c30053180264c3", + "0x54c200508a0260264d60054c60051040260264d60050260070264c0005", + "0x4d60050260070264bd0057764be4bf0074d600701a0050890264c20054d6", + "0x54d40260ab0054d60054bf0050160260aa0054d60054be005088026026", + "0x264d30260264d600502600702602677700502640d0260ad0054d60050aa", + "0xab0054d60054bd0050160264bb0054d60054bc0054d20264bc0054d6005", + "0x508b0264ba0ab0074d60050ab0054290260ad0054d60054bb0054d4026", + "0x50260070264b70057784b80054d60070ad0054d10264b90054d60054ba", + "0x3180264b50054d60054b60053090264b60054d60054b800501c0260264d6", + "0x264b20057794b34b40074d60074b54c20073900264b50054d60054b5005", + "0x4b40054d60054b400508a0260264d60054b90051040260264d6005026007", + "0x880260264d60050260070264af00577a4b04b10074d60070ab005089026", + "0x4d60050840054d40265180054d60054b10050160260840054d60054b0005", + "0x54d60050264d30260264d600502600702602677b00502640d0264ac005", + "0x54d40265180054d60054af0050160264aa0054d60054ab0054d20264ab", + "0x54d60074ac0054d10265190054d600551800508b0264ac0054d60054aa", + "0x3090264a40054d60054a600501c0260264d60050260070264a500577c4a6", + "0x74a24b40073900264a20054d60054a20053180264a20054d60054a4005", + "0x260264d60050264d00260264d60050260070264a000577d4a10bf0074d6", + "0x4d600549f00577f02649f0054d60054a14b34c10810e40f00f50c001677e", + "0x2649d0054d60050c20057810260c20054d600549e51900778002649e005", + "0x549d00575f0260fe0054d60050fe00530f0260bf0054d60050bf00508a", + "0x4d60050c00053100260264d600502600702649d0fe0bf0c000549d0054d6", + "0x54c10054590260264d60054b30054590260264d60050f5005310026026", + "0xf00051a60260264d60050e40054590260264d60050810054590260264d6", + "0x2600702602678200502640d02649c0054d60054a000508a0260264d6005", + "0x53100260264d60050c00053100260264d60054a50050bc0260264d6005", + "0x4590260264d60054c10054590260264d60054b30054590260264d60050f5", + "0x260264d60050f00051a60260264d60050e40054590260264d6005081005", + "0x4a80054d60050264d30260264d60050264d002649c0054d60054b400508a", + "0x57810264a70054d60054a95190077800264a90054d60054a8005783026", + "0x54d600549a00575f0260fe0054d60050fe00530f02649a0054d60054a7", + "0x260264d60050c00053100260264d600502600702649a0fe49c0c000549a", + "0x264d60050f00051a60260264d60050f50053100260264d60050ab0050c3", + "0x4d60050e40054590260264d60050810054590260264d60054c1005459026", + "0x4d600502600702602678400502640d0260c60054d60054b200508a026026", + "0x50ab0050c30260264d60050c00053100260264d60054b70050bc026026", + "0x4c10054590260264d60050f00051a60260264d60050f50053100260264d6", + "0x508a0260264d60050e40054590260264d60050810054590260264d6005", + "0x7830264990054d60050264d30260264d60050264d00260c60054d60054c2", + "0x54980057810264980054d60050c84b90077800260c80054d6005499005", + "0x54960054d600549600575f0260fe0054d60050fe00530f0264960054d6", + "0x50c30260264d60050c00053100260264d60050260070264960fe0c60c0", + "0x4590260264d60050f00051a60260264d60050f50053100260264d600501a", + "0x4930054d60054c000508a0260264d60050810054590260264d60050e4005", + "0x260264d60054c50050bc0260264d600502600702602678500502640d026", + "0x264d60050f50053100260264d600501a0050c30260264d60050c0005310", + "0x4d60050810054590260264d60050e40054590260264d60050f00051a6026", + "0x4d60050264d30260264d60050264d00264930054d60050d600508a026026", + "0x2648e0054d60054904c60077800264900054d6005523005783026523005", + "0x548d00575f0260fe0054d60050fe00530f02648d0054d600548e005781", + "0x4d60050c00053100260264d600502600702648d0fe4930c000548d0054d6", + "0x50f00051a60260264d60050f50053100260264d60050de0050c3026026", + "0x2640d02648c0054d600509400508a0260264d60050e40054590260264d6", + "0xc00053100260264d60050d80050bc0260264d6005026007026026786005", + "0x51a60260264d60050f50053100260264d60050de0050c30260264d6005", + "0x2648c0054d60050e500508a0260264d60050e40054590260264d60050f0", + "0x48a0054d600548b00578302648b0054d60050264d30260264d60050264d0", + "0x530f0264880054d60054890057810264890054d600548a0d9007780026", + "0x70264880fe48c0c00054880054d600548800575f0260fe0054d60050fe", + "0x3100260264d60054480050c30260264d60050c00053100260264d6005026", + "0x4870054d60050e300508a0260264d60050f00051a60260264d60050f5005", + "0x260264d60050e80050bc0260264d600502600702602678700502640d026", + "0x264d60050f50053100260264d60054480050c30260264d60050c0005310", + "0x4d60050264d00264870054d60050f300508a0260264d60050f00051a6026", + "0xea0077800264850054d60054860057830264860054d60050264d3026026", + "0x54d60050fe00530f0264830054d60054840057810264840054d6005485", + "0x264d60050260070264830fe4870c00054830054d600548300575f0260fe", + "0x4d60050ef0057830260264d60050f50053100260264d60050c0005310026", + "0x264800054d60054810057810264810054d60054820f2007780026482005", + "0x548000575f0260fe0054d60050fe00530f0260f30054d60050f300508a", + "0x4d60050c00053100260264d60050260070264800fe0f30c00054800054d6", + "0x78102647e0054d600547f0f600778002647f0054d60050f4005783026026", + "0x4d60050fe00530f0260ff0054d60050ff00508a02647d0054d600547e005", + "0x4d600502600702647d0fe0ff0c000547d0054d600547d00575f0260fe005", + "0x7e00578302647c0054d60050ba00508b0260264d600500a00575d026026", + "0x54d600547a00578102647a0054d600547b47c00778002647b0054d6005", + "0x575f0260bb0054d60050bb00530f0260bc0054d60050bc00508a026479", + "0x264a202640d0054d60050264a10264790bb0bc0c00054790054d6005479", + "0x4a20261c50054d60050264d80264d00054d60050261030264d20054d6005", + "0x4d00260264d60050261020263120054d60050261030263090054d6005026", + "0x2c02b31b0c07883193183140c04d60070890070074c10260264d6005026", + "0x4d60053190054bf0263190054d60053190054c00260264d6005026007026", + "0x4d60050320050aa02603603503801b03208a4d60053310054bd026331005", + "0x50360054970260264d60050350050ad0260264d60050380050ad026026", + "0x78902601c0054d600501b00545d02601b0054d600501b00545e0260264d6", + "0xbb0054d60050bc0054c80260bc0054d60050264d30260390054d6005026", + "0x264d30260ba0054d60050bb03900778a0260bb0054d60050bb00507d026", + "0x34b0054d600534b00507d02634b0054d60050c30054c90260c30054d6005", + "0x3530053e30263530054d60050264d302634e0054d600534b0ba00778a026", + "0x54d600535834e00778a0263580054d600535800507d0263580054d6005", + "0x578d0260264d600507e00578c02636507e0074d600535f00578b02635f", + "0x54d600531400530f0260260054d600502600508a0261710054d6005365", + "0x578e0263180054d600531800503602600a0054d600500a005032026314", + "0xa31402608979002601c0054d600501c1c500778f0261710054d6005171", + "0x8b0054d600508b3090074880260d530f08b36a36808a4d6005088171318", + "0xd30057920d40054d60070d500579102630f0054d600530f3120070ff026", + "0x50d20057940260d10d20074d60050d40057930260264d6005026007026", + "0x3502636a0054d600536a00530f0263680054d600536800508a0260264d6", + "0x8a36a36800a3c70260d10054d60050d10053d602608a0054d600508a005", + "0x50e80264d40054d60054d440d0074870260ce4d40cf0d000a4d60050d1", + "0x54d600502609c0260264d60050260070260cc0057950cd0054d60070ce", + "0x3a40053180263940054d60053940053180263a40054d6005026796026394", + "0x501c00545c0260c43a70074d60053a439408b0c04800263a40054d6005", + "0x53ae0054970260fd0fe0ff10010110210310410510600e0ca3ae4d14d6", + "0x1060051040260264d600500e00545b0260264d60050ca0050ad0260264d6", + "0x545a0260264d60051030054970260264d60051050054970260264d6005", + "0x4590260264d60051000051040260264d600510100545b0260264d6005102", + "0x260264d60050fd0051040260264d60050fe0054590260264d60050ff005", + "0x320260fb0fc0074d60051040c43a70c04800260c40054d60050c4005318", + "0x730f0cf0074c10260fb0054d60050fb0053180260fc0054d60050fc005", + "0xf90054c00260264d60050260070260f60f70f80c07970f94d10fa0c04d6", + "0xf408a4d60050f50054bd0260f50054d60050f90054bf0260f90054d6005", + "0xad0260264d60050f30050ab0260264d60050f40050aa0260f00f10f20f3", + "0xef0054d60050f10054bc0260264d60050f00054970260264d60050f2005", + "0x260ed0ee0074d60050ef0fb0fc0c04800260ef0054d60050ef005318026", + "0xed0ee0c04800260ed0054d60050ed0053180264360054d60050cd0050e7", + "0x54d600543f0053180264480054d600502634c02643f4390074d6005436", + "0x1704d30074d600544843f4390c04800264480054d600544800531802643f", + "0x74880264d10054d60054d14d00070ff0260fa0054d60050fa00530f026", + "0x4d600a0160051980261700054d60051700053180264d30054d60054d34d2", + "0x51990260264d60050260070260ea00579a0eb0057990ec005798497005", + "0x4d60050e70053e20260e70054d60050e90051b00260e80e90074d6005497", + "0x260d00054d60050d000508a0260e40e50074d60050e80052b50260e6005", + "0x50e60053180261700054d60051700053180260050054d6005005005038", + "0x260e40054d60050e40053180260e50054d60050e50053180260e60054d6", + "0x4d60070e10054a60260e10e20e30c04d60050e40e50e61700050d008932c", + "0x260de0054d60050e00054a50260264d60050260070260df00579b0e0005", + "0xdd0050bc0260264d60050260070260dc00579c0dd0054d60070de0054a4", + "0x260da0054d60050e20050380260db0054d60050e300508a0260264d6005", + "0x54d100503602608d0054d60050c000501b0260d90054d60050fa00530f", + "0x50dc0050bc0260264d600502600702602679d00502640d0260d80054d6", + "0x30f0260060054d60050e20050380260d70054d60050e300508a0260264d6", + "0x4d60054d10050360260810054d60050c000501b0260d60054d60050fa005", + "0x4d60050df0054b60260264d600502600702602679e00502640d026094005", + "0x3802607d0054d60050e300508a0260264d60054ca0054b50264c94ca007", + "0x4d60050c000501b02601a0054d60050fa00530f0264c80054d60050e2005", + "0x40d02609c0054d60054c90050f502609b0054d60054d100503602609a005", + "0x264c609e0074d60050ec00519d0260264d600502600702602679f005026", + "0x4c24c34c40c07a04c50a00074d60071700d000735e0260264d600502600a", + "0x54d60050a000508a0264c10054d600502626b0260264d6005026007026", + "0x2640d0264be0054d60054c10056620264bf0054d60054c50056620264c0", + "0x56620264c00054d60054c400508a0260264d60050260070260267a1005", + "0x260264d60050264d00264be0054d60054c30056620264bf0054d60054c2", + "0x4c000508a0260aa0054d60054be4bf0073290264bd0054d600509e0053df", + "0xc00054d60050c000501b0260fa0054d60050fa00530f0264c00054d6005", + "0x4c60053270260aa0054d60050aa0053280264d10054d60054d1005036026", + "0xaa4d10c00fa4c00883250264bd0054d60054bd0053260264c60054d6005", + "0x57a24b90054d60074ba0053240264ba4bb4bc0ad0ab08a4d60054bd4c6", + "0x54b70053210264b70054d60054b90053200260264d60050260070264b8", + "0x7a34b40054d60074b50052940260264d60054b60056de0264b54b60074d6", + "0x50ab00508a0260264d60054b40050bc0260264d60050260070264b3005", + "0x260d60054d60050ad00530f0260060054d60050050050380260d70054d6", + "0x79e00502640d0260940054d60054bb0050360260810054d60054bc00501b", + "0x4d60050ab00508a0260264d60054b30054970260264d6005026007026026", + "0x1b0260d90054d60050ad00530f0260da0054d60050050050380260db005", + "0x2679d00502640d0260d80054d60054bb00503602608d0054d60054bc005", + "0x54b20054b50264b14b20074d60054b80054b60260264d6005026007026", + "0x30f0264c80054d600500500503802607d0054d60050ab00508a0260264d6", + "0x4d60054bb00503602609a0054d60054bc00501b02601a0054d60050ad005", + "0x502600702602679f00502640d02609c0054d60054b10050f502609b005", + "0x844af0074d60054af0052bf0264af4b00074d60050eb0051a20260264d6", + "0x54a60054590264a44a54a65194aa4ab4ac5180164d60050840052c0026", + "0x530f0260d00054d60050d000508a0260264d60054a40054590260264d6", + "0x54d60054aa0050d80260c00054d60050c000501b0260fa0054d60050fa", + "0x52c10264a50054d60054a50050d80265190054d60055190050d80264aa", + "0x54d60055180052c10261700054d60051700053180264ac0054d60054ac", + "0x4a04a10bf4a200a4d60055181704ac4a55194aa0c00fa0d04d42c2026518", + "0x531c0260264d600502600702649e0057a449f0054d60074a00052c4026", + "0x502600702649c0057a549d0054d60070c20052c60260c20054d600549f", + "0x530f0264a20054d60054a200508a0260264d600549d0050bc0260264d6", + "0x54d60054af0052c80264a10054d60054a100501b0260bf0054d60050bf", + "0x749a00531602649a4a74a94a800a4d60054af4a10bf4a200a31a0264af", + "0xc80054d60050c60052cb0260264d60050260070264990057a60c60054d6", + "0x4d10050360264a90054d60054a900530f0264a80054d60054a800508a026", + "0x4ab0054d60054ab0053270260c80054d60050c80053280264d10054d6005", + "0x75230052cd02652349349649800a4d60054ab0c84d14a94a808a315026", + "0x48d0054d60054900052cf0260264d600502600702648e0057a74900054d6", + "0xc03110260264d600502600702648b0057a848c0054d600748d005313026", + "0x4d60050260070264844854860c07a948748848948a00a4d600748c493496", + "0x3100264814824830c04d60054b00052d20260264d6005487005317026026", + "0x4800054d600548100530b0260264d60054820052d40260264d6005483005", + "0x4800052d60260264d600547f00531702647e47f0074d60054880052d6026", + "0x47e0054d600547e0053280260264d600547d00531702647c47d0074d6005", + "0x45b02647947a0074d600547b00535c02647b47e0074d600547e005308026", + "0x4d600547800535c02647847c0074d600547c0053080260264d6005479005", + "0x3050264750054d600547a0053050260264d600547600545b026476477007", + "0x4d600548900503602648a0054d600548a00530f0264740054d6005477005", + "0x3170260264d60050260070260267aa0264d6007474475007270026489005", + "0xdb0054d600549800508a0260264d600547e0053170260264d600547c005", + "0x4a700501b0260d90054d600548a00530f0260da0054d6005005005038026", + "0x702602679d00502640d0260d80054d600548900503602608d0054d6005", + "0x264d600547300545b0264724730074d600547e00535c0260264d6005026", + "0x4720053050260264d600547100545b0264704710074d600547c00535c026", + "0x264d600746e46f00727002646e0054d600547000530502646f0054d6005", + "0x50050380260db0054d600549800508a0260264d60050260070260267ab", + "0x8d0054d60054a700501b0260d90054d600548a00530f0260da0054d6005", + "0x264d600502600702602679d00502640d0260d80054d6005489005036026", + "0x48a00530f0260060054d60050050050380260d70054d600549800508a026", + "0x940054d60054890050360260810054d60054a700501b0260d60054d6005", + "0x546c0052e002646c0054d600546d0052fa02646d0054d60050264d3026", + "0x260060054d60050060050380260d70054d60050d700508a02646b0054d6", + "0x54d30050320260810054d600508100501b0260d60054d60050d600530f", + "0x260940054d60050940050360264d40054d60054d40050350264d30054d6", + "0x2600702646b0944d44d30810d60060d701600546b0054d600546b0052fd", + "0x263530260264d60054b000518d0260264d60054840053ae0260264d6005", + "0x264690054d60054690053180264690054d600502630402646a0054d6005", + "0x500503802607d0054d600549800508a0264680054d600546946a00735f", + "0x9a0054d60054a700501b02601a0054d600548600530f0264c80054d6005", + "0x502640d02609c0054d60054680050f502609b0054d6005485005036026", + "0x54b000518d0260264d600548b0050bc0260264d600502600702602679f", + "0x4660053180264660054d60050263040264670054d60050263530260264d6", + "0x54d600549800508a0264650054d600546646700735f0264660054d6005", + "0x501b02601a0054d600549600530f0264c80054d600500500503802607d", + "0x54d60054650050f502609b0054d600549300503602609a0054d60054a7", + "0x264d60054b000518d0260264d600502600702602679f00502640d02609c", + "0x49800508a0260264d60054640054b50264634640074d600548e0054b6026", + "0x1a0054d600549600530f0264c80054d600500500503802607d0054d6005", + "0x4630050f502609b0054d600549300503602609a0054d60054a700501b026", + "0x4b000518d0260264d600502600702602679f00502640d02609c0054d6005", + "0x264614620074d60054990054b60260264d60054ab0051a60260264d6005", + "0x4d600500500503802607d0054d60054a800508a0260264d60054620054b5", + "0x3602609a0054d60054a700501b02601a0054d60054a900530f0264c8005", + "0x2679f00502640d02609c0054d60054610050f502609b0054d60054d1005", + "0x264d60054b000518d0260264d600549c0052de0260264d6005026007026", + "0x54d60050263530260264d60054af0051a30260264d60054ab0051a6026", + "0x46000735f02645f0054d600545f00531802645f0054d60050262da026460", + "0x54d600500500503802607d0054d60054a200508a02645e0054d600545f", + "0x503602609a0054d60054a100501b02601a0054d60050bf00530f0264c8", + "0x2602679f00502640d02609c0054d600545e0050f502609b0054d60054d1", + "0x260264d60054ab0051a60260264d60054b000518d0260264d6005026007", + "0x545d0054b502645c45d0074d600549e0054b60260264d60054af0051a3", + "0x30f0264c80054d600500500503802607d0054d60054a200508a0260264d6", + "0x4d60054d100503602609a0054d60054a100501b02601a0054d60050bf005", + "0x736502645b0054d600502607e02609c0054d600545c0050f502609b005", + "0x4d600507d00508a0264590054d600545a00530002645a0054d600509c45b", + "0x1b02601a0054d600501a00530f0264c80054d60054c800503802607d005", + "0x4d60054d40050350264d30054d60054d300503202609a0054d600509a005", + "0x160054590054d60054590052fd02609b0054d600509b0050360264d4005", + "0x4d60050ea0050bc0260264d600502600702645909b4d44d309a01a4c807d", + "0x50050380260db0054d60050d000508a0260264d6005170005497026026", + "0x8d0054d60050c000501b0260d90054d60050fa00530f0260da0054d6005", + "0x4d60050263020264580054d60050263530260d80054d60054d1005036026", + "0x264560054d600545745800735f0264570054d6005457005318026457005", + "0x54540053000264540054d60054564550073650264550054d600502607e", + "0x260da0054d60050da0050380260db0054d60050db00508a0264530054d6", + "0x54d300503202608d0054d600508d00501b0260d90054d60050d900530f", + "0x260d80054d60050d80050360264d40054d60054d40050350264d30054d6", + "0x260070264530d84d44d308d0d90da0db0160054530054d60054530052fd", + "0x54930260264d60050fb0054970260264d60050160050df0260264d6005", + "0x7e0260264d60054d00051010260264d60050cd0057ac0260264d60054d2", + "0x4d60054510053000264510054d60050f64520073650264520054d6005026", + "0x30f0260050054d60050050050380260d00054d60050d000508a026450005", + "0x4d60050fc0050320260c00054d60050c000501b0260f80054d60050f8005", + "0x2fd0260f70054d60050f70050360264d40054d60054d40050350260fc005", + "0x50260070264500f74d40fc0c00f80050d00160054500054d6005450005", + "0x4d00051010260264d60054d20054930260264d60050160050df0260264d6", + "0x8a02644f0054d60050cc0053000260264d600501c0057ad0260264d6005", + "0x4d60050cf00530f0260050054d60050050050380260d00054d60050d0005", + "0x3502608b0054d600508b0050320260c00054d60050c000501b0260cf005", + "0x4d600544f0052fd02630f0054d600530f0050360264d40054d60054d4005", + "0x7ad0260264d600502600702644f30f4d408b0c00cf0050d001600544f005", + "0x260264d60050160050df0260264d60054d00051010260264d600501c005", + "0x54d60050d30053000260264d600540d0055230260264d60054d2005493", + "0x530f0260050054d60050050050380263680054d600536800508a02601e", + "0x54d600508b0050320260c00054d60050c000501b02636a0054d600536a", + "0x52fd02630f0054d600530f00503602608a0054d600508a00503502608b", + "0x4d600502600702601e30f08a08b0c036a00536801600501e0054d600501e", + "0x540d0055230260264d60050160050df0260264d60054d0005101026026", + "0x3120051010260264d60053090054930260264d60054d20054930260264d6", + "0x2607e0260264d60051c50057ae0260264d60050880053a70260264d6005", + "0x54d600544c00530002644c0054d600502c07a00736502607a0054d6005", + "0x530f0260050054d60050050050380260260054d600502600508a02610a", + "0x54d600500a0050320260c00054d60050c000501b02631b0054d600531b", + "0x52fd02602b0054d600502b00503602608a0054d600508a00503502600a", + "0x4d60050264d002610a02b08a00a0c031b00502601600510a0054d600510a", + "0x70260880057b10890057b008a0057af00a0054d600a0c00051af026026", + "0x4d40054d60050160053e20260160054d600500a0051b00260264d6005026", + "0x4d600540d0053180264d30054d60050264c602640d0054d60050267b2026", + "0xa4d60054d34d440d00700a23a0264d30054d60054d300531802640d005", + "0x8a0260264d600501c0054970260264d60054d000549702601c4d04d14d2", + "0x4d60054d200503502608b0054d600500500530f0261c50054d6005026005", + "0x50260070260267b300502640d02630f0054d60054d1005318026309005", + "0x51b30263140054d600508a0053df0263120054d60050267b40260264d6", + "0x3120054d60053120053180263190054d60050264c60263180054d6005314", + "0x2b31b00a4d600531931831200700a23a0263190054d6005319005318026", + "0x2600508a0260264d60053310054970260264d600502c00549702633102c", + "0x3090054d600531b00503502608b0054d600500500530f0261c50054d6005", + "0x264d60050260070260267b300502640d02630f0054d600502b005318026", + "0x30b0260350054d600501b00530b02603801b0320c04d60050890052d2026", + "0xbc0054d600502609c0260390054d600502609c0260360054d6005038005", + "0x4d60050ba00547c0260ba0054d60050264d30260bb0054d600502609c026", + "0x54a40260c30054d60050c300547d02634b0054d60050267b50260c3005", + "0x4d600534e0050bc0260264d60050260070263530057b634e0054d60070c3", + "0x4d30263580054d600534b03900737e0260390054d6005039005318026026", + "0x54d600500700503502607e0054d600535f00547e02635f0054d6005026", + "0x53180263680054d60050bc0053180261710054d6005358005318026365", + "0x260267b700502640d0260d50054d600507e00547d02636a0054d60050bb", + "0xbc0054d60050bc0053180260264d60053530050bc0260264d6005026007", + "0x53180260390054d60050390053180260d40054d600534b0bc00737e026", + "0xbb0d403900700a23a0260bb0054d60050bb0053180260d40054d60050d4", + "0x4d60050cf00547c0260cf0054d60050264d30260d00d10d20d300a4d6005", + "0x3180261710054d60050d20053180263650054d60050d30050350260ce005", + "0x4d60050ce00547d02636a0054d60050d00053180263680054d60050d1005", + "0x260cc0054d60050cd0054d70260cd0320074d60050320057b80260d5005", + "0x53a40053180263a40054d60053940050f80263940054d60050cc0057b9", + "0x264d60050260070260c40057ba3a70054d60070d50054a40263a40054d6", + "0x50264d30263ae0054d60053a417100737e0260264d60053a70050bc026", + "0x261060054d600536500503502600e0054d60050ca00547e0260ca0054d6", + "0x536a0053180261040054d60053680053180261050054d60053ae005318", + "0x260070260267bb00502640d0261020054d600500e00547d0261030054d6", + "0x261010054d60053a436800737e0260264d60050c40050bc0260264d6005", + "0xfe0ff10000a4d600536a10117136500a23a0261010054d6005101005318", + "0x1000050350260fb0054d60050fc00547c0260fc0054d60050264d30260fd", + "0x1040054d60050fe0053180261050054d60050ff0053180261060054d6005", + "0x10500a7bc0261020054d60050fb00547d0261030054d60050fd005318026", + "0x500500530f0260260054d600502600508a0260fa0054d6005102103104", + "0x260320054d60050320052c10261060054d60051060050350260050054d6", + "0xf80f900a4d60050fa03210600502608a7be0260fa0054d60050fa0057bd", + "0x260264d60050260070260f40057c00f50054d60070f60057bf0260f60f7", + "0xf50057c20260f10054d60050f30057c10260f20f30074d600503500535c", + "0x264d60050ee0050bc0260264d60050f00053100260ee0ef0f00c04d6005", + "0x54a40260264d600502600a02643f4394360ed00a4d60050ef0057c3026", + "0x4d60054480050bc0260264d60050260070261700057c44480054d600743f", + "0x547e0260ec0054d60050264d30264970054d60050f10ed00737e026026", + "0x54d60054970053180260ea0054d60050f70050350260eb0054d60050ec", + "0x547d0260e70054d60054390053180260e80054d60054360053180260e9", + "0x50bc0260264d60050260070260267c500502640d0260e60054d60050eb", + "0x54d60050e50053180260e50054d60050f143600737e0260264d6005170", + "0x4d60050264d30260e10e20e30e400a4d60054390e50ed0f700a23a0260e5", + "0x3180260ea0054d60050e40050350260df0054d60050e000547c0260e0005", + "0x4d60050e10053180260e80054d60050e20053180260e90054d60050e3005", + "0x4a40260de0054d60050f20057c10260e60054d60050df00547d0260e7005", + "0x50dd0050bc0260264d60050260070260dc0057c60dd0054d60070e6005", + "0x47e0260da0054d60050264d30260db0054d60050de0e900737e0260264d6", + "0x4d60050db00531802608d0054d60050ea0050350260d90054d60050da005", + "0x47d0260060054d60050e70053180260d70054d60050e80053180260d8005", + "0xbc0260264d60050260070260267c700502640d0260d60054d60050d9005", + "0x4d60050810053180260810054d60050de0e800737e0260264d60050dc005", + "0x50264d302607d4c94ca09400a4d60050e70810e90ea00a23a026081005", + "0x2608d0054d600509400503502601a0054d60054c800547c0264c80054d6", + "0x507d0053180260d70054d60054c90053180260d80054d60054ca005318", + "0x9b09a0074d600503600535c0260d60054d600501a00547d0260060054d6", + "0x264c60057c809e0054d60070d60054a402609c0054d600509a0057c1026", + "0x54d600509c0d800737e0260264d600509e0050bc0260264d6005026007", + "0x8d0050350264c40054d60054c500547e0264c50054d60050264d30260a0", + "0x4c10054d60050d70053180264c20054d60050a00053180264c30054d6005", + "0x502640d0264bf0054d60054c400547d0264c00054d6005006005318026", + "0x9c0d700737e0260264d60054c60050bc0260264d60050260070260267c9", + "0x50064be0d808d00a23a0264be0054d60054be0053180264be0054d6005", + "0x54d60054bc00547c0264bc0054d60050264d30260ad0ab0aa4bd00a4d6", + "0x53180264c20054d60050aa0053180264c30054d60054bd0050350264bb", + "0x54d60054bb00547d0264c00054d60050ad0053180264c10054d60050ab", + "0x4b80057ca4b90054d60074bf0054a40264ba0054d600509b0057c10264bf", + "0x4d60054ba4c200737e0260264d60054b90050bc0260264d6005026007026", + "0x50350264b50054d60054b600547e0264b60054d60050264d30264b7005", + "0x54d60054c10053180264b30054d60054b70053180264b40054d60054c3", + "0x2640d0264b00054d60054b500547d0264b10054d60054c00053180264b2", + "0x4c100737e0260264d60054b80050bc0260264d60050260070260267cb005", + "0x4c04af4c24c300a23a0264af0054d60054af0053180264af0054d60054ba", + "0x4d60054aa00547c0264aa0054d60050264d30264ab4ac51808400a4d6005", + "0x3180264b30054d60055180053180264b40054d6005084005035026519005", + "0x4d600551900547d0264b10054d60054ab0053180264b20054d60054ac005", + "0x260264d60050260070264a50057cc4a60054d60074b00054a40264b0005", + "0x4d60054a44b300737e0264a40054d600502609e0260264d60054a60050bc", + "0xa4d60054b14b24a24b400a23a0264a20054d60054a20053180264a2005", + "0x350260264d600549f0054970260264d60054a000549702649f4a04a10bf", + "0x267cd00502640d0260c20054d60054a100531802649e0054d60050bf005", + "0x49d0054d600502609e0260264d60054a50050bc0260264d6005026007026", + "0xa23a02649c0054d600549c00531802649c0054d600549d4b200737e026", + "0x4970260264d60054a700549702649a4a74a94a800a4d60054b149c4b34b4", + "0x54d60054a900531802649e0054d60054a80050350260264d600549a005", + "0x50f800530f0261c50054d60050f900508a0260264d60050264d00260c2", + "0x2630f0054d60050c20053180263090054d600549e00503502608b0054d6", + "0x3170260264d60050360053170260264d60050260070260267b300502640d", + "0x54d60050f900508a0260c60054d60050f40054070260264d6005035005", + "0x540b0260f70054d60050f70050350260f80054d60050f800530f0260f9", + "0x50bc0260264d60050260070260c60f70f80f900a0050c60054d60050c6", + "0x261c50054d600502600508a0264990054d600502609c0260264d6005088", + "0x54990053180263090054d600500700503502608b0054d600500500530f", + "0x264980054d60050c800540c0260c80054d600530f00540e02630f0054d6", + "0x530900503502608b0054d600508b00530f0261c50054d60051c500508a", + "0x263e402649830908b1c500a0054980054d600549800540b0263090054d6", + "0x3e40264d30054d60050264a20264d40054d60050261030260880054d6005", + "0x2608b0054d60050264a202601c0054d60050261030264d10054d6005026", + "0x4d30263090054d60050267890260264d60050264d00260264d6005026102", + "0x54d600531200507d0263120054d600530f0054c802630f0054d6005026", + "0x54c90263180054d60050264d30263140054d600531230900778a026312", + "0x4d600531931400778a0263190054d600531900507d0263190054d6005318", + "0x507d02602c0054d600502b0053e302602b0054d60050264d302631b005", + "0x4d600500a0050ea0263310054d600502c31b00778a02602c0054d600502c", + "0x260264d600503800578c0260350380074d600533100578b02601b032007", + "0x500500530f0260260054d600502600508a0260360054d600503500578d", + "0x260c00054d60050c00050360260070054d60050070050320260050054d6", + "0x3908a4d600501b0360c00070050260897900260360054d600503600578e", + "0x4d60050164d40070ff02640d0054d600540d4d30074880260bb01640d0bc", + "0x260264d60050260070260c30057ce0ba0054d60070bb005791026016005", + "0x534e0057cf0260264d600534b00579402634e34b0074d60050ba005793", + "0x51bb0260264d600502600a0260264d60053530054970263583530074d6", + "0x1710057d13650057d007e0054d600a35f00509b02635f3580074d6005358", + "0x35800509a0260264d600507e0050bc0260264d60050260070263680057d2", + "0x50d902636a0054d60050260da0260264d60050880053e10260264d6005", + "0x260d30054d600502608d0260d40054d600502609c0260d50054d600536a", + "0x50d40053180260d50054d60050d50050d70260d30054d60050d30050d8", + "0xcf0d00c07d30d10d20074d60070d40d50d30160bc08a2040260d40054d6", + "0x894d60050320054af0260264d60050264d00260264d60050260070260ce", + "0x4d60050d200530f0263ae0054d600503900508a0260c43a73a43940cc0cd", + "0x10a0264d00054d60050d10050360261c50054d600540d0050320260ca005", + "0x4d600539400544a0261060054d60050cc00544b02600e0054d60050cd005", + "0x10e0261030054d60053a700510d0261040054d60053a400510b026105005", + "0x4d00260264d60050260070260267d400502640d0261020054d60050c4005", + "0x4930260264d600501c0051010260264d60050320053a70260264d6005026", + "0x260264d60054d10053e10260264d600508a0053c80260264d600508b005", + "0x51000053e00261000054d60050ce1010073650261010054d600502607e", + "0x260d00054d60050d000530f0260390054d600503900508a0260ff0054d6", + "0x50ff0053dc0260cf0054d60050cf00503602640d0054d600540d005032", + "0x3650050bc0260264d60050260070260ff0cf40d0d003908a0050ff0054d6", + "0x50260070260267d500502640d0260264d60050880053e10260264d6005", + "0x35800509b0260264d60050880053e10260264d60051710050bc0260264d6", + "0x260264d60050260070260fb0057d80fc0057d70fd0057d60fe0054d600a", + "0x54d60050fa0053180260fa0054d600502609c0260264d60050fe0050bc", + "0x264d60050fd0050bc0260264d60050260070260267d900502640d0260f9", + "0x7d900502640d0260f90054d60050f80053180260f80054d600502609e026", + "0x54d600502634c0260264d60050fc0050bc0260264d6005026007026026", + "0x4d60050260070260267d900502640d0260f90054d60050f70053180260f7", + "0x50f60053180260f60054d600502627c0260264d60050fb0050bc026026", + "0xf50053180260f50054d600502634a0260264d60050264d00260f90054d6", + "0x50f30053180260f30f40074d60050f90f540d0c04800260f50054d6005", + "0x54d60050f10050d90260f10f20074d60050f303900747f0260f30054d6", + "0x50ee0050d80260ee0054d600502608d0260ef0054d600502609c0260f0", + "0x260f40054d60050f40050320260ef0054d60050ef0053180260ee0054d6", + "0x4360ed0074d60070ef0f00ee0160bc08a2040260f20054d60050f200508a", + "0x4971700894d60050320054af0260264d600502600702644843f4390c07da", + "0xca0054d60050ed00530f0263ae0054d60050f200508a0260e90ea0eb0ec", + "0x17000510a0264d00054d60054360050360261c50054d60050f4005032026", + "0x1050054d60050ec00544a0261060054d600549700544b02600e0054d6005", + "0xe900510e0261030054d60050ea00510d0261040054d60050eb00510b026", + "0x260264d600502600a0260e70e80074d600508a0057cf0261020054d6005", + "0x70ff0261c50054d60051c508b0074880260e60e70074d60050e70051bb", + "0xe30057dc0e40057db0e50054d600a0e600509b0264d00054d60054d001c", + "0xe700509a0260264d60050e50050bc0260264d60050260070260e20057dd", + "0x50d90260e10054d60050260da0260264d60054d10053e10260264d6005", + "0xdf0054d60050df0050d80260df0054d600502608d0260e00054d60050e1", + "0xde0074d60070e80e00df4d00ca08a2040260e00054d60050e00050d7026", + "0x4d30260264d60050264d00260264d60050260070260da0db0dc0c07de0dd", + "0x54d60050de00530f02608d0054d60053ae00508a0260d90054d6005026", + "0x57df0260060054d60050dd0050360260d70054d60051c50050320260d8", + "0x264d00260264d60050260070260267e000502640d0260d60054d60050d9", + "0x50840260264d600510500516b0260264d60051060055180260264d6005", + "0x4ac0260264d60051030054ab0260264d60051020054aa0260264d600500e", + "0x54d60050da0810073650260810054d600502607e0260264d6005104005", + "0x530f0263ae0054d60053ae00508a0264ca0054d60050940053e0026094", + "0x54d60050db0050360261c50054d60051c50050320260dc0054d60050dc", + "0x50260070264ca0db1c50dc3ae08a0054ca0054d60054ca0053dc0260db", + "0x502640d0260264d60054d10053e10260264d60050e40050bc0260264d6", + "0x54d10053e10260264d60050e30050bc0260264d60050260070260267e1", + "0x2601a0057e44c80057e307d0057e24c90054d600a0e700509b0260264d6", + "0x2609a0054d600502609c0260264d60054c90050bc0260264d6005026007", + "0x260264d60050260070260267e500502640d02609b0054d600509a005318", + "0x54d600509c00531802609c0054d600502609e0260264d600507d0050bc", + "0x264d60054c80050bc0260264d60050260070260267e500502640d02609b", + "0x7e500502640d02609b0054d600509e00531802609e0054d600502634c026", + "0x54d600502627c0260264d600501a0050bc0260264d6005026007026026", + "0x4d600502634a0260264d60050264d002609b0054d60054c60053180264c6", + "0x4c50074d600509b0a01c50c04800260a00054d60050a00053180260a0005", + "0x264c24c30074d60054c43ae00747f0264c40054d60054c40053180264c4", + "0x4d60054c00050d80264c00054d600502608d0264c10054d60054c20050d9", + "0x2040264c30054d60054c300508a0264c50054d60054c50050320264c0005", + "0x50260070260ab0aa4bd0c07e64be4bf0074d60070e84c14c04d00ca08a", + "0x530f02608d0054d60054c300508a0260ad0054d60050264d30260264d6", + "0x54d60054be0050360260d70054d60054c50050320260d80054d60054bf", + "0x4d600510210310410510600e0890cd0260d60054d60050ad0057df026006", + "0x264ba0054d60054bb0053c40264bb0054d60050d64bc0073c50264bc005", + "0x264d60050260070264ba0060d70d808d08a0054ba0054d60054ba0053dc", + "0x4d600500e0050840260264d600510500516b0260264d6005106005518026", + "0x51040054ac0260264d60051030054ab0260264d60051020054aa026026", + "0x3e00264b80054d60050ab4b90073650264b90054d600502607e0260264d6", + "0x4d60054bd00530f0264c30054d60054c300508a0264b70054d60054b8005", + "0x3dc0260aa0054d60050aa0050360264c50054d60054c50050320264bd005", + "0x260264d60050260070264b70aa4c54bd4c308a0054b70054d60054b7005", + "0x264d600510500516b0260264d60051060055180260264d60050e20050bc", + "0x4d60051030054ab0260264d60051020054aa0260264d600500e005084026", + "0x50e700509a0260264d60050e80054970260264d60051040054ac026026", + "0x502608d0264b50054d600502609c0264b60054d60050263c30260264d6", + "0xc01d50264b20054d60050263c00264b30054d60050263c20264b40054d6", + "0x54b10051d70263ae0054d60053ae00508a0264b10054d60054b44b54b6", + "0x264b20054d60054b20050d80264b30054d60054b30053180264b10054d6", + "0x7e70840054d60074af0051440264af4b00074d60054b24b34b13ae00a1da", + "0x4d60050261db0264ac0054d60050263530260264d6005026007026518005", + "0x264aa0054d60054ab4ac00735f0264ab0054d60054ab0053180264ab005", + "0x4d24d10073bf0260264d60055190050bc0265194d20074d60050840051dd", + "0x264d60054a60051e00264a54a60074d60054d20051e40264d20054d6005", + "0x264a10bf4a20c04d60054a40051e50264a44a50074d60054a50051e2026", + "0x74d60054a20051e60260264d60054a10054590260264d60050bf005497", + "0x31802649e0054d600549f0050f802649f0054d60054a00053c10264a04a2", + "0x54a20053be0260c20054d600549e4aa00735f02649e0054d600549e005", + "0x260ca0054d60050ca00530f0264b00054d60054b000508a02649d0054d6", + "0xca4b000a3bc0260c20054d60050c20050f502649d0054d600549d0051df", + "0x4d60074a90050f30260264d600502600a0264a94a849c0c04d60050c249d", + "0x4990c60074d60054a70050f20260264d600502600702649a0057e84a7005", + "0xc80051e50260c84a50074d60054a50051e20260264d60054990050bc026", + "0x264d60054930054590260264d60054980053bb0264934964980c04d6005", + "0x51e50264900054d60055230c600735f0265230054d6005496005309026", + "0x4d600548d0054970260264d600548e0053bb02648c48d48e0c04d60054a5", + "0x735f02648a0054d600548b0050f802648b0054d600548c0051eb026026", + "0x267e900502640d0264880054d60054890050f50264890054d600548a490", + "0x74d600549a0054b60260264d60054a50051ed0260264d6005026007026", + "0x264d00264880054d60054860050f50260264d60054870054b5026486487", + "0x264840054d60054884850073650264850054d600502607e0260264d6005", + "0x54a800530f02649c0054d600549c00508a0264830054d60054840053e0", + "0x264d00054d60054d00050360261c50054d60051c50050320264a80054d6", + "0x264d60050260070264834d01c54a849c08a0054830054d60054830053dc", + "0x54d60055180053e00260264d60054d10053e10260264d60050264d0026", + "0x50320260ca0054d60050ca00530f0264b00054d60054b000508a026482", + "0x54d60054820053dc0264d00054d60054d00050360261c50054d60051c5", + "0x4d60050320053a70260264d60050260070264824d01c50ca4b008a005482", + "0x508a0053c80260264d600508b0054930260264d600501c005101026026", + "0x4810073650264810054d600502607e0260264d60054d10053e10260264d6", + "0x54d60050f200508a02647f0054d60054800053e00264800054d6005448", + "0x50360260f40054d60050f40050320264390054d600543900530f0260f2", + "0x47f43f0f44390f208a00547f0054d600547f0053dc02643f0054d600543f", + "0x264d60050320053a70260264d60053680050bc0260264d6005026007026", + "0x4d600508a0053c80260264d600508b0054930260264d600501c005101026", + "0x4d60050263c30260264d600535800509a0260264d60054d10053e1026026", + "0x50263c202647c0054d600502608d02647d0054d600502609c02647e005", + "0x4790054d600547c47d47e0c01d502647a0054d60050263c002647b0054d6", + "0x47b0053180264790054d60054790051d70260390054d600503900508a026", + "0x547a47b47903900a1da02647a0054d600547a0050d802647b0054d6005", + "0x4d60050260070264750057ea4760054d60074770051440264774780074d6", + "0x54730053180264730054d60050261db0264740054d6005026353026026", + "0x890074d60054760051dd0264720054d600547347400735f0264730054d6", + "0x51e40260890054d60050890880073bf0260264d60054710050bc026471", + "0x74d600546f0051e20260264d60054700051e002646f4700074d6005089", + "0x260264d600546c00549702646b46c46d0c04d600546e0051e502646e46f", + "0x546a0053c102646a46d0074d600546d0051e60260264d600546b005459", + "0x264680054d60054680053180264680054d60054690050f80264690054d6", + "0x47800508a0264660054d600546d0053be0264670054d600546847200735f", + "0x4660054d60054660051df0260bc0054d60050bc00530f0264780054d6005", + "0x4644650c04d60054674660bc47800a3bc0264670054d60054670050f5026", + "0x70264610057eb4620054d60074630050f30260264d600502600a026463", + "0x264d600545f0050bc02645f4600074d60054620050f20260264d6005026", + "0x2645b45c45d0c04d600545e0051e502645e46f0074d600546f0051e2026", + "0x54d600545c0053090260264d600545b0054590260264d600545d0053bb", + "0x4564574580c04d600546f0051e50264590054d600545a46000735f02645a", + "0x4d60054560051eb0260264d60054570054970260264d60054580053bb026", + "0x264530054d600545445900735f0264540054d60054550050f8026455005", + "0x260264d60050260070260267ec00502640d0264520054d60054530050f5", + "0x54510054b50264504510074d60054610054b60260264d600546f0051ed", + "0x502607e0260264d60050264d00264520054d60054500050f50260264d6", + "0x7a0054d600501e0053e002601e0054d600545244f00736502644f0054d6", + "0x40d0050320264640054d600546400530f0264650054d600546500508a026", + "0x7a0054d600507a0053dc0260160054d600501600503602640d0054d6005", + "0x260264d60050264d00260264d600502600702607a01640d46446508a005", + "0x4d600547800508a02644c0054d60054750053e00260264d60050880053e1", + "0x3602640d0054d600540d0050320260bc0054d60050bc00530f026478005", + "0x1640d0bc47808a00544c0054d600544c0053dc0260160054d6005016005", + "0x4d600501c0051010260264d60050320053a70260264d600502600702644c", + "0x54d10053e10260264d600508a0053c80260264d600508b005493026026", + "0x508a02610a0054d60050c30053e00260264d60050880053e10260264d6", + "0x54d600540d0050320260bc0054d60050bc00530f0260390054d6005039", + "0x3908a00510a0054d600510a0053dc0260160054d600501600503602640d", + "0x57ee08a0054d60880070057ed0260264d60050264d002610a01640d0bc", + "0x50260070264d30057f340d0057f24d40057f10160057f00880057ef089", + "0x735f0264d20054d60054d20053180264d20054d60050267f40260264d6", + "0x4d60054d00053090264d00054d600508a0057f50264d10054d60054d20c0", + "0x2608b0054d60054d10050f50261c50054d600501c00a00735f02601c005", + "0x260264d60050260070260267f600502640d0263090054d60051c50050f5", + "0x530f0c000735f02630f0054d600530f00531802630f0054d60050267f7", + "0x263180054d60053140053090263140054d60050890057f80263120054d6", + "0x3190050f502608b0054d60053120050f50263190054d600531800a00735f", + "0x50267f90260264d60050260070260267f600502640d0263090054d6005", + "0x2b0054d600531b0c000735f02631b0054d600531b00531802631b0054d6", + "0x880057fa0260050054d600500500530f0260260054d600502600508a026", + "0xa0054d600500a0050f502602b0054d600502b0050f50260880054d6005", + "0x2603233102c0c000503233102c0c04d600500a02b08800502608a7fb026", + "0x260264d600502600702601b0054d60050160057fc0260264d6005026007", + "0x50380c000735f0260380054d60050380053180260380054d60050267fd", + "0x260390054d60050360053090260360054d600501b0057fe0260350054d6", + "0xbc0050f502608b0054d60050350050f50260bc0054d600503900a00735f", + "0x4d40057ff0260264d60050260070260267f600502640d0263090054d6005", + "0x8010260264d600502600702602640d0058000260264d6005026007026026", + "0x260ba0054d60050268020260264d60050260070260bb0054d60054d3005", + "0xbb0058030260c30054d60050ba0c000735f0260ba0054d60050ba005318", + "0x3530054d600534e0053b902634e0054d600534b00580402634b0054d6005", + "0x50f502608b0054d60050c30050f50263580054d600535300a00735f026", + "0x4d600535f30908b0c080502635f0054d60050264d30263090054d6005358", + "0x30f0260260054d600502600508a0263650054d600507e00580602607e005", + "0x263650050260c00053650054d60053650058070260050054d6005005005", + "0x7cf0260264d60050264d00260264d600502610202608a0054d60050263e4", + "0x58094d40058080160054d600a08800509b0260880890074d60050c0005", + "0x53e10260264d60050160050bc0260264d60050260070264d300580a40d", + "0x3180264d10054d60050264c60264d20054d60050267b20260264d600508a", + "0x894d200700a23a0264d10054d60054d10053180264d20054d60054d2005", + "0x508b0054970260264d60051c500549702608b1c501c4d000a4d60054d1", + "0x40d02630f0054d600501c0053180263090054d60054d00050350260264d6", + "0x53e10260264d60054d40050bc0260264d600502600702602680b005026", + "0x3180263140054d60050264c60263120054d60050267b40260264d600508a", + "0x8931200700a23a0263140054d60053140053180263120054d6005312005", + "0x502b0054970260264d600531b00549702602b31b31931800a4d6005314", + "0x40d02630f0054d60053190053180263090054d60053180050350260264d6", + "0x53e10260264d600540d0050bc0260264d600502600702602680b005026", + "0x30f0054d60050890053180263090054d60050070050350260264d600508a", + "0x2600508a0263310054d600502c00540c02602c0054d600530f00540e026", + "0x3090054d60053090050350260050054d600500500530f0260260054d6005", + "0x264d600502600702633130900502600a0053310054d600533100540b026", + "0x54d60050263c30260264d60050890054970260264d60054d30050bc026", + "0x4d60050263c20260380054d600502608d02601b0054d600502609c026032", + "0x260390054d600503801b0320c01d50260360054d60050263c0026035005", + "0x50350053180260390054d60050390051d70260260054d600502600508a", + "0x4d600503603503902600a1da0260360054d60050360050d80260350054d6", + "0x264d60050260070260c300580c0ba0054d60070bb0051440260bb0bc007", + "0x4d600534e00531802634e0054d60050261db02634b0054d6005026353026", + "0x35800a0074d60050ba0051dd0263530054d600534e34b00735f02634e005", + "0xa0051e402600a0054d600500a08a0073bf0260264d60053580050bc026", + "0x7e0074d600507e0051e20260264d600535f0051e002607e35f0074d6005", + "0x4590260264d600536800549702636a3681710c04d60053650051e5026365", + "0x4d60050d50053c10260d51710074d60051710051e60260264d600536a005", + "0x35f0260d30054d60050d30053180260d30054d60050d40050f80260d4005", + "0x50bc00508a0260d10054d60051710053be0260d20054d60050d3353007", + "0x260d10054d60050d10051df0260050054d600500500530f0260bc0054d6", + "0xce0cf0d00c04d60050d20d10050bc00a3bc0260d20054d60050d20050f5", + "0x260070260cc00580d0cd0054d60070ce0050f30260264d600502600a026", + "0x260264d60053a40050bc0263a43940074d60050cd0050f20260264d6005", + "0x3bb0260ca3ae0c40c04d60053a70051e50263a707e0074d600507e0051e2", + "0xe0054d60053ae0053090260264d60050ca0054590260264d60050c4005", + "0x261031041050c04d600507e0051e50261060054d600500e39400735f026", + "0x54d60051030051eb0260264d60051040054970260264d60051050053bb", + "0xf50261000054d600510110600735f0261010054d60051020050f8026102", + "0x1ed0260264d600502600702602680e00502640d0260ff0054d6005100005", + "0x4d60050fe0054b50260fd0fe0074d60050cc0054b60260264d600507e005", + "0x4d600502607e0260264d60050264d00260ff0054d60050fd0050f5026026", + "0x260fa0054d60050fb0054070260fb0054d60050ff0fc0073650260fc005", + "0x50070050350260cf0054d60050cf00530f0260d00054d60050d000508a", + "0x260070260fa0070cf0d000a0050fa0054d60050fa00540b0260070054d6", + "0x8a0260f90054d60050c30054070260264d600508a0053e10260264d6005", + "0x4d60050070050350260050054d600500500530f0260bc0054d60050bc005", + "0x502608d0260f90070050bc00a0050f90054d60050f900540b026007005", + "0x264d600700a08a00742602608a0c00074d60050c000538f02600a0054d6", + "0x38f0260160880890c04d60050050058100260264d600502600702602680f", + "0x260c081102640d0c00074d60050c000538f0264d40160074d6005016005", + "0x268130260264d60050260070264d04d10078124d24d30074d600740d4d4", + "0x54d600501c0050d80261c54d20074d60054d200538f02601c0054d6005", + "0x502600702631230f00781430908b0074d600701c1c54d30c015a02601c", + "0x4d200538f0263140054d60050268130260264d60053090054590260264d6", + "0x4d600731431800742602608b0054d600508b00508a0263184d20074d6005", + "0x50268130260264d60050c00054590260264d6005026007026026815026", + "0x74d60073194d208b0c015a0263190054d60053190050d80263190054d6", + "0x260320054d60050268170260264d600502600702633102c00781602b31b", + "0x1b00742602631b0054d600531b00508a02601b02b0074d600502b00538f", + "0x260380054d60050268170260264d60050260070260268180264d6007032", + "0x31b0c015a0260380054d60050380050d802603502b0074d600502b00538f", + "0x54590260264d60050260070260bb0bc0078190390360074d6007038035", + "0x2635334e34b0c081a0c30ba0074d600700703600735e0260264d6005039", + "0x35f0054d60050ba00508a0263580054d600502626b0260264d6005026007", + "0x502640d0263650054d600535800566202607e0054d60050c3005662026", + "0x35300566202635f0054d600534b00508a0260264d600502600702602681b", + "0x261710054d60050268170263650054d600534e00566202607e0054d6005", + "0x35f0c015a0261710054d60051710050d802636802b0074d600502b00538f", + "0x508a0260264d60050260070260d30d400781c0d536a0074d6007171368", + "0x4d60050d536a00781d0260d50054d60050d50050d802636a0054d600536a", + "0x264d60050260070260cf00581f0d00054d60070d100581e0260d10d2007", + "0x70260cd0058220264d60070ce0058210260ce0054d60050d0005820026", + "0x4590260264d600502b0054590260264d60050890058230260264d6005026", + "0x260264d60050880054970260264d600507e00545b0260264d6005016005", + "0x3940054d60050265870260cc0054d60050263530260264d600536500545b", + "0x508a0263a40054d60053940cc00735f0263940054d6005394005318026", + "0x2602682400502640d0260c40054d60053a40050f50263a70054d60050d2", + "0x57c102600e0ca3ae0c04d60050cd3650d20c08250260264d6005026007", + "0x54d60050ca0057c10261050054d600507e0057c10261060054d600500e", + "0x50d80261020160074d600501600538f0261030054d6005026813026104", + "0xfe0ff0078261001010074d60071021033ae0c015a0261030054d6005103", + "0x4d60050fd1060078280260fd0054d60050268270260264d6005026007026", + "0x260fb0054d60051050fc00737e0260fc0054d60050fc0053180260fc005", + "0x50fa0050d80260f91000074d600510000538f0260fa0054d6005026817", + "0x74d60070fa0f91010c015a0260fb0054d60050fb0053180260fa0054d6", + "0x260264d60050f70054590260264d60050260070260f50f60078290f70f8", + "0xf41000f80c015a0260f40054d60050f40050d80260f40054d6005026817", + "0x50f300508a0260264d60050260070260f00f100782a0f20f30074d6007", + "0xef0074d60050f20f300781d0260f20054d60050f20050d80260f30054d6", + "0x8200260264d600502600702643600582b0ed0054d60070ee00581e0260ee", + "0x54d600502682702643f0054d60054390057c10264390054d60050ed005", + "0x3180264970054d60050ef00508a0261700054d600544843f007828026448", + "0x8230260264d600502600702602682c00502640d0260ec0054d6005170005", + "0x260264d60050160054590260264d600502b0054590260264d6005089005", + "0x264d60050880054970260264d60051040054970260264d60050fb005497", + "0xef00508a0260264d60050eb0054b50260ea0eb0074d60054360054b6026", + "0x702602682d00502640d0260e80054d60050ea0050f50260e90054d6005", + "0x4590260264d60050890058230260264d60050f00054590260264d6005026", + "0x260264d60050fb0054970260264d60050160054590260264d600502b005", + "0xe70054d60050263530260264d60051040054970260264d6005088005497", + "0xe60e700735f0260e60054d60050e60053180260e60054d6005026229026", + "0xe80054d60050e50050f50260e90054d60050f100508a0260e50054d6005", + "0x260264d60050f50054590260264d600502600702602682d00502640d026", + "0x1000f600781d0261000054d60051000050d80260f60054d60050f600508a", + "0x50260070260e100582e0e20054d60070e300581e0260e30e40074d6005", + "0x8a0260df0054d60050e00057c10260e00054d60050e20058200260264d6", + "0x50ec0880078280260ec0054d60050df0053180264970054d60050e4005", + "0xdd0054d60050de10400737e0260de0054d60050de0053180260de0054d6", + "0x58300db0dc0074d60070dd49700782f0260dd0054d60050dd005318026", + "0xd90c01d50260d90054d60050db0890078310260264d60050260070260da", + "0x4d600508d0051d70260d80054d60050dc00508a02608d0054d60050160fb", + "0x4d60050890058230260264d600502600702602683200502640d0260d7005", + "0x50fb0054970260264d60050160054590260264d600502b005459026026", + "0xd60053180260d60054d60050265870260060054d60050263530260264d6", + "0x54d60050da00508a0260810054d60050d600600735f0260d60054d6005", + "0x4d600502600702602682400502640d0260c40054d60050810050f50263a7", + "0x50160054590260264d600502b0054590260264d6005089005823026026", + "0x880054970260264d60051040054970260264d60050fb0054970260264d6", + "0x260264d60050940054b50264ca0940074d60050e10054b60260264d6005", + "0x50e90052720260e80054d60054ca0050f50260e90054d60050e400508a", + "0x2600702602682400502640d0260c40054d60050e80058330263a70054d6", + "0x54590260264d60050890058230260264d60050fe0054590260264d6005", + "0x4970260264d60051060054970260264d60050160054590260264d600502b", + "0x260264d60051050054970260264d60051040054970260264d6005088005", + "0x54d600507d00531802607d0054d60050262290264c90054d6005026353", + "0xf50263a70054d60050ff00508a0264c80054d600507d4c900735f02607d", + "0x8230260264d600502600702602682400502640d0260c40054d60054c8005", + "0x260264d60050160054590260264d600502b0054590260264d6005089005", + "0x264d600536500545b0260264d60050880054970260264d600507e00545b", + "0xd200508a0260264d600501a0054b502609a01a0074d60050cf0054b6026", + "0x702602682400502640d0260c40054d600509a0050f50263a70054d6005", + "0x8230260264d600536500545b0260264d60050d30054590260264d6005026", + "0x260264d60050160054590260264d600502b0054590260264d6005089005", + "0x9b0054d60050263530260264d60050880054970260264d600507e00545b", + "0x9c09b00735f02609c0054d600509c00531802609c0054d6005026229026", + "0xc40054d600509e0050f50263a70054d60050d400508a02609e0054d6005", + "0xa00058340260a00054d60050c44c60073650264c60054d600502607e026", + "0x4c50054d60054c50058350263a70054d60053a700508a0264c50054d6005", + "0x735e0260264d60050bb0054590260264d60050260070264c53a7007005", + "0x26b0260264d60050260070264c04c14c20c08364c34c40074d60070070bc", + "0x54d60054c30056620264be0054d60054c400508a0264bf0054d6005026", + "0x4d600502600702602683700502640d0260aa0054d60054bf0056620264bd", + "0x56620264bd0054d60054c00056620264be0054d60054c200508a026026", + "0x74d600502b00538f0264be0054d60054be00508a0260aa0054d60054c1", + "0x4bc0ad0074d60050ab4be00781d0260ab0054d60050ab0050d80260ab02b", + "0x58200260264d60050260070264ba0058384bb0054d60074bc00581e026", + "0x4d60050260070264b80058390264d60074b90058210264b90054d60054bb", + "0x50160054590260264d600502b0054590260264d6005089005823026026", + "0x4bd00545b0260264d60050880054970260264d60050aa00545b0260264d6", + "0x53180264b60054d60050265870264b70054d60050263530260264d6005", + "0x4d60050ad00508a0264b50054d60054b64b700735f0264b60054d60054b6", + "0x502600702602683a00502640d0264b30054d60054b50050f50264b4005", + "0x4d60050aa0057c10264b04b14b20c04d60054b84bd0ad0c08250260264d6", + "0xd802651802b0074d600502b00538f0260840054d60050268170264af005", + "0x4aa00783b4ab4ac0074d60075180844b20c015a0260840054d6005084005", + "0x54ab0050d80264ac0054d60054ac00508a0260264d6005026007026519", + "0x54d60074a500581e0264a54a60074d60054ab4ac00781d0264ab0054d6", + "0x7c10260bf0054d60054a40058200260264d60050260070264a200583c4a4", + "0x4d60054b00057c10264a00054d60054b10057c10264a10054d60050bf005", + "0xd80260c20160074d600501600538f02649e0054d600502681302649f005", + "0x4a800783d49c49d0074d60070c249e4a60c015a02649e0054d600549e005", + "0x4a70053180264a70054d60054a14af0078280260264d60050260070264a9", + "0xc60054d600502681702649a0054d60054a04a700737e0264a70054d6005", + "0x53180260c60054d60050c60050d802649949c0074d600549c00538f026", + "0x49349600783e4980c80074d60070c649949d0c015a02649a0054d600549a", + "0x5230054d60050268170260264d60054980054590260264d6005026007026", + "0x83f48e4900074d600752349c0c80c015a0265230054d60055230050d8026", + "0x50d80264900054d600549000508a0260264d600502600702648c48d007", + "0x748a00581e02648a48b0074d600548e49000781d02648e0054d600548e", + "0x4870054d60054890058200260264d60050260070264880058404890054d6", + "0x4854860078280264850054d60050268270264860054d60054870057c1026", + "0x4820054d60054840053180264830054d600548b00508a0264840054d6005", + "0x260264d60050890058230260264d600502600702602684100502640d026", + "0x264d600549f0054970260264d60050160054590260264d600502b005459", + "0x4d60054880054b60260264d60050880054970260264d600549a005497026", + "0xf502647f0054d600548b00508a0260264d60054810054b5026480481007", + "0x4590260264d600502600702602684200502640d02647e0054d6005480005", + "0x260264d600502b0054590260264d60050890058230260264d600548c005", + "0x264d60050880054970260264d600549f0054970260264d6005016005459", + "0x54d600502622902647d0054d60050263530260264d600549a005497026", + "0x8a02647b0054d600547c47d00735f02647c0054d600547c00531802647c", + "0x2684200502640d02647e0054d600547b0050f502647f0054d600548d005", + "0x54d600549600508a0260264d60054930054590260264d6005026007026", + "0x2647947a0074d600549c49600781d02649c0054d600549c0050d8026496", + "0x4780058200260264d60050260070264770058434780054d600747900581e", + "0x4830054d600547a00508a0264750054d60054760057c10264760054d6005", + "0x53180264740054d60054820880078280264820054d6005475005318026", + "0x4d60054730053180264730054d600547449a00737e0264740054d6005474", + "0x4d60050260070264700058444714720074d600747348300782f026473005", + "0x46e0054d600501649f46f0c01d502646f0054d6005471089007831026026", + "0xd80052720260d70054d600546e0051d70260d80054d600547200508a026", + "0x702602684600502640d02646c0054d60050d700584502646d0054d6005", + "0x4590260264d600502b0054590260264d60050890058230260264d6005026", + "0x2646b0054d60050263530260264d600549f0054970260264d6005016005", + "0x546a46b00735f02646a0054d600546a00531802646a0054d6005026587", + "0x264b30054d60054690050f50264b40054d600547000508a0264690054d6", + "0x4590260264d60050890058230260264d600502600702602683a00502640d", + "0x260264d600549f0054970260264d60050160054590260264d600502b005", + "0x74d60054770054b60260264d60050880054970260264d600549a005497", + "0x50f502647f0054d600547a00508a0260264d60054680054b5026467468", + "0x54d600547e0058330264b40054d600547f00527202647e0054d6005467", + "0x264d60054a90054590260264d600502600702602683a00502640d0264b3", + "0x4d60050160054590260264d600502b0054590260264d6005089005823026", + "0x54af0054970260264d60050880054970260264d600549f005497026026", + "0x50263530260264d60054a00054970260264d60054a10054970260264d6", + "0x35f0264650054d60054650053180264650054d60050262290264660054d6", + "0x54640050f50264b40054d60054a800508a0264640054d6005465466007", + "0x50890058230260264d600502600702602683a00502640d0264b30054d6", + "0x880054970260264d60050160054590260264d600502b0054590260264d6", + "0x545b0260264d60054b100545b0260264d60054af0054970260264d6005", + "0x264d60054630054b50264624630074d60054a20054b60260264d60054b0", + "0x502640d0264b30054d60054620050f50264b40054d60054a600508a026", + "0x50890058230260264d60055190054590260264d600502600702602683a", + "0x4b000545b0260264d60050160054590260264d600502b0054590260264d6", + "0x545b0260264d60054af0054970260264d60050880054970260264d6005", + "0x3180264600054d60050262290264610054d60050263530260264d60054b1", + "0x54aa00508a02645f0054d600546046100735f0264600054d6005460005", + "0x2600702602683a00502640d0264b30054d600545f0050f50264b40054d6", + "0x54590260264d600502b0054590260264d60050890058230260264d6005", + "0x45b0260264d60050880054970260264d60050aa00545b0260264d6005016", + "0x4d600545e0054b502645d45e0074d60054ba0054b60260264d60054bd005", + "0x2607e0264b30054d600545d0050f50264b40054d60050ad00508a026026", + "0x54d600545b00583402645b0054d60054b345c00736502645c0054d6005", + "0x4b400700545a0054d600545a0058350264b40054d60054b400508a02645a", + "0x4570c08474584590074d600700731b00735e0260264d600502600702645a", + "0x545900508a0264540054d600502626b0260264d6005026007026455456", + "0x264510054d60054540056620264520054d60054580056620264530054d6", + "0x264530054d600545700508a0260264d600502600702602684800502640d", + "0x54510057c10264510054d60054560056620264520054d6005455005662", + "0x38f02601e0054d600502681302644f0054d60054520057c10264500054d6", + "0x1e4530c015a02601e0054d600501e0050d802607a0160074d6005016005", + "0x50268170260264d600502600702644a44b00784910a44c0074d600707a", + "0x10b0054d600510b0050d802610d10a0074d600510a00538f02610b0054d6", + "0x4d600502600702644344900784a11010e0074d600710b10d44c0c015a026", + "0x54420050d80264420054d60050268170260264d6005110005459026026", + "0x702611111300784b1141120074d600744210a10e0c015a0264420054d6", + "0x1140054d60051140050d80261120054d600511200508a0260264d6005026", + "0x584c11e0054d600711d00581e02611d11a0074d600511411200781d026", + "0x51200057c10261200054d600511e0058200260264d6005026007026014", + "0x2643d0054d600543e44000782802643e0054d60050268270264400054d6", + "0x84d00502640d02643b0054d600543d00531802643c0054d600511a00508a", + "0x4d600502b0054590260264d60050890058230260264d6005026007026026", + "0x54500054970260264d600544f0054970260264d6005016005459026026", + "0x4b502643843a0074d60050140054b60260264d60050880054970260264d6", + "0x54d60054380050f50261280054d600511a00508a0260264d600543a005", + "0x264d60051110054590260264d600502600702602684e00502640d02612b", + "0x4d60050160054590260264d600502b0054590260264d6005089005823026", + "0x54500054970260264d60050880054970260264d600544f005497026026", + "0x1290053180261290054d600502622902612a0054d60050263530260264d6", + "0x54d600511300508a0261270054d600512912a00735f0261290054d6005", + "0x4d600502600702602684e00502640d02612b0054d60051270050f5026128", + "0x10a0050d80264490054d600544900508a0260264d6005443005459026026", + "0x4d600713300581e0261331260074d600510a44900781d02610a0054d6005", + "0x264350054d60051340058200260264d600502600702643700584f134005", + "0x543400531802643c0054d600512600508a0264340054d60054350057c1", + "0x4330054d60054330053180264330054d600543b08800782802643b0054d6", + "0x782f0264320054d60054320053180264320054d600543345000737e026", + "0x890078310260264d600502600702642f0058504304310074d600743243c", + "0x543100508a02642d0054d600501644f42e0c01d502642e0054d6005430", + "0x42b42c0c04d600546c00581002646c0054d600542d0051d702646d0054d6", + "0x4d30262160054d600502b42b42c0c01d50260264d600542a00545902642a", + "0x4d60050cb0058520260cb0054d60050822160078510260820054d6005026", + "0x70054290054d600542900583502646d0054d600546d00508a026429005", + "0x502b0054590260264d60050890058230260264d600502600702642946d", + "0x50263530260264d600544f0054970260264d60050160054590260264d6", + "0x35f0264260054d60054260053180264260054d60050265870264280054d6", + "0x51420050f50264230054d600542f00508a0261420054d6005426428007", + "0x50890058230260264d600502600702602685300502640d0264220054d6", + "0x44f0054970260264d60050160054590260264d600502b0054590260264d6", + "0x54b60260264d60050880054970260264d60054500054970260264d6005", + "0x54d600512600508a0260264d60051460054b50264211460074d6005437", + "0x58330264230054d600512800527202612b0054d60054210050f5026128", + "0x54590260264d600502600702602685300502640d0264220054d600512b", + "0x4590260264d600502b0054590260264d60050890058230260264d600544a", + "0x260264d60050880054970260264d600544f0054970260264d6005016005", + "0x41c0054d600502622902641f0054d60050263530260264d6005450005497", + "0x508a0265730054d600541c41f00735f02641c0054d600541c005318026", + "0x4190054d600502607e0264220054d60055730050f50264230054d600544b", + "0x508a02614a0054d60054170058340264170054d6005422419007365026", + "0x2600702614a42300700514a0054d600514a0058350264230054d6005423", + "0x58230260264d60050880054970260264d60053310054590260264d6005", + "0x3530260264d60050160054590260264d60050070054970260264d6005089", + "0x14b0054d600514b00531802614b0054d600502622902614c0054d6005026", + "0x4160073650264160054d600502607e0261490054d600514b14c00735f026", + "0x54d600502c00508a0261520054d60054130058340264130054d6005149", + "0x260264d600502600702615202c0070051520054d600515200583502602c", + "0x1510054d60050268170260264d60054d20054590260264d6005016005459", + "0xc015a0261510054d60051510050d80261580c00074d60050c000538f026", + "0x4590260264d600502600702641015a0078544114120074d600715115808b", + "0x15c0054d600515c0050d802615c0054d60050268170260264d6005411005", + "0x4d600502600702640e41400785515e40f0074d600715c0c04120c015a026", + "0x781d02615e0054d600515e0050d802640f0054d600540f00508a026026", + "0x70264070058564080054d600740b00581e02640b40c0074d600515e40f", + "0x5870054d60051630057c10261630054d60054080058200260264d6005026", + "0x40c00508a0261670054d60051655870078280261650054d6005026827026", + "0x702602685700502640d02616b0054d60051670053180264050054d6005", + "0x4970260264d60050070054970260264d60050890058230260264d6005026", + "0x4d600516c0054b502616e16c0074d60054070054b60260264d6005088005", + "0x2640d0264030054d600516e0050f50264040054d600540c00508a026026", + "0x890058230260264d600540e0054590260264d6005026007026026858005", + "0x263530260264d60050070054970260264d60050880054970260264d6005", + "0x264010054d60054010053180264010054d60050262290264020054d6005", + "0x4000050f50264040054d600541400508a0264000054d600540140200735f", + "0x4100054590260264d600502600702602685800502640d0264030054d6005", + "0x260c00054d60050c00050d802615a0054d600515a00508a0260264d6005", + "0x3fe0058591770054d600717500581e0261753ff0074d60050c015a00781d", + "0x4d600517a0057c102617a0054d60051770058200260264d6005026007026", + "0x82802616b0054d600517b0053180264050054d60053ff00508a02617b005", + "0x17d00700737e02617d0054d600517d00531802617d0054d600516b088007", + "0x74d60073fd40500782f0263fd0054d60053fd0053180263fd0054d6005", + "0x17e0054d60053fb0890078310260264d600502600702617f00585a3fb3fc", + "0x3f418617e0c01d50263f40054d600502608d0261860054d600502609c026", + "0x3ef0054d60053f03f10078510263f00054d60050264d30263f10054d6005", + "0x3ed0058350263fc0054d60053fc00508a0263ed0054d60053ef005852026", + "0x4d60050890058230260264d60050260070263ed3fc0070053ed0054d6005", + "0x53eb0053180263eb0054d60050265870263ec0054d6005026353026026", + "0x263e90054d600502607e0263ea0054d60053eb3ec00735f0263eb0054d6", + "0x17f00508a02618f0054d600518d00583402618d0054d60053ea3e9007365", + "0x502600702618f17f00700518f0054d600518f00583502617f0054d6005", + "0x880054970260264d60050070054970260264d60050890058230260264d6", + "0x260264d60053e80054b50263e73e80074d60053fe0054b60260264d6005", + "0x4d600502607e0264030054d60053e70050f50264040054d60053ff00508a", + "0x263e40054d60053e50058340263e50054d60054033e60073650263e6005", + "0x263e44040070053e40054d60053e40058350264040054d600540400508a", + "0x260264d60054d20054590260264d60053120054590260264d6005026007", + "0x530f00508a0261960160074d600501600538f0261ad0054d600502608d", + "0x260264d600502600702602685b0264d60071ad19600742602630f0054d6", + "0x51980050d80261990c00074d60050c000538f0261980054d6005026817", + "0x70261a619d00785c19c1a50074d600719819930f0c015a0261980054d6", + "0x38f02619f0054d60050268170260264d600519c0054590260264d6005026", + "0x1a21a50c015a02619f0054d600519f0050d80261a20c00074d60050c0005", + "0x1a300508a0260264d60050260070261a81ae00785d1a71a30074d600719f", + "0x74d60051a71a300781d0261a70054d60051a70050d80261a30054d6005", + "0x260264d60050260070263e200585e1b00054d60071af00581e0261af1aa", + "0x4d60050268270263df0054d60053e30057c10263e30054d60051b0005820", + "0x263de0054d60051aa00508a0261b50054d60051b33df0078280261b3005", + "0x260264d600502600702602685f00502640d0263dd0054d60051b5005318", + "0x264d60050070054970260264d60050890058230260264d6005088005497", + "0x4d60053e20054b60260264d60050160054590260264d60050c0005459026", + "0xf50263dc0054d60051aa00508a0260264d60053e10054b50263e03e1007", + "0x4590260264d600502600702602686000502640d0263db0054d60053e0005", + "0x260264d60050160054590260264d60050880054970260264d60051a8005", + "0x264d60050c00054590260264d60050070054970260264d6005089005823", + "0x4d60051bb0053180261bb0054d60050262290263d90054d6005026353026", + "0x263dc0054d60051ae00508a0261bd0054d60051bb3d900735f0261bb005", + "0x260264d600502600702602686000502640d0263db0054d60051bd0050f5", + "0x4d60050c000538f02619d0054d600519d00508a0260264d60051a6005459", + "0x1c00074d60053d819d00781d0263d80054d60053d80050d80263d80c0007", + "0x8200260264d60050260070263d20058613d50054d60073d600581e0263d6", + "0x4d60051c000508a0261c40054d60055c90057c10265c90054d60053d5005", + "0x3cf0074d60070c00163de0c08110263dd0054d60051c40053180263de005", + "0x3ca0054d60053dd0880078280260264d60050260070263cb3cd0078623ce", + "0xc01d50263c90054d60053ca00700737e0263ca0054d60053ca005318026", + "0x53c73c80078510263c70054d60050264d30263c80054d60053ce3c9089", + "0x263cf0054d60053cf00508a0262550054d60052560058520262560054d6", + "0x54590260264d60050260070262553cf0070052550054d6005255005835", + "0x8230260264d60053dd0054970260264d60050880054970260264d60053cb", + "0x261ce0054d60050263530260264d60050070054970260264d6005089005", + "0x51d01ce00735f0261d00054d60051d00053180261d00054d6005026863", + "0x263c30054d60053c53c40073650263c40054d600502607e0263c50054d6", + "0x53c20058350263cd0054d60053cd00508a0263c20054d60053c3005834", + "0x264d60050880054970260264d60050260070263c23cd0070053c20054d6", + "0x4d60050c00054590260264d60050070054970260264d6005089005823026", + "0x54b50261d53c00074d60053d20054b60260264d6005016005459026026", + "0x3db0054d60051d50050f50263dc0054d60051c000508a0260264d60053c0", + "0x1da0058340261da0054d60053db1d70073650261d70054d600502607e026", + "0x1440054d60051440058350263dc0054d60053dc00508a0261440054d6005", + "0x54590260264d60050880054970260264d60050260070261443dc007005", + "0x54d60050264d30261db0054d60050c00070890c01d50260264d6005016", + "0x8a0261e40054d60053bf0058520263bf0054d60051dd1db0078510261dd", + "0x70261e430f0070051e40054d60051e400583502630f0054d600530f005", + "0x8230260264d60050880054970260264d60054d00054590260264d6005026", + "0x260264d60050160054590260264d60050070054970260264d6005089005", + "0x1e20054d60050268630261e00054d60050263530260264d60050c0005459", + "0x2607e0261e50054d60051e21e000735f0261e20054d60051e2005318026", + "0x54d60053c10058340263c10054d60051e51e60073650261e60054d6005", + "0x4d10070053be0054d60053be0058350264d10054d60054d100508a0263be", + "0x4d60050070054970260264d60050c00054590260264d60050260070263be", + "0x58520263bc0054d60051df0050078510261df0054d60050264d3026026", + "0x54d60053bb0058350260260054d600502600508a0263bb0054d60053bc", + "0xa0074d60070050260070050260264d60050264d00263bb0260070053bb", + "0x260160054d60050070054de0260264d600502600702608808900786408a", + "0x74d600701600586502600a0054d600500a00508a0260264d600502600a", + "0x264d20054d600540d0058670260264d60050260070264d300586640d4d4", + "0x86a00502640d0264d00054d60054d20058690264d10054d60054d4005868", + "0x4d600501c00586b02601c0054d60050264d30260264d6005026007026026", + "0x86c0264d00054d60051c50058690264d10054d60054d30058680261c5005", + "0x4d60050264d00260264d600502600702630900586d08b0054d60074d0005", + "0x58700263120054d600530f00586f02630f0054d600508b00586e026026", + "0x4d60053140c000735f0263140054d60053140053180263140054d6005312", + "0x30f02600a0054d600500a00508a0263190054d60054d10053be026318005", + "0x4d60053180050f50263190054d60053190051df02608a0054d600508a005", + "0x2c02b31b0c000502c02b31b0c04d600531831908a00a00a3bc026318005", + "0x260264d60053090050bc0260264d60050264d00260264d6005026007026", + "0x4d60053310c000742f0263310054d60050264d30260264d60054d10053bb", + "0x30f02600a0054d600500a00508a02601b0054d600503200542e026032005", + "0x2601b08a00a0c000501b0054d600501b00543002608a0054d600508a005", + "0x260264d60050070058710260264d60050c00053ae0260264d6005026007", + "0x54d60050350053180260350054d60050261060260380054d6005026353", + "0x73650260390054d600502607e0260360054d600503503800735f026035", + "0x4d600508900508a0260bb0054d60050bc0054310260bc0054d6005036039", + "0xc00050bb0054d60050bb0054300260880054d600508800530f026089005", + "0x260c00054d60050050058720260070054d60050260058720260bb088089", + "0x260264d600502600702608900587408a00587300a0054d60c00070053a6", + "0x4d40058760160058750880054d60c00c00053a60260264d600500a0050bc", + "0x40d0054d60050264d30260264d60050880050bc0260264d6005026007026", + "0x264d30050054d30054d60054d300547d0264d30054d600540d00547e026", + "0x264d20054d60050264d30260264d60050160050bc0260264d6005026007", + "0x70264d10050054d10054d60054d100547d0264d10054d60054d200547c", + "0x47c0264d00054d60050264d30260264d60054d40054970260264d6005026", + "0x2600702601c00500501c0054d600501c00547d02601c0054d60054d0005", + "0x58771c50054d60c00c00053a60260264d600508a0050bc0260264d6005", + "0x264d30260264d60051c50050bc0260264d600502600702630900587808b", + "0x3120054d600531200547d0263120054d600530f00547c02630f0054d6005", + "0x50264d30260264d600508b0050bc0260264d6005026007026312005005", + "0x53180054d600531800547d0263180054d600531400547e0263140054d6", + "0x4d60050264d30260264d60053090054970260264d6005026007026318005", + "0x500531b0054d600531b00547d02631b0054d600531900547c026319005", + "0x587a02c00587902b0054d60c00c00053a60260264d600502600702631b", + "0x4d60050890054970260264d600502b0050bc0260264d6005026007026331", + "0x1b00547d02601b0054d600503200547c0260320054d60050264d3026026", + "0x264d600502c0050bc0260264d600502600702601b00500501b0054d6005", + "0x4d600503800547c0260380054d60050264d30260264d6005089005497026", + "0x260264d60050260070260350050050350054d600503500547d026035005", + "0x390360074bb0260390054d60053310053090260360054d6005089005309", + "0x87b0264d60070bc0050810260bc0054d60050bc0053180260bc0054d6005", + "0x50ba00547e0260ba0054d60050264d30260264d60050260070260bb005", + "0x264d60050260070260c30050050c30054d60050c300547d0260c30054d6", + "0x4d600534b00547c02634b0054d60050264d30260264d60050bb0054ca026", + "0x8a0054d600502638902634e00500534e0054d600534e00547d02634e005", + "0x890054d60050c00053810260264d60050264d00260264d6005026102026", + "0x264d20054d60050263530264d340d4d401608808a4d6005089005253026", + "0x50070050350260050054d600500500530f0260260054d600502600508a", + "0x264d20054d60054d20050f50264d30054d60054d300544f0260070054d6", + "0x4d60071c500587d0261c501c4d04d100a4d60054d24d300700502608a87c", + "0x87f02630f0054d60050263530260264d600502600702630900587e08b005", + "0x4d600531230f00735f0263120054d60053120053180263120054d6005026", + "0x263190054d600531831400735f0263180054d60050880054bc026314005", + "0x31b00735f02602b0054d60054d400588002631b0054d600501631900735f", + "0x4d600533102c00735f0263310054d600540d00588002602c0054d600502b", + "0x2603503801b0c04d600508b0058810260320054d600502617102600a005", + "0x74d60050380050c40260264d60050350050bc0260264d600501b005120", + "0x502609c0260bc0054d600502609c0260264d60050360053ae026039036", + "0xc30054d60050ba0bb0bc0c03760260ba0054d600502609c0260bb0054d6", + "0x4d000530f0264d10054d60054d100508a02634b0054d600503900508b026", + "0x320054d600503200536802601c0054d600501c0050350264d00054d6005", + "0x8a00737702634b0054d600534b0053120260c30054d60050c3005375026", + "0x35835334e00a4d600534b0c303201c4d04d108937402600a0054d600500a", + "0x24a0260264d600502600702636500588207e0054d600735f0051be02635f", + "0x536800a00735f0260264d60051710051040263681710074d600507e005", + "0x260d30d40074d600536a0050c40260d50054d600502617102636a0054d6", + "0xd10054d600502609c0260d20054d600502609c0260264d60050d40053ae", + "0x508b0260cf0054d60050d00d10d20c03760260d00054d600502609c026", + "0x54d600535300530f02634e0054d600534e00508a0260ce0054d60050d3", + "0x53750260d50054d60050d50053680263580054d6005358005035026353", + "0xd535835334e0893740260ce0054d60050ce0053120260cf0054d60050cf", + "0xc40058833a70054d60073a40051be0263a43940cc0cd00a4d60050ce0cf", + "0x53ae0051040260ca3ae0074d60053a700524a0260264d6005026007026", + "0x8a0261060054d600500e00540c02600e0054d60050ca00540e0260264d6", + "0x4d60053940050350260cc0054d60050cc00530f0260cd0054d60050cd005", + "0x50260070261063940cc0cd00a0051060054d600510600540b026394005", + "0x30f0260cd0054d60050cd00508a0261050054d60050c40054070260264d6", + "0x4d600510500540b0263940054d60053940050350260cc0054d60050cc005", + "0x4d600500a0053ae0260264d60050260070261053940cc0cd00a005105005", + "0x530f02634e0054d600534e00508a0261040054d6005365005407026026", + "0x54d600510400540b0263580054d60053580050350263530054d6005353", + "0x264d60050880050ad0260264d600502600702610435835334e00a005104", + "0x4d60054d400539a0260264d600540d00539a0260264d600508a005385026", + "0x4d100508a0261030054d60053090054070260264d6005016005497026026", + "0x1c0054d600501c0050350264d00054d60054d000530f0264d10054d6005", + "0x264d60050264d002610301c4d04d100a0051030054d600510300540b026", + "0x4d600508a00531802608a0054d600502688402600a0054d6005026353026", + "0x880c00074d60050c00058850260890054d600508a00a00735f02608a005", + "0x4970260264d60054d40054970264d340d4d401600a4d6005088005886026", + "0x4d20054d60050160053090260264d60054d30054970260264d600540d005", + "0x8860264d00c00074d60050c00058850264d10054d60054d208900735f026", + "0x8b0054970260264d600501c00549702630908b1c501c00a4d60054d0005", + "0x35f02630f0054d60051c50053090260264d60053090054970260264d6005", + "0x3140058860263140c00074d60050c00058850263120054d600530f4d1007", + "0x4d60053190054970260264d600531800549702602b31b31931800a4d6005", + "0x31200735f02602c0054d600531b0053090260264d600502b005497026026", + "0x3200549702603503801b03200a4d60050c00058860263310054d600502c", + "0x53090260264d60050380054970260264d600501b0054970260264d6005", + "0x54d60050261710260390054d600503633100735f0260360054d6005035", + "0x2609c0260264d60050bb0053ae0260ba0bb0074d60050390050c40260bc", + "0x37602634e0054d600502609c02634b0054d600502609c0260c30054d6005", + "0x2600508a0263580054d60050ba00508b0263530054d600534e34b0c30c0", + "0x70054d60050070050350260050054d600500500530f0260260054d6005", + "0x3580053120263530054d60053530053750260bc0054d60050bc005368026", + "0x17136507e35f00a4d60053583530bc0070050260893740263580054d6005", + "0x524a0260264d600502600702636a0058873680054d60071710051be026", + "0x54d60050d400540e0260264d60050d50051040260d40d50074d6005368", + "0x530f02635f0054d600535f00508a0260d20054d60050d300540c0260d3", + "0x54d60050d200540b0263650054d600536500503502607e0054d600507e", + "0x54d600536a0054070260264d60050260070260d236507e35f00a0050d2", + "0x503502607e0054d600507e00530f02635f0054d600535f00508a0260d1", + "0x260d136507e35f00a0050d10054d60050d100540b0263650054d6005365", + "0x264d40160078880880890074d60070050260070050260264d60050264d0", + "0x508a0050c00264d24d340d0c04d600500a00537f0260264d6005026007", + "0x50890260890054d600508900508a0260264d600502600a0264d10054d6", + "0x501c0050880260264d60050260070261c500588901c4d00074d60074d1", + "0x2630f0054d600508b0054d40263090054d60054d000501602608b0054d6", + "0x4d20263120054d60050264d30260264d600502600702602688a00502640d", + "0x4d60053140054d40263090054d60051c50050160263140054d6005312005", + "0x260264d600502600702631900588b3180054d600730f0054d102630f005", + "0x502b00531802602b0054d600531b00530902631b0054d600531800501c", + "0x4d600502600702603200588c33102c0074d600730900508902602b0054d6", + "0x54d40260380054d600502c00501602601b0054d6005331005088026026", + "0x264d30260264d600502600702602688d00502640d0260350054d600501b", + "0x380054d60050320050160260390054d60050360054d20260360054d6005", + "0x350054d10260bc0054d600503800508b0260350054d60050390054d4026", + "0x260264d60050264d00260264d60050260070260ba00588e0bb0054d6007", + "0x2b40d00737e02634b0054d60050c30053090260c30054d60050bb00501c", + "0x54d600534b4d300737e02634b0054d600534b00531802634e0054d6005", + "0xa23a0263530054d600535300531802634e0054d600534e005318026353", + "0x1710c00074d60050c000588f02636507e35f35800a4d60054d235334e007", + "0x7e00531802635f0054d600535f0053180263580054d6005358005035026", + "0x4d60071710880890c036a0263650054d600536500531802607e0054d6005", + "0x536507e35f0c03760260264d60050260070260d40d500789036a368007", + "0x2636a0054d600536a00530f0263680054d600536800508a0260d30054d6", + "0x50d30053750260c00054d60050c00053680263580054d6005358005035", + "0xbc0d30c035836a3680893740260bc0054d60050bc0053120260d30054d6", + "0x260264d60050260070260cf0d00d10d200a0050cf0d00d10d200a4d6005", + "0x264d60050c00058910260264d600535f0054970260264d60050bc005104", + "0x54d60050263530260264d60053650054970260264d600507e005497026", + "0xce00735f0260cd0054d60050cd0053180260cd0054d60050261060260ce", + "0x54d60050cc3940073650263940054d600502607e0260cc0054d60050cd", + "0x530f0260d50054d60050d500508a0263a70054d60053a40058920263a4", + "0x54d60053a70058930263580054d60053580050350260d40054d60050d4", + "0x260264d60050264d00260264d60050260070263a73580d40d500a0053a7", + "0x4d600502b40d00737e0260264d60050c00058910260264d60050ba0050bc", + "0x3180260ca0054d60053ae4d300737e0263ae0054d600502609e0260c4005", + "0xca0c400700a23a0260ca0054d60050ca0053180260c40054d60050c4005", + "0x51040054970260264d600510500549702610410510600e00a4d60054d2", + "0x261020054d60051030058950261030054d60051060bc0078940260264d6", + "0x500e0050350260880054d600508800530f0260890054d600508900508a", + "0x2600702610200e08808900a0051020054d600510200589302600e0054d6", + "0xc00058910260264d60053190050bc0260264d60050264d00260264d6005", + "0x261000054d600510140d00737e0261010054d600502609e0260264d6005", + "0xfd0fe0ff00a4d60054d24d310000700a23a0261000054d6005100005318", + "0x530900508b0260264d60050fc0054970260264d60050fd0054970260fc", + "0xf90054d60050fa0058950260fa0054d60050fe0fb0078940260fb0054d6", + "0xff0050350260880054d600508800530f0260890054d600508900508a026", + "0x70260f90ff08808900a0050f90054d60050f90058930260ff0054d6005", + "0x8960260264d60050c00058910260264d600508a0051040260264d6005026", + "0x260f70054d60050261060260f80054d60050263530260264d600500a005", + "0x502607e0260f60054d60050f70f800735f0260f70054d60050f7005318", + "0xf30054d60050f40058920260f40054d60050f60f50073650260f50054d6", + "0x70050350264d40054d60054d400530f0260160054d600501600508a026", + "0x4d00260f30074d401600a0050f30054d60050f30058930260070054d6005", + "0x702608808900789708a00a0074d60070050260070050260264d6005026", + "0x8a0260264d600502600a0260160054d600500700529e0260264d6005026", + "0x70264d300589840d4d40074d600701600533402600a0054d600500a005", + "0x4d10054d60054d400533b0264d20054d600540d00533c0260264d6005026", + "0x264d600502600702602689900502640d0264d00054d60054d20052a0026", + "0x54d300533b0261c50054d600501c00533602601c0054d60050264d3026", + "0x2608b0054d60054d10054500264d00054d60051c50052a00264d10054d6", + "0x3090053390260264d600502600702630f00589a3090054d60074d00052a2", + "0x3120074d600531200589b0263120054d60053120054050263120054d6005", + "0x1040260264d60053180050ad02631b3193180c04d60053140052a4026314", + "0x2c0054d600502616502602b0054d60053190053090260264d600531b005", + "0x50810263310054d60053310053180263310054d600502c02b0074bb026", + "0x264d600531200589d0260264d600502600702603200589c0264d6007331", + "0x260264d60050320054ca0260264d600502600702602689e00502640d026", + "0x350051040260264d600503800549702603503801b0c04d60053120052a4", + "0x260390054d60050360054bc0260360054d600501b0053370260264d6005", + "0x390074bb0260bb0054d60050bc0054bc0260bc0c00074d60050c0005252", + "0x264d60070ba0050810260ba0054d60050ba0053180260ba0054d60050bb", + "0x50c00050ad0260264d60050264d00260264d60050260070260c300589f", + "0x50268a002634b0054d60050263530260264d600508b0051200260264d6", + "0x3530054d600534e34b00735f02634e0054d600534e00531802634e0054d6", + "0x35f0058a102635f0054d60053533580073650263580054d600502607e026", + "0x8a0054d600508a00530f02600a0054d600500a00508a02607e0054d6005", + "0x260264d600502600702607e08a00a0c000507e0054d600507e0058a2026", + "0xa0054d600500a00508a0260264d60050264d00260264d60050c30054ca", + "0xc000511002608b0054d600508b00544f02608a0054d600508a00530f026", + "0x3650c00053681713650c04d60050c008b08a00a00a2860260c00054d6005", + "0x4d600530f0050bc0260264d60050264d00260264d6005026007026368171", + "0x36a08b0078a302636a0054d60050264d30260264d60050c00050ad026026", + "0xa0054d600500a00508a0260d40054d60050d50058a40260d50054d6005", + "0x8a00a0c00050d40054d60050d40058a202608a0054d600508a00530f026", + "0x4d60050070051200260264d60050c00050ad0260264d60050260070260d4", + "0x50d20053180260d20054d60050261060260d30054d6005026353026026", + "0x260d00054d600502607e0260d10054d60050d20d300735f0260d20054d6", + "0x8900508a0260ce0054d60050cf0058a10260cf0054d60050d10d0007365", + "0xce0054d60050ce0058a20260880054d600508800530f0260890054d6005", + "0x260890054d60050268a502600a0054d60050268a50260ce0880890c0005", + "0x260264d600502610202640d0054d60050268a60260160054d600502649f", + "0x54d60050070053120260260054d600502600508a0260264d60050264d0", + "0x4d40054d60074d10058a80264d14d24d30c04d60050070260078a7026007", + "0x53120264d30054d60054d300508a0260264d60050260070264d00058a9", + "0x4d440d0078aa0261c501c0074d60054d24d30074a90264d20054d60054d2", + "0x4d60050260070263090058ab08b0054d60071c500549a0264d40054d6005", + "0x58ac0880054d600731200549902631230f0074d600508b0050c6026026", + "0x500500530f02601c0054d600501c00508a0260264d6005026007026314", + "0x880054d60050880160070c802630f0054d600530f0053120260050054d6", + "0x2b0054d600731b0050e202631b3193180c04d600530f00501c0c00e3026", + "0xe00260323310074d600502b0050e10260264d600502600702602c0058ad", + "0x531800508a0260264d600502600702601b0058ae0c00054d6007032005", + "0x263310054d60053310053120263190054d600531900530f0263180054d6", + "0x360350380c04d60053313193180c00e30260c00054d60050c000a0078af", + "0x50e10260264d60050260070260bc0058b00390054d60070360050e2026", + "0x260070260c30058b108a0054d60070ba0050e00260ba0bb0074d6005039", + "0x78af0260264d600502600a02634b0054d60050bb0050c00260264d6005", + "0x70263580058b235334e0074d600734b00508902608a0054d600508a089", + "0x7e0054d600534e00501602635f0054d60053530050880260264d6005026", + "0x264d60050260070260268b300502640d0263650054d600535f0054d4026", + "0x53580050160263680054d60051710054d20261710054d60050264d3026", + "0x8b436a0054d60073650054d10263650054d60053680054d402607e0054d6", + "0x4d600536a00501c0260264d60050264d00260264d60050260070260d5005", + "0x53090260d20054d600507e00508b0260d30054d60050261110260d4005", + "0x54d600503500530f0260380054d600503800508a0260d10054d60050d4", + "0x53180260d30054d60050d300511a0260d20054d60050d2005312026035", + "0x260ce0cf0d00c04d60050d10d30d203503808a8b50260d10054d60050d1", + "0xcd0054e00260264d60050260070260cc0058b70cd0054d60070ce0058b6", + "0x50260070260c40058b93a70054d60073a40058b80263a43940074d6005", + "0xf70260264d60053ae0050fb0260ca3ae0074d60053a70050fc0260264d6", + "0x4d60053940050c00261060054d600500e0058ba02600e0054d60050ca005", + "0x160261030054d60050cf00530f0261040054d60050d000508a026105005", + "0x268bc00502640d0261010054d60051060058bb0261020054d6005105005", + "0x4d60053940050c00261000054d60050c40058bd0260264d6005026007026", + "0x160261030054d60050cf00530f0261040054d60050d000508a0260ff005", + "0x268bc00502640d0261010054d60051000058bb0261020054d60050ff005", + "0x264d60054d40058be0260264d60050880051040260264d6005026007026", + "0x4d60050cc0058bf0260264d60050c00050df0260264d600508a0050df026", + "0x8c00260cf0054d60050cf00530f0260d00054d60050d000508a0260fe005", + "0x264d00260264d60050260070260fe0cf0d00c00050fe0054d60050fe005", + "0x58bd0260fd0054d60050264d30260264d60050d50050bc0260264d6005", + "0x54d600503500530f0261040054d600503800508a0260fc0054d60050fd", + "0x508b0261010054d60050fc0058bb0261020054d600507e005016026103", + "0x50260070260f90058c20fa0054d60071010058c10260fb0054d6005102", + "0x4d60050f80058c40260f80054d60050fa08a0c00884d408a8c30260264d6", + "0x260f50054d60050f60058c50260f60054d60050f70fb0074df0260f7005", + "0x50f50058c00261030054d600510300530f0261040054d600510400508a", + "0x4d60054d40058be0260264d60050260070260f51031040c00050f50054d6", + "0x50880051040260264d60050c00050df0260264d600508a0050df026026", + "0x260f30054d60050f40fb0074df0260f40054d60050f90058c60260264d6", + "0x510300530f0261040054d600510400508a0260f20054d60050f30058c5", + "0x50260070260f21031040c00050f20054d60050f20058c00261030054d6", + "0x4d40058be0260264d60050880051040260264d60050c00050df0260264d6", + "0x4df0260f10054d60050c30058c60260264d60050890058c70260264d6005", + "0x503800508a0260ef0054d60050f00058c50260f00054d60050f10bb007", + "0x50ef0054d60050ef0058c00260350054d600503500530f0260380054d6", + "0x58c70260264d60050c00050df0260264d60050260070260ef0350380c0", + "0x8bf0260264d60054d40058be0260264d60050880051040260264d6005089", + "0x4d600503500530f0260380054d600503800508a0260ee0054d60050bc005", + "0x4d60050260070260ee0350380c00050ee0054d60050ee0058c0026035005", + "0x54d40058be0260264d60050880051040260264d60050890058c7026026", + "0x74df0260ed0054d600501b0058c60260264d600500a0058c70260264d6", + "0x4d600531800508a0264390054d60054360058c50264360054d60050ed331", + "0xc00054390054d60054390058c00263190054d600531900530f026318005", + "0x880051040260264d60050890058c70260264d6005026007026439319318", + "0x58bf0260264d600500a0058c70260264d60054d40058be0260264d6005", + "0x54d600531900530f0263180054d600531800508a02643f0054d600502c", + "0x264d600502600702643f3193180c000543f0054d600543f0058c0026319", + "0x4d60054d40058be0260264d60050890058c70260264d600500a0058c7026", + "0x30f0074df0264480054d60053140058c60260264d6005016005483026026", + "0x54d600501c00508a0264970054d60051700058c50261700054d6005448", + "0x1c0c00054970054d60054970058c00260050054d600500500530f02601c", + "0x50890058c70260264d600500a0058c70260264d6005026007026497005", + "0x3090058bf0260264d60050160054830260264d60054d40058be0260264d6", + "0x50054d600500500530f02601c0054d600501c00508a0260ec0054d6005", + "0x260264d60050260070260ec00501c0c00050ec0054d60050ec0058c0026", + "0x264d60050160054830260264d60050890058c70260264d600500a0058c7", + "0xeb4d20074df0260eb0054d60054d00058c60260264d600540d0058c8026", + "0x4d30054d60054d300508a0260e90054d60050ea0058c50260ea0054d6005", + "0x54d30c00050e90054d60050e90058c00260050054d600500500530f026", + "0x4d60050264a20264d00054d60050264a00264d20054d60050261030260e9", + "0x50264a10263120054d60050264a00263090054d60050260bf0261c5005", + "0x268a502602c0054d60050268c902631b0054d60050261030263180054d6", + "0x8a60260360054d60050260bf0260380054d60050260f10260320054d6005", + "0x2634b0054d60050260f10260ba0054d60050260f10260bc0054d6005026", + "0x3650054d600502610302635f0054d60050264a20263530054d60050268ca", + "0x54d60050268ca0260d50054d60050261030263680054d60050264a2026", + "0x4d60050261020260cf0054d60050260bf0260d10054d60050264a00260d3", + "0x263a43940cc0cd0ce08a4d60050160058cb0260264d60050264d0026026", + "0xc40050f90260c40054d60053a70051280263a73a40074d60053a40058cc", + "0x54d60050ca00529e0260ca4d40074d60054d40052600263ae0054d6005", + "0x50d80263ae0054d60053ae0050d80261060054d600500e0058cd02600e", + "0x4d60050260070260268ce0264d60071063ae0074260261060054d6005106", + "0x50ce0058be0260264d60053120054980260264d6005365005101026026", + "0x3940050df0260264d60053a400542c0260264d60050d30058cf0260264d6", + "0x51010260264d60050cd0051040260264d60050cc0050df0260264d6005", + "0x4960260264d600502c0058d00260264d600531b0051010260264d60054d2", + "0x260264d600540d0054970260264d60053090054960260264d6005036005", + "0x264d60053180055230260264d60054d00054980260264d60054d4005120", + "0x4d60050380050e50260264d60050320058c70260264d60050bc0058c8026", + "0x50cf0054960260264d60050d10054980260264d60051c5005493026026", + "0xba0050e50260264d60050d50051010260264d60053680054930260264d6", + "0x58cf0260264d600534b0050e50260264d600535f0054930260264d6005", + "0x261040054d60051050058d20261050054d60050268d10260264d6005353", + "0x2600508a0261020054d60051030058d40261030054d60051040880078d3", + "0x70054d600500700530f0260050054d60050050050380260260054d6005", + "0x8a00503502600a0054d600500a0050320260c00054d60050c000501b026", + "0x1020054d60051020058d50260890054d600508900503602608a0054d6005", + "0x70074c10260264d600502600702610208908a00a0c0007005026016005", + "0x4c00260264d60050260070260fc0fd0fe0c08d60ff1001010c04d6007089", + "0x4d60050fb0054bd0260fb0054d60050ff0054bf0260ff0054d60050ff005", + "0x264d60050f80050ad0260264d60050f90050ab0260f60f70f80f90fa08a", + "0x4d60050fa0053720260264d60050f60054970260264d60050f70050ad026", + "0xf20f30f40c04d60050f50053710260f50054d60050fa0052510260fa005", + "0x4d60050ce0058d70260264d60050f20050ad0260264d60050f400539a026", + "0x4d60050ef0054970260ed0ee0ef0f000a4d60050f10054dd0260f10ce007", + "0x50f300536f0260264d60050ed0054970260264d60050ee005497026026", + "0x261000054d60051000050360261010054d600510100530f0260f30054d6", + "0x264d600502600702644843f0078d84394360074d60070f00f30260c0370", + "0x4d60050ce0058be0260264d60053120054980260264d600543900539a026", + "0x53940050df0260264d60053a400542c0260264d60050d30058cf026026", + "0x4d20051010260264d60050cd0051040260264d60050cc0050df0260264d6", + "0x54960260264d600502c0058d00260264d600531b0051010260264d6005", + "0x1200260264d600540d0054970260264d60053090054960260264d6005036", + "0x260264d60053180055230260264d60054d00054980260264d60054d4005", + "0x264d60050380050e50260264d60050320058c70260264d60050bc0058c8", + "0x4d60050cf0054960260264d60050d10054980260264d60051c5005493026", + "0x50ba0050e50260264d60050d50051010260264d6005368005493026026", + "0x3530058cf0260264d600534b0050e50260264d600535f0054930260264d6", + "0x58d20261700054d60050268d90260264d60053650051010260264d6005", + "0x4d60050ec0058d40260ec0054d60054970880078d30264970054d6005170", + "0x30f0260050054d60050050050380264360054d600543600508a0260eb005", + "0x4d600500a0050320260c00054d60050c000501b0261010054d6005101005", + "0x8d50261000054d600510000503602608a0054d600508a00503502600a005", + "0x50260070260eb10008a00a0c01010054360160050eb0054d60050eb005", + "0x8a0260e90ea0074d60050ce0058da0260264d600544800539a0260264d6", + "0x4d600508a0050350261010054d600510100530f02643f0054d600543f005", + "0x8dc0260e90054d60050e90058db0261000054d600510000503602608a005", + "0x4d60070e40050e80260e40e50e60e70e808a4d60050e910008a10143f08a", + "0x260bb0054d60050e30050e70260264d60050260070260e20058dd0e3005", + "0x50bb0050d60260bb0054d60050bb0ba0074360260e10054d60050261fb", + "0x4d60050e00e100a0c04800260e10054d60050e10053180260e00bb0074d6", + "0xde0074d60050df0e800747f0260df0054d60050df0053180260df358007", + "0xdb0050d80260db0054d600502608d0260dc0054d60050dd0050d90260dd", + "0x54d60050de00508a0263580054d600535835f0074880260db0054d6005", + "0x260d808d0d90c08de0c307e0da0c04d60070dc0db0e50e700a0060260de", + "0x4d60050c30050d60260c30054d60050c334b0074360260264d6005026007", + "0x7e0054d600507e3650070ff0260da0054d60050da00530f0260d70c3007", + "0xc30054970260264d60050260070260060058df0264d60070d7005081026", + "0x260d40260d60054d60050260d50260264d60053530058cf0260264d6005", + "0x264ca0054d60050940050d20260940054d60050260d30260810054d6005", + "0x54d60050260cf02607d0054d60054c90050d00264c90054d60050260d1", + "0x54d600501a4c807d4ca0810d60890cd02601a0054d60050260ce0264c8", + "0x508a0260264d600509b0053a702609c09b0074d600509a0050ea02609a", + "0x54d60050da00530f0260050054d60050050050380260de0054d60050de", + "0x50350263580054d60053580050320260c00054d60050c000501b0260da", + "0x74d60050bb0050d602607e0054d600507e0050360260e60054d60050e6", + "0x264c60cd0074d60050cd00545502609e0054d600509e00531802609e0bb", + "0x4c609e09c07e0e63580c00da0050de40d8e00264c60054d60054c6005312", + "0xd20054d60050d20d100748a0264c336a4c41710d04c50d20a00164d6005", + "0xff0261710054d60051713680074880260d00054d60050d00cf007489026", + "0x70264c10058e14c20054d60074c30054a602636a0054d600536a0d5007", + "0x4bf0054d60074c00054a40264c00054d60054c20054a50260264d6005026", + "0x4d20051010260264d60054bf0050bc0260264d60050260070264be0058e2", + "0x54960260264d600502c0058d00260264d600531b0051010260264d6005", + "0x1200260264d600540d0054970260264d60053090054960260264d6005036", + "0x260264d600508800516b0260264d60054d00054980260264d60054d4005", + "0x264d60050320058c70260264d60050bc0058c80260264d6005318005523", + "0x4d60050bb0054970260264d60051c50054930260264d60050380050e5026", + "0x50d30058cf0260264d60050ea0058be0260264d6005312005498026026", + "0xcc0050df0260264d60053940050df0260264d60053a400542c0260264d6", + "0x268e30264bd0054d60050263530260264d60050cd0051040260264d6005", + "0x54d60050aa4bd00735f0260aa0054d60050aa0053180260aa0054d6005", + "0x58e40264bc0054d60050ab0ad0073650260ad0054d600502607e0260ab", + "0x54d60050d20050380260a00054d60050a000508a0264bb0054d60054bc", + "0x50320260d00054d60050d000501b0264c50054d60054c500530f0260d2", + "0x54d600536a0050360264c40054d60054c40050350261710054d6005171", + "0x264bb36a4c41710d04c50d20a00160054bb0054d60054bb0058d502636a", + "0x264ba0054d60050261710260264d60054be0050bc0260264d6005026007", + "0xd40054d60050d40d30078e50260d40054d60053a43940cc0cd0ea08a8c3", + "0x4b44b54b64b708a4d60054b80058cb0264b84b90074d60050d40058e6026", + "0x54b40050df0260264d60054b50050df0260264d60054b70058be0264b3", + "0x2609c0264b20054d60054b60054350260264d60054b300542c0260264d6", + "0x3760264af0054d600502609c0264b00054d600502609c0264b10054d6005", + "0x4c500530f0260a00054d60050a000508a0260840054d60054af4b04b10c0", + "0x4ba0054d60054ba0053680264c40054d60054c40050350264c50054d6005", + "0xa00893740264b20054d60054b20053120260840054d6005084005375026", + "0x5190054d60074aa0051be0264aa4ab4ac51800a4d60054b20844ba4c44c5", + "0xbb0050d60264a50054d60050261fb0260264d60050260070264a60058e7", + "0x54a44a51710c04800264a50054d60054a50053180264a40bb0074d6005", + "0x74d60050bf51800747f0260bf0054d60050bf0053180260bf4a20074d6", + "0x260c249e0074d600551900524a02649f0054d60054a00050d90264a04a1", + "0x54d600549d0050d802649d0054d600502608d0260264d600549e005104", + "0x8a2040264a10054d60054a100508a0264a20054d60054a200503202649d", + "0x4d600502600702649a4a74a90c08e84a849c0074d60070c249f49d36a4ac", + "0x50380264990054d60054a100508a0260c60054d60050880058e9026026", + "0x54d60050d000501b0260c80054d600549c00530f02630f0054d60050d2", + "0x50360264980054d60054ab00503502601c0054d60054a2005032026035", + "0x54d60050c60058ea0264960054d60054b90053410263190054d60054a8", + "0x264d60054d20051010260264d60050260070260268eb00502640d026493", + "0x4d60054b90058ec0260264d600502c0058d00260264d600531b005101026", + "0x54d40051200260264d600540d0054970260264d6005309005496026026", + "0x3180055230260264d600508800516b0260264d60054d00054980260264d6", + "0x50e50260264d60050320058c70260264d60050bc0058c80260264d6005", + "0x4980260264d60050bb0054970260264d60051c50054930260264d6005038", + "0x265230054d600502607e0260264d60050360054960260264d6005312005", + "0x4a100508a02648e0054d60054900058e40264900054d600549a523007365", + "0x4a90054d60054a900530f0260d20054d60050d20050380264a10054d6005", + "0x4ab0050350264a20054d60054a20050320260d00054d60050d000501b026", + "0x48e0054d600548e0058d50264a70054d60054a70050360264ab0054d6005", + "0x4d20051010260264d600502600702648e4a74ab4a20d04a90d24a1016005", + "0x58ec0260264d600502c0058d00260264d600531b0051010260264d6005", + "0x1200260264d600540d0054970260264d60053090054960260264d60054b9", + "0x260264d600508800516b0260264d60054d00054980260264d60054d4005", + "0x264d60050320058c70260264d60050bc0058c80260264d6005318005523", + "0x4d60050bb0054970260264d60051c50054930260264d60050380050e5026", + "0x54a60058e40260264d60050360054960260264d6005312005498026026", + "0x260d20054d60050d20050380265180054d600551800508a02648d0054d6", + "0x51710050320260d00054d60050d000501b0264ac0054d60054ac00530f", + "0x2636a0054d600536a0050360264ab0054d60054ab0050350261710054d6", + "0x2600702648d36a4ab1710d04ac0d251801600548d0054d600548d0058d5", + "0x58d00260264d600531b0051010260264d60054d20051010260264d6005", + "0x4970260264d60053090054960260264d60050360054960260264d600502c", + "0x260264d60054d00054980260264d60054d40051200260264d600540d005", + "0x264d60050bc0058c80260264d60053180055230260264d600508800516b", + "0x4d60051c50054930260264d60050380050e50260264d60050320058c7026", + "0x50ea0058be0260264d60053120054980260264d60050bb005497026026", + "0x3940050df0260264d60053a400542c0260264d60050d30058cf0260264d6", + "0x58e40260264d60050cd0051040260264d60050cc0050df0260264d6005", + "0x54d60050d20050380260a00054d60050a000508a02648c0054d60054c1", + "0x50320260d00054d60050d000501b0264c50054d60054c500530f0260d2", + "0x54d600536a0050360264c40054d60054c40050350261710054d6005171", + "0x2648c36a4c41710d04c50d20a001600548c0054d600548c0058d502636a", + "0x260264d60050d30058cf0260264d60050060054ca0260264d6005026007", + "0x264d60053680054930260264d60050cf0054960260264d60050d1005498", + "0x4d60050c30050d602648b0054d600502609e0260264d60050d5005101026", + "0x4890054d60054890053180264890054d600548b48a0074bb02648a0c3007", + "0x4d20051010260264d60050260070264880058ed0264d6007489005081026", + "0x54960260264d600502c0058d00260264d600531b0051010260264d6005", + "0x4980260264d60054d40051200260264d600540d0054970260264d6005309", + "0x260264d60053180055230260264d60050c30054970260264d60054d0005", + "0x264d60050380050e50260264d60050320058c70260264d60050bc0058c8", + "0x4d60053120054980260264d60051c50054930260264d60050bb005497026", + "0x53530058cf0260264d60050ea0058be0260264d6005036005496026026", + "0xcc0050df0260264d60053940050df0260264d60053a400542c0260264d6", + "0x58d20264870054d60050268ee0260264d60050cd0051040260264d6005", + "0x4d60054850058d40264850054d60054860880078d30264860054d6005487", + "0x30f0260050054d60050050050380260de0054d60050de00508a026484005", + "0x4d60053580050320260c00054d60050c000501b0260da0054d60050da005", + "0x8d502607e0054d600507e0050360260e60054d60050e6005035026358005", + "0x502600702648407e0e63580c00da0050de0160054840054d6005484005", + "0xea08a8c30264830054d60050261710260264d60054880054ca0260264d6", + "0x58e602634e0054d600534e3530078e502634e0054d60053a43940cc0cd", + "0x8be02647c47d47e47f48008a4d60054810058cb0264814820074d600534e", + "0x260264d600547d0050df0260264d600547e0050df0260264d6005480005", + "0x54d600502609c02647b0054d600547f0054350260264d600547c00542c", + "0x47947a0c03760264780054d600502609c0264790054d600502609c02647a", + "0x54d60050da00530f0260de0054d60050de00508a0264770054d6005478", + "0x53750264830054d60054830053680260e60054d60050e60050350260da", + "0x4830e60da0de08937402647b0054d600547b0053120264770054d6005477", + "0x4710058ef4720054d60074730051be02647347447547600a4d600547b477", + "0x547000510402646f4700074d600547200524a0260264d6005026007026", + "0x2646e0054d600546e00531802646e0054d600546f0c30074bb0260264d6", + "0x50880058e90260264d600502600702646d0058f00264d600746e005081", + "0x2630f0054d60050050050380264990054d600547600508a02646c0054d6", + "0x53580050320260350054d60050c000501b0260c80054d600547500530f", + "0x263190054d600507e0050360264980054d600547400503502601c0054d6", + "0x4d60050264c60264930054d600546c0058ea0264960054d6005482005341", + "0xa4d600546b0bb40d49800a23a02646b0054d600546b00531802646b005", + "0x8cb0260264d60054680054970260264d600546900549702646846901b46a", + "0x50df0260264d600546700510402602b46633146703908a4d6005496005", + "0x263310054d60053310320078af0260264d600502600a0260264d6005466", + "0x748902630f0054d600530f31200748a0264653310074d6005331005151", + "0x31931b0070ff02601c0054d600501c1c50074880260350054d6005035036", + "0x54d600501b03800743602646a0054d600546a0050350263190054d6005", + "0x2602b0054d600502b02c0078f10260390054d60050390bc0078aa02601b", + "0x50260070264610058f44620058f34630058f24640054d600a465005198", + "0x19c0260264d600545f0051a502645f4600074d60054640051990260264d6", + "0x268f500502640d02645d0054d600545e00546c02645e0054d6005460005", + "0x545b0051a602645b45c0074d600546300519d0260264d6005026007026", + "0x40d02645d0054d600545a00546c02645a0054d600545c00519f0260264d6", + "0x264584590074d60054620051a20260264d60050260070260268f5005026", + "0x4d600545700546c0264570054d60054590051a70260264d60054580051a3", + "0x4d60054610050bc0260264d60050260070260268f500502640d02645d005", + "0x45500546c0264550054d60054560051ae0264560054d60050264d3026026", + "0xc80054d60050c800530f0264990054d600549900508a02645d0054d6005", + "0x49900a1b502645d0054d600545d00546c02646a0054d600546a005035026", + "0x263140054d600531431800748702645231445345400a4d600545d46a0c8", + "0x390054dd0260264d60050260070264500058f64510054d60074520050e8", + "0x4d600507a0054970260264d600544f00539a02644c07a01e44f00a4d6005", + "0x31802644b0054d600510a44c0074bb02610a0054d60054510050e7026026", + "0x502600702644a0058f70264d600744b00508102644b0054d600544b005", + "0x261100058fa10e0058f910d0058f810b0054d600a3310051980260264d6", + "0x4d60054490051b00264434490074d600510b0051990260264d6005026007", + "0x261131140074d60054430052b50261120054d60054420053e2026442005", + "0x501b00531802630f0054d600530f0050380264540054d600545400508a", + "0x261140054d60051140053180261120054d600511200531802601b0054d6", + "0x1110c04d600511311411201b30f45408932c0261130054d6005113005318", + "0x260264d60050260070260140058fb11e0054d600711d0054a602611d11a", + "0x702643e0058fc4400054d60071200054a40261200054d600511e0054a5", + "0x4970260264d60054930053670260264d60054400050bc0260264d6005026", + "0x260264d60054d40051200260264d600502b00542c0260264d600501e005", + "0x264d60054d20051010260264d60053090054960260264d60054d0005498", + "0x45300530f02643c0054d600511a00503802643d0054d600511100508a026", + "0x4380054d600531900503602643a0054d600503500501b02643b0054d6005", + "0x260264d600543e0050bc0260264d60050260070260268fd00502640d026", + "0x545300530f0264d10054d600511a0050380261280054d600511100508a", + "0x264d30054d600531900503602608b0054d600503500501b02612b0054d6", + "0x4970260264d60054930053670260264d60050260070260268fe00502640d", + "0x260264d60054d40051200260264d600502b00542c0260264d600501e005", + "0x264d60054d20051010260264d60053090054960260264d60054d0005498", + "0x11100508a0260264d600512a0054b502612912a0074d60050140054b6026", + "0x1330054d600545300530f0261260054d600511a0050380261270054d6005", + "0x1290050f50264370054d60053190050360261340054d600503500501b026", + "0x10d00519d0260264d60050260070260268ff00502640d0264350054d6005", + "0x4320074d600701b45400735e0260264d600502600a0264334340074d6005", + "0x2642d0054d600502626b0260264d600502600702642e42f4300c0900431", + "0x542d00566202642b0054d600543100566202642c0054d600543200508a", + "0x543000508a0260264d600502600702602690100502640d02642a0054d6", + "0x2642a0054d600542f00566202642b0054d600542e00566202642c0054d6", + "0x4d600542a42b0073290262160054d60054340053df0260264d60050264d0", + "0x1b0264530054d600545300530f02642c0054d600542c00508a026082005", + "0x4d60050820053280263190054d60053190050360260350054d6005035005", + "0x3250262160054d60052160053260264330054d6005433005327026082005", + "0x1420053240261424264284290cb08a4d600521643308231903545342c088", + "0x54d60054230053200260264d60050260070264220059024230054d6007", + "0x52940260264d60054210056de02641f4210074d6005146005321026146", + "0x4d600541c0050bc0260264d600502600702657300590341c0054d600741f", + "0x530f0264d10054d600530f0050380261280054d60050cb00508a026026", + "0x54d600542600503602608b0054d600542800501b02612b0054d6005429", + "0x264d60055730054970260264d60050260070260268fe00502640d0264d3", + "0x4d600502b00542c0260264d600501e0054970260264d6005493005367026", + "0x53090054960260264d60054d00054980260264d60054d4005120026026", + "0x503802643d0054d60050cb00508a0260264d60054d20051010260264d6", + "0x54d600542800501b02643b0054d600542900530f02643c0054d600530f", + "0x4d60050260070260268fd00502640d0264380054d600542600503602643a", + "0x502b00542c0260264d600501e0054970260264d6005493005367026026", + "0x3090054960260264d60054d00054980260264d60054d40051200260264d6", + "0x264174190074d60054220054b60260264d60054d20051010260264d6005", + "0x4d600530f0050380261270054d60050cb00508a0260264d60054190054b5", + "0x360261340054d600542800501b0261330054d600542900530f026126005", + "0x268ff00502640d0264350054d60054170050f50264370054d6005426005", + "0x514c0052bf02614c14a0074d600510e0051a20260264d6005026007026", + "0x264114121581511524134161490164d600514b0052c002614b14c0074d6", + "0x54d600545400508a0260264d60054110054590260264d6005158005459", + "0x50d80260350054d600503500501b0264530054d600545300530f026454", + "0x54d60054120050d80261510054d60051510050d80261520054d6005152", + "0x52c102601b0054d600501b0053180264160054d60054160052c1026412", + "0xa4d600514901b4164121511520354534544d42c20261490054d6005149", + "0x4d600502600702641400590415e0054d600740f0052c402640f15c41015a", + "0x40b00590540c0054d600740e0052c602640e0054d600515e00531c026026", + "0x54d600515a00508a0260264d600540c0050bc0260264d6005026007026", + "0x52c802615c0054d600515c00501b0264100054d600541000530f02615a", + "0x2658716340740800a4d600514c15c41015a00a31a02614c0054d600514c", + "0x1650052cb0260264d60050260070261670059061650054d6007587005316", + "0x4070054d600540700530f0264080054d600540800508a0264050054d6005", + "0x4130053270264050054d60054050053280263190054d6005319005036026", + "0x2640416e16c16b00a4d600541340531940740808a3150264130054d6005", + "0x4030052cf0260264d60050260070264020059074030054d60074040052cd", + "0x4d60050260070263ff0059084000054d60074010053130264010054d6005", + "0x263fd17d17b0c090917a3fe17717500a4d600740016e16c0c0311026026", + "0x3fc0c04d600514a0052d20260264d600517a0053170260264d6005026007", + "0x17f00530b0260264d60053fb0052d40260264d60053fc00531002617f3fb", + "0x264d60051860053170263f41860074d60053fe0052d602617e0054d6005", + "0x3f40053280260264d60053f10053170263f03f10074d600517e0052d6026", + "0x74d60053ef00535c0263ef3f40074d60053f40053080263f40054d6005", + "0x35c0263eb3f00074d60053f00053080260264d60053ec00545b0263ec3ed", + "0x4d60053ed0053050260264d60053e900545b0263e93ea0074d60053eb005", + "0x360261750054d600517500530f02618f0054d60053ea00530502618d005", + "0x502600702602690a0264d600718f18d0072700261770054d6005177005", + "0x2b00542c0260264d600501e0054970260264d60054930053670260264d6", + "0x54960260264d60054d00054980260264d60054d40051200260264d6005", + "0x3170260264d60053f00053170260264d60054d20051010260264d6005309", + "0x54d600530f00503802643d0054d600516b00508a0260264d60053f4005", + "0x503602643a0054d600516300501b02643b0054d600517500530f02643c", + "0x535c0260264d60050260070260268fd00502640d0264380054d6005177", + "0x74d60053f000535c0260264d60053e800545b0263e73e80074d60053f4", + "0x53050263e40054d60053e70053050260264d60053e600545b0263e53e6", + "0x4d600502600702602690b0264d60071ad3e40072700261ad0054d60053e5", + "0x502b00542c0260264d600501e0054970260264d6005493005367026026", + "0x3090054960260264d60054d00054980260264d60054d40051200260264d6", + "0x3802643d0054d600516b00508a0260264d60054d20051010260264d6005", + "0x4d600516300501b02643b0054d600517500530f02643c0054d600530f005", + "0x50260070260268fd00502640d0264380054d600517700503602643a005", + "0x30f0264d10054d600530f0050380261280054d600516b00508a0260264d6", + "0x4d600517700503602608b0054d600516300501b02612b0054d6005175005", + "0x530f0261280054d600512800508a0261960054d600502608d0264d3005", + "0x54d60051960050d80263140054d600531400503502612b0054d600512b", + "0x531802602b0054d600502b0050f60264d40054d60054d400544f026196", + "0x508b3090074890264d10054d60054d14d000748a02601e0054d600501e", + "0x4d419631412b12808890c0264d30054d60054d34d20070ff02608b0054d6", + "0x1a600590e19d0054d600719c00590d02619c1a519919800a4d600501e02b", + "0x519f0054590261a219f0074d600519d00590f0260264d6005026007026", + "0x9110260264d60051a30054dc0261a71a30074d60051a20059100260264d6", + "0x51ae0050bc0260264d60050260070261a80059121ae0054d60071a7005", + "0x50d20261af0054d60051aa0059130261aa0054d60050264d30260264d6", + "0x4d60053e20058d40263e20054d60051af1b00078d30261b00054d6005493", + "0x30f0264d10054d60054d10050380261980054d600519800508a0263e3005", + "0x4d600501c00503202608b0054d600508b00501b0261990054d6005199005", + "0x8d50264d30054d60054d30050360261a50054d60051a500503502601c005", + "0x50260070263e34d31a501c08b1994d11980160053e30054d60053e3005", + "0x3df0058d20263df0054d60050269140260264d60051a80050bc0260264d6", + "0x54d60051b31b50078d30261b50054d60054930050d20261b30054d6005", + "0x50380261980054d600519800508a0263dd0054d60053de0058d40263de", + "0x54d600508b00501b0261990054d600519900530f0264d10054d60054d1", + "0x50360261a50054d60051a500503502601c0054d600501c00503202608b", + "0x1c08b1994d11980160053dd0054d60053dd0058d50264d30054d60054d3", + "0x1a60058e40260264d60054930053670260264d60050260070263dd4d31a5", + "0x4d10054d60054d10050380261980054d600519800508a0263e10054d6005", + "0x1c00503202608b0054d600508b00501b0261990054d600519900530f026", + "0x4d30054d60054d30050360261a50054d60051a500503502601c0054d6005", + "0x70263e14d31a501c08b1994d11980160053e10054d60053e10058d5026", + "0x1010260264d600514a00518d0260264d60053fd0053ae0260264d6005026", + "0x260264d600501e0054970260264d60054930053670260264d60054d2005", + "0x264d60054d00054980260264d60054d40051200260264d600502b00542c", + "0x54d60050263040263e00054d60050263530260264d6005309005496026", + "0x8a0263db0054d60053dc3e000735f0263dc0054d60053dc0053180263dc", + "0x4d600517b00530f0261260054d600530f0050380261270054d600516b005", + "0xf50264370054d600517d0050360261340054d600516300501b026133005", + "0xbc0260264d60050260070260268ff00502640d0264350054d60053db005", + "0x260264d60054d20051010260264d600514a00518d0260264d60053ff005", + "0x264d600502b00542c0260264d600501e0054970260264d6005493005367", + "0x4d60053090054960260264d60054d00054980260264d60054d4005120026", + "0x51bb0053180261bb0054d60050263040263d90054d6005026353026026", + "0x1270054d600516b00508a0261bd0054d60051bb3d900735f0261bb0054d6", + "0x16300501b0261330054d600516c00530f0261260054d600530f005038026", + "0x4350054d60051bd0050f50264370054d600516e0050360261340054d6005", + "0x260264d600514a00518d0260264d60050260070260268ff00502640d026", + "0x264d600501e0054970260264d60054930053670260264d60054d2005101", + "0x4d60054d00054980260264d60054d40051200260264d600502b00542c026", + "0x54b50261c03d80074d60054020054b60260264d6005309005496026026", + "0x1260054d600530f0050380261270054d600516b00508a0260264d60053d8", + "0x16e0050360261340054d600516300501b0261330054d600516c00530f026", + "0x70260268ff00502640d0264350054d60051c00050f50264370054d6005", + "0x4960260264d60054d20051010260264d600514a00518d0260264d6005026", + "0x260264d600501e0054970260264d60054930053670260264d6005309005", + "0x264d60054d00054980260264d60054d40051200260264d600502b00542c", + "0x3d60054b50263d53d60074d60051670054b60260264d60054130051a6026", + "0x261260054d600530f0050380261270054d600540800508a0260264d6005", + "0x53190050360261340054d600516300501b0261330054d600540700530f", + "0x260070260268ff00502640d0264350054d60053d50050f50264370054d6", + "0x51010260264d600514a00518d0260264d600540b0052de0260264d6005", + "0x4970260264d60054930053670260264d60053090054960260264d60054d2", + "0x260264d60054d40051200260264d600502b00542c0260264d600501e005", + "0x264d600514c0051a30260264d60054130051a60260264d60054d0005498", + "0x4d60055c90053180265c90054d60050262da0263d20054d6005026353026", + "0x261270054d600515a00508a0261c40054d60055c93d200735f0265c9005", + "0x515c00501b0261330054d600541000530f0261260054d600530f005038", + "0x264350054d60051c40050f50264370054d60053190050360261340054d6", + "0x1010260264d600514a00518d0260264d60050260070260268ff00502640d", + "0x260264d60054930053670260264d60053090054960260264d60054d2005", + "0x264d60054d40051200260264d600502b00542c0260264d600501e005497", + "0x4d600514c0051a30260264d60054130051a60260264d60054d0005498026", + "0x508a0260264d60053cf0054b50263ce3cf0074d60054140054b6026026", + "0x54d600541000530f0261260054d600530f0050380261270054d600515a", + "0x50f50264370054d60053190050360261340054d600515c00501b026133", + "0x54d60054353cd0073650263cd0054d600502607e0264350054d60053ce", + "0x50380261270054d600512700508a0263ca0054d60053cb0058e40263cb", + "0x54d600513400501b0261330054d600513300530f0261260054d6005126", + "0x50360263140054d600531400503502601c0054d600501c005032026134", + "0x1c1341331261270160053ca0054d60053ca0058d50264370054d6005437", + "0x4d20051010260264d60051100050bc0260264d60050260070263ca437314", + "0x54970260264d60054930053670260264d60053090054960260264d6005", + "0x4980260264d60054d40051200260264d600502b00542c0260264d600501e", + "0x43d0054d600545400508a0260264d600501b0054970260264d60054d0005", + "0x3500501b02643b0054d600545300530f02643c0054d600530f005038026", + "0x263c90054d60050263530264380054d600531900503602643a0054d6005", + "0x53c83c900735f0263c80054d60053c80053180263c80054d6005026915", + "0x262550054d60053c72560073650262560054d600502607e0263c70054d6", + "0x543c00503802643d0054d600543d00508a0261ce0054d60052550058e4", + "0x2643a0054d600543a00501b02643b0054d600543b00530f02643c0054d6", + "0x54380050360263140054d600531400503502601c0054d600501c005032", + "0x43831401c43a43b43c43d0160051ce0054d60051ce0058d50264380054d6", + "0x4d60054d20051010260264d600544a0054ca0260264d60050260070261ce", + "0x501e0054970260264d60054930053670260264d6005309005496026026", + "0x4d00054980260264d60054d40051200260264d600502b00542c0260264d6", + "0x263530260264d60053310050df0260264d600501b0054970260264d6005", + "0x263c50054d60053c50053180263c50054d60050269160261d00054d6005", + "0x3c43c30073650263c30054d600502607e0263c40054d60053c51d000735f", + "0x4540054d600545400508a0263c00054d60053c20058e40263c20054d6005", + "0x3500501b0264530054d600545300530f02630f0054d600530f005038026", + "0x3140054d600531400503502601c0054d600501c0050320260350054d6005", + "0x30f4540160053c00054d60053c00058d50263190054d6005319005036026", + "0x260264d60054d20051010260264d60050260070263c031931401c035453", + "0x264d60050390058be0260264d60054930053670260264d6005309005496", + "0x4d60054d00054980260264d60054d40051200260264d600502b00542c026", + "0x54500058e40260264d60053310050df0260264d600501b005497026026", + "0x2630f0054d600530f0050380264540054d600545400508a0261d50054d6", + "0x501c0050320260350054d600503500501b0264530054d600545300530f", + "0x263190054d60053190050360263140054d600531400503502601c0054d6", + "0x260070261d531931401c03545330f4540160051d50054d60051d50058d5", + "0x51010260264d60054d20051010260264d600546d0054ca0260264d6005", + "0x4960260264d60054820058ec0260264d600502c0058d00260264d600531b", + "0x260264d60054d40051200260264d600540d0054970260264d6005309005", + "0x264d60050bc0058c80260264d60053180055230260264d60054d0005498", + "0x4d60050bb0054970260264d60050380050e50260264d60050320058c7026", + "0x51c50054930260264d60050360054960260264d6005312005498026026", + "0x50269170261d70054d60050263530260264d600508800516b0260264d6", + "0x1440054d60051da1d700735f0261da0054d60051da0053180261da0054d6", + "0x1dd0058e40261dd0054d60051441db0073650261db0054d600502607e026", + "0x50054d60050050050380264760054d600547600508a0263bf0054d6005", + "0x3580050320260c00054d60050c000501b0264750054d600547500530f026", + "0x7e0054d600507e0050360264740054d60054740050350263580054d6005", + "0x70263bf07e4743580c04750054760160053bf0054d60053bf0058d5026", + "0x8d00260264d600531b0051010260264d60054d20051010260264d6005026", + "0x260264d60053090054960260264d60054820058ec0260264d600502c005", + "0x264d60054d00054980260264d60054d40051200260264d600540d005497", + "0x4d60050320058c70260264d60050bc0058c80260264d6005318005523026", + "0x53120054980260264d60050bb0054970260264d60050380050e5026026", + "0x8800516b0260264d60051c50054930260264d60050360054960260264d6", + "0x8a0261e40054d60054710058e40260264d60050c30054970260264d6005", + "0x4d600547500530f0260050054d60050050050380264760054d6005476005", + "0x350263580054d60053580050320260c00054d60050c000501b026475005", + "0x4d60051e40058d502607e0054d600507e0050360264740054d6005474005", + "0x4980260264d60050260070261e407e4743580c04750054760160051e4005", + "0x260264d60050d30058cf0260264d60050ea0058be0260264d6005312005", + "0x264d60050cc0050df0260264d60053940050df0260264d60053a400542c", + "0x4d600531b0051010260264d60054d20051010260264d60050cd005104026", + "0x53090054960260264d60050360054960260264d600502c0058d0026026", + "0x4d00054980260264d60054d40051200260264d600540d0054970260264d6", + "0x58c80260264d60053180055230260264d600508800516b0260264d6005", + "0x4930260264d60050380050e50260264d60050320058c70260264d60050bc", + "0x260264d60050d10054980260264d60050bb0054970260264d60051c5005", + "0x264d60050d50051010260264d60053680054930260264d60050cf005496", + "0x4d600534b0050e50260264d60053650051010260264d60053530058cf026", + "0x58e40261e20054d60050d81e00073650261e00054d600502607e026026", + "0x54d60050050050380260de0054d60050de00508a0261e50054d60051e2", + "0x50320260c00054d60050c000501b0260d90054d60050d900530f026005", + "0x54d600508d0050360260e60054d60050e60050350263580054d6005358", + "0x261e508d0e63580c00d90050de0160051e50054d60051e50058d502608d", + "0x260264d60050ea0058be0260264d60053120054980260264d6005026007", + "0x264d60053940050df0260264d60053a400542c0260264d60050d30058cf", + "0x4d60054d20051010260264d60050cd0051040260264d60050cc0050df026", + "0x50360054960260264d600502c0058d00260264d600531b005101026026", + "0x4d40051200260264d600540d0054970260264d60053090054960260264d6", + "0x55230260264d600508800516b0260264d60054d00054980260264d6005", + "0xe50260264d60050320058c70260264d60050bc0058c80260264d6005318", + "0x260264d60050d10054980260264d60051c50054930260264d6005038005", + "0x264d60050d50051010260264d60053680054930260264d60050cf005496", + "0x4d600534b0050e50260264d60053650051010260264d60053530058cf026", + "0x50e20058e40260264d60050ba0050e50260264d600535f005493026026", + "0x260050054d60050050050380260e80054d60050e800508a0261e60054d6", + "0x500a0050320260c00054d60050c000501b0260e70054d60050e700530f", + "0x260e50054d60050e50050360260e60054d60050e600503502600a0054d6", + "0x260070261e60e50e600a0c00e70050e80160051e60054d60051e60058d5", + "0x54980260264d60053650051010260264d600508800516b0260264d6005", + "0x42c0260264d60050d30058cf0260264d60050ce0058be0260264d6005312", + "0x260264d60050cc0050df0260264d60053940050df0260264d60053a4005", + "0x264d600531b0051010260264d60054d20051010260264d60050cd005104", + "0x4d60053090054960260264d60050360054960260264d600502c0058d0026", + "0x54d00054980260264d60054d40051200260264d600540d005497026026", + "0x320058c70260264d60050bc0058c80260264d60053180055230260264d6", + "0x54980260264d60051c50054930260264d60050380050e50260264d6005", + "0x1010260264d60053680054930260264d60050cf0054960260264d60050d1", + "0x260264d600535f0054930260264d60050ba0050e50260264d60050d5005", + "0x3c10054d600502607e0260264d60053530058cf0260264d600534b0050e5", + "0x508a0261df0054d60053be0058e40263be0054d60050fc3c1007365026", + "0x54d60050fe00530f0260050054d60050050050380260260054d6005026", + "0x503502600a0054d600500a0050320260c00054d60050c000501b0260fe", + "0x54d60051df0058d50260fd0054d60050fd00503602608a0054d600508a", + "0x8908a0074d600508a0050d60261df0fd08a00a0c00fe0050260160051df", + "0x8a0054970260264d60050260070260880059180264d6007089005081026", + "0x54970260264d600500a0054970260264d60050070054970260264d6005", + "0x264d40054d600501600547c0260160054d60050264d30260264d60050c0", + "0x502600508a0264d30054d600540d0053a502640d0054d60054d4005212", + "0x54d30054d60054d30053a30260050054d60050050050380260260054d6", + "0x269190260264d60050880054ca0260264d60050260070264d30050260c0", + "0x4d60054d24d10074bb0264d108a0074d600508a0050d60264d20054d6005", + "0x1c00591a0264d60074d00050810264d00054d60054d00053180264d0005", + "0x264d60050070054970260264d600508a0054970260264d6005026007026", + "0x54d60050264d30260264d60050c00054970260264d600500a005497026", + "0x53a50263090054d600508b00521202608b0054d60051c500547c0261c5", + "0x54d60050050050380260260054d600502600508a02630f0054d6005309", + "0x264d600502600702630f0050260c000530f0054d600530f0053a3026005", + "0x4d600500a0050d60263120054d60050269190260264d600501c0054ca026", + "0x3180054d60053180053180263180054d60053123140074bb02631400a007", + "0x8a0054970260264d600502600702631900591b0264d6007318005081026", + "0x54970260264d600500a0054970260264d60050070054970260264d6005", + "0x2602b0054d600531b00547c02631b0054d60050264d30260264d60050c0", + "0x502600508a0263310054d600502c0053a502602c0054d600502b005212", + "0x53310054d60053310053a30260050054d60050050050380260260054d6", + "0x791c0260264d60053190054ca0260264d60050260070263310050260c0", + "0xa0050d60260264d600502600702603800591d01b0320074d60070c0026", + "0x4d600703503200791c02601b0054d600501b00591e02603500a0074d6005", + "0x260bb0054d60050269200260264d60050260070260bc00591f039036007", + "0x4d60050ba0053180260bb0054d60050bb0053180260ba0054d60050264db", + "0x9210260390054d600503900591e0260360054d600503600508a0260ba005", + "0x4d60050269230260264d60050260070260269220c30054d60070ba0bb007", + "0x4d600503908a34e00500a92502634e34b0074d600534b00592402634b005", + "0x260c30054d60050c300591e0263580054d6005358005926026358353007", + "0x2600702602692835f0054d60073580059270263530054d6005353005038", + "0x260264d600536500549702636507e0074d600535f0059290260264d6005", + "0x36a3680074d60050c300717135300a92502617134b0074d600534b005924", + "0xd40054d60050d40059260260d40d50074d600501b00a34b36800a925026", + "0xd40059270260d50054d60050d500503802636a0054d600536a005926026", + "0x36a0074d600536a0059240260264d600502600702602692a0d30054d6007", + "0x260d00054d60050d10d200792c0260d10d30074d60050d300592b0260d2", + "0x2600702602692d0cf0054d60070d00059270260d00054d60050d0005926", + "0x260264d60050cd0054970260cd0ce0074d60050cf0059290260264d6005", + "0x53180263940054d60050cc0ce0074bb0260cc07e0074d600507e0050d6", + "0x4d60050260070263a400592e0264d60073940050810263940054d6005394", + "0x50d30059300260264d600536a00592f0260264d600507e005497026026", + "0x52120260c40054d60053a700547e0263a70054d60050264d30260264d6", + "0x54d600503600508a0260ca0054d60053ae0053a50263ae0054d60050c4", + "0x360c00050ca0054d60050ca0053a30260d50054d60050d5005038026036", + "0x93100502640d0260264d60053a40054ca0260264d60050260070260ca0d5", + "0x500e00593302600e0054d60050d30059320260264d6005026007026026", + "0x59360264d60071060059350261060054d60051060059340261060054d6", + "0x4d600536a00592f0260264d600507e0054970260264d6005026007026105", + "0x51030053180261030054d60050265870261040054d6005026353026026", + "0x261010054d600502607e0261020054d600510310400735f0261030054d6", + "0x3600508a0260ff0054d60051000053a20261000054d6005102101007365", + "0xff0054d60050ff0053a30260d50054d60050d50050380260360054d6005", + "0xfe0054d600510536a00792c0260264d60050260070260ff0d50360c0005", + "0x70260269370fd0054d60070fe0059270260fe0054d60050fe005926026", + "0x264d60050fb0054970260fb0fc0074d60050fd0059290260264d6005026", + "0x50810260fa0054d60050fa0053180260fa0054d600507e0fc0074bb026", + "0xf80054d60050264d30260264d60050260070260f90059380264d60070fa", + "0xf60053a50260f60054d60050f70052120260f70054d60050f800547e026", + "0xd50054d60050d50050380260360054d600503600508a0260f50054d6005", + "0x260264d60050260070260f50d50360c00050f50054d60050f50053a3026", + "0x4970260264d600502600702602693900502640d0260264d60050f90054ca", + "0xf30054d60050f400547c0260f40054d60050264d30260264d600507e005", + "0x3600508a0260f10054d60050f20053a50260f20054d60050f3005212026", + "0xf10054d60050f10053a30260d50054d60050d50050380260360054d6005", + "0x92f0260264d600507e0054970260264d60050260070260f10d50360c0005", + "0xef0054d60050f000547c0260f00054d60050264d30260264d600536a005", + "0x3600508a0260ed0054d60050ee0053a50260ee0054d60050ef005212026", + "0xed0054d60050ed0053a30260d50054d60050d50050380260360054d6005", + "0x9300260264d600534b00592f0260264d60050260070260ed0d50360c0005", + "0x260264d60050c30059300260264d600500a0054970260264d600501b005", + "0x54d600543600547c0264360054d60050264d30260264d6005007005497", + "0x508a0264480054d600543f0053a502643f0054d6005439005212026439", + "0x54d60054480053a30263530054d60053530050380260360054d6005036", + "0x260264d60050070054970260264d60050260070264483530360c0005448", + "0x264d600508a0054970260264d600500a0054970260264d600501b005930", + "0x4d600517000547c0261700054d60050264d30260264d6005039005930026", + "0x8a0260eb0054d60050ec0053a50260ec0054d6005497005212026497005", + "0x4d60050eb0053a30260050054d60050050050380260360054d6005036005", + "0x264d600508a0054970260264d60050260070260eb0050360c00050eb005", + "0x4d600500a0054970260264d600501b0059300260264d6005007005497026", + "0xe90052120260e90054d60050ea00547c0260ea0054d60050264d3026026", + "0xbc0054d60050bc00508a0260e70054d60050e80053a50260e80054d6005", + "0x50bc0c00050e70054d60050e70053a30260050054d6005005005038026", + "0x4d60050070054970260264d600508a0054970260264d60050260070260e7", + "0x50e600547c0260e60054d60050264d30260264d600500a005497026026", + "0x260e30054d60050e40053a50260e40054d60050e50052120260e50054d6", + "0x50e30053a30260050054d60050050050380260380054d600503800508a", + "0x4d600508a00593a0260264d60050264d00260e30050380c00050e30054d6", + "0x264d600540d00529c02640d4d40160c04d600508800593b02608808a007", + "0x4d10052d60264d10054d600502693c0264d24d30074d60050160052d6026", + "0x4d20074d60054d20053080260264d60054d000531702601c4d00074d6005", + "0x53080260264d600530900545b02630908b0074d60051c500535c0261c5", + "0x531400545b0263143120074d600530f00535c02630f01c0074d600501c", + "0x2700263190054d60053120053050263180054d600508b0053050260264d6", + "0x4d600501c0053170260264d600502600702602693d0264d6007319318007", + "0x264d600502600702602693e00502640d0260264d60054d2005317026026", + "0x1c00535c0260264d600531b00545b02602b31b0074d60054d200535c026", + "0x320054d600502b0053050260264d600502c00545b02633102c0074d6005", + "0x702602693f0264d600701b03200727002601b0054d6005331005305026", + "0x360054d60050269400260350380074d60054d300535c0260264d6005026", + "0x35b0260bb0350074d600503500535b0260bc0390074d600503600535c026", + "0xbb0260c035a0260ba0054d60050ba0056620260ba0bc0074d60050bc005", + "0x34b00545b0260264d600502600702635334e00794134b0c30074d60070ba", + "0x9420264d60070bc0350072700260c30054d60050c300508a0260264d6005", + "0x4d60050890059430260264d60054d40053170260264d6005026007026026", + "0x503900545b0260264d600500a0053170260264d600508a0051a6026026", + "0x2640d0263580054d60050c300508a0260264d600503800545b0260264d6", + "0xc035a0260390054d60050390056620260264d6005026007026026944005", + "0x45b0260264d600502600702617136500794507e35f0074d60070390380c3", + "0x260264d60050890059430260264d60054d40053170260264d600507e005", + "0x54d600535f00508a0260264d600500a0053170260264d600508a0051a6", + "0x264d600517100545b0260264d600502600702602694400502640d026358", + "0x264d600502600702602694600502640d0263680054d600536500508a026", + "0x4d600503900545b0260264d600503500545b0260264d600535300545b026", + "0x534e00508a0260264d60050bc00545b0260264d600503800545b026026", + "0x260d40054d600502693c0260d536a0074d60054d40052d60263680054d6", + "0x50d50053080260264d60050d30053170260d20d30074d60050d40052d6", + "0x264d60050cf00545b0260cf0d00074d60050d100535c0260d10d50074d6", + "0x45b0260cc0cd0074d60050ce00535c0260ce0d20074d60050d2005308026", + "0x54d60050cd0053050263940054d60050d00053050260264d60050cc005", + "0x260070260269470264d60073a43940072700260264d600502600a0263a4", + "0x2640d0260264d60050d50053170260264d60050d20053170260264d6005", + "0x45b0260c43a70074d60050d500535c0260264d6005026007026026948005", + "0x4d60053ae00545b0260ca3ae0074d60050d200535c0260264d60053a7005", + "0x72700261060054d60050ca00530502600e0054d60050c4005305026026", + "0x260264d60050264d00260264d60050260070260269490264d600710600e", + "0x510300535c0261030054d60050269400261041050074d600536a00535c", + "0x74d600510100535b0261001040074d600510400535b0261011020074d6", + "0xfe0074d60070ff1003680c035a0260ff0054d60050ff0056620260ff101", + "0x8a0260264d60050fd00545b0260264d60050260070260fb0fc00794a0fd", + "0x502600702602694b0264d60071011040072700260fe0054d60050fe005", + "0xa0053170260264d600508a0051a60260264d60050890059430260264d6", + "0x508a0260264d600510500545b0260264d600510200545b0260264d6005", + "0x56620260264d600502600702602694c00502640d0260fa0054d60050fe", + "0xf60f700794d0f80f90074d60071021050fe0c035a0261020054d6005102", + "0x264d60050890059430260264d60050f800545b0260264d6005026007026", + "0x4d60050f900508a0260264d600500a0053170260264d600508a0051a6026", + "0x4d60050f600545b0260264d600502600702602694c00502640d0260fa005", + "0x4d600502600702602694e00502640d0260f50054d60050f700508a026026", + "0x510200545b0260264d600510400545b0260264d60050fb00545b026026", + "0xfc00508a0260264d600510100545b0260264d600510500545b0260264d6", + "0xc00054d60050c00050360260050054d600500500530f0260f50054d6005", + "0xf508a94f02608a0054d600508a00532702600a0054d600500a005328026", + "0x9510f00054d60070f10059500260f10f20f30f400a4d600508a00a0c0005", + "0xee0059530260ee0054d60050f00059520260264d60050260070260ef005", + "0x54d60050f400508a0260264d60050260070264360059540ed0054d6007", + "0x50360260070054d600500700501b0260f30054d60050f300530f0260f4", + "0xf20070f30f408a9560260ed0054d60050ed0059550260f20054d60050f2", + "0xeb0059580ec0054d600749700595702649717044843f43908a4d60050ed", + "0x4d600508900595a0260ea0054d60050ec0059590260264d6005026007026", + "0x260e60e70074d60050ea00595a0260264d60050e90059430260e80e9007", + "0x4d60050e60051b30260e50054d60050e80051b30260264d60050e7005943", + "0x4bb0260e20054d60050e40053090260e30054d60050e50053090260e4005", + "0x70e10050810260e10054d60050e10053180260e10054d60050e20e3007", + "0x9130260df0054d60050264d30260264d60050260070260e000595b0264d6", + "0x4d60050dd00595d0260dd0054d60050de00595c0260de0054d60050df005", + "0x1b02643f0054d600543f00530f0264390054d600543900508a0260dc005", + "0x4d60050dc00595e0261700054d60051700050360264480054d6005448005", + "0x50e00054ca0260264d60050260070260dc17044843f43908a0050dc005", + "0x595c0260da0054d60050db0058d20260db0054d600502695f0260264d6", + "0x54d600543900508a02608d0054d60050d900595d0260d90054d60050da", + "0x50360264480054d600544800501b02643f0054d600543f00530f026439", + "0x8d17044843f43908a00508d0054d600508d00595e0261700054d6005170", + "0x54d60050eb0059600260264d60050890059430260264d6005026007026", + "0x501b02643f0054d600543f00530f0264390054d600543900508a0260d8", + "0x54d60050d800595e0261700054d60051700050360264480054d6005448", + "0x4d60054360050bc0260264d60050260070260d817044843f43908a0050d8", + "0x4d60050265870260d70054d60050263530260264d6005089005943026026", + "0x260d60054d60050060d700735f0260060054d6005006005318026006005", + "0x50940059600260940054d60050d60810073650260810054d600502607e", + "0x260f30054d60050f300530f0260f40054d60050f400508a0264ca0054d6", + "0x54ca00595e0260f20054d60050f20050360260070054d600500700501b", + "0x890059430260264d60050260070264ca0f20070f30f408a0054ca0054d6", + "0x260f40054d60050f400508a0264c90054d60050ef0059600260264d6005", + "0x50f20050360260070054d600500700501b0260f30054d60050f300530f", + "0x70264c90f20070f30f408a0054c90054d60054c900595e0260f20054d6", + "0x51a60260264d60050890059430260264d60050264d00260264d6005026", + "0x8a0260264d600536a0053170260264d600500a0053170260264d600508a", + "0x54d600507d0058d202607d0054d60050269610260fa0054d6005368005", + "0x530f02609a0054d600501a00595d02601a0054d60054c800595c0264c8", + "0x54d60050c00050360260070054d600500700501b0260050054d6005005", + "0x502600702609a0c00070050fa08a00509a0054d600509a00595e0260c0", + "0x8a0051a60260264d60050890059430260264d60054d40053170260264d6", + "0x508a0260264d60054d30053170260264d600500a0053170260264d6005", + "0x9c0054d600509b0058d202609b0054d60050269610263580054d6005026", + "0x500530f0264c60054d600509e00595d02609e0054d600509c00595c026", + "0xc00054d60050c00050360260070054d600500700501b0260050054d6005", + "0x4d60050260bf0264c60c000700535808a0054c60054d60054c600595e026", + "0x4d60050c00054590260264d60050264d00260264d600502610202640d005", + "0x4d60050269630264d30054d60050269620260264d600508a005459026026", + "0x264d10054d60054d24d30074e20264d20054d60054d20059640264d2005", + "0x54d04d10074e20264d00054d60054d00059640264d00054d6005026965", + "0x260264d60051c500572702608b1c50074d600501c0054da02601c0054d6", + "0x500500530f0260260054d600502600508a0263090054d600508b005728", + "0x260880054d60050880053180260070054d600500700501b0260050054d6", + "0x31230f00a4d600530908800700502608a9660263090054d60053090052c1", + "0x9683180054d60073140059670264d40054d60054d440d0074890263144d4", + "0x31b0054da02631b0054d60053180059690260264d6005026007026319005", + "0x320054d600502608d0263310054d600502c0057b902602c02b0074d6005", + "0x320050d80263120054d600531200530f02630f0054d600530f00508a026", + "0x890054d60050890052c10263310054d60053310050d80260320054d6005", + "0x30f08896a02602b0054d600502b00572002600a0054d600500a0050d8026", + "0x360054d600703500596b02603503801b0c04d600502b00a089331032312", + "0x4590260bb0bc0074d600503600596d0260264d600502600702603900596c", + "0x50260070260c300596e0ba0054d60070bb0052c60260264d60050bc005", + "0x530f02601b0054d600501b00508a0260264d60050ba0050bc0260264d6", + "0x54d60050160052c10264d40054d60054d400501b0260380054d6005038", + "0x735800597002635835334e34b00a4d60050164d403801b00a96f026016", + "0x3650054d600535f0059720260264d600502600702607e00597135f0054d6", + "0x59750260264d60050260070263680059741710054d6007365005973026", + "0xc04d60050d50059770260264d600536a0059760260d536a0074d6005171", + "0x59790260264d60050d20054590260264d60050d40059780260d20d30d4", + "0xcf0054d600502697b0260d00054d60050d100597a0260d10054d60050d3", + "0x50ce0059640260cf0054d60050cf0059640260ce0054d600502697c026", + "0x70263a439400797e0cc0cd0074d60070ce0cf34b0c097d0260ce0054d6", + "0x3a70074d60053a700535b0263a70054d60050cc00597a0260264d6005026", + "0x4d600500e00545b02610600e0ca3ae00a4d60050c40d03530c097f0260c4", + "0xcd00508a0260ca0054d60050ca0056620260264d600510600545b026026", + "0x264d60073a70ca0072700263ae0054d60053ae00501b0260cd0054d6005", + "0x4d60050269810261050054d60050263530260264d6005026007026026980", + "0x261030054d600510410500735f0261040054d6005104005318026104005", + "0x51010059820261010054d60051031020073650261020054d600502607e", + "0x2634e0054d600534e00530f0260cd0054d60050cd00508a0261000054d6", + "0x3ae34e0cd00a0051000054d60051000059830263ae0054d60053ae00501b", + "0x4d60050ff0059840260ff0054d60050264d30260264d6005026007026100", + "0x8a0260fc0054d60050fd0059860260fd0054d60050fe0059850260fe005", + "0x4d60053ae00501b02634e0054d600534e00530f0260cd0054d60050cd005", + "0x50260070260fc3ae34e0cd00a0050fc0054d60050fc0059830263ae005", + "0x50263530260264d60050d000545b0260264d60053a40059870260264d6", + "0x35f0260fa0054d60050fa0053180260fa0054d60050269880260fb0054d6", + "0x50f90f80073650260f80054d600502607e0260f90054d60050fa0fb007", + "0x263940054d600539400508a0260f60054d60050f70059820260f70054d6", + "0x50f60059830263530054d600535300501b02634e0054d600534e00530f", + "0x53680050bc0260264d60050260070260f635334e39400a0050f60054d6", + "0x59890260f40054d60050f50054e50260f50054d60050264d30260264d6", + "0x54d60050f20059860260f20054d60050f30059850260f30054d60050f4", + "0x501b02634e0054d600534e00530f02634b0054d600534b00508a0260f1", + "0x260f135334e34b00a0050f10054d60050f10059830263530054d6005353", + "0x54d600534b00508a0260f00054d600507e0059820260264d6005026007", + "0x59830263530054d600535300501b02634e0054d600534e00530f02634b", + "0x52de0260264d60050260070260f035334e34b00a0050f00054d60050f0", + "0x98a0260ef0054d60050263530260264d60050160053100260264d60050c3", + "0x4d60050ee0ef00735f0260ee0054d60050ee0053180260ee0054d6005026", + "0x9820264390054d60050ed4360073650264360054d600502607e0260ed005", + "0x4d600503800530f02601b0054d600501b00508a02643f0054d6005439005", + "0xa00543f0054d600543f0059830264d40054d60054d400501b026038005", + "0x508a0260264d60050160053100260264d600502600702643f4d403801b", + "0x54d60050390054840261700054d600503800530f0264480054d600501b", + "0x264d60050160053100260264d600502600702602698b00502640d026497", + "0x4d600530f00508a0260264d60050890053100260264d600500a005459026", + "0x9820264970054d60053190054840261700054d600531200530f026448005", + "0x4d600517000530f0264480054d600544800508a0260ec0054d6005497005", + "0xa0050ec0054d60050ec0059830264d40054d60054d400501b026170005", + "0x1020260880054d600502698c02608a0054d60050260bf0260ec4d4170448", + "0x52c00260160054d600502671f0260264d60050264d00260264d6005026", + "0x260264d60054d30051a60261c501c4d04d14d24d340d4d40164d60050c0", + "0x264d60054d00054590260264d60054d10054590260264d60054d2005459", + "0x4d600502600508a0260264d60051c50054590260264d600501c005459026", + "0x72002640d0054d600540d0052c10260050054d600500500530f026026005", + "0x2630f30908b0c04d600501640d00502600a98d0260160054d6005016005", + "0x3120059900260264d600502600702631400598f3120054d600730f00598e", + "0x264d600531b0050bc0260264d600531800531002631b3193180c04d6005", + "0x700501b0263090054d600530900530f02608b0054d600508b00508a026", + "0x531900730908b00a9910263190054d60053190057200260070054d6005", + "0x733100596702600a0054d600500a08a00748902633100a02c02b00a4d6", + "0x2601b0054d600502671f0260264d60050260070260320059920890054d6", + "0x54d40052c102602c0054d600502c00530f02602b0054d600502b00508a", + "0x890054d600508908800799302601b0054d600501b0057200264d40054d6", + "0x54d600703600598e0260360350380c04d600501b4d402c02b00a98d026", + "0x9900260bb0054d60050890059690260264d60050260070260bc005994039", + "0x534b0050bc0260264d60050ba00531002634b0c30ba0c04d6005039005", + "0x7200260350054d600503500530f0260380054d600503800508a0260264d6", + "0xc303503800a9950260bb0054d60050bb0057200260c30054d60050c3005", + "0x702607e00599735f0054d600735800599602635835334e0c04d60050bb", + "0x4d60051710057270263681713650c04d600535f0059980260264d6005026", + "0x35300530f02634e0054d600534e00508a0260264d60053680050bc026026", + "0x3650054d600536500572002600a0054d600500a00501b0263530054d6005", + "0x4d60070d30059670260d30d40d536a00a4d600536500a35334e00a991026", + "0x260d00054d60050d20059690260264d60050260070260d10059990d2005", + "0x50ce00599a0260264d60050cf0057270260ce0cf0074d60050d00054da", + "0x263940054d600502608d0260cc0054d60050cd0057b90260cd0ce0074d6", + "0x3a40050d80260cc0054d60050cc0050d80263a43940074d600539400538f", + "0x260ca3ae00799b0c43a70074d60073a40cc36a0c015a0263a40054d6005", + "0xe0054d600500e0050d802600e0054d600502699c0260264d6005026007", + "0x4d600502600702610310400799d1051060074d600700e0c43a70c015a026", + "0x4d600502608d0261020054d600502693c0260264d6005105005459026026", + "0x1b0260d50054d60050d500530f0261060054d600510600508a026101005", + "0x4d60051020053280261010054d60051010050d80260d40054d60050d4005", + "0x4e40263940054d60053940050d80260ce0054d60050ce00599e026102005", + "0x70fd00599f0260fd0fe0ff10000a4d60053940ce1021010d40d5106088", + "0xfa0c04d60050fc0059a10260264d60050260070260fb0059a00fc0054d6", + "0xfa0059a20260264d60050f80050bc0260264d60050f90054590260f80f9", + "0x1000054d600510000508a0260f60054d60050f70052140260f70054d6005", + "0xf60059a30260fe0054d60050fe00501b0260ff0054d60050ff00530f026", + "0xfb0054b60260264d60050260070260f60fe0ff10000a0050f60054d6005", + "0xf30054d600510000508a0260264d60050f50054b50260f40f50074d6005", + "0xf40050f50260f10054d60050fe00501b0260f20054d60050ff00530f026", + "0x1030054590260264d60050260070260269a400502640d0260f00054d6005", + "0x263530260264d60050ce0059780260264d60053940054590260264d6005", + "0x260ee0054d60050ee0053180260ee0054d60050269a50260ef0054d6005", + "0xed4360073650264360054d600502607e0260ed0054d60050ee0ef00735f", + "0x1040054d600510400508a02643f0054d60054390059a60264390054d6005", + "0x43f0059a30260d40054d60050d400501b0260d50054d60050d500530f026", + "0xca0054590260264d600502600702643f0d40d510400a00543f0054d6005", + "0x263530260264d60050ce0059780260264d60053940054590260264d6005", + "0x261700054d60051700053180261700054d60050262290264480054d6005", + "0xd500530f0260f30054d60053ae00508a0264970054d600517044800735f", + "0xf00054d60054970050f50260f10054d60050d400501b0260f20054d6005", + "0xeb0059a60260eb0054d60050f00ec0073650260ec0054d600502607e026", + "0xf20054d60050f200530f0260f30054d60050f300508a0260ea0054d6005", + "0xf20f300a0050ea0054d60050ea0059a30260f10054d60050f100501b026", + "0x36a00508a0260e90054d60050d10059a60260264d60050260070260ea0f1", + "0xd40054d60050d400501b0260d50054d60050d500530f02636a0054d6005", + "0x264d60050260070260e90d40d536a00a0050e90054d60050e90059a3026", + "0x35300530f02634e0054d600534e00508a0260e80054d600507e0059a6026", + "0xe80054d60050e80059a302600a0054d600500a00501b0263530054d6005", + "0x260264d60050890059a70260264d60050260070260e800a35334e00a005", + "0x503500530f0260380054d600503800508a0260e70054d60050bc0059a6", + "0x50e70054d60050e70059a302600a0054d600500a00501b0260350054d6", + "0x9a80260264d60054d40053100260264d60050260070260e700a03503800a", + "0x54d600502b00508a0260e60054d60050320059a60260264d6005088005", + "0x59a302600a0054d600500a00501b02602c0054d600502c00530f02602b", + "0x53100260264d60050260070260e600a02c02b00a0050e60054d60050e6", + "0x9a60260264d600508a0054960260264d60050880059a80260264d60054d4", + "0x4d600530900530f02608b0054d600508b00508a0260e50054d6005314005", + "0xa0050e50054d60050e50059a30260070054d600500700501b026309005", + "0x4d600508a00530802608808908a0c04d600500a00593b0260e500730908b", + "0x4d14d20c09aa4d340d4d40c04d600708801600700500a9a902601608a007", + "0x54d400530f0264d30054d60054d30059ab0260264d60050260070264d0", + "0x9ac01c0054d60074d300531302640d0054d600540d0050360264d40054d6", + "0x4d60050264e302608b0054d60050269ad0260264d60050260070261c5005", + "0x9ae0263090054d600530900532802608b0054d600508b005328026309005", + "0x502600702631b3193180c09af31431230f0c04d600730908b40d4d400a", + "0x3602630f0054d600530f00530f0263140054d60053140059ab0260264d6", + "0x2600702602c0059b002b0054d60073140053130263120054d6005312005", + "0x7400263310054d60053310053280263310054d60050269b10260264d6005", + "0x4d60050c00053170260264d60050260070260320059b20264d6007331005", + "0x502b0059b30260264d60050890053170260264d600501c0059b3026026", + "0x502658702601b0054d60050263530260264d600508a0053170260264d6", + "0x350054d600503801b00735f0260380054d60050380053180260380054d6", + "0x390059b40260390054d60050350360073650260360054d600502607e026", + "0x30f0054d600530f00530f0260260054d600502600508a0260bc0054d6005", + "0x30f02600a0050bc0054d60050bc0059b50263120054d6005312005036026", + "0xc09b70260bb0320074d60050320059b60260264d60050260070260bc312", + "0x36a3680c09b817136507e35f35835334e34b0c30ba40d4d60070bb08a026", + "0xd40079b90260d40054d60051710ba0079b90260264d60050260070260d5", + "0x535f0d20079b90260d20054d600507e0d30079b90260d30054d6005365", + "0x54d60053530d00079b90260d00054d60053580d10079b90260d10054d6", + "0x260cd0054d600534b0ce0079b90260ce0054d600534e0cf0079b90260cf", + "0x50c00053280260cd0054d60050cd00508a0260cc0054d60050c300530b", + "0x3940054d60053940053280263940cc0074d60050cc0053080260c00054d6", + "0xa9bb0263a40054d60053a40059ba0263a40320074d60050320059b6026", + "0x3ae00535c0263ae0054d60050269b10260c43a70074d60053a43940c00cd", + "0x4d600500e0056620261051060074d60050c400535c02600e0ca0074d6005", + "0x260070261011020079bc1031040074d600710500e3a70c035a02600e005", + "0x8a0260ff0054d600510000547c0261000054d60050264d30260264d6005", + "0x4d60050ff00547d0260fd0054d60051030056620260fe0054d6005104005", + "0x54d60050264d30260264d60050260070260269bd00502640d0260fc005", + "0x56620260fe0054d600510200508a0260fa0054d60050fb00547e0260fb", + "0x54d60050ca0056620260fc0054d60050fa00547d0260fd0054d6005101", + "0x50260070260f60f70079be0f80f90074d60071060ca0fe0c035a0260ca", + "0x6620260f40054d60050f80056620260f50054d60050f900508a0260264d6", + "0x269bf00502640d0260f20054d60050fc00547d0260f30054d60050fd005", + "0x54d60050f10056620260f10054d60050269c00260264d6005026007026", + "0x50260070260ed0ee0079c10ef0f00074d60070f10fd0f70c035a0260f1", + "0x6620260f40054d60050f60056620260f50054d60050f000508a0260264d6", + "0x269bf00502640d0260f20054d60050fc00547d0260f30054d60050ef005", + "0x4360054d60050264d30260264d60050fc00529c0260264d6005026007026", + "0xf60056620260f50054d60050ee00508a0264390054d600543600547e026", + "0xf20054d600543900547d0260f30054d60050ed0056620260f40054d6005", + "0x50bc0260264d60050260070264480059c243f0054d60070f20054a4026", + "0x890054d60050890053280260f50054d60050f500508a0260264d600543f", + "0xf500a9bb0260320054d60050320059ba0260cc0054d60050cc005328026", + "0x53280260ec0054d60050f30f40073290264971700074d60050320cc089", + "0xc09c40e90ea0eb0c04d60070ec02b31230f00a9c30260ec0054d60050ec", + "0x54e10260eb0054d60050eb00530f0260264d60050260070260e60e70e8", + "0xc09c50e30e40e50c04d600749701c0ea0eb00a9c30260e90054d60050e9", + "0x54e10260e50054d60050e500530f0260264d60050260070260e00e10e2", + "0xc09c70dd0de0df0c04d60070e30e90e40e500a9c60260e30054d60050e3", + "0x500f0260d90054d60050dd0059c80260264d60050260070260da0db0dc", + "0x54d600517000508a0260d80054d600508d0059c902608d0054d60050d9", + "0x59b50260de0054d60050de0050360260df0054d60050df00530f026170", + "0x2607e0260264d60050260070260d80de0df17000a0050d80054d60050d8", + "0x54d60050060059b40260060054d60050da0d70073650260d70054d6005", + "0x50360260dc0054d60050dc00530f0261700054d600517000508a0260d6", + "0x260d60db0dc17000a0050d60054d60050d60059b50260db0054d60050db", + "0x260810054d600502607e0260264d60050e90059b30260264d6005026007", + "0x17000508a0264ca0054d60050940059b40260940054d60050e0081007365", + "0xe10054d60050e10050360260e20054d60050e200530f0261700054d6005", + "0x264d60050260070264ca0e10e217000a0054ca0054d60054ca0059b5026", + "0x54d600502607e0260264d60054970053170260264d600501c0059b3026", + "0x8a0264c80054d600507d0059b402607d0054d60050e64c90073650264c9", + "0x4d60050e70050360260e80054d60050e800530f0261700054d6005170005", + "0x50260070264c80e70e817000a0054c80054d60054c80059b50260e7005", + "0x1c0059b30260264d60050f400545b0260264d60054480050bc0260264d6", + "0x52d40260264d600502b0059b30260264d60050f300545b0260264d6005", + "0x3530260264d60050890053170260264d60050cc0053170260264d6005032", + "0x9a0054d600509a00531802609a0054d60050269ca02601a0054d6005026", + "0x9c00736502609c0054d600502607e02609b0054d600509a01a00735f026", + "0x54d60050f500508a0264c60054d600509e0059b402609e0054d600509b", + "0x59b50263120054d600531200503602630f0054d600530f00530f0260f5", + "0x53170260264d60050260070264c631230f0f500a0054c60054d60054c6", + "0x9b30260264d60050890053170260264d600501c0059b30260264d60050c0", + "0x54d60050d53680079b90260264d60050320052d40260264d600502b005", + "0x265870264c40054d60050263530264c50054d600536a0a00079b90260a0", + "0x54d60054c34c400735f0264c30054d60054c30053180264c30054d6005", + "0x59b40264c00054d60054c24c10073650264c10054d600502607e0264c2", + "0x54d600530f00530f0264c50054d60054c500508a0264bf0054d60054c0", + "0x4c500a0054bf0054d60054bf0059b50263120054d600531200503602630f", + "0xc00053170260264d600502c0050bc0260264d60050260070264bf31230f", + "0x53170260264d60050890053170260264d600501c0059b30260264d6005", + "0x3180264bd0054d60050265870264be0054d60050263530260264d600508a", + "0x530f00530f0260aa0054d60054bd4be00735f0264bd0054d60054bd005", + "0x264bc0054d60050aa0050f50260ad0054d60053120050360260ab0054d6", + "0x3170260264d600508a0053170260264d60050260070260269cb00502640d", + "0x260264d600501c0059b30260264d60050c00053170260264d6005089005", + "0x531b0050f50260ad0054d60053190050360260ab0054d600531800530f", + "0x264ba0054d60054bc4bb0073650264bb0054d600502607e0264bc0054d6", + "0x50ab00530f0260260054d600502600508a0264b90054d60054ba0059b4", + "0x54b90054d60054b90059b50260ad0054d60050ad0050360260ab0054d6", + "0x3170260264d600508a0053170260264d60050260070264b90ad0ab02600a", + "0x4b80054d60051c50059cc0260264d60050c00053170260264d6005089005", + "0x2600508a0264b60054d60054b70059c90264b70054d60054b800500f026", + "0x40d0054d600540d0050360264d40054d60054d400530f0260260054d6005", + "0x264d60050260070264b640d4d402600a0054b60054d60054b60059b5026", + "0x4d60050c00053170260264d60050890053170260264d600508a005317026", + "0x59b40264b40054d60054d04b50073650264b50054d600502607e026026", + "0x54d60054d200530f0260260054d600502600508a0264b30054d60054b4", + "0x2600a0054b30054d60054b30059b50264d10054d60054d10050360264d2", + "0xa0c00074d60070070050890260070054d60050050050c00264b34d14d2", + "0x50160260890054d600500a0050880260264d600502600702608a0059cd", + "0x260269ce00502640d0260160054d60050890054d40260880054d60050c0", + "0x40d0054d60054d40054d20264d40054d60050264d30260264d6005026007", + "0x160054d10260160054d600540d0054d40260880054d600508a005016026", + "0x54d60054d300501c0260264d60050260070264d20059cf4d30054d6007", + "0x735e0264d00054d60054d00053180264d00054d60054d10053090264d1", + "0x8a0260264d600502600702630f30908b0c09d01c501c0074d60074d0026", + "0x70263180059d13143120074d600708800508902601c0054d600501c005", + "0x31b0054d60053120050160263190054d60053140050880260264d6005026", + "0x264d60050260070260269d200502640d02602b0054d60053190054d4026", + "0x53180050160263310054d600502c0054d202602c0054d60050264d3026", + "0x9d30320054d600702b0054d102602b0054d60053310054d402631b0054d6", + "0x380053090260380054d600503200501c0260264d600502600702601b005", + "0x74d600703501c00735e0260350054d60050350053180260350054d6005", + "0x4d60050391c50073290260264d60050260070260ba0bb0bc0c09d4039036", + "0x1602634e0054d600503600508a02634b0054d60050c30057390260c3005", + "0x269d500502640d0263580054d600534b00573a0263530054d600531b005", + "0x264d60050ba00545b0260264d60050bb00545b0260264d6005026007026", + "0x9d600502640d02635f0054d60050bc00508a0260264d60051c500545b026", + "0x4d60051c500545b0260264d600501b0050bc0260264d6005026007026026", + "0x7e0054d902607e0054d60050264d302635f0054d600501c00508a026026", + "0x3530054d600531b00501602634e0054d600535f0052720263650054d6005", + "0x264d60050260070260269d500502640d0263580054d600536500573a026", + "0x4d600508b00508a0260264d600530f00545b0260264d600530900545b026", + "0x4d60054d20050bc0260264d60050260070260269d700502640d026171005", + "0x3680054d90263680054d60050264d30261710054d600502600508a026026", + "0x3530054d600508800501602634e0054d600517100527202636a0054d6005", + "0x260d40059d80d50054d600735800573e0263580054d600536a00573a026", + "0x260070260d10059d90d20d30074d60073530050890260264d6005026007", + "0x260cf0054d60050d30050160260d00054d60050d20050880260264d6005", + "0x260264d60050260070260269da00502640d0260ce0054d60050d00054d4", + "0x4d60050d10050160260cc0054d60050cd0054d20260cd0054d60050264d3", + "0x59db3940054d60070ce0054d10260ce0054d60050cc0054d40260cf005", + "0x53a70053090263a70054d600539400501c0260264d60050260070263a4", + "0x3ae0074d60070c434e00735e0260c40054d60050c40053180260c40054d6", + "0x3ae0054d60053ae00508a0260264d600502600702610510600e0c09dc0ca", + "0x880260264d60050260070261020059dd1031040074d60070cf005089026", + "0x4d60051010054d40261000054d60051040050160261010054d6005103005", + "0x54d60050264d30260264d60050260070260269de00502640d0260ff005", + "0x54d40261000054d60051020050160260fd0054d60050fe0054d20260fe", + "0x50260070260fb0059df0fc0054d60070ff0054d10260ff0054d60050fd", + "0x3180260f90054d60050fa0053090260fa0054d60050fc00501c0260264d6", + "0xf50f60c09e00f70f80074d60070f93ae00735e0260f90054d60050f9005", + "0xf30057390260f30054d60050f70ca0073290260264d60050260070260f4", + "0xf00054d60051000050160260f10054d60050f800508a0260f20054d6005", + "0x264d60050260070260269e100502640d0260ef0054d60050f200573a026", + "0x4d60050ca00545b0260264d60050f400545b0260264d60050f500545b026", + "0x4d60050260070260269e200502640d0260ee0054d60050f600508a026026", + "0x53ae00508a0260264d60050ca00545b0260264d60050fb0050bc026026", + "0x2720264360054d60050ed0054d90260ed0054d60050264d30260ee0054d6", + "0x4d600543600573a0260f00054d60051000050160260f10054d60050ee005", + "0x4d600510600545b0260264d60050260070260269e100502640d0260ef005", + "0x502640d0264390054d600500e00508a0260264d600510500545b026026", + "0x534e00508a0260264d60053a40050bc0260264d60050260070260269e3", + "0x2720264480054d600543f0054d902643f0054d60050264d30264390054d6", + "0x4d600544800573a0260f00054d60050cf0050160260f10054d6005439005", + "0x260264d60050260070264970059e41700054d60070ef00573e0260ef005", + "0x50880260264d60050260070260ea0059e50eb0ec0074d60070f0005089", + "0x54d60050e90054d40260e80054d60050ec0050160260e90054d60050eb", + "0xe60054d60050264d30260264d60050260070260269e600502640d0260e7", + "0xe50054d40260e80054d60050ea0050160260e50054d60050e60054d2026", + "0xe30054d60070e70054d10260e40054d60050e800508b0260e70054d6005", + "0x53090260e10054d60050e300501c0260264d60050260070260e20059e7", + "0x264d60070e00050810260e00054d60050e00053180260e00054d60050e1", + "0xde00547e0260de0054d60050264d30260264d60050260070260df0059e8", + "0x70260269e900502640d0260dc0054d60050dd00547d0260dd0054d6005", + "0x47c0260db0054d60050264d30260264d60050df0054ca0260264d6005026", + "0x4d60050dc00547b0260dc0054d60050da00547d0260da0054d60050db005", + "0xd80054d600508d0059eb02608d0054d60050d91700d50c09ea0260d9005", + "0xd80059ec0260e40054d60050e40053120260f10054d60050f100508a026", + "0x50e20050bc0260264d60050260070260d80e40f10c00050d80054d6005", + "0x50264d30260264d60051700053170260264d60050d50053170260264d6", + "0x260f10054d60050f100508a0260060054d60050d70059ed0260d70054d6", + "0x60e40f10c00050060054d60050060059ec0260e40054d60050e4005312", + "0x54d60050f000508b0260264d60050d50053170260264d6005026007026", + "0x53120260f10054d60050f100508a0260810054d60054970059ed0260d6", + "0x70260810d60f10c00050810054d60050810059ec0260d60054d60050d6", + "0x4ca0054d60050d40059ed0260940054d600535300508b0260264d6005026", + "0x4ca0059ec0260940054d600509400531202634e0054d600534e00508a026", + "0x50260070050260264d60050264d00264ca09434e0c00054ca0054d6005", + "0x500a0050d60260264d60050260070260160880079ee08908a0074d6007", + "0x9ef0264d60074d400508102608a0054d600508a00508a0264d400a0074d6", + "0x50c00059f00260264d600500a0054970260264d600502600702640d005", + "0x4d10054d60054d20059f20264d20054d60054d30070079f10264d30054d6", + "0x4d10059f30260890054d600508900530f02608a0054d600508a00508a026", + "0x540d0054ca0260264d60050260070264d108908a0c00054d10054d6005", + "0x4d00050890260264d600502600a0264d00054d60050070050c00260264d6", + "0x4d60051c50050880260264d600502600702608b0059f41c501c0074d6007", + "0x40d0263120054d60053090054d402630f0054d600501c005016026309005", + "0x54d20263140054d60050264d30260264d60050260070260269f5005026", + "0x54d60053180054d402630f0054d600508b0050160263180054d6005314", + "0x2b0059f631b0054d60073120054d10263190054d600530f00508b026312", + "0x4d600502c00530902602c0054d600531b00501c0260264d6005026007026", + "0x1b0320074d600733108a0079f70263310054d6005331005318026331005", + "0x1b0c00074e20260264d60050264d00260264d60050260070260380059f8", + "0x390054d600503600a0074bb0260360054d600502609e0260350054d6005", + "0x3190053120260890054d600508900530f0260320054d600503200508a026", + "0x390054d60050390053180260350054d60050350057200263190054d6005", + "0x260ba0bb0bc0c00050ba0bb0bc0c04d600503903531908903208a721026", + "0x260264d600500a0054970260264d60050c00057270260264d6005026007", + "0x260264d60050260070260269f900502640d0260c30054d600503800508a", + "0x264d600500a0054970260264d60050c00057270260264d600502b0050bc", + "0x54d60050264d30260264d60050264d00260c30054d600508a00508a026", + "0x9f20263530054d600534e3190079f102634e0054d600534b0059fa02634b", + "0x4d60053580059f30260890054d600508900530f0263580054d6005353005", + "0x264d600500a0054970260264d60050260070263580890c30c0005358005", + "0x54d60050263530260264d60050070051040260264d60050c0005727026", + "0x35f00735f02607e0054d600507e00531802607e0054d600502610602635f", + "0x54d60053651710073650261710054d600502607e0263650054d600507e", + "0x530f0260880054d600508800508a02636a0054d60053680059fb026368", + "0x3e402636a0160880c000536a0054d600536a0059f30260160054d6005016", + "0x70050260264d60050264d00260264d60050261020260880054d6005026", + "0x59fd0260264d60050260070264d340d0079fc4d40160074d6007005026", + "0x260160054d600501600508a0260264d600502600a0264d20054d600500a", + "0x5a000260264d600502600702601c0059ff4d04d10074d60074d20059fe", + "0x54d60051c5005a0202608b0054d60054d1005a010261c50054d60054d0", + "0x30f0054d60050264d30260264d6005026007026026a0300502640d026309", + "0x312005a0202608b0054d600501c005a010263120054d600530f005a04026", + "0x4d6005026007026318005a063140054d6007309005a050263090054d6005", + "0x5a0802631b0054d600508b00578d0263190054d6005314005a07026026", + "0x74d600502b0051bb02602b0054d600502b00507d02602b0054d6005319", + "0x26038005a0b01b005a0a032005a093310054d600a02c00509b02602c02b", + "0x260264d60050880053e10260264d60053310050bc0260264d6005026007", + "0x54d600502608d0260360054d60050350050d90260350054d60050260da", + "0xa0060260360054d60050360050d70260390054d60050390050d8026039", + "0x4d600502600702634e34b0c30c0a0c0ba0bb0bc0c04d60070360390c04d4", + "0x50320263580054d60050bc00530f0263530054d600501600508a026026", + "0x54d60050ba00531802607e0054d60050bb00503602635f0054d6005007", + "0x260264d60050264d00260264d6005026007026026a0d00502640d026365", + "0x264d600502b00509a0260264d600531b0057940260264d600508a0053a7", + "0x368005a0e0263680054d600534e1710073650261710054d600502607e026", + "0xc30054d60050c300530f0260160054d600501600508a02636a0054d6005", + "0x36a005a0f02634b0054d600534b0050360260070054d6005007005032026", + "0x50bc0260264d600502600702636a34b0070c301608a00536a0054d6005", + "0x26007026026a1000502640d0260264d60050880053e10260264d6005032", + "0x51bb0260264d60050880053e10260264d600501b0050bc0260264d6005", + "0xd2005a120d3005a110d40054d600a0d500509b0260d502b0074d600502b", + "0x502609c0260264d60050d40050bc0260264d60050260070260d1005a13", + "0x26007026026a1400502640d0260cf0054d60050d00053180260d00054d6", + "0x53180260ce0054d600502609e0260264d60050d30050bc0260264d6005", + "0x50bc0260264d6005026007026026a1400502640d0260cf0054d60050ce", + "0x260cf0054d60050cd0053180260cd0054d600502634c0260264d60050d2", + "0x27c0260264d60050d10050bc0260264d6005026007026026a1400502640d", + "0x3940054d600502634a0260cf0054d60050cc0053180260cc0054d6005026", + "0x263a73a40074d60050cf3940070c04800263940054d6005394005318026", + "0x50d90263ae0c40074d60053a701600747f0263a70054d60053a7005318", + "0xe0054d600500e0050d802600e0054d600502608d0260ca0054d60053ae", + "0x4d400a0060260c40054d60050c400508a0263a40054d60053a4005032026", + "0x264d60050260070261011021030c0a151041051060c04d60070ca00e0c0", + "0x3a40050320263580054d600510600530f0263530054d60050c400508a026", + "0x3650054d600510400531802607e0054d600510500503602635f0054d6005", + "0x260ff005a160264d60071000050810261003650074d60053650050d6026", + "0x4970260264d600502b00509a0260264d60050264d00260264d6005026007", + "0x54d600535800530f0263530054d600535300508a0260264d6005365005", + "0x578e02607e0054d600507e00503602635f0054d600535f005032026358", + "0xfc0fd0fe08a4d600508a31b07e35f35835308979002631b0054d600531b", + "0x4d60050264d00260264d60050260070260fa0fb0fc0fd0fe08a0050fa0fb", + "0x2b3650071bd0260264d600508a0053a70260264d60050ff0054ca026026", + "0x54d60050f8005a180260f80054d60050f931b007a170260f90054d6005", + "0x50320263580054d600535800530f0263530054d600535300508a0260f7", + "0x54d60050f7005a0f02607e0054d600507e00503602635f0054d600535f", + "0x264d60050264d00260264d60050260070260f707e35f35835308a0050f7", + "0x4d600502b00509a0260264d600531b0057940260264d600508a0053a7026", + "0x5a0e0260f50054d60051010f60073650260f60054d600502607e026026", + "0x54d600510300530f0260c40054d60050c400508a0260f40054d60050f5", + "0x5a0f0261020054d60051020050360263a40054d60053a4005032026103", + "0xbc0260264d60050260070260f41023a41030c408a0050f40054d60050f4", + "0x260264d600531b0057940260264d600508a0053a70260264d6005038005", + "0xf20054d600502609c0260f30054d60050263c30260264d600502b00509a", + "0x54d60050263c00260f00054d60050263c20260f10054d600502608d026", + "0x260160054d600501600508a0260ee0054d60050f10f20f30c01d50260ef", + "0x50ef0050d80260f00054d60050f00053180260ee0054d60050ee0051d7", + "0x74360051440264360ed0074d60050ef0f00ee01600a1da0260ef0054d6", + "0x264480054d60050263530260264d600502600702643f005a194390054d6", + "0x517044800735f0261700054d60051700053180261700054d60050261db", + "0x260264d60050ec0050bc0260ec0890074d60054390051dd0264970054d6", + "0x51e00260ea0eb0074d60050890051e40260890054d60050890880073bf", + "0xc04d60050e90051e50260e90ea0074d60050ea0051e20260264d60050eb", + "0x51e60260264d60050e60054590260264d60050e70054970260e60e70e8", + "0x4d60050e40050f80260e40054d60050e50053c10260e50e80074d60050e8", + "0x260e20054d60050e349700735f0260e30054d60050e30053180260e3005", + "0x54d400530f0260ed0054d60050ed00508a0260e10054d60050e80053be", + "0x260e20054d60050e20050f50260e10054d60050e10051df0264d40054d6", + "0xf30260264d600502600a0260de0df0e00c04d60050e20e14d40ed00a3bc", + "0x50dd0050f20260264d60050260070260dc005a1a0dd0054d60070de005", + "0xd90ea0074d60050ea0051e20260264d60050da0050bc0260da0db0074d6", + "0x54590260264d600508d0053bb0260d70d808d0c04d60050d90051e5026", + "0x54d60050060db00735f0260060054d60050d80053090260264d60050d7", + "0x4970260264d60050810053bb0264ca0940810c04d60050ea0051e50260d6", + "0x54d60054c90050f80264c90054d60054ca0051eb0260264d6005094005", + "0x40d02601a0054d60054c80050f50264c80054d600507d0d600735f02607d", + "0x54b60260264d60050ea0051ed0260264d6005026007026026a1b005026", + "0x54d600509b0050f50260264d600509a0054b502609b09a0074d60050dc", + "0x501a09c00736502609c0054d600502607e0260264d60050264d002601a", + "0x260e00054d60050e000508a0264c60054d600509e005a0e02609e0054d6", + "0x50c00050360260070054d60050070050320260df0054d60050df00530f", + "0x70264c60c00070df0e008a0054c60054d60054c6005a0f0260c00054d6", + "0x5a0e0260264d60050880053e10260264d60050264d00260264d6005026", + "0x54d60054d400530f0260ed0054d60050ed00508a0260a00054d600543f", + "0x5a0f0260c00054d60050c00050360260070054d60050070050320264d4", + "0x4d00260264d60050260070260a00c00074d40ed08a0050a00054d60050a0", + "0xa1c0260264d600508a0053a70260264d60053180050bc0260264d6005026", + "0x264c50054d60050263530260264d60050880053e10260264d600508b005", + "0x54c44c500735f0264c40054d60054c40053180264c40054d6005026a1d", + "0x264c10054d60054c34c20073650264c20054d600502607e0264c30054d6", + "0x54d400530f0260160054d600501600508a0264c00054d60054c1005a0e", + "0x260c00054d60050c00050360260070054d60050070050320264d40054d6", + "0x264d60050260070264c00c00074d401608a0054c00054d60054c0005a0f", + "0x4d60050880053e10260264d600500a0057940260264d600508a0053a7026", + "0x54be0053180264be0054d60050261060264bf0054d6005026353026026", + "0x260aa0054d600502607e0264bd0054d60054be4bf00735f0264be0054d6", + "0x40d00508a0260ad0054d60050ab005a0e0260ab0054d60054bd0aa007365", + "0x70054d60050070050320264d30054d60054d300530f02640d0054d6005", + "0x4d340d08a0050ad0054d60050ad005a0f0260c00054d60050c0005036026", + "0xa1e08908a0074d60070050260070050260264d60050264d00260ad0c0007", + "0x2600a0264d40054d60050c00054d70260264d6005026007026016088007", + "0x4d340d0074d60074d4005a1f02608a0054d600508a00508a0260264d6005", + "0x599e0264d10054d60054d3005a210260264d60050260070264d2005a20", + "0x26026a2200502640d02601c0054d60054d10054e70264d00054d600540d", + "0x8b0054d60051c5005a230261c50054d60050264d30260264d6005026007", + "0x4d000572802601c0054d600508b0054e70264d00054d60054d200599e026", + "0x4d6005026007026312005a2530f0054d600701c005a240263090054d6005", + "0x5a270263180054d60053140059790263140054d600530f005a26026026", + "0x31900531802633102c02b31b00a4d600500a0057c30263190054d6005318", + "0x4d600502600702601b005a280320054d60073310054a40263190054d6005", + "0x264d30260380054d600531931b00737e0260264d60050320050bc026026", + "0x390054d60050070050350260360054d600503500547e0260350054d6005", + "0x2c0053180260bb0054d600502b0053180260bc0054d6005038005318026", + "0x7026026a2900502640d0260c30054d600503600547d0260ba0054d6005", + "0x34b0054d600531902b00737e0260264d600501b0050bc0260264d6005026", + "0x35334e00a4d600502c34b31b00700a23a02634b0054d600534b005318026", + "0x50350263650054d600507e00547c02607e0054d60050264d302635f358", + "0x54d60053580053180260bc0054d60053530053180260390054d600534e", + "0x264d00260c30054d600536500547d0260ba0054d600535f0053180260bb", + "0x4d600508a00508a0261710054d60050c30ba0bb0bc00a7bc0260264d6005", + "0x2c10260390054d60050390050350260890054d600508900530f02608a005", + "0x3908908a08a7be0261710054d60051710057bd0263090054d6005309005", + "0x4d60050260070260d40d536a36800a0050d40d536a36800a4d6005171309", + "0x54d60050264d30260264d60053120050bc0260264d60050264d0026026", + "0x260d10054d60050d2005a2b0260d20054d60050d300a3090c0a2a0260d3", + "0x50070050350260890054d600508900530f02608a0054d600508a00508a", + "0x260070260d100708908a00a0050d10054d60050d1005a2c0260070054d6", + "0x263530260264d600500a005a2d0260264d60050c00053100260264d6005", + "0x260cf0054d60050cf0053180260cf0054d60050261060260d00054d6005", + "0xce0cd0073650260cd0054d600502607e0260ce0054d60050cf0d000735f", + "0x880054d600508800508a0263940054d60050cc005a2e0260cc0054d6005", + "0x394005a2c0260070054d60050070050350260160054d600501600530f026", + "0x261020260890054d600502638902639400701608800a0053940054d6005", + "0xa300260880070074d6005007005a2f0260264d60050264d00260264d6005", + "0x4d60050160053090260264d60054d400546d0264d40160074d6005088005", + "0x4d24d30074d6005007005a3002608a0054d600540d0c000735f02640d005", + "0x4d20051af02608a0054d600508a0890073770260264d60054d3005497026", + "0x260264d60050260070261c5005a3301c005a324d0005a314d10054d600a", + "0x508b00a00735f02608b0054d600508b00531802608b0054d600502609c", + "0x263120054d600530f005a3402630f0054d60054d10051b00263090054d6", + "0x3180050f50263180054d600531430900735f0263140054d60053120053e2", + "0x502609e0260264d6005026007026026a3500502640d0263190054d6005", + "0x2b0054d600531b00a00735f02631b0054d600531b00531802631b0054d6", + "0x3310053090263310054d600502c0051b302602c0054d60054d00053df026", + "0x54d600501b0050f502601b0054d600503202b00735f0260320054d6005", + "0x380054d60050264c60260264d6005026007026026a3500502640d026319", + "0x508a0260350054d600503800a00735f0260380054d6005038005318026", + "0x54d600501c005a360260050054d600500500530f0260260054d6005026", + "0x360c04d600503501c00502600aa370260350054d60050350050f502601c", + "0x260264d60050260070260ba005a380bb0054d60070bc0050f30260bc039", + "0x503600508a0260264d600534b0050bc02634b0c30074d60050bb0050f2", + "0x263580054d60050c30050f50263530054d600503900530f02634e0054d6", + "0xa3a0260264d600508a0053ae0260264d6005026007026026a3900502640d", + "0x4d600503900530f0260360054d600503600508a02635f0054d60050ba005", + "0x4d600502600702635f0390360c000535f0054d600535f005807026039005", + "0x507e00531802607e0054d60050260a00260264d60051c50050bc026026", + "0x3190054d60053650050f50263650054d600507e00a00735f02607e0054d6", + "0x3190050f50263530054d600500500530f02634e0054d600502600508a026", + "0x54d600517135808a0c08050261710054d60050264d30263580054d6005", + "0x530f02634e0054d600534e00508a02636a0054d6005368005806026368", + "0xa3b02636a35334e0c000536a0054d600536a0058070263530054d6005353", + "0x5a3d0260264d600502600702600a005a3c0c00070074d6007005026007", + "0x54d600500700508a02608a0054d600508a005a3e02608a0054d60050c0", + "0x5a434d4005a42016005a41088005a400890054d61c508a005a3f026007", + "0xa4a1c5005a4901c005a484d0005a474d1005a464d2005a454d3005a4440d", + "0x264d6005026007026314005a4e312005a4d30f005a4c309005a4b08b005", + "0x4d60053180056620263180054d60050269c00260264d60050890050bc026", + "0x4d60050880050bc0260264d6005026007026026a4f00502640d026319005", + "0x502640d0263190054d600531b00566202631b0054d6005026a50026026", + "0x4d6005026a510260264d60050160050bc0260264d6005026007026026a4f", + "0x5026007026026a4f00502640d0263190054d600502b00566202602b005", + "0x2c00566202602c0054d6005026a520260264d60054d40050bc0260264d6", + "0x40d0050bc0260264d6005026007026026a4f00502640d0263190054d6005", + "0x40d0263190054d60053310056620263310054d6005026a530260264d6005", + "0x264ea0260264d60054d30050bc0260264d6005026007026026a4f005026", + "0x7026026a4f00502640d0263190054d60050320056620260320054d6005", + "0x66202601b0054d6005026a540260264d60054d20050bc0260264d6005026", + "0xbc0260264d6005026007026026a4f00502640d0263190054d600501b005", + "0x3190054d60050380056620260380054d6005026a550260264d60054d1005", + "0x260264d60054d00050bc0260264d6005026007026026a4f00502640d026", + "0x26a4f00502640d0263190054d60050350056620260350054d6005026a56", + "0x360054d6005026a570260264d600501c0050bc0260264d6005026007026", + "0x264d6005026007026026a4f00502640d0263190054d6005036005662026", + "0x4d60050390056620260390054d60050264eb0260264d60051c50050bc026", + "0x4d600508b0050bc0260264d6005026007026026a4f00502640d026319005", + "0x502640d0263190054d60050bc0056620260bc0054d6005026a58026026", + "0x4d6005026a590260264d60053090050bc0260264d6005026007026026a4f", + "0x5026007026026a4f00502640d0263190054d60050bb0056620260bb005", + "0xba0056620260ba0054d6005026a5a0260264d600530f0050bc0260264d6", + "0x3120050bc0260264d6005026007026026a4f00502640d0263190054d6005", + "0x40d0263190054d60050c30056620260c30054d6005026a5b0260264d6005", + "0x26a5c0260264d60053140050bc0260264d6005026007026026a4f005026", + "0x34e0054d6005319005a5d0263190054d600534b00566202634b0054d6005", + "0x353005a5f0260070054d600500700508a0263530054d600534e005a5e026", + "0x54d60050263530260264d60050260070263530070070053530054d6005", + "0x35800735f02635f0054d600535f00531802635f0054d6005026a60026358", + "0x54d600507e3650073650263650054d600502607e02607e0054d600535f", + "0x5a5f02600a0054d600500a00508a0263680054d6005171005a61026171", + "0x50261020260890054d60050264ec02636800a0070053680054d6005368", + "0x7a620160880074d60070050260070050260264d60050264d00260264d6", + "0x502600a0264d30054d60050c000529e0260264d600502600702640d4d4", + "0xa634d14d20074d60074d30053340260880054d600508800508a0260264d6", + "0x4d200533b02601c0054d60054d100533c0260264d60050260070264d0005", + "0x7026026a6400502640d0261c50054d600501c0052a002608a0054d6005", + "0x263090054d600508b00533602608b0054d60050264d30260264d6005026", + "0x8a089007a650261c50054d60053090052a002608a0054d60054d000533b", + "0x3120054d60071c50052a202630f0054d600508a00545002608a0054d6005", + "0x53120053390260264d60050264d00260264d6005026007026314005a66", + "0x260160054d600501600530f0260880054d600508800508a0263180054d6", + "0x1608800aa670263180054d60053180054050260070054d6005007005035", + "0x32005a683310054d600702c0050e802602c02b31b31900a4d6005318007", + "0x501b00a00735f02601b0054d60053310050e70260264d6005026007026", + "0x2631b0054d600531b00530f0263190054d600531900508a0260380054d6", + "0x50380050f502630f0054d600530f00544f02602b0054d600502b005035", + "0xa0050bc03903603500a4d600503830f02b31b31908a87c0260380054d6", + "0x53ae0260264d600530f0051200260264d60050260070260bc039036035", + "0x3190054d600531900508a0260bb0054d6005032005a690260264d600500a", + "0xbb005a6a02602b0054d600502b00503502631b0054d600531b00530f026", + "0x50264d00260264d60050260070260bb02b31b31900a0050bb0054d6005", + "0x30f0c0a6b0260ba0054d60050264d30260264d60053140050bc0260264d6", + "0x4d600508800508a02634b0054d60050c3005a6c0260c30054d60050ba00a", + "0xa6a0260070054d60050070050350260160054d600501600530f026088005", + "0x3ae0260264d600502600702634b00701608800a00534b0054d600534b005", + "0x260264d60050c00051200260264d60050890054ed0260264d600500a005", + "0x54d60053530053180263530054d600502610602634e0054d6005026353", + "0x736502635f0054d600502607e0263580054d600535334e00735f026353", + "0x4d60054d400508a0263650054d600507e005a6902607e0054d600535835f", + "0xa6a0260070054d600500700503502640d0054d600540d00530f0264d4005", + "0x70054d60050050050c002636500740d4d400a0053650054d6005365005", + "0x880260264d600502600702608a005a6d00a0c00074d6007007005089026", + "0x4d60050890054d40260880054d60050c00050160260890054d600500a005", + "0x54d60050264d30260264d6005026007026026a6e00502640d026016005", + "0x54d40260880054d600508a00501602640d0054d60054d40054d20264d4", + "0x4d60054d300508b0264d30880074d60050880054290260160054d600540d", + "0x260264d60050260070264d0005a6f4d10054d60070160054d10264d2005", + "0x51c50053180261c50054d600501c00530902601c0054d60054d100501c", + "0x502600702630f005a7030908b0074d60071c50260073a00261c50054d6", + "0x508902608b0054d600508b00508a0260264d60054d20051040260264d6", + "0x531400501c0260264d6005026007026318005a713143120074d6007088", + "0x2602b0054d600531b0050f002631b0054d60053190053090263190054d6", + "0xa7200502640d0263310054d600502b0050ef02602c0054d6005312005016", + "0x4d60050320050ee0260320054d60050264d30260264d6005026007026026", + "0xed0263310054d600501b0050ef02602c0054d600531800501602601b005", + "0x702c0050890260264d6005026007026035005a730380054d6007331005", + "0x54d600503900501c0260264d60050260070260bc005a740390360074d6", + "0x50160260c30054d60050ba0050f00260ba0054d60050bb0053090260bb", + "0x26026a7500502640d02634e0054d60050c30050ef02634b0054d6005036", + "0x3580054d60053530050ee0263530054d60050264d30260264d6005026007", + "0x34e0050ed02634e0054d60053580050ef02634b0054d60050bc005016026", + "0x74d600734b0050890260264d600502600702607e005a7635f0054d6007", + "0x2636a0054d600517100501c0260264d6005026007026368005a77171365", + "0x53650050160260d40054d60050d50050f00260d50054d600536a005309", + "0x26007026026a7800502640d0260d20054d60050d40050ef0260d30054d6", + "0x160260d00054d60050d10050ee0260d10054d60050264d30260264d6005", + "0x4d60050d300508b0260d20054d60050d00050ef0260d30054d6005368005", + "0x260264d60050260070260cd005a790ce0054d60070d20050ed0260cf005", + "0x8a0263940054d60050cc005a7b0260cc0054d60050ce35f03830900aa7a", + "0x4d6005394005a7c0260cf0054d60050cf00531202608b0054d600508b005", + "0x264d600530900539a0260264d60050260070263940cf08b0c0005394005", + "0x4d60050cd005a7d0260264d60050380054970260264d600535f005497026", + "0xa7c0260cf0054d60050cf00531202608b0054d600508b00508a0263a4005", + "0x54970260264d60050260070263a40cf08b0c00053a40054d60053a4005", + "0x263a70054d600534b00508b0260264d600530900539a0260264d6005038", + "0x53a700531202608b0054d600508b00508a0260c40054d600507e005a7d", + "0x50260070260c43a708b0c00050c40054d60050c4005a7c0263a70054d6", + "0x5a7d0263ae0054d600502c00508b0260264d600530900539a0260264d6", + "0x54d60053ae00531202608b0054d600508b00508a0260ca0054d6005035", + "0x264d60050260070260ca3ae08b0c00050ca0054d60050ca005a7c0263ae", + "0xa7e00502640d02600e0054d600530f00508a0260264d60050880050c3026", + "0x4d60050880050c30260264d60054d00050bc0260264d6005026007026026", + "0x106005a7d0261060054d60050264d302600e0054d600502600508a026026", + "0x1050054d6005105005a7c0264d20054d60054d20053120261050054d6005", + "0x8a0074d60070050260070050260264d60050264d00261054d200e0c0005", + "0x4d400a0074d600500a0050d60260264d6005026007026016088007a7f089", + "0x702640d005a800264d60074d400508102608a0054d600508a00508a026", + "0x264d30054d60050c0005a810260264d600500a0054970260264d6005026", + "0x8a00508a0264d10054d60054d20054ee0264d20054d60054d3007007a82", + "0x4d10054d60054d1005a830260890054d600508900530f02608a0054d6005", + "0x8a0260264d600540d0054ca0260264d60050260070264d108908a0c0005", + "0x500708a0074a90260070054d600500700531202608a0054d600508a005", + "0x4d600502600702608b005a841c50054d600701c00549a02601c4d00074d6", + "0x5a853120054d600730f00549902630f3090074d60051c50050c6026026", + "0x502609e0263180054d60053120c00073380260264d6005026007026314", + "0x4d00054d60054d000508a02631b0054d600531900a0074bb0263190054d6", + "0x31800511a0263090054d60053090053120260890054d600508900530f026", + "0x31b3183090894d008a8b502631b0054d600531b0053180263180054d6005", + "0x54970260264d600502600702633102c02b0c000533102c02b0c04d6005", + "0x260320054d6005314005a860260264d60050c00050fb0260264d600500a", + "0x4d000508a0260380054d600501b0054ee02601b0054d6005032309007a82", + "0x380054d6005038005a830260890054d600508900530f0264d00054d6005", + "0xfb0260264d600500a0054970260264d60050260070260380894d00c0005", + "0x54d60054d000508a0260350054d600508b005a870260264d60050c0005", + "0x4d00c00050350054d6005035005a830260890054d600508900530f0264d0", + "0x50c00050fb0260264d600500a0054970260264d6005026007026035089", + "0x50261060260360054d60050263530260264d60050070051040260264d6", + "0xbc0054d600503903600735f0260390054d60050390053180260390054d6", + "0xba005a870260ba0054d60050bc0bb0073650260bb0054d600502607e026", + "0x160054d600501600530f0260880054d600508800508a0260c30054d6005", + "0x890054d60050261030260c30160880c00050c30054d60050c3005a83026", + "0x54d600502610302640d0054d60050263890260160054d6005026389026", + "0x4d60070c00050074c10260264d60050264d00260264d60050261020264d2", + "0x54d00054c00260264d600502600702608b1c501c0c0a884d04d34d10c0", + "0x31230f08a4d60053090054bd0263090054d60054d00054bf0264d00054d6", + "0x50ad0260264d60053140050ad0260264d600530f0050aa026319318314", + "0x263120054d600531200545e0260264d60053190054970260264d6005318", + "0x3801b03233102c02b4d14d600531b00545c02631b0054d600531200545d", + "0x4d600502c0050ad0260264d600502b0054970260c30ba0bb0bc039036035", + "0x501b0054970260264d60050320051040260264d600533100545b026026", + "0x3900545b0260264d600503600545a0260264d60050350054970260264d6", + "0x54590260264d60050bb0054590260264d60050bc0051040260264d6005", + "0x31802634b0054d600502638b0260264d60050c30051040260264d60050ba", + "0x34b34e0074bb02634e0380074d60050380050d60260380054d6005038005", + "0x4d10054d60054d100530f0263530054d60053530053180263530054d6005", + "0x26358005a890264d60073530050810264d30054d60054d34d20070ff026", + "0x260264d60050890051010260264d60050380054970260264d6005026007", + "0x35f0054d6005026a8a0260264d600540d0053850260264d6005016005385", + "0x4d100530f0260260054d600502600508a02607e0054d600500a005a8b026", + "0x4d30054d60054d30050360260070054d60050070050350264d10054d6005", + "0x260894ef02607e0054d600507e0058db02635f0054d600535f005375026", + "0xd536a36817136508a0050d536a36817136508a4d600507e35f4d30074d1", + "0xd40054d600502623c0260264d60053580054ca0260264d6005026007026", + "0x3180260d20054d60050d40d30074bb0260d30380074d60050380050d6026", + "0x50260070260d1005a8c0264d60070d20050810260d20054d60050d2005", + "0x160053850260264d60050890051010260264d60050380054970260264d6", + "0x5a8b0260d00054d6005026a8d0260264d600540d0053850260264d6005", + "0x54d60054d100530f0260260054d600502600508a0260cf0054d600500a", + "0x53750264d30054d60054d30050360260070054d60050070050350264d1", + "0x4d30074d10260894ef0260cf0054d60050cf0058db0260d00054d60050d0", + "0x260070263a43940cc0cd0ce08a0053a43940cc0cd0ce08a4d60050cf0d0", + "0x2637c0263a70054d60050263530260264d60050d10054ca0260264d6005", + "0x54d60050c43a700735f0260c40054d60050c40053180260c40054d6005", + "0x4d600502609e0260ca0054d6005026a8f0263ae0054d6005026a8e0264d4", + "0x74d600510600537a0261060054d600500e0380ca3ae00a24002600e005", + "0x530f0260260054d600502600508a0260264d6005105005242026104105", + "0x54d60051040053780260070054d60050070050350264d10054d60054d1", + "0xa4d60051040074d102600a2450264d40054d60054d440d007377026104", + "0x4d60050260070260fe005a900ff0054d60071000050e8026100101102103", + "0xf50260fc0054d60050fd4d400735f0260fd0054d60050ff0050e7026026", + "0xf90c0a910fa08a0fb0c04d60074d31020074c10260fc0054d60050fc005", + "0xfa0054bf0260fa0054d60050fa0054c00260264d60050260070260f70f8", + "0xf50050aa0260f10f20f30f40f508a4d60050f60054bd0260f60054d6005", + "0x54970260264d60050f30050ad0260264d60050f40050ab0260264d6005", + "0xf00054d60050f00053180260f00054d60050f20054bc0260264d60050f1", + "0x5026a920260ef0054d60050263530260880054d60050f00fc00735f026", + "0xed0054d60050ee0ef00735f0260ee0054d60050ee0053180260ee0054d6", + "0x2617044843f43900a4d60054360054dd0264360054d600500a005a8b026", + "0xec00735f0260ec0054d60054970ed00735f0264970054d6005439005880", + "0x51700ea00735f0260ea0054d60054480eb00735f0260eb0054d600543f", + "0x260e60e70074d60050e90050c40260e80054d60050261710260e90054d6", + "0xe40054d600502609c0260e50054d600502609c0260264d60050e70053ae", + "0x508b0260e20054d60050e30e40e50c03760260e30054d600502609c026", + "0x54d60050fb00530f0261030054d600510300508a0260e10054d60050e6", + "0x53750260e80054d60050e80053680261010054d60051010050350260fb", + "0x4d600508a0890070ff0260e10054d60050e10053120260e20054d60050e2", + "0xe10e20e81010fb1030893740260880054d600508801600737702608a005", + "0x70260db005a930dc0054d60070dd0051be0260dd0de0df0e000a4d6005", + "0x264d60050da0051040260d90da0074d60050dc00524a0260264d6005026", + "0x8d0050c40260d80054d600502617102608d0054d60050d908800735f026", + "0x260d60054d600502609c0260264d60050d70053ae0260060d70074d6005", + "0x50940810d60c03760260940054d600502609c0260810054d600502609c", + "0x260e00054d60050e000508a0264c90054d600500600508b0264ca0054d6", + "0x50d80053680260de0054d60050de0050350260df0054d60050df00530f", + "0x264c90054d60054c90053120264ca0054d60054ca0053750260d80054d6", + "0x709a0051be02609a01a4c807d00a4d60054c94ca0d80de0df0e0089374", + "0x9e0074d600509b00524a0260264d600502600702609c005a9409b0054d6", + "0xa000540c0260a00054d60054c600540e0260264d600509e0051040264c6", + "0x4c80054d60054c800530f02607d0054d600507d00508a0264c50054d6005", + "0x4c500540b02608a0054d600508a00503602601a0054d600501a005035026", + "0x54070260264d60050260070264c508a01a4c807d08a0054c50054d6005", + "0x54d60054c800530f02607d0054d600507d00508a0264c40054d600509c", + "0x540b02608a0054d600508a00503602601a0054d600501a0050350264c8", + "0x3ae0260264d60050260070264c408a01a4c807d08a0054c40054d60054c4", + "0x54d60050e000508a0264c30054d60050db0054070260264d6005088005", + "0x50360260de0054d60050de0050350260df0054d60050df00530f0260e0", + "0x4c308a0de0df0e008a0054c30054d60054c300540b02608a0054d600508a", + "0x264d600500a0058be0260264d60050fc0053ae0260264d6005026007026", + "0x54d600502607e0260264d60050890051010260264d6005016005385026", + "0x8a0264c00054d60054c10054070264c10054d60050f74c20073650264c2", + "0x4d60051010050350260f90054d60050f900530f0261030054d6005103005", + "0x8a0054c00054d60054c000540b0260f80054d60050f8005036026101005", + "0x3850260264d600500a0058be0260264d60050260070264c00f81010f9103", + "0x260264d60054d40053ae0260264d60050890051010260264d6005016005", + "0x510200530f0261030054d600510300508a0264bf0054d60050fe005407", + "0x264d30054d60054d30050360261010054d60051010050350261020054d6", + "0x264d60050260070264bf4d310110210308a0054bf0054d60054bf00540b", + "0x4d60050890051010260264d60050160053850260264d600500a0058be026", + "0x4d600502607e0260264d60054d20051010260264d600540d005385026026", + "0x260aa0054d60054bd0054070264bd0054d600508b4be0073650264be005", + "0x500700503502601c0054d600501c00530f0260260054d600502600508a", + "0x50aa0054d60050aa00540b0261c50054d60051c50050360260070054d6", + "0x4d40074d60054d40054550260264d60050264d00260aa1c500701c02608a", + "0x264280264d20054d60054d30054340264d30054d600540d0050c002640d", + "0x264d60074d14d20074260264d20054d60054d20050d80264d10054d6005", + "0x50c00264d04d40074d60054d40054550260264d6005026007026026a95", + "0x8b0054d60050261420261c50054d600501c00543402601c0054d60054d0", + "0x7026026a960264d600708b1c50074260261c50054d60051c50050d8026", + "0x30f0074d60073090050890263090054d60054d40050c00260264d6005026", + "0x160263180054d60053120050880260264d6005026007026314005a97312", + "0x26a9800502640d02631b0054d60053180054d40263190054d600530f005", + "0x54d600502b0054d202602b0054d60050264d30260264d6005026007026", + "0x54d102631b0054d600502c0054d40263190054d600531400501602602c", + "0x4d600533100501c0260264d6005026007026032005a993310054d600731b", + "0x508b0260350054d600501b0053090260380054d600502642302601b005", + "0x54d600500700530f0260260054d600502600508a0260360054d6005319", + "0x53180260380054d60050380054220260360054d6005036005312026007", + "0x260bb0bc0390c04d600503503803600702608a1460260350054d6005035", + "0xba00541f0260264d60050260070260c3005a9a0ba0054d60070bb005421", + "0x54d600503900508a0263530054d600534b0050c002634e34b0074d6005", + "0x541c02607e0054d600535300501602635f0054d60050bc00530f026358", + "0x54970260264d6005026007026026a9b00502640d0263650054d600534e", + "0x3681710074d60050c30054b60260264d60050880053a70260264d6005016", + "0x50bc00530f02636a0054d600503900508a0260264d60051710054b5026", + "0x260d30054d60053680050f50260d40054d60050890050360260d50054d6", + "0x4d30260264d60050320050bc0260264d6005026007026026a9c00502640d", + "0x54d600502600508a0260d10054d60050d20055730260d20054d6005026", + "0x541c02607e0054d600531900501602635f0054d600500700530f026358", + "0x50260070260cf005a9d0d00054d60073650054190263650054d60050d1", + "0x264d60050260070260cc005a9e0cd0ce0074d600707e0050890260264d6", + "0x4d60050160054970260264d60050cd00534b0260264d60050ce0050c3026", + "0x4d60050263530260264d60050d00054170260264d60050880053a7026026", + "0x735f0263a40054d60053a40053180263a40054d600502614a026394005", + "0x4d600535f00530f02636a0054d600535800508a0263a70054d60053a4394", + "0x40d0260d30054d60053a70050f50260d40054d60050890050360260d5005", + "0x508a0260264d60050cc0050c30260264d6005026007026026a9c005026", + "0x54d60050890050360263ae0054d600535f00530f0260c40054d6005358", + "0x4d6005026007026026a9f00502640d02600e0054d60050d00054220260ca", + "0x50880053a70260264d60050160054970260264d60050cf0050bc026026", + "0x502614c0261060054d60050263530260264d600507e0050c30260264d6", + "0x1040054d600510510600735f0261050054d60051050053180261050054d6", + "0x890050360260d50054d600535f00530f02636a0054d600535800508a026", + "0x7026026a9c00502640d0260d30054d60051040050f50260d40054d6005", + "0x50260da0260264d6005026007026026aa000502640d0260264d6005026", + "0xd80261010054d600502608d0261020054d60051030050d90261030054d6", + "0x10108900700a0060261020054d60051020050d70261010054d6005101005", + "0x3180260264d60050260070260fb0fc0fd0c0aa10fe0ff1000c04d6007102", + "0x4d60050ff0050360261000054d600510000530f0260fe0054d60050fe005", + "0x4970260264d60050260070260fa005aa20264d60070fe0050810260ff005", + "0x260264d60054d40051040260264d60050880053a70260264d6005016005", + "0x54d60050f80053180260f80054d600502614b0260f90054d6005026353", + "0x30f02636a0054d600502600508a0260f70054d60050f80f900735f0260f8", + "0x4d60050f70050f50260d40054d60050ff0050360260d50054d6005100005", + "0x4d60054d40050c00260264d6005026007026026a9c00502640d0260d3005", + "0xf60050890260264d600502600a0260f50054d60050fa0051490260f6005", + "0x4d60050f30050880260264d60050260070260f2005aa30f30f40074d6007", + "0x40d0260ef0054d60050f10054d40260f00054d60050f40050160260f1005", + "0x54d20260ee0054d60050264d30260264d6005026007026026aa4005026", + "0x54d60050ed0054d40260f00054d60050f20050160260ed0054d60050ee", + "0x1c0260264d6005026007026439005aa54360054d60070ef0054d10260ef", + "0x4d60054480053180264480054d600543f00530902643f0054d6005436005", + "0x264d60050260070260ec005aa64971700074d60070f0005089026448005", + "0xeb0054d40260ea0054d60051700050160260eb0054d6005497005088026", + "0x50264d30260264d6005026007026026aa700502640d0260e90054d6005", + "0x260ea0054d60050ec0050160260e70054d60050e80054d20260e80054d6", + "0x70260e5005aa80e60054d60070e90054d10260e90054d60050e70054d4", + "0xe30054d60050e40053090260e40054d60050e600501c0260264d6005026", + "0x1520260e10054d60050e20f50074130260e20054d60050e3448007416026", + "0x4d60070ea0050890260e00054d60050e00050de0260e00054d60050e1005", + "0xc30260264d60050264d00260264d60050260070260dd005aa90de0df007", + "0x260dc0054d60050264230260264d60050de00534b0260264d60050df005", + "0x71580260da0054d60050db0dc0071580260db0e00074d60050e0005151", + "0x4d600510000530f0260c40054d600502600508a0260d90054d60050e00da", + "0x40d02600e0054d60050d90054220260ca0054d60050ff0050360263ae005", + "0xdd0050c30260264d60050264d00260264d6005026007026026a9f005026", + "0x260d80054d60050e008d00715802608d0054d60050264230260264d6005", + "0x50ff0050360263ae0054d600510000530f0260c40054d600502600508a", + "0x60d70074d600500e00541202600e0054d60050d80054220260ca0054d6", + "0x50810050d80260810054d60050264280260d60054d6005006005411026", + "0x74d60070d60810c40c015a0260d60054d60050d60050d80260810054d6", + "0x260264d60054ca0054590260264d600502600702607d4c9007aaa4ca094", + "0x4d600502608d0260264d60054c800541702601a4c80074d60050d7005412", + "0x9b0074d600709a01a0940c041002609a0054d600509a0050d802609a005", + "0x40f02609c0054d600509c00515c0260264d600502600702609e005aab09c", + "0x4d600509b00508a0260a00054d60054c600515e0264c60054d600509c005", + "0x1b0263ae0054d60053ae00530f0260050054d600500500503802609b005", + "0x4d600508a00503502600a0054d600500a0050320260c00054d60050c0005", + "0xde0260160054d60050160053180260ca0054d60050ca00503602608a005", + "0x50a00160880ca08a00a0c03ae00509b40d4140260a00054d60050a0005", + "0x4be4bf4c04c14c24c34c44c50160054be4bf4c04c14c24c34c44c50164d6", + "0x264d60050880053a70260264d60050160054970260264d6005026007026", + "0x4d60050aa0053180260aa0054d60050264080264bd0054d6005026353026", + "0x3650260ad0054d600502607e0260ab0054d60050aa4bd00735f0260aa005", + "0x509e00508a0264bb0054d60054bc0053a20264bc0054d60050ab0ad007", + "0x263ae0054d60053ae00530f0260050054d600500500503802609e0054d6", + "0x508a00503502600a0054d600500a0050320260c00054d60050c000501b", + "0x54bb0054d60054bb0053a30260ca0054d60050ca00503602608a0054d6", + "0x507d0054590260264d60050260070264bb0ca08a00a0c03ae00509e016", + "0xd70054170260264d60050880053a70260264d60050160054970260264d6", + "0x53180264b90054d600502614a0264ba0054d60050263530260264d6005", + "0x54d600502607e0264b80054d60054b94ba00735f0264b90054d60054b9", + "0x8a0264b50054d60054b60053a20264b60054d60054b84b70073650264b7", + "0x4d60053ae00530f0260050054d60050050050380264c90054d60054c9005", + "0x3502600a0054d600500a0050320260c00054d60050c000501b0263ae005", + "0x4d60054b50053a30260ca0054d60050ca00503602608a0054d600508a005", + "0x4d00260264d60050260070264b50ca08a00a0c03ae0054c90160054b5005", + "0x3a70260264d60050160054970260264d60050e50050bc0260264d6005026", + "0x260264d60050f50051630260264d60050ea0050c30260264d6005088005", + "0x4b30054d60050265870264b40054d60050263530260264d6005448005497", + "0x508a0264b20054d60054b34b400735f0264b30054d60054b3005318026", + "0x54d60050ff0050360260d50054d600510000530f02636a0054d6005026", + "0x4d6005026007026026a9c00502640d0260d30054d60054b20050f50260d4", + "0x4d60050160054970260264d60054390050bc0260264d60050264d0026026", + "0x50f50051630260264d60050f00050c30260264d60050880053a7026026", + "0x4b00053180264b00054d60050265870264b10054d60050263530260264d6", + "0x54d600502600508a0264af0054d60054b04b100735f0264b00054d6005", + "0x50f50260d40054d60050ff0050360260d50054d600510000530f02636a", + "0x53a70260264d6005026007026026a9c00502640d0260d30054d60054af", + "0x8a0260264d60050160054970260264d60054d40051040260264d6005088", + "0x4d60050fc0050360260d50054d60050fd00530f02636a0054d6005026005", + "0x73650260840054d600502607e0260d30054d60050fb0050f50260d4005", + "0x4d600536a00508a0264ac0054d60055180053a20265180054d60050d3084", + "0x1b0260d50054d60050d500530f0260050054d600500500503802636a005", + "0x4d600508a00503502600a0054d600500a0050320260c00054d60050c0005", + "0x160054ac0054d60054ac0053a30260d40054d60050d400503602608a005", + "0x70050260070050260264d60050264d00264ac0d408a00a0c00d500536a", + "0x4d600500a0052600260264d600502600702640d4d4007aac0160880074d6", + "0x264d10054d60054d20058cd0264d20054d60054d300529e0264d300a007", + "0x880c015a0264d10054d60054d10050d80264d00c00074d60050c000538f", + "0x54590260264d600502600702630908b007aad1c501c0074d60074d14d0", + "0x1200260264d600508a00542c0260264d60050890054970260264d60051c5", + "0x3120054d600530f005aae02630f0054d60050264d30260264d600500a005", + "0x508a0263180054d6005314005ab00263140054d60053120c0007aaf026", + "0x54d60050070050350260160054d600501600530f02601c0054d600501c", + "0x4d600502600702631800701601c00a0053180054d6005318005ab1026007", + "0x529e02631900a0074d600500a0052600260264d6005309005459026026", + "0x2b31b08b0c0ab202602b0c00074d60050c000538f02631b0054d6005319", + "0x4d6005331005ab40260264d6005026007026032005ab333102c0074d6007", + "0x264e90260380054d600502635302601b0054d6005331005339026331005", + "0x54d600503503800735f0260350054d60050350053180260350054d6005", + "0x2a402603901b0074d600501b00589b02601b0054d600501b005405026036", + "0x50ba0051040260264d60050bb0054970260ba0bb0bc0c04d6005039005", + "0x35f02634b0054d60050c30054bc0260c30054d60050bc0053370260264d6", + "0x50ad02635f3583530c04d600501b0052a402634e0054d600534b036007", + "0x2607e0054d60053580053090260264d600535f0051040260264d6005353", + "0x53650050c40261710054d60050261710263650054d600507e34e00735f", + "0x9c0260d50054d600502609c0260264d60053680053ae02636a3680074d6", + "0x4d60050d30d40d50c03760260d30054d600502609c0260d40054d6005026", + "0x30f02602c0054d600502c00508a0260d10054d600536a00508b0260d2005", + "0x4d60051710053680260070054d60050070050350260160054d6005016005", + "0x3740260d10054d60050d10053120260d20054d60050d2005375026171005", + "0x4d60070cd0051be0260cd0ce0cf0d000a4d60050d10d217100701602c089", + "0x3a408a0074d600508a0058cc0260264d6005026007026394005ab50cc005", + "0xc0ab60260c40c00074d60050c000538f0263a70054d60053a4005128026", + "0x5ab80260264d600502600702600e005ab70ca3ae0074d60070c43a70d0", + "0x74d60050cc00524a0261060054d60050ca0054370260ca0054d60050ca", + "0x1060054350261030054d6005026ab90260264d6005105005104026104105", + "0xcf0054d60050cf00530f0263ae0054d60053ae00508a0261020054d6005", + "0x1040053180261020054d60051020053120260ce0054d60050ce005035026", + "0xfe0ff10010100a4d60051031041020ce0cf3ae089aba0261040054d6005", + "0x5abd0260264d60050260070260fc005abc0fd0054d60070fe005abb026", + "0x50fa005abe0260264d60050fb0051040260f80f90fa0fb00a4d60050fd", + "0x4bb0260f70890074d60050890050d60260264d60050f80050bc0260264d6", + "0x54d60050f60053180260264d600502600a0260f60054d60050f70f9007", + "0x264d30260264d60050260070260f5005abf0264d60070f60050810260f6", + "0xf20054d60050f300547d0260f30054d60050f400547e0260f40054d6005", + "0x260264d60050f50054ca0260264d6005026007026026ac000502640d026", + "0x4d60050f000547d0260f00054d60050f100547c0260f10054d60050264d3", + "0x4d30260264d60050ef00529c0260ee0ef0074d60050f2005ac10260f2005", + "0x54d600543600547d0264360054d60050ed00547c0260ed0054d6005026", + "0xbc0260264d600502600702643f005ac24390054d60070ee0054a4026436", + "0x54d600544800547d0264480054d600543600547b0260264d6005439005", + "0x264d600543f0050bc0260264d6005026007026026ac300502640d026170", + "0x260ec005ac44970054d60071700054a40261700054d600543600547d026", + "0x260eb0054d60050263440260264d60054970050bc0260264d6005026007", + "0x7ac50e90ea0074d60070eb0c01010c08110260eb0054d60050eb0050d8", + "0x4d60050ea00508a0260264d60050264d00260264d60050260070260e70e8", + "0xd80260ff0054d60050ff0050350261000054d600510000530f0260ea005", + "0x4d600508a0050f602600a0054d600500a00544f0260e90054d60050e9005", + "0x8908a00a0e90ff1000ea08890c0260890054d600508900531802608a005", + "0x260264d60050260070260e30e40e50e600a0050e30e40e50e600a4d6005", + "0x260264d60050890054970260264d60050e70054590260264d60050264d0", + "0xe20054d60050263530260264d600500a0051200260264d600508a00542c", + "0xe10e200735f0260e10054d60050e10053180260e10054d6005026863026", + "0xde0054d60050e00df0073650260df0054d600502607e0260e00054d6005", + "0x10000530f0260e80054d60050e800508a0260dd0054d60050de0054e8026", + "0xdd0054d60050dd005ab10260ff0054d60050ff0050350261000054d6005", + "0xbc0260264d60050264d00260264d60050260070260dd0ff1000e800a005", + "0x260264d600508a00542c0260264d60050890054970260264d60050ec005", + "0x54d60050dc005ac60260dc0054d60050264d30260264d600500a005120", + "0x8a0260d90054d60050da005ab00260da0054d60050db0c0007aaf0260db", + "0x4d60050ff0050350261000054d600510000530f0261010054d6005101005", + "0x50260070260d90ff10010100a0050d90054d60050d9005ab10260ff005", + "0xa0051200260264d600508a00542c0260264d60050890054970260264d6", + "0x8a02608d0054d60050fc0054e80260264d60050c00054590260264d6005", + "0x4d60050ff0050350261000054d600510000530f0261010054d6005101005", + "0x502600702608d0ff10010100a00508d0054d600508d005ab10260ff005", + "0xa0051200260264d600508a00542c0260264d60050890054970260264d6", + "0x263530260264d60050cc005ac70260264d60050c00054590260264d6005", + "0x260d70054d60050d70053180260d70054d60050264080260d80054d6005", + "0x60d60073650260d60054d600502607e0260060054d60050d70d800735f", + "0xe0054d600500e00508a0260940054d60050810054e80260810054d6005", + "0x94005ab10260ce0054d60050ce0050350260cf0054d60050cf00530f026", + "0x890054970260264d60050260070260940ce0cf00e00a0050940054d6005", + "0x54590260264d600500a0051200260264d600508a00542c0260264d6005", + "0xd00054d60050d000508a0264ca0054d60053940054e80260264d60050c0", + "0x4ca005ab10260ce0054d60050ce0050350260cf0054d60050cf00530f026", + "0x890054970260264d60050260070264ca0ce0cf0d000a0054ca0054d6005", + "0x54590260264d600500a0051200260264d600508a00542c0260264d6005", + "0x31802607d0054d60050264080264c90054d60050263530260264d60050c0", + "0x4d600502607e0264c80054d600507d4c900735f02607d0054d600507d005", + "0x2609b0054d600509a0054e802609a0054d60054c801a00736502601a005", + "0x50070050350260160054d600501600530f0260320054d600503200508a", + "0x2600702609b00701603200a00509b0054d600509b005ab10260070054d6", + "0x54970260264d600500a0051200260264d60050c00054590260264d6005", + "0x10602609c0054d60050263530260264d600508a00542c0260264d6005089", + "0x4d600509e09c00735f02609e0054d600509e00531802609e0054d6005026", + "0x4e80264c50054d60054c60a00073650260a00054d600502607e0264c6005", + "0x4d600540d00530f0264d40054d60054d400508a0264c40054d60054c5005", + "0xa0054c40054d60054c4005ab10260070054d600500700503502640d005", + "0x4d600508a00530802608808908a0c04d600500a00593b0264c400740d4d4", + "0x4d14d20c0ac94d340d4d40c04d600708801600700500aac802601608a007", + "0x54d400530f0264d30054d60054d3005aca0260264d60050260070264d0", + "0xacb01c0054d60074d300595302640d0054d600540d0050360264d40054d6", + "0x4d6005026acd02608b0054d6005026acc0260264d60050260070261c5005", + "0xace0263090054d600530900532802608b0054d600508b005328026309005", + "0x502600702631b3193180c0acf31431230f0c04d600730908b40d4d400a", + "0x3602630f0054d600530f00530f0263140054d6005314005aca0260264d6", + "0x2600702602c005ad002b0054d60073140059530263120054d6005312005", + "0x7400263310054d60053310053280263310054d60050269400260264d6005", + "0x4d60050c00053170260264d6005026007026032005ad10264d6007331005", + "0x502b005ad20260264d60050890053170260264d600501c005ad2026026", + "0x502658702601b0054d60050263530260264d600508a0053170260264d6", + "0x350054d600503801b00735f0260380054d60050380053180260380054d6", + "0x39005ad30260390054d60050350360073650260360054d600502607e026", + "0x30f0054d600530f00530f0260260054d600502600508a0260bc0054d6005", + "0x30f02600a0050bc0054d60050bc005ad40263120054d6005312005036026", + "0xc09b70260bb0320074d60050320059b60260264d60050260070260bc312", + "0x36a3680c0ad517136507e35f35835334e34b0c30ba40d4d60070bb08a026", + "0xd40079b90260d40054d60051710ba0079b90260264d60050260070260d5", + "0x535f0d20079b90260d20054d600507e0d30079b90260d30054d6005365", + "0x54d60053530d00079b90260d00054d60053580d10079b90260d10054d6", + "0x260cd0054d600534b0ce0079b90260ce0054d600534e0cf0079b90260cf", + "0x50c00053280260cd0054d60050cd00508a0260cc0054d60050c300530b", + "0x3940054d60053940053280263940cc0074d60050cc0053080260c00054d6", + "0xa9bb0263a40054d60053a40059ba0263a40320074d60050320059b6026", + "0x3ae00535c0263ae0054d60050269400260c43a70074d60053a43940c00cd", + "0x4d600500e0056620261051060074d60050c400535c02600e0ca0074d6005", + "0x26007026101102007ad61031040074d600710500e3a70c035a02600e005", + "0x8a0260ff0054d600510000547c0261000054d60050264d30260264d6005", + "0x4d60050ff00547d0260fd0054d60051030056620260fe0054d6005104005", + "0x54d60050264d30260264d6005026007026026ad700502640d0260fc005", + "0x56620260fe0054d600510200508a0260fa0054d60050fb00547e0260fb", + "0x54d60050ca0056620260fc0054d60050fa00547d0260fd0054d6005101", + "0x50260070260f60f7007ad80f80f90074d60071060ca0fe0c035a0260ca", + "0x6620260f40054d60050f80056620260f50054d60050f900508a0260264d6", + "0x26ad900502640d0260f20054d60050fc00547d0260f30054d60050fd005", + "0x54d60050f10056620260f10054d60050269c00260264d6005026007026", + "0x50260070260ed0ee007ada0ef0f00074d60070f10fd0f70c035a0260f1", + "0x6620260f40054d60050f60056620260f50054d60050f000508a0260264d6", + "0x26ad900502640d0260f20054d60050fc00547d0260f30054d60050ef005", + "0x4360054d60050264d30260264d60050fc00529c0260264d6005026007026", + "0xf60056620260f50054d60050ee00508a0264390054d600543600547e026", + "0xf20054d600543900547d0260f30054d60050ed0056620260f40054d6005", + "0x50bc0260264d6005026007026448005adb43f0054d60070f20054a4026", + "0x890054d60050890053280260f50054d60050f500508a0260264d600543f", + "0xf500a9bb0260320054d60050320059ba0260cc0054d60050cc005328026", + "0x53280260ec0054d60050f30f40073290264971700074d60050320cc089", + "0xc0add0e90ea0eb0c04d60070ec02b31230f00aadc0260ec0054d60050ec", + "0x59550260eb0054d60050eb00530f0260264d60050260070260e60e70e8", + "0xc0ade0e30e40e50c04d600749701c0ea0eb00aadc0260e90054d60050e9", + "0x59550260e50054d60050e500530f0260264d60050260070260e00e10e2", + "0xc0ae00dd0de0df0c04d60070e30e90e40e500aadf0260e30054d60050e3", + "0x5ae10260d90054d60050dd0054e60260264d60050260070260da0db0dc", + "0x54d600517000508a0260d80054d600508d005ae202608d0054d60050d9", + "0x5ad40260de0054d60050de0050360260df0054d60050df00530f026170", + "0x2607e0260264d60050260070260d80de0df17000a0050d80054d60050d8", + "0x54d6005006005ad30260060054d60050da0d70073650260d70054d6005", + "0x50360260dc0054d60050dc00530f0261700054d600517000508a0260d6", + "0x260d60db0dc17000a0050d60054d60050d6005ad40260db0054d60050db", + "0x260810054d600502607e0260264d60050e9005ad20260264d6005026007", + "0x17000508a0264ca0054d6005094005ad30260940054d60050e0081007365", + "0xe10054d60050e10050360260e20054d60050e200530f0261700054d6005", + "0x264d60050260070264ca0e10e217000a0054ca0054d60054ca005ad4026", + "0x54d600502607e0260264d60054970053170260264d600501c005ad2026", + "0x8a0264c80054d600507d005ad302607d0054d60050e64c90073650264c9", + "0x4d60050e70050360260e80054d60050e800530f0261700054d6005170005", + "0x50260070264c80e70e817000a0054c80054d60054c8005ad40260e7005", + "0x1c005ad20260264d60050f400545b0260264d60054480050bc0260264d6", + "0x52d40260264d600502b005ad20260264d60050f300545b0260264d6005", + "0x3530260264d60050890053170260264d60050cc0053170260264d6005032", + "0x9a0054d600509a00531802609a0054d60050269ca02601a0054d6005026", + "0x9c00736502609c0054d600502607e02609b0054d600509a01a00735f026", + "0x54d60050f500508a0264c60054d600509e005ad302609e0054d600509b", + "0x5ad40263120054d600531200503602630f0054d600530f00530f0260f5", + "0x53170260264d60050260070264c631230f0f500a0054c60054d60054c6", + "0xad20260264d60050890053170260264d600501c005ad20260264d60050c0", + "0x54d60050d53680079b90260264d60050320052d40260264d600502b005", + "0x265870264c40054d60050263530264c50054d600536a0a00079b90260a0", + "0x54d60054c34c400735f0264c30054d60054c30053180264c30054d6005", + "0x5ad30264c00054d60054c24c10073650264c10054d600502607e0264c2", + "0x54d600530f00530f0264c50054d60054c500508a0264bf0054d60054c0", + "0x4c500a0054bf0054d60054bf005ad40263120054d600531200503602630f", + "0xc00053170260264d600502c0050bc0260264d60050260070264bf31230f", + "0x53170260264d60050890053170260264d600501c005ad20260264d6005", + "0x3180264bd0054d60050265870264be0054d60050263530260264d600508a", + "0x530f00530f0260aa0054d60054bd4be00735f0264bd0054d60054bd005", + "0x264bc0054d60050aa0050f50260ad0054d60053120050360260ab0054d6", + "0x3170260264d600508a0053170260264d6005026007026026ae300502640d", + "0x260264d600501c005ad20260264d60050c00053170260264d6005089005", + "0x531b0050f50260ad0054d60053190050360260ab0054d600531800530f", + "0x264ba0054d60054bc4bb0073650264bb0054d600502607e0264bc0054d6", + "0x50ab00530f0260260054d600502600508a0264b90054d60054ba005ad3", + "0x54b90054d60054b9005ad40260ad0054d60050ad0050360260ab0054d6", + "0x3170260264d600508a0053170260264d60050260070264b90ad0ab02600a", + "0x4b80054d60051c5005ae40260264d60050c00053170260264d6005089005", + "0x2600508a0264b60054d60054b7005ae20264b70054d60054b8005ae1026", + "0x40d0054d600540d0050360264d40054d60054d400530f0260260054d6005", + "0x264d60050260070264b640d4d402600a0054b60054d60054b6005ad4026", + "0x4d60050c00053170260264d60050890053170260264d600508a005317026", + "0x5ad30264b40054d60054d04b50073650264b50054d600502607e026026", + "0x54d60054d200530f0260260054d600502600508a0264b30054d60054b4", + "0x2600a0054b30054d60054b3005ad40264d10054d60054d10050360264d2", + "0x261020260160054d60050260bf0260890054d60050261030264b34d14d2", + "0x8a4d400a4d600700a0c00050c0ae50260264d60050264d00260264d6005", + "0x1c0054d6005026ae70260264d60050260070264d04d14d20c0ae64d340d", + "0x53280261c50054d600540d01c007ae802640d0054d600540d005328026", + "0x54d6005026ae902608b0054d60054d31c5007ae80264d30054d60054d3", + "0x5aec0260264d600530f005aeb02631230f0074d600508b005aea026309", + "0x54d60054d400530f0260260054d600502600508a0263140054d6005312", + "0x5aee0263140054d6005314005aed0260070054d600500700501b0264d4", + "0x74d402608aaef02608a0054d600508a0890070ff0263090054d6005309", + "0xaf00260880054d600508801600748902631b08831931800a4d6005309314", + "0x502b005af20260264d600502600702602c005af102b0054d600731b005", + "0x260264d600501b0050bc0260264d6005331005af302601b0323310c04d6", + "0x54d600531800508a0260350054d600502608d0260380054d6005026af4", + "0x536f0260320054d6005032005aee0263190054d600531900530f026318", + "0x3803231931808aaf50260350054d60050350050d80260380054d6005038", + "0x70260ba005af70bb0054d60070bc005af60260bc0390360c04d6005035", + "0x264d600534b0050bc02634b0c30074d60050bb005af80260264d6005026", + "0x353005afb0260264d600534e005afa02635334e0074d60050c3005af9026", + "0x3681710c0afd36507e35f0c04d600735808a0390c0afc0263580054d6005", + "0xd40056620260d40d50074d600536500535c0260264d600502600702636a", + "0x4d60050d50056620260d20d30074d60050d4088007afe0260d40054d6005", + "0x260cf0054d6005026a530260d00d10074d60050d50d3007afe0260d5005", + "0x507e00503602635f0054d600535f00530f0260cf0054d60050cf005662", + "0x260d10054d60050d100501b0260d20054d60050d200566202607e0054d6", + "0x260070260ce005aff0264d60070cf0058210260d00054d60050d0005662", + "0x263530260264d60050d000545b0260264d60050d200545b0260264d6005", + "0x260cc0054d60050cc0053180260cc0054d6005026b000260cd0054d6005", + "0x3943a40073650263a40054d600502607e0263940054d60050cc0cd00735f", + "0x360054d600503600508a0260c40054d60053a7005b010263a70054d6005", + "0x7e0050360260d10054d60050d100501b02635f0054d600535f00530f026", + "0x260c407e0d135f03608a0050c40054d60050c40054f102607e0054d6005", + "0x545b02600e0ca3ae0c04d60050ce0d00360c08250260264d6005026007", + "0x1050054d60050d20057c10261060054d600500e0057c10260264d60050ca", + "0x1030053180261030054d60051041060078280261040054d6005026827026", + "0x54d60051020053550261020054d600510510300737e0261030054d6005", + "0x508a0260ff0054d6005100005b030261000054d6005101005b02026101", + "0x54d60050d100501b02635f0054d600535f00530f0263ae0054d60053ae", + "0x3ae08a0050ff0054d60050ff0054f102607e0054d600507e0050360260d1", + "0x30f0260fe0054d600503600508a0260264d60050260070260ff07e0d135f", + "0x4d600536a0050f50260fc0054d60053680050360260fd0054d6005171005", + "0x4d60050ba0054b60260264d6005026007026026b0400502640d0260fb005", + "0x30f0260fe0054d600503600508a0260264d60050fa0054b50260f90fa007", + "0x4d60050f90050f50260fc0054d600508a0050360260fd0054d6005039005", + "0x4d600502c0054b60260264d6005026007026026b0400502640d0260fb005", + "0x30f0260fe0054d600531800508a0260264d60050f80054b50260f70f8007", + "0x4d60050f70050f50260fc0054d600508a0050360260fd0054d6005319005", + "0xb010260f50054d60050fb0f60073650260f60054d600502607e0260fb005", + "0x4d60050fd00530f0260fe0054d60050fe00508a0260f40054d60050f5005", + "0x4f10260fc0054d60050fc0050360260880054d600508800501b0260fd005", + "0x260264d60050260070260f40fc0880fd0fe08a0050f40054d60050f4005", + "0xf30054d600502607e0260264d60050890051010260264d6005016005496", + "0x508a0260f10054d60050f2005b010260f20054d60054d00f3007365026", + "0x54d600500700501b0264d20054d60054d200530f0260260054d6005026", + "0x2608a0050f10054d60050f10054f10264d10054d60054d1005036026007", + "0x9640260050054d6005026b050260260054d600502671f0260f14d10074d2", + "0x4d6005026b060260070054d60050050260074e20260050054d6005005005", + "0x2600a0054d60050c00070074e20260c00054d60050c00059640260c0005", + "0x508a00a0074e202608a0054d600508a00596402608a0054d60050264f2", + "0x4e20260880054d60050880059640260880054d6005026b070260890054d6", + "0x4d60054d40059640264d40054d6005026b080260160054d6005088089007", + "0x9640264d30054d6005026b0902640d0054d60054d40160074e20264d4005", + "0x4d6005026b0a0264d20054d60054d340d0074e20264d30054d60054d3005", + "0x264d00054d60054d14d20074e20264d10054d60054d10059640264d1005", + "0x501c4d00074e202601c0054d600501c00596402601c0054d6005026b0b", + "0x4e202608b0054d600508b00596402608b0054d6005026b0c0261c50054d6", + "0x4d600530f00596402630f0054d6005026b0d0263090054d600508b1c5007", + "0x9640263140054d6005026b0e0263120054d600530f3090074e202630f005", + "0x4d6005026b0f0263180054d60053143120074e20263140054d6005314005", + "0x2631b0054d60053193180074e20263190054d6005319005964026319005", + "0x502b31b0074e202602b0054d600502b00596402602b0054d60050264f4", + "0x4e20263310054d60053310059640263310054d6005026b1002602c0054d6", + "0x4d600501b00596402601b0054d6005026b110260320054d600533102c007", + "0x9640260350054d6005026b120260380054d600501b0320074e202601b005", + "0x4d6005026b130260360054d60050350380074e20260350054d6005035005", + "0x260bc0054d60050390360074e20260390054d6005039005964026039005", + "0x50bb0bc0074e20260bb0054d60050bb0059640260bb0054d60050264f5", + "0x4e20260c30054d60050c30059640260c30054d6005026b140260ba0054d6", + "0x4d600534e00596402634e0054d6005026b1502634b0054d60050c30ba007", + "0x9640263580054d6005026b160263530054d600534e34b0074e202634e005", + "0x4d6005026b1702635f0054d60053583530074e20263580054d6005358005", + "0x263650054d600507e35f0074e202607e0054d600507e00596402607e005", + "0x51713650074e20261710054d60051710059640261710054d6005026b18", + "0x4e202636a0054d600536a00596402636a0054d6005026b190263680054d6", + "0x4d60050d40059640260d40054d6005026b1a0260d50054d600536a368007", + "0x9640260d20054d6005026b1b0260d30054d60050d40d50074e20260d4005", + "0x4d6005026b1c0260d10054d60050d20d30074e20260d20054d60050d2005", + "0x260cf0054d60050d00d10074e20260d00054d60050d00059640260d0005", + "0x50ce0cf0074e20260ce0054d60050ce0059640260ce0054d60050264f7", + "0x4e20260cc0054d60050cc0059640260cc0054d6005026b1d0260cd0054d6", + "0x4d60053a40059640263a40054d6005026b1e0263940054d60050cc0cd007", + "0x9640260c40054d6005026b1f0263a70054d60053a43940074e20263a4005", + "0x4d6005026b200263ae0054d60050c43a70074e20260c40054d60050c4005", + "0x2600e0054d60050ca3ae0074e20260ca0054d60050ca0059640260ca005", + "0x510600e0074e20261060054d60051060059640261060054d60050264f8", + "0x4e20261040054d60051040059640261040054d6005026b210261050054d6", + "0x4d60051020059640261020054d6005026b220261030054d6005104105007", + "0x9640261000054d6005026b230261010054d60051021030074e2026102005", + "0x4d6005026b240260ff0054d60051001010074e20261000054d6005100005", + "0x260fd0054d60050fe0ff0074e20260fe0054d60050fe0059640260fe005", + "0x50fc0fd0074e20260fc0054d60050fc0059640260fc0054d6005026b25", + "0x4e20260fa0054d60050fa0059640260fa0054d6005026b260260fb0054d6", + "0x4d60050f80059640260f80054d6005026b270260f90054d60050fa0fb007", + "0x9640260f60054d6005026b280260f70054d60050f80f90074e20260f8005", + "0x4d6005026b290260f50054d60050f60f70074e20260f60054d60050f6005", + "0x260f30054d60050f40f50074e20260f40054d60050f40059640260f4005", + "0x50f20f30074e20260f20054d60050f20059640260f20054d6005026b2a", + "0x4e20260f00054d60050f00059640260f00054d6005026b2b0260f10054d6", + "0x4d60050ee0059640260ee0054d6005026b2c0260ef0054d60050f00f1007", + "0x9640264360054d6005026b2d0260ed0054d60050ee0ef0074e20260ee005", + "0x4d6005026b2e0264390054d60054360ed0074e20264360054d6005436005", + "0x264480054d600543f4390074e202643f0054d600543f00596402643f005", + "0x51704480074e20261700054d60051700059640261700054d6005026b2f", + "0x4e20260ec0054d60050ec0059640260ec0054d6005026b300264970054d6", + "0x4d60050ea0059640260ea0054d6005026b310260eb0054d60050ec497007", + "0x9640260e80054d6005026b320260e90054d60050ea0eb0074e20260ea005", + "0x4d6005026b330260e70054d60050e80e90074e20260e80054d60050e8005", + "0x260e50054d60050e60e70074e20260e60054d60050e60059640260e6005", + "0x50e40e50074e20260e40054d60050e40059640260e40054d6005026b34", + "0x4e20260e20054d60050e20059640260e20054d6005026b350260e30054d6", + "0x4d60050e00059640260e00054d6005026b360260e10054d60050e20e3007", + "0x9640260de0054d6005026b370260df0054d60050e00e10074e20260e0005", + "0x4d6005026b380260dd0054d60050de0df0074e20260de0054d60050de005", + "0x260db0054d60050dc0dd0074e20260dc0054d60050dc0059640260dc005", + "0x50da0db0074e20260da0054d60050da0059640260da0054d6005026b39", + "0x4e202608d0054d600508d00596402608d0054d60050264fa0260d90054d6", + "0x4d60050d70059640260d70054d6005026b3a0260d80054d600508d0d9007", + "0x9640260d60054d6005026b3b0260060054d60050d70d80074e20260d7005", + "0x4d6005026b3c0260810054d60050d60060074e20260d60054d60050d6005", + "0x264ca0054d60050940810074e20260940054d6005094005964026094005", + "0x261020260890054d60050260bf0264ca0050054ca0054d60054ca005720", + "0x502600a0260880054d600502671f0260264d60050264d00260264d6005", + "0x260070264d24d340d0c0b3d4d40160074d60070c002600735e0260264d6", + "0x6620264d00054d600501600508a0264d10054d600502626b0260264d6005", + "0x26b3e00502640d0261c50054d60054d100566202601c0054d60054d4005", + "0x4d60054d20056620264d00054d600540d00508a0260264d6005026007026", + "0x2608b0054d60051c501c0073290261c50054d60054d300566202601c005", + "0x53120052d60263120054d600502693c02630f3090074d600508b0052d6", + "0x2630f0054d600530f0053280260264d60053140053170263183140074d6", + "0x545b02602b31b0074d600531900535c02631930f0074d600530f005308", + "0x74d600502c00535c02602c3180074d60053180053080260264d600502b", + "0x530502601b0054d600531b0053050260264d600503200545b026032331", + "0x4d600703801b0072700263090054d60053090053280260380054d6005331", + "0x30f0053170260264d60053180053170260264d6005026007026026b3f026", + "0x530f00535c0260264d6005026007026026b4000502640d0260264d6005", + "0xbc0390074d600531800535c0260264d600503500545b0260360350074d6", + "0x50bc0053050260bb0054d60050360053050260264d600503900545b026", + "0x260264d6005026007026026b410264d60070ba0bb0072700260ba0054d6", + "0x4d60070c30057400260c30054d60050c30053280260c30054d6005026b42", + "0x880057270260264d60050264d00260264d600502600702634b005b43026", + "0x53170260264d60050890054960260264d600500a0053100260264d6005", + "0x3180263530054d600502658702634e0054d60050263530260264d6005309", + "0x4d600502607e0263580054d600535334e00735f0263530054d6005353005", + "0x263650054d600507e005b4402607e0054d600535835f00736502635f005", + "0x500700501b0260050054d600500500530f0264d00054d60054d000508a", + "0x260070263650070054d000a0053650054d6005365005b450260070054d6", + "0x1710079b90260d536a36817100a4d600534b3094d00c0b460260264d6005", + "0x54d600502626b0260d20d30074d600536a00535c0260d40054d60050d5", + "0x26026b470264d60070d10d20072700260d40054d60050d400508a0260d1", + "0x3170260264d600500a0053100260264d60050264d00260264d6005026007", + "0x260264d60050880057270260264d60050890054960260264d6005368005", + "0x26b4800502640d0260d00054d60050d400508a0260264d60050d300545b", + "0x260cd005b4a0ce0cf0074d60070d30d4007b490260264d6005026007026", + "0xcc0054d60050cc0050d80260cc0054d6005026b4b0260264d6005026007", + "0x7026394005b4d0264d60070cc005b4c0260cf0054d60050cf00508a026", + "0x54960260264d60050ce0054590260264d60050264d00260264d6005026", + "0x3100260264d60053680053170260264d60050880057270260264d6005089", + "0x263a70054d6005026b000263a40054d60050263530260264d600500a005", + "0x502607e0260c40054d60053a73a400735f0263a70054d60053a7005318", + "0xe0054d60050ca005b440260ca0054d60050c43ae0073650263ae0054d6", + "0x700501b0260050054d600500500530f0260cf0054d60050cf00508a026", + "0x702600e0070050cf00a00500e0054d600500e005b450260070054d6005", + "0x53941060cf0c0b4e0261060ce0074d60050ce00538f0260264d6005026", + "0x261020054d6005026b4f0260264d60051030054590261031041050c04d6", + "0xfe0ff10010100a4d60051021040070c0b500261020054d60051020050d8", + "0x54d60050268170260264d60050fe0054590260264d60050ff005459026", + "0x501b0261050054d600510500508a0260fd0054d60050fd0050d80260fd", + "0x264d60070fd005b4c0261000054d60051000050d80261010054d6005101", + "0x50890054960260264d60050264d00260264d60050260070260fc005b51", + "0xa0053100260264d60053680053170260264d60050880057270260264d6", + "0x263530260264d60051000054590260264d60050ce0054590260264d6005", + "0x260fa0054d60050fa0053180260fa0054d6005026b000260fb0054d6005", + "0xf90f80073650260f80054d600502607e0260f90054d60050fa0fb00735f", + "0x1050054d600510500508a0260f60054d60050f7005b440260f70054d6005", + "0xf6005b450261010054d600510100501b0260050054d600500500530f026", + "0xce00538f0260264d60050260070260f610100510500a0050f60054d6005", + "0x54590260f20f30f40c04d60050fc0f51050c0b4e0260f50ce0074d6005", + "0x260f10054d60050f10050d80260f10054d6005026b4f0260264d60050f2", + "0x260264d60050ee0054590260ed0ee0ef0f000a4d60050f10f31010c0b50", + "0x4d60054360ce007b520264360054d60050261420260264d60050ed005459", + "0xd80260f00054d60050f000501b0264390054d600543900536f026439005", + "0x26170005b5444843f0074d60074390f4007b530260ef0054d60050ef005", + "0x4970054d60054970050d80264970054d6005026b4f0260264d6005026007", + "0x264d60050ea0054590260e90ea0eb0ec00a4d60054974480f00c0b50026", + "0xe70054d70260e70e80074d600500a005b550260264d60050e9005459026", + "0xeb0054d60050eb0050d80260e50054d60050e6005b560260e60054d6005", + "0xb580e30e40074d60070eb0e543f0c0b570260ec0054d60050ec00501b026", + "0x4d60050e3005b590260264d60050264d00260264d60050260070260e2005", + "0x9640260e00054d60050e10059790260e10054d60050e3005a260260e3005", + "0x50e8005b550260df0054d60050e00880074e20260e00054d60050e0005", + "0xdb0054d60050dc005b560260dc0054d60050dd0054d70260dd0de0074d6", + "0xb5a0d90da0074d60070ef0db0e40c0b570260df0054d60050df005720026", + "0xd9005a260260d90054d60050d9005b590260264d600502600702608d005", + "0xd70054d60050d70059640260d70054d60050d80059790260d80054d6005", + "0x4d70260810d60074d60050de005b550260060054d60050d70df0074e2026", + "0x4d60050060057200264ca0054d6005094005b560260940054d6005081005", + "0x50260070264c8005b5b07d4c90074d60071004ca0da0c0b57026006005", + "0x97902601a0054d600507d005a2602607d0054d600507d005b590260264d6", + "0x509a0060074e202609a0054d600509a00596402609a0054d600501a005", + "0x2609e0054d60050ec00501b02609c0054d60054c900508a02609b0054d6", + "0x53680053280260a00054d600509b0057200264c60054d60050d60052c1", + "0x50890054960260264d6005026007026026b5c00502640d0264c50054d6", + "0xd60053100260264d60053680053170260264d60050060057270260264d6", + "0x53180264c30054d60050264080264c40054d60050263530260264d6005", + "0x54d600502607e0264c20054d60054c34c400735f0264c30054d60054c3", + "0x8a0264bf0054d60054c0005b440264c00054d60054c24c10073650264c1", + "0x4d60050ec00501b0260050054d600500500530f0264c80054d60054c8005", + "0x50260070264bf0ec0054c800a0054bf0054d60054bf005b450260ec005", + "0x3680053170260264d60050de0053100260264d60050890054960260264d6", + "0x263530260264d60051000054590260264d60050df0057270260264d6005", + "0x264bd0054d60054bd0053180264bd0054d60050264080264be0054d6005", + "0xaa0ab0073650260ab0054d600502607e0260aa0054d60054bd4be00735f", + "0x8d0054d600508d00508a0264bc0054d60050ad005b440260ad0054d6005", + "0x4bc005b450260ec0054d60050ec00501b0260050054d600500500530f026", + "0x50264d00260264d60050260070264bc0ec00508d00a0054bc0054d6005", + "0x3680053170260264d60050880057270260264d60050890054960260264d6", + "0x54590260264d60051000054590260264d60050e80053100260264d6005", + "0x3180264ba0054d60050264080264bb0054d60050263530260264d60050ef", + "0x4d600502607e0264b90054d60054ba4bb00735f0264ba0054d60054ba005", + "0x264b60054d60054b7005b440264b70054d60054b94b80073650264b8005", + "0x50ec00501b0260050054d600500500530f0260e20054d60050e200508a", + "0x260070264b60ec0050e200a0054b60054d60054b6005b450260ec0054d6", + "0x880057270260264d60050890054960260264d60050264d00260264d6005", + "0x54590260264d600500a0053100260264d60053680053170260264d6005", + "0xb5d0264b50054d60050263530260264d60050ef0054590260264d6005100", + "0x4d60054b44b500735f0264b40054d60054b40053180264b40054d6005026", + "0xb440264b10054d60054b34b20073650264b20054d600502607e0264b3005", + "0x4d600500500530f0261700054d600517000508a0264b00054d60054b1005", + "0xa0054b00054d60054b0005b450260f00054d60050f000501b026005005", + "0xa0053100260264d60050264d00260264d60050260070264b00f0005170", + "0x57270260264d60050890054960260264d60053680053170260264d6005", + "0x264af0054d60050263530260d00054d60050cd00508a0260264d6005088", + "0x50844af00735f0260840054d60050840053180260840054d6005026587", + "0x264ab0054d60055184ac0073650264ac0054d600502607e0265180054d6", + "0x500500530f0260d00054d60050d000508a0264aa0054d60054ab005b44", + "0x54aa0054d60054aa005b450260070054d600500700501b0260050054d6", + "0x508a0260264d60050264d00260264d60050260070264aa0070050d000a", + "0x54d600500a0052c102609e0054d600500700501b02609c0054d60054d0", + "0x508a0264c50054d60053090053280260a00054d60050880057200264c6", + "0x54d600509e00501b0260050054d600500500530f02609c0054d600509c", + "0x52c10260a00054d60050a00057200264c50054d60054c500532802609e", + "0x8a4a651900a4d60054c60a04c509e00509c089b5e0264c60054d60054c6", + "0x5b604a40054d60074a5005b5f02608a0054d600508a0890074890264a5", + "0x53170264a04a10bf0c04d60054a4005b610260264d60050260070264a2", + "0x265190054d600551900508a0260264d60054a00050bc0260264d60054a1", + "0x4a65190c0b620260bf0054d60050bf0057200264a60054d60054a600530f", + "0x702649c005b6449d0054d60070c2005b630260c249e49f0c04d60050bf", + "0x4a74a90074d600549d005b650264a80054d600502671f0260264d6005026", + "0x49a0057270260c649a0074d60054a90054da0260264d60054a70050bc026", + "0x2649f0054d600549f00508a0264990054d60050c60057280260264d6005", + "0x54a80057200264990054d60054990052c102649e0054d600549e00530f", + "0x49600598e0264964980c80c04d60054a849949e49f00ab660264a80054d6", + "0xc04d60054930059900260264d6005026007026523005b674930054d6007", + "0x26b680260264d600548d0050bc0260264d600549000531002648d48e490", + "0x54d600548c48e0074e202648c0054d600548c00596402648c0054d6005", + "0x508a0264890054d600548a005b6a02648a0054d600548b005b6902648b", + "0x54d600508a00501b0264980054d600549800530f0260c80054d60050c8", + "0x4d600502600702648908a4980c800a0054890054d6005489005b4502608a", + "0x530f0260c80054d60050c800508a0264880054d6005523005b44026026", + "0x54d6005488005b4502608a0054d600508a00501b0264980054d6005498", + "0x54d600549c005b440260264d600502600702648808a4980c800a005488", + "0x501b02649e0054d600549e00530f02649f0054d600549f00508a026487", + "0x2648708a49e49f00a0054870054d6005487005b4502608a0054d600508a", + "0x54d600551900508a0264860054d60054a2005b440260264d6005026007", + "0x5b4502608a0054d600508a00501b0264a60054d60054a600530f026519", + "0x70050260264d60050264d002648608a4a651900a0054860054d6005486", + "0x263440260264d600502600702640d4d4007b6b0160880074d6007005026", + "0x54d60054d30050d80264d20c00074d60050c000538f0264d30054d6005", + "0x50260070261c501c007b6c4d04d10074d60074d34d20880c015a0264d3", + "0x74d60074d008b4d10c015a02608b0070074d600500700538f0260264d6", + "0x260264d600530f0054590260264d6005026007026314312007b6d30f309", + "0x264d600508a0054590260264d60050c00054590260264d6005089005727", + "0x4d60053180059840263180054d60050264d30260264d600500a005310026", + "0x2602b0054d600531b005b6f02631b0054d6005319007007b6e026319005", + "0x502b005b700260160054d600501600530f0263090054d600530900508a", + "0x4d60053140054590260264d600502600702602b0163090c000502b0054d6", + "0x263310070074d600500700538f02602c08a0074d600508a00538f026026", + "0x264d6005026007026035038007b7101b0320074d600733102c3120c0811", + "0xc0b570260390054d60050360054d702603600a0074d600500a0057b8026", + "0x5b590260264d60050260070260ba005b720bb0bc0074d600701b039032", + "0x74d60050890054da0260c30054d60050bb005a260260bb0054d60050bb", + "0x260c30054d60050c30059640263530070074d600500700538f02634e34b", + "0x260264d600502600702607e005b7335f3580074d600735334e0bc0c0b57", + "0x50c30059790263650054d600535f005a2602635f0054d600535f005b59", + "0x263680054d60053680059640263680054d60053650059790261710054d6", + "0x26007026026b750264d6007368171007b740263580054d600535800508a", + "0x53100260264d600508a0054590260264d600534b0057270260264d6005", + "0xb7602636a0054d60050264d30260264d60050c00054590260264d600500a", + "0x50d4007007b6e0260d40054d60050d50059890260d50054d600536a005", + "0x263580054d600535800508a0260d20054d60050d3005b6f0260d30054d6", + "0xd20163580c00050d20054d60050d2005b700260160054d600501600530f", + "0x54d60050d10050d80260d10054d60050263440260264d6005026007026", + "0x50260070260cd0ce007b770cf0d00074d60070d10073580c08110260d1", + "0xd80260160054d600501600530f0260d00054d60050d000508a0260264d6", + "0x4d600500a0052c10260c00054d60050c00050d80260cf0054d60050cf005", + "0x96a02634b0054d600534b00572002608a0054d600508a0050d802600a005", + "0x263a43940cc0c00053a43940cc0c04d600534b08a00a0c00cf0160d0088", + "0x260264d600534b0057270260264d60050cd0054590260264d6005026007", + "0x264d60050c00054590260264d600500a0053100260264d600508a005459", + "0x4d60050c40053180260c40054d60050268630263a70054d6005026353026", + "0x3650260ca0054d600502607e0263ae0054d60050c43a700735f0260c4005", + "0x50ce00508a0261060054d600500e005b7802600e0054d60053ae0ca007", + "0x51060054d6005106005b700260160054d600501600530f0260ce0054d6", + "0x54590260264d60050c30059870260264d60050260070261060160ce0c0", + "0x3100260264d600508a0054590260264d600534b0057270260264d6005007", + "0x261050054d60050263530260264d60050c00054590260264d600500a005", + "0x510410500735f0261040054d60051040053180261040054d6005026408", + "0x261010054d60051031020073650261020054d600502607e0261030054d6", + "0x501600530f02607e0054d600507e00508a0261000054d6005101005b78", + "0x502600702610001607e0c00051000054d6005100005b700260160054d6", + "0xc00054590260264d60050070054590260264d60050890057270260264d6", + "0x263530260264d600500a0053100260264d600508a0054590260264d6005", + "0x260fe0054d60050fe0053180260fe0054d60050264080260ff0054d6005", + "0xfd0fc0073650260fc0054d600502607e0260fd0054d60050fe0ff00735f", + "0xba0054d60050ba00508a0260fa0054d60050fb005b780260fb0054d6005", + "0x160ba0c00050fa0054d60050fa005b700260160054d600501600530f026", + "0x4d60050890057270260264d60050350054590260264d60050260070260fa", + "0x508a0054590260264d60050c00054590260264d6005007005459026026", + "0x50268630260f90054d60050263530260264d600500a0053100260264d6", + "0xf70054d60050f80f900735f0260f80054d60050f80053180260f80054d6", + "0xf5005b780260f50054d60050f70f60073650260f60054d600502607e026", + "0x160054d600501600530f0260380054d600503800508a0260f40054d6005", + "0x260264d60050260070260f40160380c00050f40054d60050f4005b70026", + "0x264d60050890057270260264d60050070054590260264d60051c5005459", + "0x4d600500a0053100260264d600508a0054590260264d60050c0005459026", + "0x50f20053180260f20054d60050262290260f30054d6005026353026026", + "0x260f00054d600502607e0260f10054d60050f20f300735f0260f20054d6", + "0x1c00508a0260ee0054d60050ef005b780260ef0054d60050f10f0007365", + "0xee0054d60050ee005b700260160054d600501600530f02601c0054d6005", + "0x3100260264d60050070054590260264d60050260070260ee01601c0c0005", + "0x260264d60050c00054590260264d60050890057270260264d600500a005", + "0x4360054d60050261060260ed0054d60050263530260264d600508a005459", + "0x2607e0264390054d60054360ed00735f0264360054d6005436005318026", + "0x54d6005448005b780264480054d600543943f00736502643f0054d6005", + "0x5b7002640d0054d600540d00530f0264d40054d60054d400508a026170", + "0x26b7a02608a0054d6005026b7902617040d4d40c00051700054d6005170", + "0xb7b0264d30054d6005026b790264d40054d60050260bf0260880054d6005", + "0x2608b0054d6005026b7902601c0054d60050260bf0264d10054d6005026", + "0x3190054d60050260bf0263140054d6005026b7902630f0054d6005026b7b", + "0x264d60050261020263310054d6005026b7902602b0054d6005026b7b026", + "0x50320054d70260320c00074d60050c00057b80260264d60050264d0026", + "0xd80260350054d6005026b7c0260380054d600501b0057b902601b0054d6", + "0x350380260c015a0260350054d60050350050d80260380054d6005038005", + "0x50390054590260264d60050260070260bb0bc007b7d0390360074d6007", + "0x3600508a0260c30054d600502608d0260ba0054d600502671f0260264d6", + "0xc30054d60050c30050d80260050054d600500500530f0260360054d6005", + "0x52c102634b0c00074d60050c00057b80260ba0054d60050ba005720026", + "0x2635835334e0c04d600534b0ba0c300503608ab7e02634b0054d600534b", + "0xc0005b550260264d600502600702635f005b800890054d6007358005b7f", + "0x3680054d60053650054d70261710054d600502699c02636507e0074d6005", + "0x88007b810261710054d60051710050d802636a0054d6005368005b56026", + "0x260d3005b820d40d50074d600717136a34e0c0b570260890054d6005089", + "0x54d60050d4005a260260d40054d60050d4005b590260264d6005026007", + "0x54d70260d00054d6005026b830260d10d20074d600507e005b5502640d", + "0x54d60050d00050d80260ce0054d60050cf005b560260cf0054d60050d1", + "0xcd0074d60070d00ce0d50c0b5702640d0054d600540d4d3007b840260d0", + "0xa260260cc0054d60050cc005b590260264d6005026007026394005b850cc", + "0x502c00597902602c0054d600502c331007b8402602c0054d60050cc005", + "0x4fc0260c40054d6005026b870263a70054d60053a4005b860263a40054d6", + "0x4d60053ae0c4007b520260c40054d60050c40050d80263ae0054d6005026", + "0x10600e0074d60070ca0cd007b530260ca0054d60050ca00536f0260ca005", + "0xe00508a0261040054d60050264280260264d6005026007026105005b88", + "0x1040054d60051040050d80263530054d600535300530f02600e0054d6005", + "0x1021030c04d600510610435300e00ab890261060054d60051060050d8026", + "0x70260ff005b8b1000054d6007101005b8a0260264d600502600a026101", + "0x260fd0054d60050fe005b8d0260fe0054d6005026b8c0260264d6005026", + "0xfb00536f0260fb0054d60050fc3a7007b520260fc0054d6005100005b8e", + "0x4d60050fd0fb0070c0b8f0260fd0054d60050fd00536f0260fb0054d6005", + "0x260264d60050f700539a0260264d60050f800539a0260f70f80f90fa00a", + "0xf9103007b530260fa0054d60050fa00501b0260f90054d60050f900536f", + "0x54d600502608d0260264d60050260070260f4005b900f50f60074d6007", + "0xf231800a4d60050f50f30fa0c0b500260f30054d60050f30050d80260f3", + "0xd2005b550260264d60050f10054590260264d60050f200545902631b0f1", + "0xed0054d60050ef0054d70260ee0054d6005026b910260ef0f00074d6005", + "0x3190074890260ee0054d60050ee0050d80264360054d60050ed005b56026", + "0xee4360f60c0b5702631b0054d600531b02b007b920263180054d6005318", + "0x4d600543f005b590260264d6005026007026448005b9343f4390074d6007", + "0x263120054d6005312314007b840263120054d600543f005a2602643f005", + "0x4d60050264280264970054d6005170005b860261700054d6005312005979", + "0x7b520260ec0054d60050ec0050d80260eb0054d60050264fc0260ec005", + "0x70ea439007b530260ea0054d60050ea00536f0260ea0054d60050eb0ec", + "0xe60054d60050264280260264d60050260070260e7005b940e80e90074d6", + "0xe60050d80261020054d600510200530f0260e90054d60050e900508a026", + "0x50e80e61020e900ab890260e80054d60050e80050d80260e60054d6005", + "0xb950e20054d60070e3005b8a0260264d600502600a0260e30e40e50c04d6", + "0x50e0005b8d0260e00054d6005026b8c0260264d60050260070260e1005", + "0xdd0054d60050de497007b520260de0054d60050e2005b8e0260df0054d6", + "0x3180c0b8f0260df0054d60050df00536f0260dd0054d60050dd00536f026", + "0xd900539a0260264d60050da00539a0260d90da0db0dc00a4d60050df0dd", + "0x260dc0054d60050dc00501b0260db0054d60050db00536f0260264d6005", + "0xb500260264d60050260070260d7005b960d808d0074d60070db0e5007b53", + "0x4590260264d60050060054590263090d60064d000a4d60050d831b0dc0c0", + "0x54d6005026b970260940810074d60050f0005b550260264d60050d6005", + "0x50d802607d0054d60054c9005b560264c90054d60050940054d70264ca", + "0x530930f007b920264d00054d60054d001c0074890264ca0054d60054ca", + "0x2600702609a005b9801a4c80074d60074ca07d08d0c0b570263090054d6", + "0x261c50054d600501a005a2602601a0054d600501a005b590260264d6005", + "0x9b005b8602609b0054d60051c50059790261c50054d60051c508b007b84", + "0xd80264c60054d60050264fc02609e0054d600502634402609c0054d6005", + "0x50a000536f0260a00054d60054c609e007b5202609e0054d600509e005", + "0x50260070264c3005b994c44c50074d60070a04c8007b530260a00054d6", + "0x530f0264c50054d60054c500508a0264c20054d60050264280260264d6", + "0x54d60054c40050d80264c20054d60054c20050d80260e40054d60050e4", + "0x264d600502600a0264bf4c04c10c04d60054c44c20e44c500ab890264c4", + "0x26b8c0260264d60050260070264bd005b9a4be0054d60074bf005b8a026", + "0xad0054d60054be005b8e0260ab0054d60050aa005b8d0260aa0054d6005", + "0x536f0264bc0054d60054bc00536f0264bc0054d60050ad09c007b52026", + "0x39a0264b84b94ba4bb00a4d60050ab4bc4d00c0b8f0260ab0054d60050ab", + "0x4ba0054d60054ba00536f0260264d60054b800539a0260264d60054b9005", + "0x5b9b4b64b70074d60074ba4c1007b530264bb0054d60054bb00501b026", + "0x4d24b34b401600a4d60054b63094bb0c0b500260264d60050260070264b5", + "0x4d6005081005b550260264d60054b30054590260264d60054b4005459026", + "0x54d70264b00054d6005026b9c0260264d60054b20053100264b14b2007", + "0x54d60054b00050d80260840054d60054af005b560264af0054d60054b1", + "0x264d20054d60054d24d1007b920260160054d60050164d40074890264b0", + "0x260264d60050260070264ab005b9d4ac5180074d60074b00844b70c0b57", + "0xa08a007b8402600a0054d60054ac005a260264ac0054d60054ac005b59", + "0x5190054d60054aa005b860264aa0054d600500a00597902600a0054d6005", + "0x4d60054a60050d80264a50054d60050264fc0264a60054d600502608d026", + "0x264a40054d60054a400536f0264a40054d60054a54a6007b520264a6005", + "0x4280260264d60050260070264a1005b9e0bf4a20074d60074a4518007b53", + "0x54d60054c000530f0264a20054d60054a200508a0264a00054d6005026", + "0xab890260bf0054d60050bf0050d80264a00054d60054a00050d80264c0", + "0xc2005b8a0260264d600502600a0260c249e49f0c04d60050bf4a04c04a2", + "0x4a80054d6005026b8c0260264d600502600702649c005b9f49d0054d6007", + "0x519007b520264a70054d600549d005b8e0264a90054d60054a8005b8d026", + "0x54d60054a900536f02649a0054d600549a00536f02649a0054d60054a7", + "0x4d60050c800539a0264980c84990c600a4d60054a949a0160c0b8f0264a9", + "0xc600501b0264990054d600549900536f0260264d600549800539a026026", + "0x26007026523005ba04934960074d600749949f007b530260c60054d6005", + "0x48e49000a4d60054934d20c60c0b500260264d60050264d00260264d6005", + "0x890054fb0260264d600548d0054590260264d600548e00545902648c48d", + "0x264d60054890050bc0260264d600548a00545902648948a48b0c04d6005", + "0xba20264870054d600548c48848b0c0ba10264880054d600540d005979026", + "0x4d6005485005ba40264850054d6005486005ba30264860054d6005487005", + "0x1b02649e0054d600549e00530f0264960054d600549600508a026484005", + "0x48449049e49600a0054840054d6005484005ba50264900054d6005490005", + "0x264d600540d0059870260264d6005089005ba60260264d6005026007026", + "0x54d60050265870264830054d60050263530260264d60054d2005459026", + "0x8a0264810054d600548248300735f0264820054d6005482005318026482", + "0x4d60054810050f502647f0054d60050c600501b0264800054d6005523005", + "0x4d6005089005ba60260264d6005026007026026ba700502640d02647e005", + "0x55190054590260264d60054d20054590260264d600540d005987026026", + "0x8a0260264d600547d0054b502647c47d0074d600549c0054b60260264d6", + "0x4d600547c0050f502647f0054d600501600501b0264800054d600549f005", + "0x47e47b00736502647b0054d600502607e0260264d60050264d002647e005", + "0x4800054d600548000508a0264790054d600547a005ba802647a0054d6005", + "0x479005ba502647f0054d600547f00501b02649e0054d600549e00530f026", + "0x50264d00260264d600502600702647947f49e48000a0054790054d6005", + "0x40d0059870260264d6005089005ba60260264d60055190054590260264d6", + "0x26b5d0264780054d60050263530260264d60054d20054590260264d6005", + "0x54d600547747800735f0264770054d60054770053180264770054d6005", + "0x5ba80264740054d60054764750073650264750054d600502607e026476", + "0x54d60054c000530f0264a10054d60054a100508a0264730054d6005474", + "0x4a100a0054730054d6005473005ba50260160054d600501600501b0264c0", + "0x508a005ba90260264d60050264d00260264d60050260070264730164c0", + "0x4d20054590260264d600540d0059870260264d6005089005ba60260264d6", + "0x53180264710054d60050264080264720054d60050263530260264d6005", + "0x54d600502607e0264700054d600547147200735f0264710054d6005471", + "0x8a02646d0054d600546e005ba802646e0054d600547046f00736502646f", + "0x4d600501600501b0264c00054d60054c000530f0264ab0054d60054ab005", + "0x502600702646d0164c04ab00a00546d0054d600546d005ba5026016005", + "0x810053100260264d6005089005ba60260264d600508a005ba90260264d6", + "0x5baa0260264d60054d40054960260264d600540d0059870260264d6005", + "0x58702646c0054d60050263530260264d60053090054590260264d60054d1", + "0x4d600546b46c00735f02646b0054d600546b00531802646b0054d6005026", + "0xf50264680054d60054bb00501b0264690054d60054b500508a02646a005", + "0xba90260264d6005026007026026bab00502640d0264670054d600546a005", + "0x260264d60050810053100260264d6005089005ba60260264d600508a005", + "0x264d60054d1005baa0260264d60054d40054960260264d600540d005987", + "0x4d60054bd0054b60260264d600509c0054590260264d6005309005459026", + "0x1b0264690054d60054c100508a0260264d60054660054b5026465466007", + "0x264d60050264d00264670054d60054650050f50264680054d60054d0005", + "0x463005ba80264630054d60054674640073650264640054d600502607e026", + "0x4c00054d60054c000530f0264690054d600546900508a0264620054d6005", + "0x4c046900a0054620054d6005462005ba50264680054d600546800501b026", + "0x4d600508a005ba90260264d60050264d00260264d6005026007026462468", + "0x540d0059870260264d60050810053100260264d6005089005ba6026026", + "0x4d1005baa0260264d60054d40054960260264d600509c0054590260264d6", + "0x26b5d0264610054d60050263530260264d60053090054590260264d6005", + "0x54d600546046100735f0264600054d60054600053180264600054d6005", + "0x5ba802645d0054d600545f45e00736502645e0054d600502607e02645f", + "0x54d60050e400530f0264c30054d60054c300508a02645c0054d600545d", + "0x4c300a00545c0054d600545c005ba50264d00054d60054d000501b0260e4", + "0x508a005ba90260264d60050264d00260264d600502600702645c4d00e4", + "0x40d0059870260264d60050810053100260264d6005089005ba60260264d6", + "0x5baa0260264d60054d40054960260264d600508b005ba90260264d6005", + "0x40802645b0054d60050263530260264d60053090054590260264d60054d1", + "0x4d600545a45b00735f02645a0054d600545a00531802645a0054d6005026", + "0xba80264570054d60054594580073650264580054d600502607e026459005", + "0x4d60050e400530f02609a0054d600509a00508a0264560054d6005457005", + "0xa0054560054d6005456005ba50264d00054d60054d000501b0260e4005", + "0x5ba60260264d600508a005ba90260264d60050260070264564d00e409a", + "0x3100260264d600508b005ba90260264d600540d0059870260264d6005089", + "0x260264d60054d1005baa0260264d60054d40054960260264d60050f0005", + "0x264d600531b0054590260264d600530f005baa0260264d600501c005496", + "0x4d60054540053180264540054d60050265870264550054d6005026353026", + "0x264520054d60050d700508a0264530054d600545445500735f026454005", + "0xbac00502640d0264500054d60054530050f50264510054d60050dc00501b", + "0x4d6005089005ba60260264d600508a005ba90260264d6005026007026026", + "0x50f00053100260264d600508b005ba90260264d600540d005987026026", + "0x1c0054960260264d60054d1005baa0260264d60054d40054960260264d6", + "0x54590260264d600531b0054590260264d600530f005baa0260264d6005", + "0x264d600544f0054b502601e44f0074d60050e10054b60260264d6005497", + "0x1e0050f50264510054d600531800501b0264520054d60050e500508a026", + "0x736502607a0054d600502607e0260264d60050264d00264500054d6005", + "0x4d600545200508a02610a0054d600544c005ba802644c0054d600545007a", + "0xba50264510054d600545100501b0260e40054d60050e400530f026452005", + "0x4d00260264d600502600702610a4510e445200a00510a0054d600510a005", + "0x4590260264d6005089005ba60260264d600508a005ba90260264d6005026", + "0x260264d600508b005ba90260264d600540d0059870260264d6005497005", + "0x264d60054d1005baa0260264d60054d40054960260264d60050f0005310", + "0x4d600531b0054590260264d600530f005baa0260264d600501c005496026", + "0x544a00531802644a0054d6005026b5d02644b0054d6005026353026026", + "0x2610d0054d600502607e02610b0054d600544a44b00735f02644a0054d6", + "0xe700508a0261100054d600510e005ba802610e0054d600510b10d007365", + "0x3180054d600531800501b0261020054d600510200530f0260e70054d6005", + "0x264d60050260070261103181020e700a0051100054d6005110005ba5026", + "0x264d6005089005ba60260264d600508a005ba90260264d60050264d0026", + "0x4d600508b005ba90260264d600540d0059870260264d6005314005ba9026", + "0x54d1005baa0260264d60054d40054960260264d60050f0005310026026", + "0x31b0054590260264d600530f005baa0260264d600501c0054960260264d6", + "0x53180264430054d60050264080264490054d60050263530260264d6005", + "0x54d600502607e0264420054d600544344900735f0264430054d6005443", + "0x8a0261130054d6005114005ba80261140054d6005442112007365026112", + "0x4d600531800501b0261020054d600510200530f0264480054d6005448005", + "0x502600702611331810244800a0051130054d6005113005ba5026318005", + "0x314005ba90260264d6005089005ba60260264d600508a005ba90260264d6", + "0x54960260264d600508b005ba90260264d600540d0059870260264d6005", + "0x4960260264d60050d20053100260264d60054d1005baa0260264d60054d4", + "0x260264d60053190054960260264d600530f005baa0260264d600501c005", + "0x11a0054d60050265870261110054d60050263530260264d600502b005baa", + "0x508a02611d0054d600511a11100735f02611a0054d600511a005318026", + "0x54d600511d0050f50260140054d60050fa00501b02611e0054d60050f4", + "0x264d600508a005ba90260264d6005026007026026bad00502640d026120", + "0x4d600540d0059870260264d6005314005ba90260264d6005089005ba6026", + "0x54d1005baa0260264d60054d40054960260264d600508b005ba9026026", + "0x30f005baa0260264d600501c0054960260264d60050d20053100260264d6", + "0x54590260264d600502b005baa0260264d60053190054960260264d6005", + "0x264d60054400054b502643e4400074d60050ff0054b60260264d60053a7", + "0x43e0050f50260140054d600500700501b02611e0054d600510300508a026", + "0x736502643d0054d600502607e0260264d60050264d00261200054d6005", + "0x4d600511e00508a02643b0054d600543c005ba802643c0054d600512043d", + "0xba50260140054d600501400501b0261020054d600510200530f02611e005", + "0xba90260264d600502600702643b01410211e00a00543b0054d600543b005", + "0x260264d6005314005ba90260264d6005089005ba60260264d600508a005", + "0x264d60053a70054590260264d600508b005ba90260264d600540d005987", + "0x4d60050d20053100260264d60054d1005baa0260264d60054d4005496026", + "0x53190054960260264d600530f005baa0260264d600501c005496026026", + "0x5026b5d02643a0054d60050263530260264d600502b005baa0260264d6", + "0x1280054d600543843a00735f0264380054d60054380053180264380054d6", + "0x12a005ba802612a0054d600512812b00736502612b0054d600502607e026", + "0x3530054d600535300530f0261050054d600510500508a0261290054d6005", + "0x35310500a0051290054d6005129005ba50260070054d600500700501b026", + "0x5089005ba60260264d600508a005ba90260264d6005026007026129007", + "0x8b005ba90260264d600540d0059870260264d6005314005ba90260264d6", + "0x5baa0260264d60054d40054960260264d6005331005ba90260264d6005", + "0xbaa0260264d600501c0054960260264d60050d20053100260264d60054d1", + "0x260264d600502b005baa0260264d60053190054960260264d600530f005", + "0x54d60051260053180261260054d60050264080261270054d6005026353", + "0x73650261340054d600502607e0261330054d600512612700735f026126", + "0x4d600539400508a0264350054d6005437005ba80264370054d6005133134", + "0xba50260070054d600500700501b0263530054d600535300530f026394005", + "0xba90260264d600502600702643500735339400a0054350054d6005435005", + "0x260264d6005314005ba90260264d6005089005ba60260264d600508a005", + "0x264d6005331005ba90260264d600508b005ba90260264d600507e005310", + "0x4d60054d3005ba90260264d60054d1005baa0260264d60054d4005496026", + "0x53190054960260264d600530f005baa0260264d600501c005496026026", + "0x50264080264340054d60050263530260264d600502b005baa0260264d6", + "0x4320054d600543343400735f0264330054d60054330053180264330054d6", + "0x430005ba80264300054d60054324310073650264310054d600502607e026", + "0x3530054d600535300530f0260d30054d60050d300508a02642f0054d6005", + "0x3530d300a00542f0054d600542f005ba50260070054d600500700501b026", + "0x50c00053100260264d600508a005ba90260264d600502600702642f007", + "0x331005ba90260264d600508b005ba90260264d6005314005ba90260264d6", + "0x5ba90260264d60054d1005baa0260264d60054d40054960260264d6005", + "0x4960260264d600530f005baa0260264d600501c0054960260264d60054d3", + "0x260264d6005088005bae0260264d600502b005baa0260264d6005319005", + "0x535300530f02634e0054d600534e00508a02642e0054d600535f005ba8", + "0x542e0054d600542e005ba50260070054d600500700501b0263530054d6", + "0xba90260264d60050bb0054590260264d600502600702642e00735334e00a", + "0x260264d6005314005ba90260264d60050c00053100260264d600508a005", + "0x264d6005331005ba90260264d600508b005ba90260264d6005088005bae", + "0x4d60054d3005ba90260264d60054d1005baa0260264d60054d4005496026", + "0x53190054960260264d600530f005baa0260264d600501c005496026026", + "0x42d005baf02642d0054d60050264d30260264d600502b005baa0260264d6", + "0x42a0054d600542b005ba402642b0054d600542c005ba302642c0054d6005", + "0x700501b0260050054d600500500530f0260bc0054d60050bc00508a026", + "0x4d002642a0070050bc00a00542a0054d600542a005ba50260070054d6005", + "0x7026088089007bb008a00a0074d60070050260070050260264d6005026", + "0x8a0260264d600502600a0260160054d60050070054d70260264d6005026", + "0x70264d3005bb140d4d40074d6007016005a1f02600a0054d600500a005", + "0x4d10054d60054d400599e0264d20054d600540d005a210260264d6005026", + "0x264d6005026007026026bb200502640d0264d00054d60054d20054e7026", + "0x54d300599e0261c50054d600501c005a2302601c0054d60050264d3026", + "0x2608b0054d60054d10057280264d00054d60051c50054e70264d10054d6", + "0x50264d00260264d600502600702630f005bb33090054d60074d0005a24", + "0x9640263140054d60053120059790263120054d6005309005a260260264d6", + "0x500a00508a0263180054d60053140c00074e20263140054d6005314005", + "0x2608b0054d600508b0052c102608a0054d600508a00530f02600a0054d6", + "0x2b31b3190c04d600531808b08a00a00a98d0263180054d6005318005720", + "0x50bc0260264d60050264d00260264d600502600702602b31b3190c0005", + "0x54d600502c0c008b0c0bb402602c0054d60050264d30260264d600530f", + "0x530f02600a0054d600500a00508a0260320054d6005331005bb5026331", + "0x702603208a00a0c00050320054d6005032005bb602608a0054d600508a", + "0x3530260264d60050c00057270260264d60050070053100260264d6005026", + "0x380054d60050380053180260380054d600502610602601b0054d6005026", + "0x360073650260360054d600502607e0260350054d600503801b00735f026", + "0x54d600508900508a0260bc0054d6005039005bb70260390054d6005035", + "0x890c00050bc0054d60050bc005bb60260880054d600508800530f026089", + "0x50261020260880054d6005026bb802608a0054d60050260bf0260bc088", + "0x57b90264d40160074d60050c00054da0260264d60050264d00260264d6", + "0x40d0054d600540d0050d80264d30054d60050264fc02640d0054d60054d4", + "0xb530260890054d6005089088007bb90260890054d60054d340d007b52026", + "0x5b8d0260264d60050260070264d0005bba4d14d20074d6007089026007", + "0x1c50054d60051c50059640261c50054d6005026bbb02601c0054d60054d1", + "0x530f0264d20054d60054d200508a02608b0054d60051c50160074e2026", + "0x508b0054d20c0bbc02608b0054d600508b0057200260050054d6005005", + "0x5026007026318005bbd3140054d6007312005b6302631230f3090c04d6", + "0x36f02631b01c0074d600501c00536e0263190054d6005026bbe0260264d6", + "0x2603233102c02b00a4d600531931b0070c0b8f0263190054d6005319005", + "0x1b0054d60050264f90260264d600503200539a0260264d600533100539a", + "0x2c00536f02602b0054d600502b00501b02601b0054d600501b00536f026", + "0x264d6005026007026038005bc00264d600701b005bbf02602c0054d6005", + "0x4d600508a0054960260264d600501c00539a0260264d6005314005bc1026", + "0x4d6005026b000260350054d60050263530260264d600502c00539a026026", + "0x260390054d600503603500735f0260360054d6005036005318026036005", + "0x50bb005b440260bb0054d60050390bc0073650260bc0054d600502607e", + "0x2630f0054d600530f00530f0263090054d600530900508a0260ba0054d6", + "0x2b30f30900a0050ba0054d60050ba005b4502602b0054d600502b00501b", + "0x2634e34b0c30c04d600503802c3090c0bc20260264d60050260070260ba", + "0x2635f005bc43583530074d600734b0c3007bc30260264d600534e00539a", + "0x4d60053650050bc02636507e0074d6005314005b650260264d6005026007", + "0x536e0263680054d6005026bc50261710054d600535807e0074e2026026", + "0x36836a02b0c0b8f0263680054d600536800536f02636a01c0074d600501c", + "0x4d60050d200539a0260264d60050d300539a0260d20d30d40d500a4d6005", + "0x35300508a0260d10054d60050d100536f0260d10054d6005026bc6026026", + "0xd50054d60050d500501b0261710054d60051710057200263530054d6005", + "0x70260d0005bc70264d60070d1005bbf0260d40054d60050d400536f026", + "0x39a0260264d600508a0054960260264d60051710057270260264d6005026", + "0x260cf0054d60050263530260264d60050d400539a0260264d600501c005", + "0x50ce0cf00735f0260ce0054d60050ce0053180260ce0054d6005026b00", + "0x263940054d60050cd0cc0073650260cc0054d600502607e0260cd0054d6", + "0x530f00530f0263530054d600535300508a0263a40054d6005394005b44", + "0x53a40054d60053a4005b450260d50054d60050d500501b02630f0054d6", + "0xc04d60050d00d43530c0bc20260264d60050260070263a40d530f35300a", + "0xe0ca0074d60070c43a7007bc30260264d60053ae00539a0263ae0c43a7", + "0xbc90261050054d600500e1710074e20260264d6005026007026106005bc8", + "0x4d600510400536f02610301c0074d600501c00536e0261040054d6005026", + "0x510000539a0260ff10010110200a4d60051041030d50c0b8f026104005", + "0xfe00536f0260fe0054d6005026bca0260264d60050ff00539a0260264d6", + "0x1050054d60051050057200260ca0054d60050ca00508a0260fe0054d6005", + "0xfe005bbf0261010054d600510100536f0261020054d600510200501b026", + "0x260264d60051050057270260264d60050260070260fd005bcb0264d6007", + "0x264d600510100539a0260264d600508a0054960260264d600501c00539a", + "0x4d60050fb0053180260fb0054d6005026b000260fc0054d6005026353026", + "0x3650260f90054d600502607e0260fa0054d60050fb0fc00735f0260fb005", + "0x50ca00508a0260f70054d60050f8005b440260f80054d60050fa0f9007", + "0x261020054d600510200501b02630f0054d600530f00530f0260ca0054d6", + "0x260264d60050260070260f710230f0ca00a0050f70054d60050f7005b45", + "0xbc30260264d60050f400539a0260f40f50f60c04d60050fd1010ca0c0bc2", + "0x74e20260264d60050260070260f1005bcc0f20f30074d60070f50f6007", + "0x74d600501c00536e0260ef0054d6005026bcd0260f00054d60050f2105", + "0xed00a4d60050ef0ee1020c0b8f0260ef0054d60050ef00536f0260ee01c", + "0x26bce0260264d600543f00539a0260264d600543900539a02643f439436", + "0xf30054d60050f300508a0264480054d600544800536f0264480054d6005", + "0x43600536f0260ed0054d60050ed00501b0260f00054d60050f0005720026", + "0x264d6005026007026170005bcf0264d6007448005bbf0264360054d6005", + "0x4d600501c00539a0260264d600508a0054960260264d60050f0005727026", + "0x4d6005026b000264970054d60050263530260264d600543600539a026026", + "0x260eb0054d60050ec49700735f0260ec0054d60050ec0053180260ec005", + "0x50e9005b440260e90054d60050eb0ea0073650260ea0054d600502607e", + "0x2630f0054d600530f00530f0260f30054d60050f300508a0260e80054d6", + "0xed30f0f300a0050e80054d60050e8005b450260ed0054d60050ed00501b", + "0x260e50e60e70c04d60051704360f30c0bc20260264d60050260070260e8", + "0x260e2005bd00e30e40074d60070e60e7007bc30260264d60050e500539a", + "0x54d6005026bd10260e10054d60050e30f00074e20260264d6005026007", + "0xb8f0260e00054d60050e000536f0260df01c0074d600501c00536e0260e0", + "0x39a0260264d60050dc00539a0260db0dc0dd0de00a4d60050e00df0ed0c0", + "0xda0054d60050da00536f0260da0054d6005026bd20260264d60050db005", + "0xde00501b0260e10054d60050e10057200260e40054d60050e400508a026", + "0xbd30264d60070da005bbf0260dd0054d60050dd00536f0260de0054d6005", + "0x501c00539a0260264d60050e10057270260264d60050260070260d9005", + "0x50263530260264d60050dd00539a0260264d600508a0054960260264d6", + "0x35f0260d80054d60050d80053180260d80054d6005026b0002608d0054d6", + "0x50d70060073650260060054d600502607e0260d70054d60050d808d007", + "0x260e40054d60050e400508a0260810054d60050d6005b440260d60054d6", + "0x5081005b450260de0054d60050de00501b02630f0054d600530f00530f", + "0xdd0e40c0bc20260264d60050260070260810de30f0e400a0050810054d6", + "0x74ca094007bc30260264d60054c900539a0264c94ca0940c04d60050d9", + "0x4d60054c80e10074e20260264d600502600702601a005bd44c807d0074d6", + "0x36f02609c01c0074d600501c00536e02609b0054d6005026bd502609a005", + "0x264c50a04c609e00a4d600509b09c0de0c0b8f02609b0054d600509b005", + "0x4c40054d6005026bd60260264d60054c500539a0260264d60050a000539a", + "0x9a00572002607d0054d600507d00508a0264c40054d60054c400536f026", + "0x4c60054d60054c600536f02609e0054d600509e00501b02609a0054d6005", + "0x9a0057270260264d60050260070264c3005bd70264d60074c4005bbf026", + "0x539a0260264d600501c00539a0260264d600508a0054960260264d6005", + "0x3180264c10054d6005026b000264c20054d60050263530260264d60054c6", + "0x4d600502607e0264c00054d60054c14c200735f0264c10054d60054c1005", + "0x264bd0054d60054be005b440264be0054d60054c04bf0073650264bf005", + "0x509e00501b02630f0054d600530f00530f02607d0054d600507d00508a", + "0x260070264bd09e30f07d00a0054bd0054d60054bd005b4502609e0054d6", + "0x50ad00539a0260ad0ab0aa0c04d60054c34c607d0c0bc20260264d6005", + "0x4d60050260070264ba005bd84bb4bc0074d60070ab0aa007bc30260264d6", + "0x536e0264b80054d6005026bd90264b90054d60054bb09a0074e2026026", + "0x4b84b709e0c0b8f0264b80054d60054b800536f0264b701c0074d600501c", + "0x4d60054b300539a0260264d60054b400539a0264b34b44b54b600a4d6005", + "0x4bc00508a0264b20054d60054b200536f0264b20054d6005026bda026026", + "0x4b60054d60054b600501b0264b90054d60054b90057200264bc0054d6005", + "0x70264b1005bdb0264d60074b2005bbf0264b50054d60054b500536f026", + "0x4960260264d600501c00539a0260264d60054b90057270260264d6005026", + "0x264b00054d60050263530260264d60054b500539a0260264d600508a005", + "0x54af4b000735f0264af0054d60054af0053180264af0054d6005026b00", + "0x264ac0054d60050845180073650265180054d600502607e0260840054d6", + "0x530f00530f0264bc0054d60054bc00508a0264ab0054d60054ac005b44", + "0x54ab0054d60054ab005b450264b60054d60054b600501b02630f0054d6", + "0xc04d60054b14b54bc0c0bc20260264d60050260070264ab4b630f4bc00a", + "0x4a44a50074d60075194aa007bc30260264d60054a600539a0264a65194aa", + "0xbdd0260bf0054d60054a44b90074e20260264d60050260070264a2005bdc", + "0x54a101c4b60c0b8f0264a10054d60054a100536f0264a10054d6005026", + "0x264d600549e00539a0260264d600549f00539a02649e49f4a000a00a4d6", + "0x8a0074890260bf0054d60050bf0057200264a00054d60054a000536f026", + "0x702649c005bde49d0c20074d60074a04a5007bc302600a0054d600500a", + "0x4a90054d6005026bdf0264a80054d600549d0bf0074e20260264d6005026", + "0x49a0057280260264d60054a700572702649a4a70074d60054a80054da026", + "0x30f0054d600530f00530f0260c20054d60050c200508a0260c60054d6005", + "0xc200abe10264a90054d60054a9005be00260c60054d60050c60052c1026", + "0x493005be34960054d6007498005be20264980c84990c04d60054a90c630f", + "0x4900054d60050264f60265230054d6005026bdf0260264d6005026007026", + "0x26be502648e0054d6005490523007be40264900054d60054900050d8026", + "0x54d600548d48e007be402648d0054d600548d0050d802648d0054d6005", + "0x48c007be402648b0054d600548b0050d802648b0054d6005026be602648c", + "0x4890054d60054890050d80264890054d6005026be702648a0054d600548b", + "0x4870050d80264870054d6005026be80264880054d600548948a007be4026", + "0x4850054d6005026be90264860054d6005487488007be40264870054d6005", + "0x26bea0264840054d6005485486007be40264850054d60054850050d8026", + "0x54d6005483484007be40264830054d60054830050d80264830054d6005", + "0x482007be40264810054d60054810050d80264810054d6005026beb026482", + "0x47e0c04d6005496005bed02647f0054d6005026bec0264800054d6005481", + "0x47d005bee0260264d600547c0050bc0260264d600547e00531002647c47d", + "0x264790054d600502608d0260264d600547b005bef02647a47b0074d6005", + "0x5480005bee0260264d6005478005bef0264774780074d600547f005bee", + "0x264740054d600547a005bf00260264d6005476005bef0264754760074d6", + "0x549900508a0264720054d6005475005bf00264730054d6005477005bf0", + "0x2600a0054d600500a00501b0260c80054d60050c800530f0264990054d6", + "0x5473005bf10264790054d60054790050d80264740054d6005474005bf1", + "0x47347947400a0c8499088bf20264720054d6005472005bf10264730054d6", + "0x2646c005bf446d0054d600746e005bf302646e46f47047100a4d6005472", + "0x46a0054d600546d005bf502646b0054d600502671f0260264d6005026007", + "0x46f00501b0264700054d600547000530f0264710054d600547100508a026", + "0x46b0054d600546b00572002646a0054d600546a005bf102646f0054d6005", + "0x7466005bf702646646746846900a4d600546b46a46f47047108abf6026", + "0x4630c04d6005465005bf90260264d6005026007026464005bf84650054d6", + "0x462005b690260264d60054610050bc0260264d60054630054f3026461462", + "0x4690054d600546900508a02645f0054d6005460005b6a0264600054d6005", + "0x45f005b450264670054d600546700501b0264680054d600546800530f026", + "0x464005b440260264d600502600702645f46746846900a00545f0054d6005", + "0x4680054d600546800530f0264690054d600546900508a02645e0054d6005", + "0x46846900a00545e0054d600545e005b450264670054d600546700501b026", + "0x47100508a02645d0054d600546c005b440260264d600502600702645e467", + "0x46f0054d600546f00501b0264700054d600547000530f0264710054d6005", + "0x264d600502600702645d46f47047100a00545d0054d600545d005b45026", + "0xc800530f0264990054d600549900508a02645c0054d6005493005b44026", + "0x45c0054d600545c005b4502600a0054d600500a00501b0260c80054d6005", + "0x260264d60050bf0057270260264d600502600702645c00a0c849900a005", + "0x54d600545a00531802645a0054d600502658702645b0054d6005026353", + "0x73650264580054d600502607e0264590054d600545a45b00735f02645a", + "0x4d600549c00508a0264560054d6005457005b440264570054d6005459458", + "0xb4502600a0054d600500a00501b02630f0054d600530f00530f02649c005", + "0x7270260264d600502600702645600a30f49c00a0054560054d6005456005", + "0x260264d600508a0054960260264d600501c00539a0260264d60054b9005", + "0x54d60054540053180264540054d60050265870264550054d6005026353", + "0x73650264520054d600502607e0264530054d600545445500735f026454", + "0x4d60054a200508a0264500054d6005451005b440264510054d6005453452", + "0xb450264b60054d60054b600501b02630f0054d600530f00530f0264a2005", + "0x7270260264d60050260070264504b630f4a200a0054500054d6005450005", + "0x260264d600501c00539a0260264d600508a0054960260264d600509a005", + "0x54d600501e00531802601e0054d600502658702644f0054d6005026353", + "0x736502644c0054d600502607e02607a0054d600501e44f00735f02601e", + "0x4d60054ba00508a02644b0054d600510a005b4402610a0054d600507a44c", + "0xb4502609e0054d600509e00501b02630f0054d600530f00530f0264ba005", + "0x7270260264d600502600702644b09e30f4ba00a00544b0054d600544b005", + "0x260264d600508a0054960260264d600501c00539a0260264d60050e1005", + "0x54d600510b00531802610b0054d600502658702644a0054d6005026353", + "0x736502610e0054d600502607e02610d0054d600510b44a00735f02610b", + "0x4d600501a00508a0264490054d6005110005b440261100054d600510d10e", + "0xb450260de0054d60050de00501b02630f0054d600530f00530f02601a005", + "0x7270260264d60050260070264490de30f01a00a0054490054d6005449005", + "0x260264d600501c00539a0260264d600508a0054960260264d60050f0005", + "0x54d60054420053180264420054d60050265870264430054d6005026353", + "0x73650261140054d600502607e0261120054d600544244300735f026442", + "0x4d60050e200508a0261110054d6005113005b440261130054d6005112114", + "0xb450260ed0054d60050ed00501b02630f0054d600530f00530f0260e2005", + "0x7270260264d60050260070261110ed30f0e200a0051110054d6005111005", + "0x260264d600508a0054960260264d600501c00539a0260264d6005105005", + "0x54d600511d00531802611d0054d600502658702611a0054d6005026353", + "0x73650260140054d600502607e02611e0054d600511d11a00735f02611d", + "0x4d60050f100508a0264400054d6005120005b440261200054d600511e014", + "0xb450261020054d600510200501b02630f0054d600530f00530f0260f1005", + "0x7270260264d600502600702644010230f0f100a0054400054d6005440005", + "0x260264d600501c00539a0260264d600508a0054960260264d6005171005", + "0x54d600543d00531802643d0054d600502658702643e0054d6005026353", + "0x736502643b0054d600502607e02643c0054d600543d43e00735f02643d", + "0x4d600510600508a0264380054d600543a005b4402643a0054d600543c43b", + "0xb450260d50054d60050d500501b02630f0054d600530f00530f026106005", + "0xbc10260264d60050260070264380d530f10600a0054380054d6005438005", + "0x260264d600508a0054960260264d600501c00539a0260264d6005314005", + "0x54d600512b00531802612b0054d60050265870261280054d6005026353", + "0x73650261290054d600502607e02612a0054d600512b12800735f02612b", + "0x4d600535f00508a0261260054d6005127005b440261270054d600512a129", + "0xb4502602b0054d600502b00501b02630f0054d600530f00530f02635f005", + "0x4960260264d600502600702612602b30f35f00a0051260054d6005126005", + "0x1330054d6005318005b440260264d600501c00539a0260264d600508a005", + "0x700501b02630f0054d600530f00530f0263090054d600530900508a026", + "0x702613300730f30900a0051330054d6005133005b450260070054d6005", + "0x3530260264d60050160057270260264d600508a0054960260264d6005026", + "0x4370054d60054370053180264370054d6005026b5d0261340054d6005026", + "0x4340073650264340054d600502607e0264350054d600543713400735f026", + "0x54d60054d000508a0264320054d6005433005b440264330054d6005435", + "0x5b450260070054d600500700501b0260050054d600500500530f0264d0", + "0x70050260264d60050264d00264320070054d000a0054320054d6005432", + "0x2600a0260264d6005026007026088089007bfa08a00a0074d6007005026", + "0x4d40160074d60070c0005bfb02600a0054d600500a00508a0260264d6005", + "0x5bfd0264d30054d60054d4005a260260264d600502600702640d005bfc", + "0x54d60054d2005bfe0264d10054d60050160057200264d20054d60054d3", + "0x1c0054d60050264d30260264d6005026007026026bff00502640d0264d0", + "0x1c5005bfe0264d10054d600540d0057200261c50054d600501c005c00026", + "0x4d6005026007026309005c0208b0054d60074d0005c010264d00054d6005", + "0xa00508a02630f0054d600508b0070074e20260264d60050264d0026026", + "0x30f0054d600530f00572002608a0054d600508a00530f02600a0054d6005", + "0x3143120c04d60054d130f08a00a00a9950264d10054d60054d1005720026", + "0xbc0260264d60050264d00260264d60050260070263183143120c0005318", + "0x4d60053194d10070c0c030263190054d60050264d30260264d6005309005", + "0x30f02600a0054d600500a00508a02602b0054d600531b005c0402631b005", + "0x2602b08a00a0c000502b0054d600502b005c0502608a0054d600508a005", + "0x260264d60050c00057270260264d60050070057270260264d6005026007", + "0x54d60053310053180263310054d600502610602602c0054d6005026353", + "0x736502601b0054d600502607e0260320054d600533102c00735f026331", + "0x4d600508900508a0260350054d6005038005c060260380054d600503201b", + "0xc00050350054d6005035005c050260880054d600508800530f026089005", + "0x50264d00260264d60050261020260160054d6005026b79026035088089", + "0x50260070264d24d3007c0740d4d40074d60070050260070050260264d6", + "0x8a0264d00c00074d60050c000538f0264d10054d600502699c0260264d6", + "0x5026007026026c080264d60074d14d00074260264d40054d60054d4005", + "0x1c50890074d600508900538f02601c0c00074d60050c000538f0260264d6", + "0x4d600502600702631230f007c0930908b0074d60071c501c4d40c0811026", + "0x3180074d600730931408b0c0b5702631408a0074d600508a00599a026026", + "0xa260263190054d6005319005b590260264d600502600702631b005c0a319", + "0x50880059790260880054d6005088016007b840260880054d6005319005", + "0x38f0263310054d600502634402602c0054d600502b00597a02602b0054d6", + "0x323180c08110263310054d60053310050d80260320c00074d60050c0005", + "0x502699c0260264d6005026007026036035007c0b03801b0074d6007331", + "0x74d600703803901b0c015a0260390054d60050390050d80260390054d6", + "0x2634b0054d60050264fc0260264d60050260070260c30ba007c0c0bb0bc", + "0xbc007b5302634e0054d600534e00536f02634e0054d600534b0bb007b52", + "0x5358005c0e0260264d600502600702635f005c0d3583530074d600734e", + "0x73290261710054d6005026c0f0263650054d600502626b02607e0054d6", + "0x4d600540d00530f0263530054d600535300508a0263680054d600536507e", + "0xc100263680054d60053680053280261710054d600517100532802640d005", + "0xc110d30054d60070d40053160260d40d536a0c04d600536817140d35300a", + "0xd102c0073290260d10054d600502626b0260264d60050260070260d2005", + "0x36a0054d600536a00508a0260cf0054d60050d30052cb0260d00054d6005", + "0x36a0c0c120260cf0054d60050cf0053280260d00054d60050d0005328026", + "0x39400529c0263940cc0074d60050cd005c130260cd0ce0074d60050cf0d0", + "0xc40074d60050cc00535c0263a73a40074d600500a00535c0260264d6005", + "0x4d600500e00545b02610510600e0ca00a4d60050c43a40070c097f0263ae", + "0x10210310400a4d60053ae3a70ca0c097f0260264d600510600545b026026", + "0x4d60050263440260264d600510200545b0260264d600510300545b026101", + "0x1b0261050054d60051050056620261000054d60051000050d8026100005", + "0x1000c00ce0c08110261010054d60051010056620261040054d6005104005", + "0x1011050073290260264d60050260070260fc0fd007c140fe0ff0074d6007", + "0xd50054d60050d500530f0260ff0054d60050ff00508a0260fb0054d6005", + "0xfb0053280260fe0054d60050fe0050d80261040054d600510400501b026", + "0x890054d60050890050d802608a0054d600508a00599e0260fb0054d6005", + "0xfa00a0050f70f80f90fa00a4d600508908a0fb0fe1040d50ff0884e4026", + "0x890054590260264d60050fc0054590260264d60050260070260f70f80f9", + "0x545b0260264d600510500545b0260264d600508a0059780260264d6005", + "0x3180260f50054d60050268630260f60054d60050263530260264d6005101", + "0x4d600502607e0260f40054d60050f50f600735f0260f50054d60050f5005", + "0x260f10054d60050f2005c150260f20054d60050f40f30073650260f3005", + "0x510400501b0260d50054d60050d500530f0260fd0054d60050fd00508a", + "0x260070260f11040d50fd00a0050f10054d60050f1005c160261040054d6", + "0x53170260264d600508a0059780260264d60050890054590260264d6005", + "0xc150260264d600502c00545b0260264d60050c00054590260264d600500a", + "0x4d60050d500530f02636a0054d600536a00508a0260f00054d60050d2005", + "0xa0050f00054d60050f0005c160260070054d600500700501b0260d5005", + "0x59780260264d60050890054590260264d60050260070260f00070d536a", + "0x45b0260264d60050c00054590260264d600500a0053170260264d600508a", + "0x260ee0054d6005026b5d0260ef0054d60050263530260264d600502c005", + "0x502607e0260ed0054d60050ee0ef00735f0260ee0054d60050ee005318", + "0x43f0054d6005439005c150264390054d60050ed4360073650264360054d6", + "0x700501b02640d0054d600540d00530f02635f0054d600535f00508a026", + "0x702643f00740d35f00a00543f0054d600543f005c160260070054d6005", + "0x9780260264d60050890054590260264d60050c30054590260264d6005026", + "0x260264d60050c00054590260264d600500a0053170260264d600508a005", + "0x1700054d60050262290264480054d60050263530260264d600502c00545b", + "0x2607e0264970054d600517044800735f0261700054d6005170005318026", + "0x54d60050eb005c150260eb0054d60054970ec0073650260ec0054d6005", + "0x501b02640d0054d600540d00530f0260ba0054d60050ba00508a0260ea", + "0x260ea00740d0ba00a0050ea0054d60050ea005c160260070054d6005007", + "0x260264d60050890054590260264d60050360054590260264d6005026007", + "0x264d60050c00054590260264d600500a0053170260264d600508a005978", + "0x54d60050268630260e90054d60050263530260264d600502c00545b026", + "0x7e0260e70054d60050e80e900735f0260e80054d60050e80053180260e8", + "0x4d60050e5005c150260e50054d60050e70e60073650260e60054d6005026", + "0x1b02640d0054d600540d00530f0260350054d600503500508a0260e4005", + "0xe400740d03500a0050e40054d60050e4005c160260070054d6005007005", + "0x264d600508a0059780260264d60050890054590260264d6005026007026", + "0x4d6005016005ba90260264d60050c00054590260264d600500a005317026", + "0x50e20053180260e20054d60050264080260e30054d6005026353026026", + "0x260e00054d600502607e0260e10054d60050e20e300735f0260e20054d6", + "0x31b00508a0260de0054d60050df005c150260df0054d60050e10e0007365", + "0x70054d600500700501b02640d0054d600540d00530f02631b0054d6005", + "0x264d60050260070260de00740d31b00a0050de0054d60050de005c16026", + "0x4d600508a0059780260264d60050890054590260264d6005312005459026", + "0x5016005ba90260264d60050c00054590260264d600500a005317026026", + "0xdc0053180260dc0054d60050268630260dd0054d60050263530260264d6", + "0xda0054d600502607e0260db0054d60050dc0dd00735f0260dc0054d6005", + "0x508a02608d0054d60050d9005c150260d90054d60050db0da007365026", + "0x54d600500700501b02640d0054d600540d00530f02630f0054d600530f", + "0x4d600502600702608d00740d30f00a00508d0054d600508d005c16026007", + "0x5016005ba90260264d600508a0059780260264d6005089005459026026", + "0x260d70054d60050d80c000a0c0c170260d80054d60050264d30260264d6", + "0x540d00530f0264d40054d60054d400508a0260060054d60050d7005c18", + "0x50060054d6005006005c160260070054d600500700501b02640d0054d6", + "0x9780260264d60050890054590260264d600502600702600600740d4d400a", + "0x260264d60050c00054590260264d600500a0053170260264d600508a005", + "0x810054d60050261060260d60054d60050263530260264d6005016005ba9", + "0x2607e0260940054d60050810d600735f0260810054d6005081005318026", + "0x54d60054c9005c150264c90054d60050944ca0073650264ca0054d6005", + "0x501b0264d20054d60054d200530f0264d30054d60054d300508a02607d", + "0x2607d0074d24d300a00507d0054d600507d005c160260070054d6005007", + "0x535b0260880890074d600500700535c02608a00a0074d600500500535c", + "0x4d4016007c190264d40890074d600508900535b02601600a0074d600500a", + "0x508800535b0264d10054d60054d20260079b90264d24d340d0c04d6005", + "0x8b4d10079b902608b1c501c0c04d60054d000a007c190264d00880074d6", + "0x26318314007c1a31230f0074d60071c540d3090c04f00263090054d6005", + "0x31b0054d600530f00508a0263190054d600502626b0260264d6005026007", + "0x502640d02602c0054d600531900566202602b0054d6005312005662026", + "0x531400508a0263310054d60050269c00260264d6005026007026026c1b", + "0x2602c0054d600533100566202602b0054d600531800566202631b0054d6", + "0x2603503801b0c04d6005089032007c1902603208a0074d600508a00535b", + "0xc1c0bc0390074d600703802b0360c04f00260360054d600503531b0079b9", + "0x3900508a0260c30054d600502626b0260264d60050260070260ba0bb007", + "0x3530054d60050c300566202634e0054d60050bc00566202634b0054d6005", + "0x263580054d60050269c00260264d6005026007026026c1d00502640d026", + "0x535800566202634e0054d60050ba00566202634b0054d60050bb00508a", + "0x7026171365007c1e07e35f0074d600701b01c34b0c04f00263530054d6", + "0x2636a0054d600535f00508a0263680054d600502626b0260264d6005026", + "0xc1f00502640d0260d40054d60053680056620260d50054d600507e005662", + "0x4d600536500508a0260d30054d60050269c00260264d6005026007026026", + "0xc190260d40054d60050d30056620260d50054d600517100566202636a005", + "0x4f00260cf0054d60050d036a0079b90260d00d10d20c04d600508808a007", + "0x260264d60050260070263940cc007c200cd0ce0074d60070d40d20cf0c0", + "0xc2100502640d0263a70054d60050cd0056620263a40054d60050ce00508a", + "0x53940056620263a40054d60050cc00508a0260264d6005026007026026", + "0x702600e0ca007c223ae0c40074d60070d10d53a40c04f00263a70054d6", + "0x261050054d60050c400508a0261060054d600502626b0260264d6005026", + "0xc2300502640d0261030054d60051060056620261040054d60053ae005662", + "0x4d60050ca00508a0261020054d60050269c00260264d6005026007026026", + "0x4f00261030054d60051020056620261040054d600500e005662026105005", + "0x260264d60050260070260fe0ff007c241001010074d60071033a71050c0", + "0xc2500502640d0260fc0054d60051000056620260fd0054d600510100508a", + "0x50fe0056620260fd0054d60050ff00508a0260264d6005026007026026", + "0x70260f80f9007c260fa0fb0074d600735302c0fd0c04f00260fc0054d6", + "0xf60054d60050fa0056620260f70054d60050fb00508a0260264d6005026", + "0xf70054d60050f900508a0260264d6005026007026026c2700502640d026", + "0xc280f40f50074d60070f61040f70c04f00260f60054d60050f8005662026", + "0xf500508a0260f10054d600502626b0260264d60050260070260f20f3007", + "0xee0054d60050f10056620260ef0054d60050f40056620260f00054d6005", + "0x260ed0054d60050269c00260264d6005026007026026c2900502640d026", + "0x50ed0056620260ef0054d60050f20056620260f00054d60050f300508a", + "0x702644843f007c2a4394360074d60070ee0fc0f00c04f00260ee0054d6", + "0x4970054d60054390056620261700054d600543600508a0260264d6005026", + "0x1700054d600543f00508a0260264d6005026007026026c2b00502640d026", + "0x260ec0054d60054970ef34e4d300ac2c0264970054d6005448005662026", + "0xe80e90ea0eb0164d60050c00ec1700c0c2e0260ec0054d60050ec005c2d", + "0xe30054d60050e40eb0079b90260264d60050ea005c2f0260e40e50e60e7", + "0x9b90260e10054d60050e60e20079b90260e20054d60050e50e30079b9026", + "0xdf00508a0260df0054d60050e80e00079b90260e00054d60050e70e1007", + "0x50264d00260e90df0070050e90054d60050e90053280260df0054d6005", + "0x8908a0c04d600500a0052d202600a0070074d6005007005c300260264d6", + "0x508a0057b80260264d60050880052d40260264d60050890052d4026088", + "0x40d0054d60054d40054d70264d40054d6005016005c3102601608a0074d6", + "0x4d20053180264d20054d60054d30050f80264d30054d600540d0057b9026", + "0x54d600508a005c310264d10054d60054d20c000735f0264d20054d6005", + "0x52c10260050054d600500500530f0260260054d600502600508a0264d0", + "0x4d14d000502600ac320264d10054d60054d10050f50264d00054d60054d0", + "0x2600702630f005c333090054d600708b0050f302608b1c501c0c04d6005", + "0x3140c04d60053120052d20263120070074d6005007005c300260264d6005", + "0x318005c340260264d60053190052d40260264d6005314005310026319318", + "0x2c0074d600502b0052d602602b0054d600531b00530b02631b0054d6005", + "0x535c0260323310074d60053310053080260264d600502c005317026331", + "0x54d600501b0053050260264d600503800545b02603801b0074d6005032", + "0xbc0260bc0390074d60053090050f20260360054d60050350057c1026035", + "0x4d600533100535c0260bb0054d600503603900735f0260264d60050bc005", + "0x7c102634b0054d60050c30053050260264d60050ba00545b0260c30ba007", + "0x50070052d20263530054d600534e0bb00735f02634e0054d600534b005", + "0x260264d600535f0052d40260264d600535800531002607e35f3580c04d6", + "0x51710052d60261710054d600536500530b0263650054d600507e005c34", + "0xd536a0074d600536a0053080260264d600536800531702636a3680074d6", + "0xd40053050260264d60050d300545b0260d30d40074d60050d500535c026", + "0x54d60050d135300735f0260d10054d60050d20057c10260d20054d6005", + "0x53050260264d60050cf00545b0260ce0cf0074d600536a00535c0260d0", + "0x4d60050cc0d000735f0260cc0054d60050cd0057c10260cd0054d60050ce", + "0x42e0263a70054d60053a439400742f0263a40054d60050264d3026394005", + "0x4d60051c500530f02601c0054d600501c00508a0260c40054d60053a7005", + "0x4d60050260070260c41c501c0c00050c40054d60050c40054300261c5005", + "0x1c00508a0263ae0054d600530f0054310260264d600500700518d026026", + "0x3ae0054d60053ae0054300261c50054d60051c500530f02601c0054d6005", + "0x4d00260264d600502610202608a0054d60050263890263ae1c501c0c0005", + "0x3180260880054d6005026c350260890054d60050263530260264d6005026", + "0x50c000589b0260160054d600508808900735f0260880054d6005088005", + "0x4d60054d30054970264d24d340d0c04d60054d40052a40264d40c00074d6", + "0x4d10054bc0264d10054d600540d0053370260264d60054d2005104026026", + "0x74d60050c000589b02601c0054d60054d001600735f0264d00054d6005", + "0x260264d600508b0050ad02630f30908b0c04d60051c50052a40261c50c0", + "0x531201c00735f0263120054d60053090053090260264d600530f005104", + "0x31b3193180c04d60050c00052a40263140054d600502617102600a0054d6", + "0x4d600531b0054350260264d60053190054970260264d60053180050ad026", + "0x502609c0263310054d600502609c02602c0054d600502609c02602b005", + "0x54d600502600508a02601b0054d600503233102c0c03760260320054d6", + "0x53680260070054d60050070050350260050054d600500500530f026026", + "0x54d600502b00531202601b0054d600501b0053750263140054d6005314", + "0x502b01b31400700502608937402600a0054d600500a08a00737702602b", + "0x260070260bb005c360bc0054d60070390051be02603903603503800a4d6", + "0x260264d60050ba0051040260c30ba0074d60050bc00524a0260264d6005", + "0x534b0050c402634e0054d600502617102634b0054d60050c300a00735f", + "0x9c02635f0054d600502609c0260264d60053530053ae0263583530074d6", + "0x4d600536507e35f0c03760263650054d600502609c02607e0054d6005026", + "0x30f0260380054d600503800508a0263680054d600535800508b026171005", + "0x4d600534e0053680260360054d60050360050350260350054d6005035005", + "0x3740263680054d60053680053120261710054d600517100537502634e005", + "0x4d60070d30051be0260d30d40d536a00a4d600536817134e036035038089", + "0xcf0d00074d60050d200524a0260264d60050260070260d1005c370d2005", + "0x50ce00540c0260ce0054d60050cf00540e0260264d60050d0005104026", + "0x260d50054d60050d500530f02636a0054d600536a00508a0260cd0054d6", + "0xd40d536a00a0050cd0054d60050cd00540b0260d40054d60050d4005035", + "0x536a00508a0260cc0054d60050d10054070260264d60050260070260cd", + "0x260d40054d60050d40050350260d50054d60050d500530f02636a0054d6", + "0x260264d60050260070260cc0d40d536a00a0050cc0054d60050cc00540b", + "0x4d600503800508a0263940054d60050bb0054070260264d600500a0053ae", + "0x40b0260360054d60050360050350260350054d600503500530f026038005", + "0x260880054d600502638a02639403603503800a0053940054d6005394005", + "0x4c10260264d60050264d00260264d60050261020264d40054d6005026103", + "0x264d60050260070264d04d14d20c0c384d301640d0c04d60070c0005007", + "0x1c0054bd02601c0054d60054d30054bf0264d30054d60054d30054c0026", + "0x508b0050ab0260264d60051c50050aa02630f08930908b1c508a4d6005", + "0x880073820260264d600530f0054970260264d60053090050ad0260264d6", + "0x3140054d60050263530263120054d60050890054bc0260890054d6005089", + "0x31831400735f0263180054d60053180053180263180054d6005026a92026", + "0x531b00588002633102c02b31b00a4d600508a0054dd0263190054d6005", + "0x54d600502b01b00735f02601b0054d600503231900735f0260320054d6", + "0x260360054d600533103500735f0260350054d600502c03800735f026038", + "0x50bc0053ae0260bb0bc0074d60050360050c40260390054d6005026171", + "0x502609c0260c30054d600502609c0260ba0054d600502609c0260264d6", + "0x54d60050bb00508b02634e0054d600534b0c30ba0c037602634b0054d6", + "0x503502640d0054d600540d00530f0260260054d600502600508a026353", + "0x54d600534e0053750260390054d60050390053680260070054d6005007", + "0x3740260160054d60050164d40070ff0263530054d600535300531202634e", + "0x4d60073650051be02636507e35f35800a4d600535334e03900740d026089", + "0xd536a0c04d600500a00537f0260264d6005026007026368005c39171005", + "0x260d10d20074d600517100524a0260d30054d600531236a00737e0260d4", + "0x50d30053180260d00054d60050d10d500737e0260264d60050d2005104", + "0x4d60050d40d00d307e00a23a0260d00054d60050d00053180260d30054d6", + "0xce0054d60050ce0053180263940054d600502609e0260cc0cd0ce0cf00a", + "0x53180263a40054d60053a40053180263a40054d60053940ce00737e026", + "0xcc0cd3a40cf00a23a0260cc0054d60050cc0053180260cd0054d60050cd", + "0x4d60050ca0054970260264d60053ae0054970260ca3ae0c43a700a4d6005", + "0x508a0261060054d600500e00540c02600e0054d60050c400540e026026", + "0x54d60053a700503502635f0054d600535f00530f0263580054d6005358", + "0x35808a0051060054d600510600540b0260160054d60050160050360263a7", + "0x58960260264d60053120054970260264d60050260070261060163a735f", + "0x3580054d600535800508a0261050054d60053680054070260264d600500a", + "0x1600503602607e0054d600507e00503502635f0054d600535f00530f026", + "0x2610501607e35f35808a0051050054d600510500540b0260160054d6005", + "0x260264d60050880053880260264d600508a0058be0260264d6005026007", + "0x1040054d600502607e0260264d60054d40051010260264d600500a005896", + "0x508a0261020054d60051030054070261030054d60054d0104007365026", + "0x54d60050070050350264d20054d60054d200530f0260260054d6005026", + "0x2608a0051020054d600510200540b0264d10054d60054d1005036026007", + "0x880890074d60070050260070050260264d60050264d00261024d10074d2", + "0xa02640d0054d60050c00050c00260264d60050260070264d4016007c3a", + "0x4d30074d600740d0050890260890054d600508900508a0260264d6005026", + "0x160264d00054d60054d20050880260264d60050260070264d1005c3b4d2", + "0x26c3c00502640d0261c50054d60054d00054d402601c0054d60054d3005", + "0x54d600508b0054d202608b0054d60050264d30260264d6005026007026", + "0x508b0261c50054d60053090054d402601c0054d60054d1005016026309", + "0x5026007026314005c3d3120054d60071c50054d102630f0054d600501c", + "0x2631900a0074d600500a0050d60263180054d600531200501c0260264d6", + "0x2c0c0c3e02b31b0074d600731908900735e0263180054d6005318005318", + "0x531b00508a02601b0054d600502626b0260264d6005026007026032331", + "0x260360054d600501b0056620260350054d600502b0056620260380054d6", + "0x260380054d600502c00508a0260264d6005026007026026c3f00502640d", + "0x53180050d60260360054d60053310056620260350054d6005032005662", + "0x74d60070bc03800735e0260bc0054d60050390053090260393180074d6", + "0x3530054d600502626b0260264d600502600702634e34b0c30c0c400ba0bb", + "0x35300566202635f0054d60050ba0056620263580054d60050bb00508a026", + "0xc300508a0260264d6005026007026026c4100502640d02607e0054d6005", + "0x7e0054d600534b00566202635f0054d600534e0056620263580054d6005", + "0x35a02617107e0074d600507e00535b0263650360074d600503600535b026", + "0x260264d60050260070260d40d5007c4236a3680074d60071713653580c0", + "0x707e0360072700263680054d600536800508a0260264d600536a00545b", + "0x545b0260264d600535f00545b0260264d6005026007026026c430264d6", + "0x7026026c4400502640d0260d30054d600536800508a0260264d6005035", + "0x260cf0d0007c450d10d20074d600735f0353680c035a0260264d6005026", + "0xd30054d60050d200508a0260264d60050d100545b0260264d6005026007", + "0x50cd0053180260cd0054d60050264c60260ce0054d6005318005309026", + "0x54970263a73a43940cc00a4d60050cd00a0ce00700a23a0260cd0054d6", + "0x260c40054d60050d300508a0260264d60053a70054970260264d60053a4", + "0xc4600502640d0260ca0054d60053940053180263ae0054d60050cc005035", + "0x4d60050d000508a0260264d60050cf00545b0260264d6005026007026026", + "0x4d60050d400545b0260264d6005026007026026c4700502640d02600e005", + "0x503500545b0260264d600535f00545b0260264d600503600545b026026", + "0x530902600e0054d60050d500508a0260264d600507e00545b0260264d6", + "0x1050054d60051050053180261050054d60050264c60261060054d6005318", + "0x4d600510200549702610110210310400a4d600510510600a00700a23a026", + "0x1040050350260c40054d600500e00508a0260264d6005101005497026026", + "0x8a0260264d60050264d00260ca0054d60051030053180263ae0054d6005", + "0x4d60053ae0050350260880054d600508800530f0260c40054d60050c4005", + "0xaba0260ca0054d60050ca00531802630f0054d600530f0053120263ae005", + "0xfd0fe0ff10000a0050fd0fe0ff10000a4d600508a0ca30f3ae0880c4089", + "0x260264d60053140050bc0260264d60050264d00260264d6005026007026", + "0x5c490260fb0054d60050fc00a08a30f00ac480260fc0054d60050264d3", + "0x54d600508800530f0260890054d600508900508a0260fa0054d60050fb", + "0x8900a0050fa0054d60050fa005c4a0260070054d6005007005035026088", + "0xc00051040260264d600508a005abe0260264d60050260070260fa007088", + "0x261060260f90054d60050263530260264d600500a0054970260264d6005", + "0x54d60050f80f900735f0260f80054d60050f80053180260f80054d6005", + "0x5c4b0260f50054d60050f70f60073650260f60054d600502607e0260f7", + "0x54d60054d400530f0260160054d600501600508a0260f40054d60050f5", + "0x1600a0050f40054d60050f4005c4a0260070054d60050070050350264d4", + "0xc4c08908a0074d60070050260070050260264d60050264d00260f40074d4", + "0x2600a0264d40054d60050c0005c4d0260264d6005026007026016088007", + "0x4d340d0074d60074d4005c4e02608a0054d600508a00508a0260264d6005", + "0x5c510264d10054d60054d3005c500260264d60050260070264d2005c4f", + "0x26026c5300502640d02601c0054d60054d1005c520264d00054d600540d", + "0x8b0054d60051c5005c540261c50054d60050264d30260264d6005026007", + "0x4d0005aec02601c0054d600508b005c520264d00054d60054d2005c51026", + "0x4d6005026007026312005c5630f0054d600701c005c550263090054d6005", + "0x508a0263180054d6005314005c580263140054d600530f005c57026026", + "0x54d600500a005aee0260070054d600500700501b02608a0054d600508a", + "0x3190c04d600531800a00708a00ac590263180054d600531800532802600a", + "0x260264d6005026007026331005c5a02c0054d600702b005af602602b31b", + "0x4d600501b0050bc02601b0320074d600502c005af80260264d60050264d0", + "0x501b0260890054d600508900530f0263190054d600531900508a026026", + "0x54d6005032005aee0263090054d6005309005aed02631b0054d600531b", + "0x3503800a00503903603503800a4d600503230931b08931908aaef026032", + "0x4d6005309005af30260264d60050264d00260264d6005026007026039036", + "0x530f0263190054d600531900508a0260bc0054d6005331005c5b026026", + "0x54d60050bc005c5c02631b0054d600531b00501b0260890054d6005089", + "0x260264d60050264d00260264d60050260070260bc31b08931900a0050bc", + "0x50bb00a3090c0c5d0260bb0054d60050264d30260264d60053120050bc", + "0x2608a0054d600508a00508a0260c30054d60050ba005c5e0260ba0054d6", + "0x50c3005c5c0260070054d600500700501b0260890054d600508900530f", + "0x500a005afa0260264d60050260070260c300708908a00a0050c30054d6", + "0x502610602634b0054d60050263530260264d60050c0005af30260264d6", + "0x3530054d600534e34b00735f02634e0054d600534e00531802634e0054d6", + "0x35f005c5b02635f0054d60053533580073650263580054d600502607e026", + "0x160054d600501600530f0260880054d600508800508a02607e0054d6005", + "0x1608800a00507e0054d600507e005c5c0260070054d600500700501b026", + "0x508a0050d802608a0054d6005026c5f0260264d60050264d002607e007", + "0x260264d6005026007026089005c600264d600708a005b4c02608a0054d6", + "0x264d6005007005afa0260264d60050c000539a0260264d600500a005459", + "0x4d60050160053180260160054d60050265870260880054d6005026353026", + "0x36502640d0054d600502607e0264d40054d600501608800735f026016005", + "0x502600508a0264d20054d60054d3005c610264d30054d60054d440d007", + "0x54d20054d60054d2005c620260050054d600500500530f0260260054d6", + "0x264d04d10074d6005007005af90260264d60050260070264d20050260c0", + "0x1c0260c0b4e02601c0054d600501c0050d802601c0054d60054d0005c63", + "0x54d600502608d0260264d600508b00545902630908b1c50c04d6005089", + "0x1c500508a02631200a0074d600500a00538f0260264d600502600a02630f", + "0x264d6005026007026026c640264d600730f3120074260261c50054d6005", + "0x31800742602631800a0074d600500a00538f0263140054d6005026344026", + "0x263190054d60050264280260264d6005026007026026c650264d6007314", + "0x7026026c660264d600731931b00742602631b00a0074d600500a00538f", + "0x2c00a0074d600500a00538f02602b0054d6005026b870260264d6005026", + "0x50261420260264d6005026007026026c670264d600702b02c007426026", + "0x264d600733103200742602603200a0074d600500a00538f0263310054d6", + "0x500a00538f02601b0054d60050264fe0260264d6005026007026026c68", + "0x264d6005026007026026c690264d600701b03800742602603800a0074d6", + "0x3600742602603600a0074d600500a00538f0260350054d6005026c6a026", + "0x260390054d6005026c6c0260264d6005026007026026c6b0264d6007035", + "0x4d60050264d00260264d6005026007026026c6d0264d600703900a007426", + "0x50c000539a0260264d60053090054590260264d60054d1005afa026026", + "0xbb0053180260bb0054d6005026c6e0260bc0054d60050263530260264d6", + "0xc30054d600502607e0260ba0054d60050bb0bc00735f0260bb0054d6005", + "0x508a02634e0054d600534b005c6102634b0054d60050ba0c3007365026", + "0x54d600534e005c620260050054d600500500530f0261c50054d60051c5", + "0x263530054d60050264f90260264d600502600702634e0051c50c000534e", + "0x260264d6005026007026026c6f00502640d0263580054d600535300536f", + "0x54d600535f00536f02635f0054d6005026bc60260264d600500a005459", + "0x4d6005026007026026c7100502640d02607e0054d6005358005c70026358", + "0x536500536f0263650054d6005026bca0260264d600500a005459026026", + "0x26007026026c7200502640d0261710054d600507e005c7002607e0054d6", + "0x536f0263680054d6005026bce0260264d600500a0054590260264d6005", + "0x26026c7300502640d02636a0054d6005171005c700261710054d6005368", + "0x260d50054d6005026bd20260264d600500a0054590260264d6005026007", + "0xc7400502640d0260d40054d600536a005c7002636a0054d60050d500536f", + "0x54d6005026bd60260264d600500a0054590260264d6005026007026026", + "0x2640d0260d20054d60050d4005c700260d40054d60050d300536f0260d3", + "0x5026bda0260264d600500a0054590260264d6005026007026026c75005", + "0xd00d20074d60050d200536e0260d20054d60050d100536f0260d10054d6", + "0x50264d00260264d60050260070260cf005c760264d60070d0005bbf026", + "0xd200539a0260264d60053090054590260264d60054d1005afa0260264d6", + "0x265870260ce0054d60050263530260264d60050c000539a0260264d6005", + "0x54d60050cd0ce00735f0260cd0054d60050cd0053180260cd0054d6005", + "0x5c610263a40054d60050cc3940073650263940054d600502607e0260cc", + "0x54d600500500530f0261c50054d60051c500508a0263a70054d60053a4", + "0x264d60050260070263a70051c50c00053a70054d60053a7005c62026005", + "0x260264d60053ae00539a0260ca3ae0c40c04d60050cf0c01c50c0bc2026", + "0x264d6005026007026104105007c7710600e0074d60070ca0d20c40c04ff", + "0x502640d0261020054d600510600536f0261030054d600500e00508a026", + "0x4d600510400539a0260264d60050264d00260264d6005026007026026c78", + "0x4d60050263530260264d60053090054590260264d60054d1005afa026026", + "0x735f0261000054d60051000053180261000054d6005026c79026101005", + "0x4d60050ff0fe0073650260fe0054d600502607e0260ff0054d6005100101", + "0x30f0261050054d600510500508a0260fc0054d60050fd005c610260fd005", + "0x260fc0051050c00050fc0054d60050fc005c620260050054d6005005005", + "0x260264d600500a0054590260264d60050c000539a0260264d6005026007", + "0x4d60050fb00536f0261030054d60051c500508a0260fb0054d6005026c7a", + "0xfa0050d80260f90054d60050263440260fa0054d6005026c5f026102005", + "0x4d60070f90fa1030c015a0260f90054d60050f90050d80260fa0054d6005", + "0x74d600530900538f0260264d60050260070260f50f6007c7b0f70f8007", + "0x26c7c0264d60070f70f40074260260f80054d60050f800508a0260f4309", + "0x4d6005026c5f0260f30054d60051024d1007c7d0260264d6005026007026", + "0x50d80260f20054d60050f20050d80260f10054d60050263440260f2005", + "0x70f10f20f80c015a0260f30054d60050f3005aee0260f10054d60050f1", + "0x264d60050264d00260264d60050260070260ed0ee007c7e0ef0f00074d6", + "0x4d600502600702644843f007c7f4394360074d60073090ef0f00c015a026", + "0x5aee0260050054d600500500530f0264360054d600543600508a026026", + "0x4390f300543600ac800264390054d60054390050d80260f30054d60050f3", + "0x54590260264d60050260070260ec4971700c00050ec4971700c04d6005", + "0x2290260eb0054d60050263530260264d60050f3005afa0260264d6005448", + "0x4d60050ea0eb00735f0260ea0054d60050ea0053180260ea0054d6005026", + "0xc610260e70054d60050e90e80073650260e80054d600502607e0260e9005", + "0x4d600500500530f02643f0054d600543f00508a0260e60054d60050e7005", + "0x4d60050260070260e600543f0c00050e60054d60050e6005c62026005005", + "0x4d60050f3005afa0260264d60050ed0054590260264d60050264d0026026", + "0x4d60050262290260e50054d60050263530260264d6005309005459026026", + "0x260e30054d60050e40e500735f0260e40054d60050e40053180260e4005", + "0x50e1005c610260e10054d60050e30e20073650260e20054d600502607e", + "0x260050054d600500500530f0260ee0054d60050ee00508a0260e00054d6", + "0x4d00260264d60050260070260e00050ee0c00050e00054d60050e0005c62", + "0x36f0260df0054d6005026c810260264d60053090054590260264d6005026", + "0xdc007c820dd0de0074d60071020df0f80c04ff0260df0054d60050df005", + "0x50264d30260da0054d60050dd4d1007c7d0260264d60050260070260db", + "0xd80054d600508d005c8402608d0054d60050d90da007c830260d90054d6", + "0xd8005c620260050054d600500500530f0260de0054d60050de00508a026", + "0x50db00539a0260264d60050260070260d80050de0c00050d80054d6005", + "0x5026c790260d70054d60050263530260264d60054d1005afa0260264d6", + "0xd60054d60050060d700735f0260060054d60050060053180260060054d6", + "0x94005c610260940054d60050d60810073650260810054d600502607e026", + "0x50054d600500500530f0260dc0054d60050dc00508a0264ca0054d6005", + "0x260264d60050260070264ca0050dc0c00054ca0054d60054ca005c62026", + "0x260264d60054d1005afa0260264d60050f50054590260264d60050264d0", + "0x4c90054d60050263530260264d600510200539a0260264d6005309005459", + "0x7d4c900735f02607d0054d600507d00531802607d0054d6005026229026", + "0x9a0054d60054c801a00736502601a0054d600502607e0264c80054d6005", + "0x500530f0260f60054d60050f600508a02609b0054d600509a005c61026", + "0x264d002609b0050f60c000509b0054d600509b005c620260050054d6005", + "0x260070264d4016007c850880890074d60070050260070050260264d6005", + "0x264d20054d600502693c0264d340d0074d60050c00052d60260264d6005", + "0x54d30053080260264d60054d10053170264d04d10074d60054d20052d6", + "0x264d600508b00545b02608b1c50074d600501c00535c02601c4d30074d6", + "0x45b02631230f0074d600530900535c0263094d00074d60054d0005308026", + "0x54d600530f0053050263140054d60051c50053050260264d6005312005", + "0x3183140072700260890054d600508900508a0260264d600502600a026318", + "0x3170260264d60054d00053170260264d6005026007026026c860264d6007", + "0x535c0260264d6005026007026026c8700502640d0260264d60054d3005", + "0x74d60054d000535c0260264d600531900545b02631b3190074d60054d3", + "0x53050263310054d600531b0053050260264d600502b00545b02602c02b", + "0x4d6005026007026026c880264d60070323310072700260320054d600502c", + "0x1b00574002601b0054d600501b00532802601b0054d6005026c89026026", + "0x7270260264d60050264d00260264d6005026007026038005c8a0264d6007", + "0x260264d600540d0053170260264d600508a0053100260264d600500a005", + "0x54d60050360053180260360054d60050265870260350054d6005026353", + "0x73650260bc0054d600502607e0260390054d600503603500735f026036", + "0x4d600508900508a0260ba0054d60050bb005c8b0260bb0054d60050390bc", + "0xc8c0260070054d600500700501b0260880054d600508800530f026089005", + "0xb460260264d60050260070260ba00708808900a0050ba0054d60050ba005", + "0x3580054d60053530c30079b902635334e34b0c300a4d600503840d0890c0", + "0x35800508a0263650054d600502626b02607e35f0074d600534e00535c026", + "0x264d6005026007026026c8d0264d600736507e0072700263580054d6005", + "0x4d600500a0057270260264d600508a0053100260264d600534b005317026", + "0x502640d0261710054d600535800508a0260264d600535f00545b026026", + "0x5c8f36a3680074d600735f358007b490260264d6005026007026026c8e", + "0x4d60050d40050d80260d40054d6005026c900260264d60050260070260d5", + "0xd3005c910264d60070d4005b4c0263680054d600536800508a0260d4005", + "0x260264d600508a0053100260264d60050264d00260264d6005026007026", + "0x264d600534b0053170260264d600500a0057270260264d600536a005459", + "0x4d60050d10053180260d10054d6005026b000260d20054d6005026353026", + "0x3650260cf0054d600502607e0260d00054d60050d10d200735f0260d1005", + "0x536800508a0260cd0054d60050ce005c8b0260ce0054d60050d00cf007", + "0x260070054d600500700501b0260880054d600508800530f0263680054d6", + "0x260264d60050260070260cd00708836800a0050cd0054d60050cd005c8c", + "0x3a73a43940c04d60050d30cc3680c0b4e0260cc36a0074d600536a00538f", + "0x4d60050c40050d80260c40054d6005026c920260264d60053a7005459026", + "0x3ae005c930264d60070c4005b4c0263940054d600539400508a0260c4005", + "0x260264d600536a0054590260264d60050264d00260264d6005026007026", + "0x264d600508a0053100260264d600534b0053170260264d600500a005727", + "0x54d6005026b000260ca0054d60050263530260264d60053a4005459026", + "0x7e0261060054d600500e0ca00735f02600e0054d600500e00531802600e", + "0x4d6005104005c8b0261040054d60051061050073650261050054d6005026", + "0x1b0260880054d600508800530f0263940054d600539400508a026103005", + "0x10300708839400a0051030054d6005103005c8c0260070054d6005007005", + "0x1023940c0b4e02610236a0074d600536a00538f0260264d6005026007026", + "0x54d6005026b4f0260264d60050ff0054590260ff1001010c04d60053ae", + "0xfc0fd00a4d60050fe1000070c0b500260fe0054d60050fe0050d80260fe", + "0x5026c940260264d60050fa0054590260264d60050fb0054590260fa0fb", + "0x261010054d600510100508a0260f90054d60050f90050d80260f90054d6", + "0x70f9005b4c0260fc0054d60050fc0050d80260fd0054d60050fd00501b", + "0x57270260264d60050264d00260264d60050260070260f8005c950264d6", + "0x4590260264d600508a0053100260264d600534b0053170260264d600500a", + "0x260264d600536a0054590260264d60050fc0054590260264d60053a4005", + "0x54d60050f60053180260f60054d6005026b000260f70054d6005026353", + "0x73650260f40054d600502607e0260f50054d60050f60f700735f0260f6", + "0x4d600510100508a0260f20054d60050f3005c8b0260f30054d60050f50f4", + "0xc8c0260fd0054d60050fd00501b0260880054d600508800530f026101005", + "0x38f0260264d60050260070260f20fd08810100a0050f20054d60050f2005", + "0x260ee0ef0f00c04d60050f80f11010c0b4e0260f136a0074d600536a005", + "0x54d60050ed0050d80260ed0054d6005026b4f0260264d60050ee005459", + "0x4d600543f00545902644843f43943600a4d60050ed0ef0fd0c0b500260ed", + "0x51700050d80261700054d6005026b4f0260264d6005448005459026026", + "0xeb0054590260ea0eb0ec49700a4d600517036a4360c0b500261700054d6", + "0x260e80e90074d600508a005b550260264d60050ea0054590260264d6005", + "0x50ec0050d80260e60054d60050e7005b560260e70054d60050e80054d7", + "0x264970054d600549700501b0264390054d60054390050d80260ec0054d6", + "0x260264d60050260070260e3005c960e40e50074d60070ec0e60f00c0b57", + "0x50e20059790260e20054d60050e4005a260260e40054d60050e4005b59", + "0xe00054d60050e100a0074e20260e10054d60050e10059640260e10054d6", + "0x5b560260dd0054d60050de0054d70260de0df0074d60050e9005b55026", + "0x74390dc0e50c0b570260e00054d60050e00057200260dc0054d60050dd", + "0x54d60050da005b590260264d60050260070260d9005c970da0db0074d6", + "0x59640260d80054d600508d00597902608d0054d60050da005a260260da", + "0x4d60050df005b550260d70054d60050d80e00074e20260d80054d60050d8", + "0x260940054d6005081005b560260810054d60050d60054d70260d6006007", + "0x5c984c94ca0074d60070fc0940db0c0b570260d70054d60050d7005720", + "0x54c9005a260264c90054d60054c9005b590260264d600502600702607d", + "0x2601a0054d600501a00596402601a0054d60054c80059790264c80054d6", + "0x54d702609c09b0074d6005006005b5502609a0054d600501a0d70074e2", + "0x54d600509a0057200264c60054d600509e005b5602609e0054d600509c", + "0x4d60050260070264c4005c994c50a00074d60073a44c64ca0c0b5702609a", + "0x54c5005a260264c50054d60054c5005b590260264d60050264d0026026", + "0x264c20054d60054c20059640264c20054d60054c30059790264c30054d6", + "0x8800530f0260a00054d60050a000508a0264c10054d60054c209a0074e2", + "0x34b0054d600534b0053280264970054d600549700501b0260880054d6005", + "0xa0089b5e02609b0054d600509b0052c10264c10054d60054c1005720026", + "0x70264bd4be4bf4c000a0054bd4be4bf4c000a4d600509b4c134b497088", + "0x57270260264d600509b0053100260264d60050264d00260264d6005026", + "0x4080260aa0054d60050263530260264d600534b0053170260264d600509a", + "0x4d60050ab0aa00735f0260ab0054d60050ab0053180260ab0054d6005026", + "0xc8b0264bb0054d60050ad4bc0073650264bc0054d600502607e0260ad005", + "0x4d600508800530f0264c40054d60054c400508a0264ba0054d60054bb005", + "0xa0054ba0054d60054ba005c8c0264970054d600549700501b026088005", + "0xd70057270260264d60050264d00260264d60050260070264ba4970884c4", + "0x54590260264d600534b0053170260264d60050060053100260264d6005", + "0x3180264b80054d60050264080264b90054d60050263530260264d60053a4", + "0x4d600502607e0264b70054d60054b84b900735f0264b80054d60054b8005", + "0x264b40054d60054b5005c8b0264b50054d60054b74b60073650264b6005", + "0x549700501b0260880054d600508800530f02607d0054d600507d00508a", + "0x260070264b449708807d00a0054b40054d60054b4005c8c0264970054d6", + "0xe00057270260264d60050df0053100260264d60050264d00260264d6005", + "0x54590260264d60053a40054590260264d600534b0053170260264d6005", + "0x3180264b20054d60050264080264b30054d60050263530260264d60050fc", + "0x4d600502607e0264b10054d60054b24b300735f0264b20054d60054b2005", + "0x260840054d60054af005c8b0264af0054d60054b14b00073650264b0005", + "0x549700501b0260880054d600508800530f0260d90054d60050d900508a", + "0x260070260844970880d900a0050840054d6005084005c8c0264970054d6", + "0xe90053100260264d600500a0057270260264d60050264d00260264d6005", + "0x54590260264d60053a40054590260264d600534b0053170260264d6005", + "0x4080265180054d60050263530260264d60054390054590260264d60050fc", + "0x4d60054ac51800735f0264ac0054d60054ac0053180264ac0054d6005026", + "0xc8b0265190054d60054ab4aa0073650264aa0054d600502607e0264ab005", + "0x4d600508800530f0260e30054d60050e300508a0264a60054d6005519005", + "0xa0054a60054d60054a6005c8c0264970054d600549700501b026088005", + "0x53100260264d600534b0053170260264d60050260070264a64970880e3", + "0x261710054d60050d500508a0260264d600500a0057270260264d600508a", + "0x264a40054d60050265870264a50054d60050263530260264d60050264d0", + "0x502607e0264a20054d60054a44a500735f0264a40054d60054a4005318", + "0x4a00054d60054a1005c8b0264a10054d60054a20bf0073650260bf0054d6", + "0x700501b0260880054d600508800530f0261710054d600517100508a026", + "0x70264a000708817100a0054a00054d60054a0005c8c0260070054d6005", + "0x264d30260264d600508a0053100260264d60050264d00260264d6005026", + "0x4d600549e005c9b02649e0054d600549f40d00a0c0c9a02649f0054d6005", + "0x1b0260880054d600508800530f0260890054d600508900508a0260c2005", + "0xc200708808900a0050c20054d60050c2005c8c0260070054d6005007005", + "0x264d600508a0053100260264d60050c00053170260264d6005026007026", + "0x54d600502610602649d0054d60050263530260264d600500a005727026", + "0x7e0264a80054d600549c49d00735f02649c0054d600549c00531802649c", + "0x4d60054a7005c8b0264a70054d60054a84a90073650264a90054d6005026", + "0x1b0264d40054d60054d400530f0260160054d600501600508a02649a005", + "0x49a0074d401600a00549a0054d600549a005c8c0260070054d6005007005", + "0x8908a007c9c00a0c00074d60070050260070050260264d60050264d0026", + "0x50160057b90260160880074d60050070054da0260264d6005026007026", + "0xd80264d40054d60054d40050d802640d0054d6005026c9d0264d40054d6", + "0x4d1007c9e4d24d30074d600740d4d40c00c015a02640d0054d600540d005", + "0x54d60050264d30260264d60054d20054590260264d60050260070264d0", + "0x8a02608b0054d60051c5005ca00261c50054d600501c088007c9f02601c", + "0x4d600508b005ca102600a0054d600500a00530f0264d30054d60054d3005", + "0x264d60054d00054590260264d600502600702608b00a4d30c000508b005", + "0x3090880074e20263090054d60053090059640263090054d6005026b05026", + "0xa0054d600500a00530f0264d10054d60054d100508a02630f0054d6005", + "0x3183143120c04d600530f00a4d10c0b6202630f0054d600530f005720026", + "0x3530260264d60050070057270260264d60050260070263183143120c0005", + "0x31b0054d600531b00531802631b0054d60050261060263190054d6005026", + "0x2c00736502602c0054d600502607e02602b0054d600531b31900735f026", + "0x54d600508a00508a0260320054d6005331005ca20263310054d600502b", + "0x8a0c00050320054d6005032005ca10260890054d600508900530f02608a", + "0x7ca308a00a0074d60070050260070050260264d60050264d0026032089", + "0x502600a0260160054d60050070054d70260264d6005026007026088089", + "0xca540d4d40074d6007016005ca402600a0054d600500a00508a0260264d6", + "0x4d400599e0264d20054d600540d005a210260264d60050260070264d3005", + "0x7026026ca600502640d0264d00054d60054d20054e70264d10054d6005", + "0x261c50054d600501c005a2302601c0054d60050264d30260264d6005026", + "0x54d10057280264d00054d60051c50054e70264d10054d60054d300599e", + "0x264d600502600702630f005ca73090054d60074d0005a2402608b0054d6", + "0x4d60053120059790263120054d6005309005a260260264d60050264d0026", + "0x263180054d60053140c00074e20263140054d6005314005964026314005", + "0x508b0052c102608a0054d600508a00530f02600a0054d600500a00508a", + "0x4d600531808b08a00a00ab660263180054d600531800572002608b0054d6", + "0x4d60050264d00260264d600502600702602b31b3190c000502b31b3190c0", + "0xc008b0c0bb402602c0054d60050264d30260264d600530f0050bc026026", + "0x54d600500a00508a0260320054d6005331005bb50263310054d600502c", + "0xa0c00050320054d6005032005bb602608a0054d600508a00530f02600a", + "0x50c00057270260264d60050070053100260264d600502600702603208a", + "0x380053180260380054d600502610602601b0054d60050263530260264d6", + "0x360054d600502607e0260350054d600503801b00735f0260380054d6005", + "0x508a0260bc0054d6005039005bb70260390054d6005035036007365026", + "0x54d60050bc005bb60260880054d600508800530f0260890054d6005089", + "0x74d60070050260070050260264d60050264d00260bc0880890c00050bc", + "0x264d40054d600502699c0260264d6005026007026016088007ca808908a", + "0x40d00742602608a0054d600508a00508a02640d0070074d600500700538f", + "0x4d30074d600500a005b550260264d6005026007026026ca90264d60074d4", + "0x538f0264d00054d60054d1005b560264d10054d60054d20054d70264d2", + "0x309005caa08b1c50074d600701c4d008a0c0b5702601c0070074d6005007", + "0x4d600508b005a2602608b0054d600508b005b590260264d6005026007026", + "0x4e20263120054d60053120059640263120054d600530f00597902630f005", + "0x4d60053180050d80263180054d60050263440263140054d60053120c0007", + "0x3190074d60073180071c50c08110263140054d6005314005720026318005", + "0x263190054d600531900508a0260264d600502600702602c02b007cab31b", + "0x531400572002631b0054d600531b0050d80260890054d600508900530f", + "0x54d331431b08931908ab7e0264d30054d60054d30052c10263140054d6", + "0x2c0054590260264d600502600702601b0323310c000501b0323310c04d6", + "0x263530260264d60053140057270260264d60054d30053100260264d6005", + "0x260350054d60050350053180260350054d60050268630260380054d6005", + "0x360390073650260390054d600502607e0260360054d600503503800735f", + "0x2b0054d600502b00508a0260bb0054d60050bc005cac0260bc0054d6005", + "0x8902b0c00050bb0054d60050bb0055020260890054d600508900530f026", + "0x4d60050070054590260264d60054d30053100260264d60050260070260bb", + "0x4d60050264080260ba0054d60050263530260264d60050c0005727026026", + "0x2634b0054d60050c30ba00735f0260c30054d60050c30053180260c3005", + "0x5353005cac0263530054d600534b34e00736502634e0054d600502607e", + "0x260890054d600508900530f0263090054d600530900508a0263580054d6", + "0x3100260264d60050260070263580893090c00053580054d6005358005502", + "0x4d600535f0070c00c0cad02635f0054d60050264d30260264d600500a005", + "0x30f02608a0054d600508a00508a0263650054d600507e005cae02607e005", + "0x2636508908a0c00053650054d60053650055020260890054d6005089005", + "0x260264d60050070054590260264d600500a0053100260264d6005026007", + "0x3680054d60050261060261710054d60050263530260264d60050c0005727", + "0x2607e02636a0054d600536817100735f0263680054d6005368005318026", + "0x54d60050d4005cac0260d40054d600536a0d50073650260d50054d6005", + "0x55020260160054d600501600530f0260880054d600508800508a0260d3", + "0x260070050260264d60050264d00260d30160880c00050d30054d60050d3", + "0x5026cb00260264d6005026007026088089007caf08a00a0074d6007005", + "0x538f0260264d600502600a0264d40054d6005016005b860260160054d6", + "0x74d440d00742602600a0054d600500a00508a02640d0c00074d60050c0", + "0x5b860264d30054d600502697b0260264d6005026007026026cb10264d6", + "0x74d24d10074260264d10c00074d60050c000538f0264d20054d60054d3", + "0x5b860264d00054d6005026cb30260264d6005026007026026cb20264d6", + "0x264d600701c005b4c02601c0054d600501c0050d802601c0054d60054d0", + "0x50c00054590260264d60050264d00260264d60050260070261c5005cb4", + "0x5026b0002608b0054d60050263530260264d60050070054590260264d6", + "0x30f0054d600530908b00735f0263090054d60053090053180263090054d6", + "0x314005cb50263140054d600530f3120073650263120054d600502607e026", + "0x8a0054d600508a00530f02600a0054d600500a00508a0263180054d6005", + "0x260264d600502600702631808a00a0c00053180054d6005318005cb6026", + "0x2c02b31b0c04d60051c531900a0c0b4e0263190c00074d60050c000538f", + "0x4d6005331005b860263310054d6005026cb00260264d600502b005459026", + "0x26cb70264d600703202c00742602631b0054d600531b00508a026032005", + "0x500700538f02601b0070074d600500700538f0260264d6005026007026", + "0x54d600503500536f0260350054d600503801b007b520260380070074d6", + "0x264d60050260070260bc005cb80390360074d600703531b007b53026035", + "0x50ba0050d80260ba0054d60050bb005b860260bb0054d6005026cb3026", + "0x5cb90264d60070ba005b4c0260360054d600503600508a0260ba0054d6", + "0x264d60050070054590260264d60050264d00260264d60050260070260c3", + "0x54d60050263530260264d60050c00054590260264d6005039005459026", + "0x34b00735f02634e0054d600534e00531802634e0054d6005026b0002634b", + "0x54d60053533580073650263580054d600502607e0263530054d600534e", + "0x530f0260360054d600503600508a02607e0054d600535f005cb502635f", + "0x702607e08a0360c000507e0054d600507e005cb602608a0054d600508a", + "0x3650c04d60050c30c00360c0b4e0260264d60050264d00260264d6005026", + "0x530f0263650054d600536500508a0260264d6005368005459026368171", + "0x54d60051710050d80260390054d60050390050d802608a0054d600508a", + "0x4d60070d4005b8a0260d40d536a0c04d600517103908a36500ab89026171", + "0x260d10054d60050d3005b8e0260264d60050260070260d2005cba0d3005", + "0x36a007b530260d00054d60050d000536f0260d00054d60050d1007007b52", + "0x50ce005cbc0260264d60050260070260cd005cbb0ce0cf0074d60070d0", + "0x260cf0054d60050cf00508a0263940054d60050cc005cbd0260cc0054d6", + "0x3940d50cf0c00053940054d6005394005cb60260d50054d60050d500530f", + "0x3a70054d6005026b5d0263a40054d60050263530260264d6005026007026", + "0x2607e0260c40054d60053a73a400735f0263a70054d60053a7005318026", + "0x54d60050ca005cb50260ca0054d60050c43ae0073650263ae0054d6005", + "0x5cb60260d50054d60050d500530f0260cd0054d60050cd00508a02600e", + "0x70054590260264d600502600702600e0d50cd0c000500e0054d600500e", + "0x2636a0054d600536a00508a0261060054d60050d2005cb50260264d6005", + "0x1060d536a0c00051060054d6005106005cb60260d50054d60050d500530f", + "0x260264d60050c00054590260264d60050264d00260264d6005026007026", + "0x1040054d6005026b5d0261050054d60050263530260264d6005007005459", + "0x2607e0261030054d600510410500735f0261040054d6005104005318026", + "0x54d6005101005cb50261010054d60051031020073650261020054d6005", + "0x5cb602608a0054d600508a00530f0260bc0054d60050bc00508a026100", + "0x700538f0260264d600502600702610008a0bc0c00051000054d6005100", + "0x4d60050fe00536f0260fe0054d60050070ff007b520260ff0070074d6005", + "0x4d60050260070260fb005cbe0fc0fd0074d60070fe31b007b530260fe005", + "0xf90050d80260f90054d60050fa005b860260fa0054d6005026cb3026026", + "0xcbf0264d60070f9005b4c0260fd0054d60050fd00508a0260f90054d6005", + "0x4d60050fc0054590260264d60050264d00260264d60050260070260f8005", + "0x4d6005026b000260f70054d60050263530260264d60050c0005459026026", + "0x260f50054d60050f60f700735f0260f60054d60050f60053180260f6005", + "0x50f3005cb50260f30054d60050f50f40073650260f40054d600502607e", + "0x2608a0054d600508a00530f0260fd0054d60050fd00508a0260f20054d6", + "0x4d00260264d60050260070260f208a0fd0c00050f20054d60050f2005cb6", + "0xef0054590260ef0f00f10c04d60050f80c00fd0c0b4e0260264d6005026", + "0x2608a0054d600508a00530f0260f10054d60050f100508a0260264d6005", + "0x8a0f100ab890260f00054d60050f00050d80260fc0054d60050fc0050d8", + "0x260264d60050260070264360ed0ee0c00054360ed0ee0c04d60050f00fc", + "0x264390054d60050263530260264d60050c00054590260264d60050264d0", + "0x543f43900735f02643f0054d600543f00531802643f0054d6005026b5d", + "0x264970054d60054481700073650261700054d600502607e0264480054d6", + "0x508a00530f0260fb0054d60050fb00508a0260ec0054d6005497005cb5", + "0x50260070260ec08a0fb0c00050ec0054d60050ec005cb602608a0054d6", + "0x2640d0260eb0054d60050070050d80260264d60050c00054590260264d6", + "0x70054590260264d60050c00054590260264d6005026007026026cc0005", + "0xd80260e90054d60050ea005b860260ea0054d600502697b0260264d6005", + "0xe80054d60050eb005cbc0260264d60050264d00260eb0054d60050e9005", + "0x8a00530f02600a0054d600500a00508a0260e70054d60050e8005cbd026", + "0x260070260e708a00a0c00050e70054d60050e7005cb602608a0054d6005", + "0x263530260264d60050c00054590260264d60050070054590260264d6005", + "0x260e50054d60050e50053180260e50054d60050261060260e60054d6005", + "0xe40e30073650260e30054d600502607e0260e40054d60050e50e600735f", + "0x890054d600508900508a0260e10054d60050e2005cb50260e20054d6005", + "0x880890c00050e10054d60050e1005cb60260880054d600508800530f026", + "0x8a007cc100a0c00074d60070050260070050260264d60050264d00260e1", + "0x160057b90260160880074d60050070054da0260264d6005026007026089", + "0x264d40054d60054d40050d802640d0054d60050263440264d40054d6005", + "0x7cc24d24d30074d600740d4d40c00c015a02640d0054d600540d0050d8", + "0x501c0050d802601c0054d6005026c940260264d60050260070264d04d1", + "0x5cc30264d600701c005b4c0264d30054d60054d300508a02601c0054d6", + "0x4d60054d20054590260264d60050880057270260264d60050260070261c5", + "0x53090053180263090054d6005026b0002608b0054d6005026353026026", + "0x263120054d600502607e02630f0054d600530908b00735f0263090054d6", + "0x4d300508a0263180054d6005314005ca20263140054d600530f312007365", + "0x3180054d6005318005ca102600a0054d600500a00530f0264d30054d6005", + "0xc04d60051c54d24d30c0b4e0260264d600502600702631800a4d30c0005", + "0x50d802602c0054d60050263440260264d600502b00545902602b31b319", + "0x3801b007cc40323310074d600702c31b3190c081102602c0054d600502c", + "0x54d60050350050d80260350054d6005026c940260264d6005026007026", + "0xb530260360054d600503600536f0260360054d6005032035007b52026035", + "0x264fc0260264d60050260070260bb005cc50bc0390074d6007036331007", + "0x4d60070ba0bc0390c015a0260ba0054d60050ba0050d80260ba0054d6005", + "0x74d60050880054da0260264d600502600702635334e007cc634b0c3007", + "0x8a02607e0054d600507e0050d802607e0054d600535f0057b902635f358", + "0x5026007026026cc70264d600707e34b0074260260c30054d60050c3005", + "0x74e20263650054d60053650059640263650054d6005026cb00260264d6", + "0x4d600500a00530f0260c30054d60050c300508a0261710054d6005365358", + "0x3680c04d600517100a0c30c0bbc0261710054d600517100572002600a005", + "0xd40054d60050264d30260264d60050260070260d536a3680c00050d536a", + "0x508a0260d20054d60050d3005ca00260d30054d60050d4358007c9f026", + "0x54d60050d2005ca102600a0054d600500a00530f0260c30054d60050c3", + "0x260264d60053530054590260264d60050260070260d200a0c30c00050d2", + "0xd00054d60050262290260d10054d60050263530260264d6005088005727", + "0x2607e0260cf0054d60050d00d100735f0260d00054d60050d0005318026", + "0x54d60050cd005ca20260cd0054d60050cf0ce0073650260ce0054d6005", + "0x5ca102600a0054d600500a00530f02634e0054d600534e00508a0260cc", + "0x880057270260264d60050260070260cc00a34e0c00050cc0054d60050cc", + "0x53180263a40054d6005026b5d0263940054d60050263530260264d6005", + "0x54d600502607e0263a70054d60053a439400735f0263a40054d60053a4", + "0x8a0260ca0054d60053ae005ca20263ae0054d60053a70c40073650260c4", + "0x4d60050ca005ca102600a0054d600500a00530f0260bb0054d60050bb005", + "0x264d60050380054590260264d60050260070260ca00a0bb0c00050ca005", + "0x54d600502686302600e0054d60050263530260264d6005088005727026", + "0x7e0261050054d600510600e00735f0261060054d6005106005318026106", + "0x4d6005103005ca20261030054d60051051040073650261040054d6005026", + "0xca102600a0054d600500a00530f02601b0054d600501b00508a026102005", + "0x54590260264d600502600702610200a01b0c00051020054d6005102005", + "0x2290261010054d60050263530260264d60050880057270260264d60054d0", + "0x4d600510010100735f0261000054d60051000053180261000054d6005026", + "0xca20260fd0054d60050ff0fe0073650260fe0054d600502607e0260ff005", + "0x4d600500a00530f0264d10054d60054d100508a0260fc0054d60050fd005", + "0x4d60050260070260fc00a4d10c00050fc0054d60050fc005ca102600a005", + "0x4d60050261060260fb0054d60050263530260264d6005007005727026026", + "0x260f90054d60050fa0fb00735f0260fa0054d60050fa0053180260fa005", + "0x50f7005ca20260f70054d60050f90f80073650260f80054d600502607e", + "0x260890054d600508900530f02608a0054d600508a00508a0260f60054d6", + "0x50260264d60050264d00260f608908a0c00050f60054d60050f6005ca1", + "0x4d70260264d6005026007026088089007cc808a00a0074d6007005026007", + "0xa0054d600500a00508a0260264d600502600a0260160054d6005007005", + "0xa210260264d60050260070264d3005cc940d4d40074d6007016005a1f026", + "0x4d60054d20054e70264d10054d60054d400599e0264d20054d600540d005", + "0x54d60050264d30260264d6005026007026026cca00502640d0264d0005", + "0x54e70264d10054d60054d300599e0261c50054d600501c005a2302601c", + "0x5026007026309005ccb08b0054d60074d0005a240264d00054d60051c5", + "0xa1f02630f0054d600530f00596402630f0054d600508b005a260260264d6", + "0x314005a210260264d6005026007026318005ccc3143120074d60074d1005", + "0x2b0054d60053190054e702631b0054d600531200599e0263190054d6005", + "0x2602c0054d60050264d30260264d6005026007026026ccd00502640d026", + "0x53310054e702631b0054d600531800599e0263310054d600502c005a23", + "0x264d600502600702601b005cce0320054d600702b005a2402602b0054d6", + "0x31b005a1f0260380054d60050380059640260380054d6005032005a26026", + "0x4d6005036005a210260264d6005026007026039005ccf0360350074d6007", + "0x40d0260ba0054d60050bc0054e70260bb0054d600503500599e0260bc005", + "0x5a230260c30054d60050264d30260264d6005026007026026cd0005026", + "0x54d600534b0054e70260bb0054d600503900599e02634b0054d60050c3", + "0xa260260264d6005026007026353005cd134e0054d60070ba005a240260ba", + "0x4d60070bb005a1f0263580054d60053580059640263580054d600534e005", + "0x1710054d600507e005a210260264d6005026007026365005cd207e35f007", + "0x502640d02636a0054d60051710054e70263680054d600535f00599e026", + "0x50d5005a230260d50054d60050264d30260264d6005026007026026cd3", + "0x2636a0054d60050d40054e70263680054d600536500599e0260d40054d6", + "0xd3005a260260264d60050260070260d2005cd40d30054d600736a005a24", + "0xcf0054d60050d0005b860260d00054d600530f0059790260d10054d6005", + "0xcd00536f0260cd0054d60050ce0cf007b520260ce0054d6005026cd5026", + "0x74d60070cd00a007b530260d10054d60050d10059640260cd0054d6005", + "0x263a70054d60050380059790260264d60050260070263a4005cd63940cc", + "0x53ae0c4007b520263ae0054d6005026cd70260c40054d60053a7005b86", + "0xe0074d60070ca0cc007b530260ca0054d60050ca00536f0260ca0054d6", + "0x1040074d600710639400e0c08110260264d6005026007026105005cd8106", + "0x261000054d60053580059790260264d6005026007026101102007cd9103", + "0x50fe0ff007b520260fe0054d6005026cda0260ff0054d6005100005b86", + "0xfc0074d60070fd104007b530260fd0054d60050fd00536f0260fd0054d6", + "0xf90074d60070fb1030fc0c08110260264d60050260070260fa005cdb0fb", + "0x260f50054d60050d10059790260264d60050260070260f60f7007cdc0f8", + "0x7cdd0f20f30074d60070f40f80f90c08110260f40054d60050f5005b86", + "0x50f20c0007be40260264d60050264d00260264d60050260070260f00f1", + "0x260f30054d60050f300508a0260ee0054d60053680057280260ef0054d6", + "0x50ef005be00260ee0054d60050ee0052c102608a0054d600508a00530f", + "0x4360ed0c00054394360ed0c04d60050ef0ee08a0f300abe10260ef0054d6", + "0x264d60050f00054590260264d60050264d00260264d6005026007026439", + "0x54d60050263530260264d60050c0005bef0260264d6005368005978026", + "0x43f00735f0264480054d60054480053180264480054d600502686302643f", + "0x54d60051704970073650264970054d600502607e0261700054d6005448", + "0x530f0260f10054d60050f100508a0260eb0054d60050ec005cde0260ec", + "0x70260eb08a0f10c00050eb0054d60050eb005cdf02608a0054d600508a", + "0x59780260264d60050f60054590260264d60050264d00260264d6005026", + "0x3530260264d60050d10059870260264d60050c0005bef0260264d6005368", + "0xe90054d60050e90053180260e90054d60050268630260ea0054d6005026", + "0xe70073650260e70054d600502607e0260e80054d60050e90ea00735f026", + "0x54d60050f700508a0260e50054d60050e6005cde0260e60054d60050e8", + "0xf70c00050e50054d60050e5005cdf02608a0054d600508a00530f0260f7", + "0x4d60053680059780260264d60050264d00260264d60050260070260e508a", + "0x51030054590260264d60050d10059870260264d60050c0005bef026026", + "0xe30053180260e30054d6005026b5d0260e40054d60050263530260264d6", + "0xe10054d600502607e0260e20054d60050e30e400735f0260e30054d6005", + "0x508a0260df0054d60050e0005cde0260e00054d60050e20e1007365026", + "0x54d60050df005cdf02608a0054d600508a00530f0260fa0054d60050fa", + "0x4590260264d60050264d00260264d60050260070260df08a0fa0c00050df", + "0x260264d60050c0005bef0260264d60053680059780260264d6005101005", + "0xde0054d60050263530260264d60053580059870260264d60050d1005987", + "0xdd0de00735f0260dd0054d60050dd0053180260dd0054d6005026863026", + "0xda0054d60050dc0db0073650260db0054d600502607e0260dc0054d6005", + "0x8a00530f0261020054d600510200508a0260d90054d60050da005cde026", + "0x260070260d908a1020c00050d90054d60050d9005cdf02608a0054d6005", + "0xc0005bef0260264d60053680059780260264d60050264d00260264d6005", + "0x54590260264d60053580059870260264d60050d10059870260264d6005", + "0x3180260d80054d6005026b5d02608d0054d60050263530260264d6005394", + "0x4d600502607e0260d70054d60050d808d00735f0260d80054d60050d8005", + "0x260810054d60050d6005cde0260d60054d60050d7006007365026006005", + "0x5081005cdf02608a0054d600508a00530f0261050054d600510500508a", + "0x264d60050264d00260264d600502600702608108a1050c00050810054d6", + "0x4d60050d10059870260264d60050c0005bef0260264d6005368005978026", + "0x4d60050263530260264d60050380059870260264d6005358005987026026", + "0x735f0264ca0054d60054ca0053180264ca0054d6005026b5d026094005", + "0x4d60054c907d00736502607d0054d600502607e0264c90054d60054ca094", + "0x30f0263a40054d60053a400508a02601a0054d60054c8005cde0264c8005", + "0x2601a08a3a40c000501a0054d600501a005cdf02608a0054d600508a005", + "0x9780260264d60050d20050bc0260264d60050264d00260264d6005026007", + "0x260264d600530f0059870260264d60050c0005bef0260264d6005368005", + "0x9a0054d60050263530260264d60050380059870260264d6005358005987", + "0x9b09a00735f02609b0054d600509b00531802609b0054d6005026587026", + "0x4c60054d600509c09e00736502609e0054d600502607e02609c0054d6005", + "0x8a00530f02600a0054d600500a00508a0260a00054d60054c6005cde026", + "0x260070260a008a00a0c00050a00054d60050a0005cdf02608a0054d6005", + "0xc0005bef0260264d60053530050bc0260264d60050264d00260264d6005", + "0x59870260264d60050bb0059780260264d600530f0059870260264d6005", + "0x3180264c40054d60050265870264c50054d60050263530260264d6005038", + "0x4d600502607e0264c30054d60054c44c500735f0264c40054d60054c4005", + "0x264c00054d60054c1005cde0264c10054d60054c34c20073650264c2005", + "0x54c0005cdf02608a0054d600508a00530f02600a0054d600500a00508a", + "0x264d60050264d00260264d60050260070264c008a00a0c00054c00054d6", + "0x4d600530f0059870260264d60050c0005bef0260264d600501b0050bc026", + "0x4d60050265870264bf0054d60050263530260264d600531b005978026026", + "0x264bd0054d60054be4bf00735f0264be0054d60054be0053180264be005", + "0x50ab005cde0260ab0054d60054bd0aa0073650260aa0054d600502607e", + "0x2608a0054d600508a00530f02600a0054d600500a00508a0260ad0054d6", + "0x4d00260264d60050260070260ad08a00a0c00050ad0054d60050ad005cdf", + "0x264bc0054d60054d10057280260264d60053090050bc0260264d6005026", + "0x4ba005ce10264ba0054d60054bb0c04bc0c0ce00264bb0054d60050264d3", + "0x8a0054d600508a00530f02600a0054d600500a00508a0264b90054d6005", + "0x260264d60050260070264b908a00a0c00054b90054d60054b9005cdf026", + "0x4b80054d60050263530260264d60050c0005bef0260264d6005007005310", + "0x4b74b800735f0264b70054d60054b70053180264b70054d6005026106026", + "0x4b40054d60054b64b50073650264b50054d600502607e0264b60054d6005", + "0x8800530f0260890054d600508900508a0264b30054d60054b4005cde026", + "0x26bdf0264b30880890c00054b30054d60054b3005cdf0260880054d6005", + "0x260050054d60050050050d80260050054d6005026ce20260260054d6005", + "0x50c00050d80260c00054d6005026ce30260070054d6005005026007be4", + "0x2608a0054d6005026ce402600a0054d60050c0007007be40260c00054d6", + "0x5026ce50260890054d600508a00a007be402608a0054d600508a0050d8", + "0x160054d6005088089007be40260880054d60050880050d80260880054d6", + "0x4d4016007be40264d40054d60054d40050d80264d40054d6005026ce6026", + "0x264d30054d60054d30050d80264d30054d6005026ce702640d0054d6005", + "0x54d10050d80264d10054d6005026ce80264d20054d60054d340d007be4", + "0x2601c0054d6005026ce90264d00054d60054d14d2007be40264d10054d6", + "0x5026cea0261c50054d600501c4d0007be402601c0054d600501c0050d8", + "0x3090054d600508b1c5007be402608b0054d600508b0050d802608b0054d6", + "0x30f309007be402630f0054d600530f0050d802630f0054d6005026ceb026", + "0x263140054d60053140050d80263140054d6005026cec0263120054d6005", + "0x53190050d80263190054d6005026ced0263180054d6005314312007be4", + "0x2602b0054d6005026cee02631b0054d6005319318007be40263190054d6", + "0x5026cef02602c0054d600502b31b007be402602b0054d600502b0050d8", + "0x320054d600533102c007be40263310054d60053310050d80263310054d6", + "0x1b032007be402601b0054d600501b0050d802601b0054d6005026cf0026", + "0x260350054d60050350050d80260350054d6005026cf10260380054d6005", + "0x50390050d80260390054d6005026cf20260360054d6005035038007be4", + "0x260bb0054d6005026cf30260bc0054d6005039036007be40260390054d6", + "0x5026cf40260ba0054d60050bb0bc007be40260bb0054d60050bb0050d8", + "0x34b0054d60050c30ba007be40260c30054d60050c30050d80260c30054d6", + "0x34e34b007be402634e0054d600534e0050d802634e0054d6005026cf5026", + "0x263580054d60053580050d80263580054d6005026cf60263530054d6005", + "0x507e0050d802607e0054d6005026cf702635f0054d6005358353007be4", + "0x261710054d6005026cf80263650054d600507e35f007be402607e0054d6", + "0x5026cf90263680054d6005171365007be40261710054d60051710050d8", + "0xd50054d600536a368007be402636a0054d600536a0050d802636a0054d6", + "0xd40d5007be40260d40054d60050d40050d80260d40054d6005026cfa026", + "0x260d20054d60050d20050d80260d20054d6005026cfb0260d30054d6005", + "0x50d00050d80260d00054d6005026cfc0260d10054d60050d20d3007be4", + "0x260ce0054d6005026cfd0260cf0054d60050d00d1007be40260d00054d6", + "0x5026cfe0260cd0054d60050ce0cf007be40260ce0054d60050ce0050d8", + "0x3940054d60050cc0cd007be40260cc0054d60050cc0050d80260cc0054d6", + "0x3a4394007be40263a40054d60053a40050d80263a40054d6005026cff026", + "0x260c40054d60050c40050d80260c40054d6005026d000263a70054d6005", + "0x50ca0050d80260ca0054d6005026d010263ae0054d60050c43a7007be4", + "0x261060054d6005026d0202600e0054d60050ca3ae007be40260ca0054d6", + "0x5026d030261050054d600510600e007be40261060054d60051060050d8", + "0x1030054d6005104105007be40261040054d60051040050d80261040054d6", + "0x102103007be40261020054d60051020050d80261020054d6005026d04026", + "0x261000054d60051000050d80261000054d6005026d050261010054d6005", + "0x50fe0050d80260fe0054d6005026d060260ff0054d6005100101007be4", + "0x260fc0054d6005026d070260fd0054d60050fe0ff007be40260fe0054d6", + "0x5026d080260fb0054d60050fc0fd007be40260fc0054d60050fc0050d8", + "0xf90054d60050fa0fb007be40260fa0054d60050fa0050d80260fa0054d6", + "0xf80f9007be40260f80054d60050f80050d80260f80054d6005026d09026", + "0x260f60054d60050f60050d80260f60054d6005026d0a0260f70054d6005", + "0x50f40050d80260f40054d6005026d0b0260f50054d60050f60f7007be4", + "0x260f20054d6005026d0c0260f30054d60050f40f5007be40260f40054d6", + "0x50265070260f10054d60050f20f3007be40260f20054d60050f20050d8", + "0xef0054d60050f00f1007be40260f00054d60050f00050d80260f00054d6", + "0xee0ef007be40260ee0054d60050ee0050d80260ee0054d6005026d0d026", + "0x264360054d60054360050d80264360054d6005026d0e0260ed0054d6005", + "0x543f0050d802643f0054d6005026d0f0264390054d60054360ed007be4", + "0x261700054d6005026d100264480054d600543f439007be402643f0054d6", + "0x5026d110264970054d6005170448007be40261700054d60051700050d8", + "0xeb0054d60050ec497007be40260ec0054d60050ec0050d80260ec0054d6", + "0xea0eb007be40260ea0054d60050ea0050d80260ea0054d6005026d12026", + "0x260e80054d60050e80050d80260e80054d6005026d130260e90054d6005", + "0x50e60050d80260e60054d60050265060260e70054d60050e80e9007be4", + "0x260e40054d6005026d140260e50054d60050e60e7007be40260e60054d6", + "0x5026d150260e30054d60050e40e5007be40260e40054d60050e40050d8", + "0xe10054d60050e20e3007be40260e20054d60050e20050d80260e20054d6", + "0xe00e1007be40260e00054d60050e00050d80260e00054d6005026d16026", + "0x260de0054d60050de0050d80260de0054d6005026d170260df0054d6005", + "0x50dc0050d80260dc0054d6005026d180260dd0054d60050de0df007be4", + "0x260da0054d6005026d190260db0054d60050dc0dd007be40260dc0054d6", + "0x5026d1a0260d90054d60050da0db007be40260da0054d60050da0050d8", + "0xd80054d600508d0d9007be402608d0054d600508d0050d802608d0054d6", + "0xd70d8007be40260d70054d60050d70050d80260d70054d6005026d1b026", + "0x260d60054d60050d60050d80260d60054d6005026d1c0260060054d6005", + "0x50940050d80260940054d6005026d1d0260810054d60050d6006007be4", + "0x264c90054d60050265050264ca0054d6005094081007be40260940054d6", + "0x5026d1e02607d0054d60054c94ca007be40264c90054d60054c90050d8", + "0x1a0054d60054c807d007be40264c80054d60054c80050d80264c80054d6", + "0x70050260264d60050264d002601a00500501a0054d600501a005be0026", + "0x268170260264d600502600702640d4d4007d1f0160880074d6007005026", + "0x54d60054d30050d80264d200a0074d600500a00538f0264d30054d6005", + "0xb530264d10054d60054d100536f0264d10054d60054d24d3007b520264d3", + "0x5d210260264d60050260070261c5005d2001c4d00074d60074d1088007", + "0x4d6005309005d230263090054d600508b005d2202608b0c00074d60050c0", + "0x3120074d600730f01c4d00c015a02630f0054d600530f0050d802630f005", + "0x4590260264d60053140054590260264d6005026007026319318007d24314", + "0x260264d60050c00054f30260264d600508a0054f30260264d600500a005", + "0x531200508a02602b0054d600531b005d2602631b0054d6005089005d25", + "0x260070054d600500700501b0260160054d600501600530f0263120054d6", + "0x260264d600502600702602b00701631200a00502b0054d600502b005504", + "0x3310054d600502608d02602c0054d6005026bdf0260264d6005319005459", + "0x3310050d80260160054d600501600530f0263180054d600531800508a026", + "0xc00074d60050c0005d2102602c0054d600502c005be00263310054d6005", + "0xd802601b00a0074d600500a00538f0260320054d6005032005bf1026032", + "0x350380c04d600501b03202c331016318089d2702601b0054d600501b005", + "0xd2a0260264d60050260070260bc005d290390054d6007036005d28026036", + "0x50c30050bc0260264d60050ba0054590260c30ba0bb0c04d6005039005", + "0x530f0260380054d600503800508a02634b0054d60050268170260264d6", + "0x54d600534b0050d80260070054d600500700501b0260350054d6005035", + "0xa4d60050bb34b00703503808ad2b0260bb0054d60050bb005be002634b", + "0x4d6005026007026365005d2c07e0054d600735f005d2802635f35835334e", + "0xbc0260264d600536800545902636a3681710c04d600507e005d2a026026", + "0x4d60050d5005bef0260d40d50074d6005171005bee0260264d600536a005", + "0x34e00508a0260d20054d60050d4005bf00260d30054d600502608d026026", + "0x3580054d600535800501b0263530054d600535300530f02634e0054d6005", + "0x8a005d210260d30054d60050d30050d80260d20054d60050d2005bf1026", + "0x74d6005089005d210260d10054d60050d1005bf10260d108a0074d6005", + "0xd00d10d30d235835334e0885090260d00054d60050d0005bf10260d0089", + "0x70263a4005d2d3940054d60070cc005bf30260cc0cd0ce0cf00a4d6005", + "0x3ae0c40074d6005089005d2e0263a70054d6005026bdf0260264d6005026", + "0x500e005d2f02600e0054d60053ae005d220260ca0054d600502608d026", + "0x74d60070ca1060cf0c0d300260ca0054d60050ca0050d80261060054d6", + "0x261040054d6005104005d320260264d6005026007026103005d31104105", + "0x5101005d2e0261010054d6005394005bf50261020054d6005104005508", + "0x260fd0054d60050ff005d220260fe0054d600502608d0260ff1000074d6", + "0x51020050d80260fe0054d60050fe0050d80260fc0054d60050fd005d2f", + "0x260070260f9005d330fa0fb0074d60070fe0fc1050c0d300261020054d6", + "0x260f80054d60050fa0055080260fa0054d60050fa005d320260264d6005", + "0x4d600502600a0260f60054d60050f80051eb0260f70054d60051020051eb", + "0xf40f50074d60070f60f70fb0c08110260f60054d60050f60050d8026026", + "0xd80260f10054d60050f500508a0260264d60050260070260f20f3007d34", + "0x8a0260264d6005026007026026d3500502640d0260f00054d60050f4005", + "0x50f03a7007be40260f00054d60050f20050d80260f10054d60050f3005", + "0x264360054d60050263440260ed0ee0074d60050c4005d2e0260ef0054d6", + "0x54360050d802643f0054d6005439005d2f0264390054d60050ed005d22", + "0x74d600743643f0f10c0d300260ef0054d60050ef005be00264360054d6", + "0x261700054d6005170005d320260264d6005026007026497005d36170448", + "0x50263440260ea0eb0074d6005100005d2e0260ec0054d6005170005508", + "0x260e70054d60050e8005d2f0260e80054d60050ea005d220260e90054d6", + "0xe74480c0d300260ec0054d60050ec0050d80260e90054d60050e90050d8", + "0x50e5005d320260264d60050260070260e4005d370e50e60074d60070e9", + "0x260e20054d60050ec0051eb0260e30054d60050e50055080260e50054d6", + "0xe20e60c08110260e10054d60050e10050d80260e10054d60050e30051eb", + "0xe000508a0260264d60050260070260dd0de007d380df0e00074d60070e1", + "0x7026026d3900502640d0260db0054d60050df0050d80260dc0054d6005", + "0xdb0054d60050dd0050d80260dc0054d60050de00508a0260264d6005026", + "0x42802608d0d90074d60050ee005d2e0260da0054d60050db0ef007be4026", + "0x54d60050d7005d2f0260d70054d600508d005d220260d80054d6005026", + "0xc0d300260da0054d60050da005be00260d80054d60050d80050d8026006", + "0x5d320260264d6005026007026094005d3a0810d60074d60070d80060dc", + "0x74d60050eb005d2e0264ca0054d60050810055080260810054d6005081", + "0x5d2f02601a0054d600507d005d220264c80054d600502642802607d4c9", + "0x54d60054ca0050d80264c80054d60054c80050d802609a0054d600501a", + "0x4d600502600702609e005d3b09c09b0074d60074c809a0d60c0d300264ca", + "0x51eb0264c60054d600509c00550802609c0054d600509c005d32026026", + "0x54d60054c50050d80264c50054d60054c60051eb0260a00054d60054ca", + "0x50260070264c14c2007d3c4c34c40074d60074c50a009b0c08110264c5", + "0x40d0264bf0054d60054c30050d80264c00054d60054c400508a0260264d6", + "0xd80264c00054d60054c200508a0260264d6005026007026026d3d005026", + "0x50d9005d2e0264be0054d60054bf0da007be40264bf0054d60054c1005", + "0x260ad0054d60050aa005d220260ab0054d6005026b870260aa4bd0074d6", + "0x54be005be00260ab0054d60050ab0050d80264bc0054d60050ad005d2f", + "0x260070264b9005d3e4ba4bb0074d60070ab4bc4c00c0d300264be0054d6", + "0x264b80054d60054ba0055080264ba0054d60054ba005d320260264d6005", + "0x54b6005d220264b50054d6005026b870264b64b70074d60054c9005d2e", + "0x264b50054d60054b50050d80264b30054d60054b4005d2f0264b40054d6", + "0x5d3f4b14b20074d60074b54b34bb0c0d300264b80054d60054b80050d8", + "0x54b10055080264b10054d60054b1005d320260264d60050260070264b0", + "0x265180054d60054af0051eb0260840054d60054b80051eb0264af0054d6", + "0x7d404ab4ac0074d60075180844b20c08110265180054d60055180050d8", + "0x4ab0050d80264a60054d60054ac00508a0260264d60050260070265194aa", + "0x4aa00508a0260264d6005026007026026d4100502640d0264a50054d6005", + "0x54d60054a54be007be40264a50054d60055190050d80264a60054d6005", + "0x5d220264a10054d60050261420260bf4a20074d60054bd005d2e0264a4", + "0x54d60054a10050d802649f0054d60054a0005d2f0264a00054d60050bf", + "0xc249e0074d60074a149f4a60c0d300264a40054d60054a4005be00264a1", + "0x55080260c20054d60050c2005d320260264d600502600702649d005d42", + "0x54d60050261420264a94a80074d60054b7005d2e02649c0054d60050c2", + "0x50d80260c60054d600549a005d2f02649a0054d60054a9005d220264a7", + "0x74a70c649e0c0d3002649c0054d600549c0050d80264a70054d60054a7", + "0x54d60050c8005d320260264d6005026007026498005d430c84990074d6", + "0x51eb0264930054d600549c0051eb0264960054d60050c80055080260c8", + "0x75234934990c08110265230054d60055230050d80265230054d6005496", + "0x4d600549000508a0260264d600502600702648c48d007d4448e4900074d6", + "0x5026007026026d4500502640d02648a0054d600548e0050d802648b005", + "0xbe402648a0054d600548c0050d802648b0054d600548d00508a0260264d6", + "0x50264fe0264874880074d60054a2005d2e0264890054d600548a4a4007", + "0x264840054d6005485005d2f0264850054d6005487005d220264860054d6", + "0x48448b0c0d300264890054d6005489005be00264860054d60054860050d8", + "0x5482005d320260264d6005026007026481005d464824830074d6007486", + "0x47e47f0074d60054a8005d2e0264800054d60054820055080264820054d6", + "0x547c005d2f02647c0054d600547e005d2202647d0054d60050264fe026", + "0x264800054d60054800050d802647d0054d600547d0050d802647b0054d6", + "0x260264d6005026007026478005d4747947a0074d600747d47b4830c0d30", + "0x54800051eb0264770054d60054790055080264790054d6005479005d32", + "0x264750054d60054750050d80264750054d60054770051eb0264760054d6", + "0x264d6005026007026471472007d484734740074d600747547647a0c0811", + "0x502640d02646f0054d60054730050d80264700054d600547400508a026", + "0x4710050d80264700054d600547200508a0260264d6005026007026026d49", + "0x74d6005488005d2e02646e0054d600546f489007be402646f0054d6005", + "0x5d2f02646a0054d600546c005d2202646b0054d6005026c6a02646c46d", + "0x54d600546e005be002646b0054d600546b0050d80264690054d600546a", + "0x4d6005026007026466005d4a4674680074d600746b4694700c0d3002646e", + "0x5d2e0264650054d60054670055080264670054d6005467005d32026026", + "0x54d6005463005d220264620054d6005026c6a0264634640074d600547f", + "0x50d80264620054d60054620050d80264600054d6005461005d2f026461", + "0x2645d005d4b45e45f0074d60074624604680c0d300264650054d6005465", + "0x54d600545e00550802645e0054d600545e005d320260264d6005026007", + "0x50d802645a0054d600545c0051eb02645b0054d60054650051eb02645c", + "0x456457007d4c4584590074d600745a45b45f0c081102645a0054d600545a", + "0x4d60054580050d80264550054d600545900508a0260264d6005026007026", + "0x4d600545700508a0260264d6005026007026026d4d00502640d026454005", + "0x264530054d600545446e007be40264540054d60054560050d8026455005", + "0x4d6005026c6c0260264d60054520054f30264514520074d600546d005d2e", + "0xd802601e0054d600544f005d2f02644f0054d6005451005d22026450005", + "0x45001e4550c0d300264530054d6005453005be00264500054d6005450005", + "0x4d600544c005d320260264d600502600702610a005d4e44c07a0074d6007", + "0x2610b44a0074d6005464005d2e02644b0054d600544c00550802644c005", + "0x54d600510b005d2202610d0054d6005026c6c0260264d600544a0054f3", + "0x50d802610d0054d600510d0050d80261100054d600510e005d2f02610e", + "0x26442005d4f4434490074d600710d11007a0c0d3002644b0054d600544b", + "0x54d60054430055080264430054d6005443005d320260264d6005026007", + "0x50d80261130054d60051120051eb0261140054d600544b0051eb026112", + "0x11e11d007d5011a1110074d60071131144490c08110261130054d6005113", + "0x4d600511a0050d80260140054d600511100508a0260264d6005026007026", + "0x4d600511d00508a0260264d6005026007026026d5100502640d026120005", + "0x264400054d6005120453007be40261200054d600511e0050d8026014005", + "0x4d6005440005be002643e0054d600543e0050d802643e0054d6005026344", + "0x2600702643a43b007d5243c43d0074d600743e00a0140c0811026440005", + "0xbef0261284380074d6005440005bee0260264d60050264d00260264d6005", + "0x54d600543d00508a02612b0054d6005128005bf00260264d6005438005", + "0x5bf10260cd0054d60050cd00501b0260ce0054d60050ce00530f02643d", + "0x54d600508a005bf102643c0054d600543c0050d80260c00054d60050c0", + "0x512b08a43c0c00cd0ce43d088bf202612b0054d600512b005bf102608a", + "0x4d00260264d600502600702612612712912a00a00512612712912a00a4d6", + "0x4f30260264d6005440005bef0260264d600543a0054590260264d6005026", + "0x261330054d60050263530260264d60050c00054f30260264d600508a005", + "0x513413300735f0261340054d60051340053180261340054d6005026863", + "0x264340054d60054374350073650264350054d600502607e0264370054d6", + "0x50ce00530f02643b0054d600543b00508a0264330054d6005434005d53", + "0x54330054d60054330055040260cd0054d60050cd00501b0260ce0054d6", + "0x54590260264d60050264d00260264d60050260070264330cd0ce43b00a", + "0xbef0260264d60050c00054f30260264d600508a0054f30260264d600500a", + "0x264320054d60050263530260264d600544b0054590260264d6005453005", + "0x543143200735f0264310054d60054310053180264310054d6005026408", + "0x2642e0054d600543042f00736502642f0054d600502607e0264300054d6", + "0x50ce00530f0264420054d600544200508a02642d0054d600542e005d53", + "0x542d0054d600542d0055040260cd0054d60050cd00501b0260ce0054d6", + "0x54590260264d60050264d00260264d600502600702642d0cd0ce44200a", + "0xbef0260264d60050c00054f30260264d600508a0054f30260264d600500a", + "0x2642c0054d60050263530260264d60054640054f30260264d6005453005", + "0x542b42c00735f02642b0054d600542b00531802642b0054d6005026408", + "0x260820054d600542a2160073650262160054d600502607e02642a0054d6", + "0x50ce00530f02610a0054d600510a00508a0260cb0054d6005082005d53", + "0x50cb0054d60050cb0055040260cd0054d60050cd00501b0260ce0054d6", + "0x54590260264d60050264d00260264d60050260070260cb0cd0ce10a00a", + "0x4f30260264d60050c00054f30260264d600508a0054f30260264d600500a", + "0x260264d600546e005bef0260264d60054640054f30260264d600546d005", + "0x4280054d60050264080264290054d60050263530260264d6005465005459", + "0x2607e0264260054d600542842900735f0264280054d6005428005318026", + "0x54d6005423005d530264230054d60054261420073650261420054d6005", + "0x501b0260ce0054d60050ce00530f02645d0054d600545d00508a026422", + "0x264220cd0ce45d00a0054220054d60054220055040260cd0054d60050cd", + "0x4f30260264d600500a0054590260264d60050264d00260264d6005026007", + "0x260264d600546d0054f30260264d60050c00054f30260264d600508a005", + "0x1460054d60050263530260264d600546e005bef0260264d600547f0054f3", + "0x42114600735f0264210054d60054210053180264210054d6005026408026", + "0x5730054d600541f41c00736502641c0054d600502607e02641f0054d6005", + "0xce00530f0264660054d600546600508a0264190054d6005573005d53026", + "0x4190054d60054190055040260cd0054d60050cd00501b0260ce0054d6005", + "0x4590260264d60050264d00260264d60050260070264190cd0ce46600a005", + "0x260264d60050c00054f30260264d600508a0054f30260264d600500a005", + "0x264d60054880054f30260264d600547f0054f30260264d6005489005bef", + "0x54d60050264080264170054d60050263530260264d6005480005459026", + "0x7e02614c0054d600514a41700735f02614a0054d600514a00531802614a", + "0x4d6005149005d530261490054d600514c14b00736502614b0054d6005026", + "0x1b0260ce0054d60050ce00530f0264780054d600547800508a026416005", + "0x4160cd0ce47800a0054160054d60054160055040260cd0054d60050cd005", + "0x260264d600500a0054590260264d60050264d00260264d6005026007026", + "0x264d6005489005bef0260264d60050c00054f30260264d600508a0054f3", + "0x54d60050263530260264d60054880054f30260264d60054a80054f3026", + "0x41300735f0261520054d60051520053180261520054d6005026408026413", + "0x54d60051511580073650261580054d600502607e0261510054d6005152", + "0x530f0264810054d600548100508a0264110054d6005412005d53026412", + "0x54d60054110055040260cd0054d60050cd00501b0260ce0054d60050ce", + "0x260264d60050264d00260264d60050260070264110cd0ce48100a005411", + "0x264d60050c00054f30260264d600508a0054f30260264d600500a005459", + "0x4d60054a4005bef0260264d60054a80054f30260264d60054a20054f3026", + "0x4d600502640802615a0054d60050263530260264d600549c005459026026", + "0x2615c0054d600541015a00735f0264100054d6005410005318026410005", + "0x515e005d5302615e0054d600515c40f00736502640f0054d600502607e", + "0x260ce0054d60050ce00530f0264980054d600549800508a0264140054d6", + "0xcd0ce49800a0054140054d60054140055040260cd0054d60050cd00501b", + "0x264d600500a0054590260264d60050264d00260264d6005026007026414", + "0x4d60054a20054f30260264d60050c00054f30260264d600508a0054f3026", + "0x4d60050263530260264d60054a4005bef0260264d60054b70054f3026026", + "0x735f02640c0054d600540c00531802640c0054d600502640802640e005", + "0x4d600540b4080073650264080054d600502607e02640b0054d600540c40e", + "0x30f02649d0054d600549d00508a0261630054d6005407005d53026407005", + "0x4d60051630055040260cd0054d60050cd00501b0260ce0054d60050ce005", + "0x264d60050264d00260264d60050260070261630cd0ce49d00a005163005", + "0x4d60050c00054f30260264d600508a0054f30260264d600500a005459026", + "0x54bd0054f30260264d60054b70054f30260264d60054be005bef026026", + "0x50264080265870054d60050263530260264d60054b80054590260264d6", + "0x1670054d600516558700735f0261650054d60051650053180261650054d6", + "0x16b005d5302616b0054d60051674050073650264050054d600502607e026", + "0xce0054d60050ce00530f0264b00054d60054b000508a02616c0054d6005", + "0xce4b000a00516c0054d600516c0055040260cd0054d60050cd00501b026", + "0x4d600500a0054590260264d60050264d00260264d600502600702616c0cd", + "0x54be005bef0260264d60050c00054f30260264d600508a0054f3026026", + "0x50263530260264d60054bd0054f30260264d60054c90054f30260264d6", + "0x35f0264040054d60054040053180264040054d600502640802616e0054d6", + "0x54034020073650264020054d600502607e0264030054d600540416e007", + "0x264b90054d60054b900508a0264000054d6005401005d530264010054d6", + "0x54000055040260cd0054d60050cd00501b0260ce0054d60050ce00530f", + "0x4d60050264d00260264d60050260070264000cd0ce4b900a0054000054d6", + "0x50c00054f30260264d600508a0054f30260264d600500a005459026026", + "0xda005bef0260264d60054c90054f30260264d60050d90054f30260264d6", + "0x264080263ff0054d60050263530260264d60054ca0054590260264d6005", + "0x54d60051753ff00735f0261750054d60051750053180261750054d6005", + "0x5d5302617a0054d60051773fe0073650263fe0054d600502607e026177", + "0x54d60050ce00530f02609e0054d600509e00508a02617b0054d600517a", + "0x9e00a00517b0054d600517b0055040260cd0054d60050cd00501b0260ce", + "0x500a0054590260264d60050264d00260264d600502600702617b0cd0ce", + "0xd90054f30260264d60050c00054f30260264d600508a0054f30260264d6", + "0x263530260264d60050da005bef0260264d60050eb0054f30260264d6005", + "0x263fd0054d60053fd0053180263fd0054d600502640802617d0054d6005", + "0x3fc3fb0073650263fb0054d600502607e0263fc0054d60053fd17d00735f", + "0x940054d600509400508a02617e0054d600517f005d5302617f0054d6005", + "0x17e0055040260cd0054d60050cd00501b0260ce0054d60050ce00530f026", + "0x50264d00260264d600502600702617e0cd0ce09400a00517e0054d6005", + "0xc00054f30260264d600508a0054f30260264d600500a0054590260264d6", + "0x54f30260264d60050eb0054f30260264d60050ef005bef0260264d6005", + "0x4080261860054d60050263530260264d60050ec0054590260264d60050ee", + "0x4d60053f418600735f0263f40054d60053f40053180263f40054d6005026", + "0xd530263ef0054d60053f13f00073650263f00054d600502607e0263f1005", + "0x4d60050ce00530f0260e40054d60050e400508a0263ed0054d60053ef005", + "0xa0053ed0054d60053ed0055040260cd0054d60050cd00501b0260ce005", + "0xa0054590260264d60050264d00260264d60050260070263ed0cd0ce0e4", + "0x5bef0260264d60050c00054f30260264d600508a0054f30260264d6005", + "0x3530260264d60050ee0054f30260264d60051000054f30260264d60050ef", + "0x3eb0054d60053eb0053180263eb0054d60050264080263ec0054d6005026", + "0x3e90073650263e90054d600502607e0263ea0054d60053eb3ec00735f026", + "0x54d600549700508a02618f0054d600518d005d5302618d0054d60053ea", + "0x55040260cd0054d60050cd00501b0260ce0054d60050ce00530f026497", + "0x54590260264d600502600702618f0cd0ce49700a00518f0054d600518f", + "0x4f30260264d60050c00054f30260264d600508a0054f30260264d600500a", + "0x260264d60053a7005bef0260264d60051000054f30260264d60050c4005", + "0x3e70054d60050264080263e80054d60050263530260264d6005102005459", + "0x2607e0263e60054d60053e73e800735f0263e70054d60053e7005318026", + "0x54d60053e4005d530263e40054d60053e63e50073650263e50054d6005", + "0x501b0260ce0054d60050ce00530f0260f90054d60050f900508a0261ad", + "0x261ad0cd0ce0f900a0051ad0054d60051ad0055040260cd0054d60050cd", + "0x260264d600508a0054f30260264d600500a0054590260264d6005026007", + "0x264d6005394005d540260264d60050c40054f30260264d60050c00054f3", + "0x54d60050264080261960054d60050263530260264d60053a7005bef026", + "0x7e0261990054d600519819600735f0261980054d6005198005318026198", + "0x4d600519c005d5302619c0054d60051991a50073650261a50054d6005026", + "0x1b0260ce0054d60050ce00530f0261030054d600510300508a02619d005", + "0x19d0cd0ce10300a00519d0054d600519d0055040260cd0054d60050cd005", + "0x264d600508a0054f30260264d600500a0054590260264d6005026007026", + "0x4d60053a4005d530260264d60050890054f30260264d60050c00054f3026", + "0x1b0260ce0054d60050ce00530f0260cf0054d60050cf00508a0261a6005", + "0x1a60cd0ce0cf00a0051a60054d60051a60055040260cd0054d60050cd005", + "0x264d600508a0054f30260264d600500a0054590260264d6005026007026", + "0x4d600534e00508a0260264d60050c00054f30260264d60050890054f3026", + "0x4840261a30054d600535800501b0261a20054d600535300530f02619f005", + "0x4590260264d6005026007026026d5500502640d0261a70054d6005365005", + "0x260264d60050890054f30260264d600508a0054f30260264d600500a005", + "0x4d600503500530f02619f0054d600503800508a0260264d60050c00054f3", + "0xd530261a70054d60050bc0054840261a30054d600500700501b0261a2005", + "0x4d60051a200530f02619f0054d600519f00508a0261ae0054d60051a7005", + "0xa0051ae0054d60051ae0055040261a30054d60051a300501b0261a2005", + "0x54590260264d60050890054f30260264d60050260070261ae1a31a219f", + "0x3530260264d60050c00054f30260264d600508a0054f30260264d600500a", + "0x1aa0054d60051aa0053180261aa0054d6005026b5d0261a80054d6005026", + "0x1b00073650261b00054d600502607e0261af0054d60051aa1a800735f026", + "0x54d60051c500508a0263e30054d60053e2005d530263e20054d60051af", + "0x55040260070054d600500700501b0260160054d600501600530f0261c5", + "0x54f30260264d60050260070263e30070161c500a0053e30054d60053e3", + "0x4f30260264d600500a0054590260264d60050c00054f30260264d6005089", + "0x261b30054d60050261060263df0054d60050263530260264d600508a005", + "0x502607e0261b50054d60051b33df00735f0261b30054d60051b3005318", + "0x3e10054d60053dd005d530263dd0054d60051b53de0073650263de0054d6", + "0x700501b02640d0054d600540d00530f0264d40054d60054d400508a026", + "0x4d00263e100740d4d400a0053e10054d60053e10055040260070054d6005", + "0x7026016088007d5608908a0074d60070050260070050260264d6005026", + "0x8a0260264d600502600a0264d40054d60050c0005d220260264d6005026", + "0x70264d2005d584d340d0074d60074d4005d5702608a0054d600508a005", + "0x4d00054d600540d005d5a0264d10054d60054d3005d590260264d6005026", + "0x264d6005026007026026d5c00502640d02601c0054d60054d1005d5b026", + "0x54d2005d5a02608b0054d60051c5005d5d0261c50054d60050264d3026", + "0x263090054d60054d0005bf002601c0054d600508b005d5b0264d00054d6", + "0x30f0055080260264d6005026007026312005d5e30f0054d600701c005503", + "0x3140074d600531400538f0263140054d60053140050d80263140054d6005", + "0x31b0050d802631b0054d6005026d5f0263190054d60053180051eb026318", + "0x545902603233102c02b00a4d600531b3190070c0b5002631b0054d6005", + "0xd802601b0054d6005026cd50260264d60050320054590260264d6005331", + "0x4d600502c0050d802602b0054d600502b00501b02601b0054d600501b005", + "0x4d00260264d6005026007026038005d600264d600701b005b4c02602c005", + "0x4590260264d60053090054f30260264d600500a0057270260264d6005026", + "0x260350054d60050263530260264d600502c0054590260264d6005314005", + "0x503603500735f0260360054d60050360053180260360054d6005026b00", + "0x260bb0054d60050390bc0073650260bc0054d600502607e0260390054d6", + "0x508900530f02608a0054d600508a00508a0260ba0054d60050bb005d61", + "0x50ba0054d60050ba005d6202602b0054d600502b00501b0260890054d6", + "0xc04d600503802c08a0c0b4e0260264d60050260070260ba02b08908a00a", + "0x3583530074d600734b0c3007d630260264d600534e00545902634e34b0c3", + "0x38f02607e0054d600535800a0074e20260264d600502600702635f005d64", + "0x4d6005026d650261710054d60053650051eb0263653140074d6005314005", + "0x36a00a4d600536817102b0c0b500263680054d60053680050d8026368005", + "0x26cd70260264d60050d30054590260264d60050d40054590260d30d40d5", + "0x3530054d600535300508a0260d20054d60050d20050d80260d20054d6005", + "0xd50050d802636a0054d600536a00501b02607e0054d600507e005720026", + "0x264d60050260070260d1005d660264d60070d2005b4c0260d50054d6005", + "0x264d60053140054590260264d600507e0057270260264d60050264d0026", + "0x54d60050263530260264d60050d50054590260264d60053090054f3026", + "0xd000735f0260cf0054d60050cf0053180260cf0054d6005026b000260d0", + "0x54d60050ce0cd0073650260cd0054d600502607e0260ce0054d60050cf", + "0x530f0263530054d600535300508a0263940054d60050cc005d610260cc", + "0x54d6005394005d6202636a0054d600536a00501b0260890054d6005089", + "0x50d10d53530c0b4e0260264d600502600702639436a08935300a005394", + "0x74d60073a73a4007d630260264d60050c40054590260c43a73a40c04d6", + "0x1060054d60050ca07e0074e20260264d600502600702600e005d670ca3ae", + "0x26d680261040054d60051050051eb0261053140074d600531400538f026", + "0x4d600510310436a0c0b500261030054d60051030050d80261030054d6005", + "0x260264d60050ff0054590260264d60051000054590260ff10010110200a", + "0x4d60053ae00508a0260fe0054d60050fe0050d80260fe0054d6005026cda", + "0xd80261020054d600510200501b0261060054d60051060057200263ae005", + "0x50260070260fd005d690264d60070fe005b4c0261010054d6005101005", + "0x53090054f30260264d60053140054590260264d60050264d00260264d6", + "0x50263530260264d60051010054590260264d60051060057270260264d6", + "0x35f0260fb0054d60050fb0053180260fb0054d6005026b000260fc0054d6", + "0x50fa0f90073650260f90054d600502607e0260fa0054d60050fb0fc007", + "0x263ae0054d60053ae00508a0260f70054d60050f8005d610260f80054d6", + "0x50f7005d620261020054d600510200501b0260890054d600508900530f", + "0x1013ae0c0b4e0260264d60050260070260f71020893ae00a0050f70054d6", + "0x70f50f6007d630260264d60050f40054590260f40f50f60c04d60050fd", + "0x4d60050f21060074e20260264d60050260070260f1005d6a0f20f30074d6", + "0x50d80260ee0054d6005026d6b0260ef0054d60053140051eb0260f0005", + "0x45902643f4394360ed00a4d60050ee0ef1020c0b500260ee0054d60050ee", + "0x4360054d60054360050d80260264d600543f0054590260264d6005439005", + "0xf3007d630260ed0054d60050ed00501b0260f00054d60050f0005720026", + "0x4d60050264d00260264d6005026007026497005d6c1704480074d6007436", + "0x30f0264480054d600544800508a0260ec0054d60051700f00074e2026026", + "0x4d6005309005bf10260ed0054d60050ed00501b0260890054d6005089005", + "0x4d60050ec3090ed08944808abf60260ec0054d60050ec005720026309005", + "0x264d00260264d60050260070260e80e90ea0eb00a0050e80e90ea0eb00a", + "0x263530260264d60053090054f30260264d60050f00057270260264d6005", + "0x260e60054d60050e60053180260e60054d60050265870260e70054d6005", + "0xe50e40073650260e40054d600502607e0260e50054d60050e60e700735f", + "0x4970054d600549700508a0260e20054d60050e3005d610260e30054d6005", + "0xe2005d620260ed0054d60050ed00501b0260890054d600508900530f026", + "0x50264d00260264d60050260070260e20ed08949700a0050e20054d6005", + "0x1060057270260264d60053090054f30260264d60053140054590260264d6", + "0x53180260e00054d60050265870260e10054d60050263530260264d6005", + "0x54d600502607e0260df0054d60050e00e100735f0260e00054d60050e0", + "0x8a0260dc0054d60050dd005d610260dd0054d60050df0de0073650260de", + "0x4d600510200501b0260890054d600508900530f0260f10054d60050f1005", + "0x50260070260dc1020890f100a0050dc0054d60050dc005d62026102005", + "0x53140054590260264d600507e0057270260264d60050264d00260264d6", + "0x50265870260db0054d60050263530260264d60053090054f30260264d6", + "0xd90054d60050da0db00735f0260da0054d60050da0053180260da0054d6", + "0xd8005d610260d80054d60050d908d00736502608d0054d600502607e026", + "0x890054d600508900530f02600e0054d600500e00508a0260d70054d6005", + "0x8900e00a0050d70054d60050d7005d6202636a0054d600536a00501b026", + "0x4d600500a0057270260264d60050264d00260264d60050260070260d736a", + "0x4d60050263530260264d60053140054590260264d60053090054f3026026", + "0x735f0260d60054d60050d60053180260d60054d6005026587026006005", + "0x4d60050810940073650260940054d600502607e0260810054d60050d6006", + "0x30f02635f0054d600535f00508a0264c90054d60054ca005d610264ca005", + "0x4d60054c9005d6202602b0054d600502b00501b0260890054d6005089005", + "0x264d60050264d00260264d60050260070264c902b08935f00a0054c9005", + "0x7d00a3090c0d6d02607d0054d60050264d30260264d60053120050bc026", + "0x8a0054d600508a00508a02601a0054d60054c8005d6e0264c80054d6005", + "0x1a005d620260070054d600500700501b0260890054d600508900530f026", + "0xc00054f30260264d600502600702601a00708908a00a00501a0054d6005", + "0x2610602609a0054d60050263530260264d600500a0057270260264d6005", + "0x54d600509b09a00735f02609b0054d600509b00531802609b0054d6005", + "0x5d610264c60054d600509c09e00736502609e0054d600502607e02609c", + "0x54d600501600530f0260880054d600508800508a0260a00054d60054c6", + "0x8800a0050a00054d60050a0005d620260070054d600500700501b026016", + "0xd6f08a00a0074d60070050260070050260264d60050264d00260a0007016", + "0x1600597a0260160054d6005026cb00260264d6005026007026088089007", + "0x4d20054d600502626b0264d340d0074d60050c00052d60264d40054d6005", + "0x31702601c4d00074d60054d10052d60264d10054d60054d24d4007329026", + "0x4d60051c500535c0261c54d30074d60054d30053080260264d60054d0005", + "0x30802601c0054d600501c0053280260264d600530900545b02630908b007", + "0x31400545b0263143120074d600530f00535c02630f01c0074d600501c005", + "0x263190054d60053120053050263180054d600508b0053050260264d6005", + "0x4d600731931800727002600a0054d600500a00508a0260264d600502600a", + "0x4d30053170260264d600501c0053170260264d6005026007026026d70026", + "0x54d300535c0260264d6005026007026026d7100502640d0260264d6005", + "0x33102c0074d600501c00535c0260264d600531b00545b02602b31b0074d6", + "0x53310053050260320054d600502b0053050260264d600502c00545b026", + "0x260264d6005026007026026d720264d600701b03200727002601b0054d6", + "0x4d600540d0052d60260350054d600503800597a0260380054d600502697b", + "0x260bb0054d60050bc0350073290260bc0054d600502626b026039036007", + "0x50390053080260264d60050ba0053170260c30ba0074d60050bb0052d6", + "0x264d600535300545b02635334e0074d600534b00535c02634b0390074d6", + "0x535c0263580c30074d60050c30053080260c30054d60050c3005328026", + "0x54d600534e0053050260264d600507e00545b02607e35f0074d6005358", + "0x26026d730264d60071713650072700261710054d600535f005305026365", + "0x260264d60050390053170260264d60050c30053170260264d6005026007", + "0x36a3680074d600503900535c0260264d6005026007026026d7400502640d", + "0xd500545b0260d40d50074d60050c300535c0260264d600536800545b026", + "0x260d20054d60050d40053050260d30054d600536a0053050260264d6005", + "0x4d6005026cb30260264d6005026007026026d750264d60070d20d3007270", + "0x73290260cf0054d600502626b0260d00054d60050d100597a0260d1005", + "0x4d60070ce0057400260ce0054d60050ce0053280260ce0054d60050cf0d0", + "0x360053170260264d60050264d00260264d60050260070260cd005d76026", + "0x26b000260cc0054d60050263530260264d60050070053170260264d6005", + "0x54d60053940cc00735f0263940054d60053940053180263940054d6005", + "0x59a60260c40054d60053a43a70073650263a70054d600502607e0263a4", + "0x54d600508a00530f02600a0054d600500a00508a0263ae0054d60050c4", + "0x264d60050260070263ae08a00a0c00053ae0054d60053ae0059a302608a", + "0x10600e00a4d60050cd0ca00a0c0b460260ca0360074d6005036005308026", + "0xcb00261030054d600510400e0079b90260264d6005106005317026104105", + "0x74d60051050052d60261010054d600510200597a0261020054d6005026", + "0x1010073290260fe0054d600502626b0260264d60051000053170260ff100", + "0x4d60050fc0053170260fb0fc0074d60050fd0052d60260fd0054d60050fe", + "0x260f80f90074d60050fa00535c0260fa0ff0074d60050ff005308026026", + "0x4d60050fb0053080260fb0054d60050fb0053280260264d60050f800545b", + "0x260264d60050f500545b0260f50f60074d60050f700535c0260f70fb007", + "0x510300508a0260f30054d60050f60053050260f40054d60050f9005305", + "0x260264d6005026007026026d770264d60070f30f40072700261030054d6", + "0x26026d7800502640d0260264d60050ff0053170260264d60050fb005317", + "0x4d60050f200545b0260f10f20074d60050ff00535c0260264d6005026007", + "0x53050260264d60050f000545b0260ef0f00074d60050fb00535c026026", + "0x4d60070ed0ee0072700260ed0054d60050ef0053050260ee0054d60050f1", + "0x53080261030054d600510300508a0260264d6005026007026026d79026", + "0x4d60050070053080264360054d60054360053280264360070074d6005007", + "0x74d60054394361030c0c120264390054d6005439005328026439007007", + "0xd7a0ec0054d60074970054a40264971700074d6005448005c1302644843f", + "0x4d6005026cb30260264d60050ec0050bc0260264d60050260070260eb005", + "0x73290260e80054d600502626b0260e90054d60050ea00597a0260ea005", + "0x4d60070e70057400260e70054d60050e70053280260e70054d60050e80e9", + "0x70053170260264d60050264d00260264d60050260070260e6005d7b026", + "0x263530260264d60050360053170260264d60051700053170260264d6005", + "0x260e40054d60050e40053180260e40054d6005026b000260e50054d6005", + "0xe30e20073650260e20054d600502607e0260e30054d60050e40e500735f", + "0x43f0054d600543f00508a0260e00054d60050e10059a60260e10054d6005", + "0x8a43f0c00050e00054d60050e00059a302608a0054d600508a00530f026", + "0x50e603643f0c0b460260264d60050264d00260264d60050260070260e0", + "0x4d60050dc0df0079b90260264d60050dd0053170260dc0dd0de0df00a4d6", + "0x32802608a0054d600508a00530f0260db0054d60050db00508a0260db005", + "0x17008a0db00ac100260de0054d60050de0053280261700054d6005170005", + "0x70260d7005d7c0d80054d600708d00531602608d0d90da0c04d60050de", + "0xda0054d60050da00508a0260060054d60050d80052cb0260264d6005026", + "0xda0c0c120260060054d60050060053280260070054d6005007005328026", + "0x4ca0054a40264ca0940074d6005081005c130260810d60074d6005006007", + "0x264d60054c90050bc0260264d600502600702607d005d7d4c90054d6007", + "0xd600508a02601a0054d60054c80052140264c80054d60050940059a2026", + "0x1a0054d600501a0059a30260d90054d60050d900530f0260d60054d6005", + "0x3170260264d600507d0050bc0260264d600502600702601a0d90d60c0005", + "0x2609b0054d6005026d7e02609a0054d60050263530260264d6005094005", + "0x502607e02609c0054d600509b09a00735f02609b0054d600509b005318", + "0xa00054d60054c60059a60264c60054d600509c09e00736502609e0054d6", + "0xa00059a30260d90054d60050d900530f0260d60054d60050d600508a026", + "0x50070053170260264d60050260070260a00d90d60c00050a00054d6005", + "0x30f0260da0054d60050da00508a0264c50054d60050d70059a60260264d6", + "0x264c50d90da0c00054c50054d60054c50059a30260d90054d60050d9005", + "0x3170260264d60050eb0050bc0260264d60050264d00260264d6005026007", + "0x260264d60050360053170260264d60051700053170260264d6005007005", + "0x54d60054c30053180264c30054d6005026d7e0264c40054d6005026353", + "0x73650264c10054d600502607e0264c20054d60054c34c400735f0264c3", + "0x4d600543f00508a0264bf0054d60054c00059a60264c00054d60054c24c1", + "0xc00054bf0054d60054bf0059a302608a0054d600508a00530f02643f005", + "0x53080261030054d600510300508a0260264d60050260070264bf08a43f", + "0x4d60050070053280264be0054d60054be0053280264be0070074d6005007", + "0x74d60050aa005c130260aa4bd0074d60050074be1030c0c12026007005", + "0x260264d60050260070264bb005d7f4bc0054d60070ad0054a40260ad0ab", + "0x54d60054ba00597a0264ba0054d6005026cb30260264d60054bc0050bc", + "0x53280264b70054d60054b84b90073290264b80054d600502626b0264b9", + "0x4d60050260070264b6005d800264d60074b70057400264b70054d60054b7", + "0x4d60050360053170260264d60050ab0053170260264d60050264d0026026", + "0x54b40053180264b40054d6005026b000264b50054d6005026353026026", + "0x264b20054d600502607e0264b30054d60054b44b500735f0264b40054d6", + "0x4bd00508a0264b00054d60054b10059a60264b10054d60054b34b2007365", + "0x4b00054d60054b00059a302608a0054d600508a00530f0264bd0054d6005", + "0xc0b460260264d60050264d00260264d60050260070264b008a4bd0c0005", + "0x79b90260264d60055180053170264ac5180844af00a4d60054b60364bd", + "0x4d600508a00530f0264ab0054d60054ab00508a0264ab0054d60054ac4af", + "0xc100260840054d60050840053280260ab0054d60050ab00532802608a005", + "0x50260070264a65194aa0c00054a65194aa0c04d60050840ab08a4ab00a", + "0x50ab0053170260264d60054bb0050bc0260264d60050264d00260264d6", + "0x5026d7e0264a50054d60050263530260264d60050360053170260264d6", + "0x4a20054d60054a44a500735f0264a40054d60054a40053180264a40054d6", + "0x4a10059a60264a10054d60054a20bf0073650260bf0054d600502607e026", + "0x8a0054d600508a00530f0264bd0054d60054bd00508a0264a00054d6005", + "0x260264d60050260070264a008a4bd0c00054a00054d60054a00059a3026", + "0x549f00566202649e49f0074d600500700535c0260264d6005036005317", + "0x26007026026d8100502640d02649d0054d600549e0056620260c20054d6", + "0x2697b0260264d60050070053170260264d600540d0053170260264d6005", + "0x264a90054d600502626b0264a80054d600549c00597a02649c0054d6005", + "0x4d60050264d002649d0054d60054a90056620260c20054d60054a8005662", + "0x21402649a0054d60054a70059a20264a70054d600549d0c2007329026026", + "0x4d600508a00530f02600a0054d600500a00508a0260c60054d600549a005", + "0x4d60050260070260c608a00a0c00050c60054d60050c60059a302608a005", + "0x4d60050263530260264d60050c00053170260264d6005007005317026026", + "0x735f0260c80054d60050c80053180260c80054d6005026106026499005", + "0x4d60054984960073650264960054d600502607e0264980054d60050c8499", + "0x30f0260890054d600508900508a0265230054d60054930059a6026493005", + "0x265230880890c00055230054d60055230059a30260880054d6005088005", + "0x535b02608908a0074d600500700535c02600a0c00074d600500500535c", + "0x16088007c1902601608a0074d600508a00535b0260880c00074d60050c0", + "0x508900535b0264d20054d60054d30260079b90264d340d4d40c04d6005", + "0x1c54d20079b90261c501c4d00c04d60054d10c0007c190264d10890074d6", + "0x4d600508a309007c1902630900a0074d600500a00535b02608b0054d6005", + "0x701c4d43180c04f00263180054d600531408b0079b902631431230f0c0", + "0x54d600502626b0260264d600502600702602c02b007d8231b3190074d6", + "0x26026d830264d60073314d00072700263190054d600531900508a026331", + "0x260264d600500a00545b0260264d600508900545b0260264d6005026007", + "0x26b0260264d6005026007026026d8400502640d0260264d600530f00545b", + "0x4d6005026007026026d850264d600703230f0072700260320054d6005026", + "0x3800547d0260380054d600501b00547c02601b0054d60050264d3026026", + "0x50264d30260264d6005026007026026d8600502640d0260350054d6005", + "0x260350054d600503900547d0260390054d600503600547e0260360054d6", + "0x70bc0054a40260bc0054d60050bc00547d0260bc0054d600503500547b", + "0x260264d60050bb0050bc0260264d60050260070260ba005d870bb0054d6", + "0xa0c33190c035a0260c30054d60050c30056620260c30054d600502626b", + "0x534e00545b0260264d6005026007026358353007d8834e34b0074d6007", + "0x35f00547c02635f0054d60050264d30260264d600508900545b0260264d6", + "0x1710054d600507e00547d0263650054d600534b00508a02607e0054d6005", + "0x260264d600535800545b0260264d6005026007026026d8900502640d026", + "0x893683530c035a0263680054d60053680056620263680054d600502626b", + "0x50d500545b0260264d60050260070260d30d4007d8a0d536a0074d6007", + "0x508a0260d10054d60050d200547c0260d20054d60050264d30260264d6", + "0x26026d8b00502640d0260cf0054d60050d100547d0260d00054d600536a", + "0x260ce0054d60050264d30260264d60050d300545b0260264d6005026007", + "0x50cd00547d0260d00054d60050d400508a0260cd0054d60050ce00547e", + "0x261710054d60050cf005d8c0263650054d60050d00052720260cf0054d6", + "0xd8d00502640d0263940054d6005171005d8c0260cc0054d6005365005272", + "0x4d600508900545b0260264d60050ba0050bc0260264d6005026007026026", + "0x53a400547e0263a40054d60050264d30260264d600500a00545b026026", + "0x263940054d60053a700547d0260cc0054d600531900508a0263a70054d6", + "0x539400547d0263ae0054d600531b0056620260c40054d60050cc00508a", + "0x530f00545b0260264d6005026007026026d8e00502640d0260ca0054d6", + "0xa00545b0260264d600508900545b0260264d60054d000545b0260264d6", + "0x8a0261060054d600500e00547e02600e0054d60050264d30260264d6005", + "0x4d600510600547d0263ae0054d600502c0056620260c40054d600502b005", + "0x26007026102103007d8f1041050074d60073123ae0c40c04f00260ca005", + "0x261000054d60051040056620261010054d600510500508a0260264d6005", + "0x260264d6005026007026026d9000502640d0260ff0054d60050ca00547d", + "0x54d60050fe00547e0260fe0054d60050264d30260264d60050ca00529c", + "0x547d0261000054d60051020056620261010054d600510300508a0260fd", + "0x50ff0fc007d910260fc0054d600510040d0073290260ff0054d60050fd", + "0x50fb0054d60050fb005d920261010054d600510100508a0260fb0054d6", + "0xd9308a00a0074d60070050260070050260264d60050264d00260fb101007", + "0x2600a0260160054d60050070054d70260264d6005026007026088089007", + "0x40d4d40074d6007016005a1f02600a0054d600500a00508a0260264d6005", + "0x599e0264d20054d600540d005a210260264d60050260070264d3005d94", + "0x26026d9500502640d0264d00054d60054d20054e70264d10054d60054d4", + "0x1c50054d600501c005a2302601c0054d60050264d30260264d6005026007", + "0x4d0005a240264d00054d60051c50054e70264d10054d60054d300599e026", + "0x260264d60050264d00260264d6005026007026309005d9608b0054d6007", + "0x5312005a270263120054d600530f00597902630f0054d600508b005a26", + "0x3180054d60053140c000735f0263140054d60053140053180263140054d6", + "0x8a00530f02600a0054d600500a00508a0263190054d60054d1005728026", + "0x3180054d60053180050f50263190054d60053190052c102608a0054d6005", + "0x702602c02b31b0c000502c02b31b0c04d600531831908a00a00ac32026", + "0x59780260264d60053090050bc0260264d60050264d00260264d6005026", + "0x320054d60053310c000742f0263310054d60050264d30260264d60054d1", + "0x8a00530f02600a0054d600500a00508a02601b0054d600503200542e026", + "0x2600702601b08a00a0c000501b0054d600501b00543002608a0054d6005", + "0x263530260264d60050070053100260264d60050c00053ae0260264d6005", + "0x260350054d60050350053180260350054d60050261060260380054d6005", + "0x360390073650260390054d600502607e0260360054d600503503800735f", + "0x890054d600508900508a0260bb0054d60050bc0054310260bc0054d6005", + "0x880890c00050bb0054d60050bb0054300260880054d600508800530f026", + "0x880890074d600508a005007afe02608a00a0074d60050c000535c0260bb", + "0x508900501b0260160054d60050160056620260160054d6005026a56026", + "0x5d970264d60070160058210260880054d60050880056620260890054d6", + "0x4d600500a00545b0260264d6005007005afa0260264d60050260070264d4", + "0x4d600502658702640d0054d60050263530260264d600508800545b026026", + "0x264d20054d60054d340d00735f0264d30054d60054d30053180264d3005", + "0xd9800502640d0264d00054d60054d20050f50264d10054d600502600508a", + "0x2608b1c501c0c04d60054d40880260c08250260264d6005026007026026", + "0x5010260264d6005026007026312005d9930f3090074d60071c501c007501", + "0x7c7d0260264d6005026007026319005d9a3183140074d600708b309007", + "0xa089007afe02602b0054d600530f31b007c7d02631b0054d6005318007", + "0x320054d60050320056620260320054d6005026a5602633102c0074d6005", + "0x2c00501b02602b0054d600502b005aee0263140054d600531400508a026", + "0xd9b0264d60070320058210263310054d600533100566202602c0054d6005", + "0x533100545b0260264d600502b005afa0260264d600502600702601b005", + "0x350053180260350054d60050265870260380054d60050263530260264d6", + "0x54d600531400508a0260360054d600503503800735f0260350054d6005", + "0x4d6005026007026026d9c00502640d0260bc0054d60050360050f5026039", + "0x4d60070ba0bb0075010260c30ba0bb0c04d600501b3313140c0825026026", + "0x74d60070c334b0075010260264d6005026007026353005d9d34e34b007", + "0x3650054d600535f02b007c7d0260264d600502600702607e005d9e35f358", + "0x171007c830263680054d60050264d30261710054d600534e365007c7d026", + "0x54d600535800508a0260d50054d600536a005c8402636a0054d6005368", + "0x3580c00050d50054d60050d5005c6202602c0054d600502c00501b026358", + "0x534e00539a0260264d600502b005afa0260264d60050260070260d502c", + "0xd30053180260d30054d60050265870260d40054d60050263530260264d6", + "0x54d600507e00508a0260d20054d60050d30d400735f0260d30054d6005", + "0x4d6005026007026026d9c00502640d0260bc0054d60050d20050f5026039", + "0x4d60050263530260264d60050c300545b0260264d600502b005afa026026", + "0x735f0260d00054d60050d00053180260d00054d60050265870260d1005", + "0x4d60050cf0050f50260390054d600535300508a0260cf0054d60050d00d1", + "0xc610260cd0054d60050bc0ce0073650260ce0054d600502607e0260bc005", + "0x4d600502c00501b0260390054d600503900508a0260cc0054d60050cd005", + "0x4d60050260070260cc02c0390c00050cc0054d60050cc005c6202602c005", + "0x530f00539a0260264d600500a00545b0260264d6005007005afa026026", + "0x3a40053180263a40054d60050265870263940054d60050263530260264d6", + "0x54d600531900508a0263a70054d60053a439400735f0263a40054d6005", + "0x4d6005026007026026d9800502640d0264d00054d60053a70050f50264d1", + "0x508b00545b0260264d600500a00545b0260264d6005007005afa026026", + "0x3ae0053180263ae0054d60050265870260c40054d60050263530260264d6", + "0x54d600531200508a0260ca0054d60053ae0c400735f0263ae0054d6005", + "0xe00736502600e0054d600502607e0264d00054d60050ca0050f50264d1", + "0x54d60054d100508a0261050054d6005106005c610261060054d60054d0", + "0x4d10c00051050054d6005105005c620260890054d600508900501b0264d1", + "0x7d9f08a00a0074d60070050260070050260264d60050264d0026105089", + "0x50c000538f0260160054d60050263440260264d6005026007026088089", + "0x264d60070164d400742602600a0054d600500a00508a0264d40c00074d6", + "0x540d00536f02640d0054d6005026af40260264d6005026007026026da0", + "0x264d20054d60050263440264d30054d600540d007007c7d02640d0054d6", + "0xc000a0c015a0264d30054d60054d3005aee0264d20054d60054d20050d8", + "0x4d100508a0260264d60050260070261c501c007da14d04d10074d60074d2", + "0x4d30054d60054d3005aee02608a0054d600508a00530f0264d10054d6005", + "0x30908b0c04d60054d04d308a4d100ac800264d00054d60054d00050d8026", + "0x260264d60051c50054590260264d600502600702630f30908b0c000530f", + "0x3140054d60050262290263120054d60050263530260264d60054d3005afa", + "0x2607e0263180054d600531431200735f0263140054d6005314005318026", + "0x54d600531b005c6102631b0054d60053183190073650263190054d6005", + "0x5c6202608a0054d600508a00530f02601c0054d600501c00508a02602b", + "0xc00054590260264d600502600702602b08a01c0c000502b0054d600502b", + "0xc7d02602c0054d600502c00536f02602c0054d6005026c810260264d6005", + "0x5032331007c830260320054d60050264d30263310054d600502c007007", + "0x2600a0054d600500a00508a0260380054d600501b005c8402601b0054d6", + "0x3808a00a0c00050380054d6005038005c6202608a0054d600508a00530f", + "0x264d60050c00054590260264d6005007005afa0260264d6005026007026", + "0x4d60050360053180260360054d60050261060260350054d6005026353026", + "0x3650260bc0054d600502607e0260390054d600503603500735f026036005", + "0x508900508a0260ba0054d60050bb005c610260bb0054d60050390bc007", + "0x50ba0054d60050ba005c620260880054d600508800530f0260890054d6", + "0x880890074d60070050260070050260264d60050264d00260ba0880890c0", + "0x538f02640d0054d60050268170260264d60050260070264d4016007da2", + "0x40d4d30890c015a02640d0054d600540d0050d80264d30070074d6005007", + "0x54d10054590260264d600502600702601c4d0007da34d14d20074d6007", + "0x50264d30260264d600500a0054f30260264d600508a0054590260264d6", + "0x54d600508b005da502608b0054d60051c50070c00c0da40261c50054d6", + "0x5da60260880054d600508800530f0264d20054d60054d200508a026309", + "0x1c0054590260264d60050260070263090884d20c00053090054d6005309", + "0x263140054d600502681702631230f0074d600500a005d2e0260264d6005", + "0x536f0263190054d6005314318007b5202631808a0074d600508a00538f", + "0x702602c005da702b31b0074d60073194d0007b530263190054d6005319", + "0x733102b31b0c08110263310070074d600500700538f0260264d6005026", + "0x4d6005312005d220260264d6005026007026035038007da801b0320074d6", + "0xbc0074d600701b0390320c0d300260390054d6005036005d2f026036005", + "0x5080260bb0054d60050bb005d320260264d60050260070260ba005da90bb", + "0x4d600534b0050d802634b0054d60050c30051eb0260c30054d60050bb005", + "0xd80263530054d600502634402634e0054d600534b0c0007be402634b005", + "0x3530070bc0c081102634e0054d600534e005be00263530054d6005353005", + "0x535800508a0260264d600502600702636507e007daa35f3580074d6007", + "0x2635f0054d600535f0050d80260880054d600508800530f0263580054d6", + "0x508a0050d802630f0054d600530f005bf102634e0054d600534e005be0", + "0xc000536a3681710c04d600508a30f34e35f088358089d2702608a0054d6", + "0x8a0054590260264d60053650054590260264d600502600702636a368171", + "0x263530260264d600534e005bef0260264d600530f0054f30260264d6005", + "0x260d40054d60050d40053180260d40054d60050268630260d50054d6005", + "0xd30d20073650260d20054d600502607e0260d30054d60050d40d500735f", + "0x7e0054d600507e00508a0260d00054d60050d10055000260d10054d6005", + "0x8807e0c00050d00054d60050d0005da60260880054d600508800530f026", + "0x4d600530f0054f30260264d600508a0054590260264d60050260070260d0", + "0x4d60050263530260264d60050c0005bef0260264d6005007005459026026", + "0x735f0260ce0054d60050ce0053180260ce0054d60050264080260cf005", + "0x4d60050cd0cc0073650260cc0054d600502607e0260cd0054d60050ce0cf", + "0x30f0260ba0054d60050ba00508a0263a40054d6005394005500026394005", + "0x263a40880ba0c00053a40054d60053a4005da60260880054d6005088005", + "0x260264d600508a0054590260264d60050350054590260264d6005026007", + "0x264d60050c0005bef0260264d60050070054590260264d600530f0054f3", + "0x54d60050268630263a70054d60050263530260264d60053120054f3026", + "0x7e0263ae0054d60050c43a700735f0260c40054d60050c40053180260c4", + "0x4d600500e00550002600e0054d60053ae0ca0073650260ca0054d6005026", + "0xda60260880054d600508800530f0260380054d600503800508a026106005", + "0x54590260264d60050260070261060880380c00051060054d6005106005", + "0xbef0260264d60050070054590260264d600530f0054f30260264d600508a", + "0x261050054d60050263530260264d60053120054f30260264d60050c0005", + "0x510410500735f0261040054d60051040053180261040054d6005026b5d", + "0x261010054d60051031020073650261020054d600502607e0261030054d6", + "0x508800530f02602c0054d600502c00508a0261000054d6005101005500", + "0x502600702610008802c0c00051000054d6005100005da60260880054d6", + "0xc0005bef0260264d600500a0054f30260264d60050070054590260264d6", + "0x261060260ff0054d60050263530260264d600508a0054590260264d6005", + "0x54d60050fe0ff00735f0260fe0054d60050fe0053180260fe0054d6005", + "0x55000260fb0054d60050fd0fc0073650260fc0054d600502607e0260fd", + "0x54d60054d400530f0260160054d600501600508a0260fa0054d60050fb", + "0x264d60050264d00260fa4d40160c00050fa0054d60050fa005da60264d4", + "0x264d6005026007026016088007dab08908a0074d6007005026007005026", + "0x4d40050d802640d0c00074d60050c000538f0264d40054d6005026c94026", + "0x264d04d1007dac4d24d30074d60074d440d08a0c015a0264d40054d6005", + "0x2601c0054d60050264d30260264d60054d20054590260264d6005026007", + "0x508a02608b0054d60051c5005da50261c50054d600501c0c000a0c0da4", + "0x54d600500700501b0260890054d600508900530f0264d30054d60054d3", + "0x4d600502600702608b0070894d300a00508b0054d600508b005da6026007", + "0x26dad02630f3090074d600500a005bee0260264d60054d0005459026026", + "0x54d60053120050d80263140c00074d60050c000538f0263120054d6005", + "0x502600702602b31b007dae3193180074d60073123144d10c015a026312", + "0x5026007026032005daf33102c0074d600731930f3180c0d300260264d6", + "0x1eb02601b0054d60053310055080263310054d6005331005d320260264d6", + "0x4d600500700501b02602c0054d600502c00508a0260380054d600501b005", + "0x350c04d600503800702c0c0db00260380054d60050380050d8026007005", + "0x260264d60050260070260bb005db10bc0054d6007039005b8a026039036", + "0x50c000538f02634b0054d60050264280260c30ba0074d6005309005bee", + "0x4d600734b34e0350c015a02634b0054d600534b0050d802634e0c00074d6", + "0x73580c33530c0d300260264d600502600702607e35f007db2358353007", + "0x54d6005171005d320260264d6005026007026368005db31713650074d6", + "0x508a0260d50054d600536a0051eb02636a0054d6005171005508026171", + "0x54d60050d50050d80260360054d600503600501b0263650054d6005365", + "0x54d60070d2005b8a0260d20d30d40c04d60050d50363650c0db40260d5", + "0x260ce0cf0074d60050ba005bee0260264d60050260070260d0005db50d1", + "0x50cd0050d80260cc0c00074d60050c000538f0260cd0054d6005026817", + "0x70260c43a7007db63a43940074d60070cd0cc0d40c015a0260cd0054d6", + "0x702600e005db70ca3ae0074d60073a40ce3940c0d300260264d6005026", + "0x1060054d60050ca0055080260ca0054d60050ca005d320260264d6005026", + "0x1060051eb0261040054d60050d1005b8e0261050054d60050bc005b8e026", + "0x8110261030054d60051030050d80260264d600502600a0261030054d6005", + "0x260264d60050260070260ff100007db81011020074d60071051033ae0c0", + "0xdb900502640d0260fd0054d60051010050d80260fe0054d600510200508a", + "0x50ff0050d80260fe0054d600510000508a0260264d6005026007026026", + "0x260fa0054d6005026c6c0260fb0fc0074d60050cf005bee0260fd0054d6", + "0xfe0c015a0260fa0054d60050fa0050d80260f90c00074d60050c000538f", + "0xc0d300260264d60050260070260f50f6007dba0f70f80074d60070fa0f9", + "0x5d320260264d60050260070260f2005dbb0f30f40074d60070f70fb0f8", + "0x54d60050f10051eb0260f10054d60050f30055080260f30054d60050f3", + "0xee0ef0074d60070f00fd0f40c08110260f00054d60050f00050d80260f0", + "0xd80264390054d60050ef00508a0260264d60050260070264360ed007dbc", + "0x8a0260264d6005026007026026dbd00502640d02643f0054d60050ee005", + "0x10443f4390c081102643f0054d60054360050d80264390054d60050ed005", + "0x544800508a0260264d60050260070260ec497007dbe1704480074d6007", + "0x26007026026dbf00502640d0260ea0054d60051700050d80260eb0054d6", + "0x260ea0054d60050ec0050d80260eb0054d600549700508a0260264d6005", + "0x50e80050d80260e80054d60050263440260e90054d60050ea0fc007be4", + "0x74d60070e80c00eb0c08110260e90054d60050e9005be00260e80054d6", + "0x8a0260264d60050264d00260264d60050260070260e40e5007dc00e60e7", + "0x4d60050d300501b0260890054d600508900530f0260e70054d60050e7005", + "0xd2b0260e90054d60050e9005be00260e60054d60050e60050d80260d3005", + "0x260e00e10e20e300a0050e00e10e20e300a4d60050e90e60d30890e708a", + "0xbef0260264d60050e40054590260264d60050264d00260264d6005026007", + "0x260de0054d60050268630260df0054d60050263530260264d60050e9005", + "0x502607e0260dd0054d60050de0df00735f0260de0054d60050de005318", + "0xda0054d60050db0055000260db0054d60050dd0dc0073650260dc0054d6", + "0xd300501b0260890054d600508900530f0260e50054d60050e500508a026", + "0x70260da0d30890e500a0050da0054d60050da005da60260d30054d6005", + "0x5bef0260264d60050c00054590260264d60050264d00260264d6005026", + "0x3530260264d60050fd0054590260264d60051040054590260264d60050fc", + "0x8d0054d600508d00531802608d0054d60050264080260d90054d6005026", + "0xd70073650260d70054d600502607e0260d80054d600508d0d900735f026", + "0x54d60050f200508a0260d60054d60050060055000260060054d60050d8", + "0x5da60260d30054d60050d300501b0260890054d600508900530f0260f2", + "0x264d00260264d60050260070260d60d30890f200a0050d60054d60050d6", + "0x5bef0260264d60050c00054590260264d60050f50054590260264d6005", + "0x50a0260264d60050fd0054590260264d60051040054590260264d60050fc", + "0x260940054d60050262290260810054d60050263530260264d60050fb005", + "0x502607e0264ca0054d600509408100735f0260940054d6005094005318", + "0x4c80054d600507d00550002607d0054d60054ca4c90073650264c90054d6", + "0xd300501b0260890054d600508900530f0260f60054d60050f600508a026", + "0x70264c80d30890f600a0054c80054d60054c8005da60260d30054d6005", + "0xdc10260264d60050cf005bef0260264d60050c00054590260264d6005026", + "0x2601a0054d60050263530260264d60050d1005dc10260264d60050bc005", + "0x509a01a00735f02609a0054d600509a00531802609a0054d6005026408", + "0x2609e0054d600509b09c00736502609c0054d600502607e02609b0054d6", + "0x508900530f02600e0054d600500e00508a0264c60054d600509e005500", + "0x54c60054d60054c6005da60260d30054d60050d300501b0260890054d6", + "0x4590260264d60050c40054590260264d60050260070264c60d308900e00a", + "0x260264d60050bc005dc10260264d60050cf005bef0260264d60050c0005", + "0xa00054d60050263530260264d60050ce00550a0260264d60050d1005dc1", + "0x4c50a000735f0264c50054d60054c50053180264c50054d6005026229026", + "0x4c20054d60054c44c30073650264c30054d600502607e0264c40054d6005", + "0x8900530f0263a70054d60053a700508a0264c10054d60054c2005500026", + "0x4c10054d60054c1005da60260d30054d60050d300501b0260890054d6005", + "0x260264d60050c00054590260264d60050260070264c10d30893a700a005", + "0x54d60050d00055000260264d60050ba005bef0260264d60050bc005dc1", + "0x501b0260890054d600508900530f0260d40054d60050d400508a0264c0", + "0x264c00d30890d400a0054c00054d60054c0005da60260d30054d60050d3", + "0x260264d60050ba005bef0260264d60050c00054590260264d6005026007", + "0x4be0054d60050264080264bf0054d60050263530260264d60050bc005dc1", + "0x2607e0264bd0054d60054be4bf00735f0264be0054d60054be005318026", + "0x54d60050ab0055000260ab0054d60054bd0aa0073650260aa0054d6005", + "0x501b0260890054d600508900530f0263680054d600536800508a0260ad", + "0x260ad03608936800a0050ad0054d60050ad005da60260360054d6005036", + "0x260264d60050c00054590260264d600507e0054590260264d6005026007", + "0x264d60050c300550a0260264d60050bc005dc10260264d60050ba005bef", + "0x4d60054bb0053180264bb0054d60050262290264bc0054d6005026353026", + "0x3650264b90054d600502607e0264ba0054d60054bb4bc00735f0264bb005", + "0x535f00508a0264b70054d60054b80055000264b80054d60054ba4b9007", + "0x260360054d600503600501b0260890054d600508900530f02635f0054d6", + "0x260264d60050260070264b703608935f00a0054b70054d60054b7005da6", + "0x54d60050bb0055000260264d6005309005bef0260264d60050c0005459", + "0x501b0260890054d600508900530f0260350054d600503500508a0264b6", + "0x264b603608903500a0054b60054d60054b6005da60260360054d6005036", + "0x260264d6005309005bef0260264d60050c00054590260264d6005026007", + "0x54d60054b40053180264b40054d60050264080264b50054d6005026353", + "0x73650264b20054d600502607e0264b30054d60054b44b500735f0264b4", + "0x4d600503200508a0264b00054d60054b10055000264b10054d60054b34b2", + "0xda60260070054d600500700501b0260890054d600508900530f026032005", + "0x4590260264d60050260070264b000708903200a0054b00054d60054b0005", + "0x260264d6005309005bef0260264d60050c00054590260264d600502b005", + "0x840054d60050262290264af0054d60050263530260264d600530f00550a", + "0x2607e0265180054d60050844af00735f0260840054d6005084005318026", + "0x54d60054ab0055000264ab0054d60055184ac0073650264ac0054d6005", + "0x501b0260890054d600508900530f02631b0054d600531b00508a0264aa", + "0x264aa00708931b00a0054aa0054d60054aa005da60260070054d6005007", + "0x260264d600500a005bef0260264d60050c00054590260264d6005026007", + "0x54d60054a60053180264a60054d60050261060265190054d6005026353", + "0x73650264a40054d600502607e0264a50054d60054a651900735f0264a6", + "0x4d600508800508a0260bf0054d60054a20055000264a20054d60054a54a4", + "0xda60260070054d600500700501b0260160054d600501600530f026088005", + "0x50260264d60050264d00260bf00701608800a0050bf0054d60050bf005", + "0xc940260264d600502600702640d4d4007dc20160880074d6007005026007", + "0x4d60054d30050d80264d200a0074d600500a00538f0264d30054d6005026", + "0x260070261c501c007dc34d04d10074d60074d34d20880c015a0264d3005", + "0x54f30260264d600500a0054590260264d60054d00054590260264d6005", + "0x2608b0054d6005089005d250260264d60050c00054f30260264d600508a", + "0x501600530f0264d10054d60054d100508a0263090054d600508b005d26", + "0x53090054d60053090055040260070054d600500700501b0260160054d6", + "0xd2e0260264d60051c50054590260264d60050260070263090070164d100a", + "0x4d6005312005d220263140054d600502614202631230f0074d6005089005", + "0xd300263140054d60053140050d80263190054d6005318005d2f026318005", + "0xd320260264d600502600702602c005dc402b31b0074d600731431901c0c0", + "0x4d60053310051eb0263310054d600502b00550802602b0054d600502b005", + "0xd80260070054d600500700501b02631b0054d600531b00508a026032005", + "0xb8a02603503801b0c04d600503200731b0c0dc50260320054d6005032005", + "0x530f005d2e0260264d6005026007026039005dc60360054d6007035005", + "0x260c30054d60050bb005d220260ba0054d60050261420260bb0bc0074d6", + "0x34b01b0c0d300260ba0054d60050ba0050d802634b0054d60050c3005d2f", + "0x5353005d320260264d6005026007026358005dc735334e0074d60070ba", + "0x36507e0074d60050bc005d2e02635f0054d60053530055080263530054d6", + "0x5368005d2f0263680054d6005365005d220261710054d60050264fe026", + "0x2635f0054d600535f0050d80261710054d60051710050d802636a0054d6", + "0x260264d60050260070260d3005dc80d40d50074d600717136a34e0c0d30", + "0x507e005d2e0260d20054d60050d40055080260d40054d60050d4005d32", + "0x260ce0054d60050d0005d220260cf0054d6005026c6a0260d00d10074d6", + "0x50d20050d80260cf0054d60050cf0050d80260cd0054d60050ce005d2f", + "0x260070263a4005dc93940cc0074d60070cf0cd0d50c0d300260d20054d6", + "0x263a70054d60053940055080263940054d6005394005d320260264d6005", + "0x50c400538f0263ae0054d60050d20051eb0260c40054d600535f0051eb", + "0x545902610410510600e00a4d60053ae0ca0380c0b500260ca0c40074d6", + "0xd80261030054d6005026b8c0260264d60051040054590260264d6005105", + "0x260ff10010110200a4d60051030c400e0c0b500261030054d6005103005", + "0x54d60053a70051eb0260264d60050ff0054590260264d6005101005459", + "0xc0b500260fe0054d60050fe0050d80261000054d60051000050d80260fe", + "0x54590260264d60050fb0054590260fa0fb0fc0fd00a4d60050fe100102", + "0xfc0054d60050fc0050d80261060054d60051060050d80260264d60050fa", + "0x264d60050f80054590260f60f70f80f900a4d60050fc1060fd0c0b50026", + "0x5026c6c0260f40f50074d60050d1005d2e0260264d60050f6005459026", + "0x260f10054d60050f2005d2f0260f20054d60050f4005d220260f30054d6", + "0x50f70050d80260f90054d60050f900501b0260f30054d60050f30050d8", + "0x260070260ee005dca0ef0f00074d60070f30f10cc0c0d300260f70054d6", + "0x260ed0054d60050ef0055080260ef0054d60050ef005d320260264d6005", + "0x4d600502600a0264390054d60050ed0051eb0264360054d6005036005b8e", + "0x44843f0074d60074364390f00c08110264390054d60054390050d8026026", + "0xd80260ec0054d600543f00508a0260264d6005026007026497170007dcb", + "0x8a0260264d6005026007026026dcc00502640d0260eb0054d6005448005", + "0xf70eb0ec0c08110260eb0054d60054970050d80260ec0054d6005170005", + "0x50ea00508a0260264d60050260070260e70e8007dcd0e90ea0074d6007", + "0x26007026026dce00502640d0260e50054d60050e90050d80260e60054d6", + "0x260e50054d60050e70050d80260e60054d60050e800508a0260264d6005", + "0xe2005d2f0260e20054d60050e3005d220260e30e40074d600508a005d2e", + "0x70e00e10e60c0d300260e000a0074d600500a00538f0260e10054d6005", + "0x54d60050de005d320260264d60050260070260dd005dcf0de0df0074d6", + "0x50d80260db0054d60050dc0051eb0260dc0054d60050de0055080260de", + "0xd808d007dd00d90da0074d60070db0e50df0c08110260db0054d60050db", + "0x4d60050d90050d80260d70054d60050da00508a0260264d6005026007026", + "0x4d600508d00508a0260264d6005026007026026dd100502640d026006005", + "0x260810d60074d60050c0005d2e0260060054d60050d80050d80260d7005", + "0x500a00538f0264ca0054d6005094005d2f0260940054d6005081005d22", + "0x702601a005dd24c807d0074d60074c94ca0d70c0d300264c900a0074d6", + "0x9a0054d60054c80055080264c80054d60054c8005d320260264d6005026", + "0x7d0c081102609b0054d600509b0050d802609b0054d600509a0051eb026", + "0x508a0260264d60050260070260a04c6007dd309e09c0074d600709b006", + "0x26026dd400502640d0264c40054d600509e0050d80264c50054d600509c", + "0x54d60050a00050d80264c50054d60054c600508a0260264d6005026007", + "0x5d220264c10054d600502608d0264c24c30074d60050f5005d2e0264c4", + "0x54d60054c10050d80264bf0054d60054c0005d2f0264c00054d60054c2", + "0x4d60050260070260aa005dd54bd4be0074d60074c14bf4c50c0d300264c1", + "0x51eb0260ab0054d60054bd0055080264bd0054d60054bd005d32026026", + "0x54d60050f900501b0264be0054d60054be00508a0260ad0054d60050ab", + "0x4bb4bc0c04d60050ad0f94be0c0dd60260ad0054d60050ad0050d80260f9", + "0xd2e0260264d60050260070264b8005dd74b90054d60074ba005b8a0264ba", + "0x4d60054b6005d220264b50054d600502608d0264b64b70074d60054c3005", + "0xd300264b50054d60054b50050d80264b30054d60054b4005d2f0264b4005", + "0xd320260264d60050260070264b0005dd84b14b20074d60074b54b34bc0c0", + "0x4d60054b7005d2e0264af0054d60054b10055080264b10054d60054b1005", + "0xd2f0264ab0054d6005518005d220264ac0054d6005026344026518084007", + "0x4d60054af0050d80264ac0054d60054ac0050d80264aa0054d60054ab005", + "0x50260070264a5005dd94a65190074d60074ac4aa4b20c0d300264af005", + "0xd2e0264a40054d60054a60055080264a60054d60054a6005d320260264d6", + "0x4d60050bf005d220264a10054d60050264280260bf4a20074d6005084005", + "0xd80264a10054d60054a10050d802649f0054d60054a0005d2f0264a0005", + "0x49d005dda0c249e0074d60074a149f5190c0d300264a40054d60054a4005", + "0x4d60050c20055080260c20054d60050c2005d320260264d6005026007026", + "0x38f0264a90054d60054a40051eb0264a80054d60054af0051eb02649c005", + "0x4bb0c0b5002649a4a90074d60054a900538f0264a74a80074d60054a8005", + "0x4980054590260264d60050c80054590264980c84990c600a4d600549a4a7", + "0x264960054d60054960050d80264960054d600549c0051eb0260264d6005", + "0x48e49052300a4d60054934a80c60c0b500264934960074d600549600538f", + "0x54990050d80260264d600548d0054590260264d600548e00545902648d", + "0xa4d60054904995230c0b500264900054d60054900050d80264990054d6", + "0xb500260264d60054890054590260264d600548b00545902648948a48b48c", + "0x4590260264d600548600545902648548648748800a4d60054964a948c0c0", + "0x54d60054870050d802648a0054d600548a0050d80260264d6005485005", + "0x4d600548300545902648148248348400a4d600548748a4880c0b50026487", + "0x4820050d80264800054d60054b9005b8e0260264d6005481005459026026", + "0x4d600748248049e0c08110264840054d600548400501b0264820054d6005", + "0x54d600547f00508a0260264d600502600702647c47d007ddb47e47f007", + "0x4d6005026007026026ddc00502640d02647a0054d600547e0050d802647b", + "0x26bdf02647a0054d600547c0050d802647b0054d600547d00508a026026", + "0x747a47847b0c08110264784c40074d60054c400538f0264790054d6005", + "0x4d600547700508a0260264d6005026007026474475007ddd4764770074d6", + "0x5026007026026dde00502640d0264720054d60054760050d8026473005", + "0xbe40264720054d60054740050d80264730054d600547500508a0260264d6", + "0x502608d02646f4700074d60054a2005d2e0264710054d6005472479007", + "0x2646c0054d600546d005d2f02646d0054d600546f005d2202646e0054d6", + "0x46c4730c0d300264710054d6005471005be002646e0054d600546e0050d8", + "0x546a005d320260264d6005026007026469005ddf46a46b0074d600746e", + "0x264670054d60054680051eb0264680054d600546a00550802646a0054d6", + "0x470005d2e0264660054d6005467471007be40264670054d60054670050d8", + "0x4620054d6005464005d220264630054d60050263440264644650074d6005", + "0x466005be00264630054d60054630050d80264610054d6005462005d2f026", + "0x702645e005de045f4600074d600746346146b0c0d300264660054d6005", + "0x45d0054d600545f00550802645f0054d600545f005d320260264d6005026", + "0x466007be402645c0054d600545c0050d802645c0054d600545d0051eb026", + "0x54d600502642802645945a0074d6005465005d2e02645b0054d600545c", + "0x50d80264560054d6005457005d2f0264570054d6005459005d22026458", + "0x74584564600c0d3002645b0054d600545b005be00264580054d6005458", + "0x54d6005454005d320260264d6005026007026453005de14544550074d6", + "0x50d80264510054d60054520051eb0264520054d6005454005508026454", + "0x4d600545a005d2e0264500054d600545145b007be40264510054d6005451", + "0xd2f02644c0054d600501e005d2202607a0054d6005026b8702601e44f007", + "0x4d6005450005be002607a0054d600507a0050d802610a0054d600544c005", + "0x502600702610b005de244a44b0074d600707a10a4550c0d30026450005", + "0x1eb02610d0054d600544a00550802644a0054d600544a005d320260264d6", + "0x4c410e44b0c081102610e0054d600510e0050d802610e0054d600510d005", + "0x511000508a0260264d6005026007026442443007de34491100074d6007", + "0x26007026026de400502640d0261140054d60054490050d80261120054d6", + "0x261140054d60054420050d80261120054d600544300508a0260264d6005", + "0x2614202611a1110074d600544f005d2e0261130054d6005114450007be4", + "0x140054d600511e005d2f02611e0054d600511a005d2202611d0054d6005", + "0x1120c0d300261130054d6005113005be002611d0054d600511d0050d8026", + "0x440005d320260264d600502600702643e005de54401200074d600711d014", + "0x43c0054d600543d0051eb02643d0054d60054400055080264400054d6005", + "0x5d2e02643b0054d600543c113007be402643c0054d600543c0050d8026", + "0x54d6005438005d220261280054d60050264fe02643843a0074d6005111", + "0x5be00261280054d60051280050d802612a0054d600512b005d2f02612b", + "0x26126005de61271290074d600712812a1200c0d3002643b0054d600543b", + "0x54d60051270055080261270054d6005127005d320260264d6005026007", + "0x7be40261340054d60051340050d80261340054d60051330051eb026133", + "0x54350054f30264344350074d600543a005d2e0264370054d600513443b", + "0x5d2f0264320054d6005434005d220264330054d6005026c6a0260264d6", + "0x54d6005437005be00264330054d60054330050d80264310054d6005432", + "0x4d600502600702642e005de742f4300074d60074334311290c0d30026437", + "0x51eb02642d0054d600542f00550802642f0054d600542f005d32026026", + "0x4d600542c437007be402642c0054d600542c0050d802642c0054d600542d", + "0x5be002642a0054d600542a0050d802642a0054d600502634402642b005", + "0x4290cb007de80822160074d600742a00a4300c081102642b0054d600542b", + "0x4280074d600542b005bee0260264d60050264d00260264d6005026007026", + "0x21600508a0261420054d6005426005bf00260264d6005428005bef026426", + "0x4840054d600548400501b0260160054d600501600530f0262160054d6005", + "0xe4005bf10260820054d60050820050d80260d60054d60050d6005bf1026", + "0x820d64840162160885090261420054d6005142005bf10260e40054d6005", + "0x4d600502600702642114642242300a00542114642242300a4d60051420e4", + "0x4d600542b005bef0260264d60054290054590260264d60050264d0026026", + "0x4d60050263530260264d60050d60054f30260264d60050e40054f3026026", + "0x735f02641c0054d600541c00531802641c0054d600502686302641f005", + "0x4d60055734190073650264190054d600502607e0265730054d600541c41f", + "0x30f0260cb0054d60050cb00508a02614a0054d6005417005d53026417005", + "0x4d600514a0055040264840054d600548400501b0260160054d6005016005", + "0x264d60050264d00260264d600502600702614a4840160cb00a00514a005", + "0x4d60050d60054f30260264d60050e40054f30260264d600500a005459026", + "0x4d600502640802614c0054d60050263530260264d6005437005bef026026", + "0x261490054d600514b14c00735f02614b0054d600514b00531802614b005", + "0x5413005d530264130054d60051494160073650264160054d600502607e", + "0x260160054d600501600530f02642e0054d600542e00508a0261520054d6", + "0x48401642e00a0051520054d60051520055040264840054d600548400501b", + "0x264d600500a0054590260264d60050264d00260264d6005026007026152", + "0x4d600543a0054f30260264d60050d60054f30260264d60050e40054f3026", + "0x4d60050264080261510054d60050263530260264d600543b005bef026026", + "0x264120054d600515815100735f0261580054d6005158005318026158005", + "0x515a005d5302615a0054d60054124110073650264110054d600502607e", + "0x260160054d600501600530f0261260054d600512600508a0264100054d6", + "0x48401612600a0054100054d60054100055040264840054d600548400501b", + "0x264d600500a0054590260264d60050264d00260264d6005026007026410", + "0x4d6005113005bef0260264d60050d60054f30260264d60050e40054f3026", + "0x4d600502640802615c0054d60050263530260264d60051110054f3026026", + "0x2615e0054d600540f15c00735f02640f0054d600540f00531802640f005", + "0x540e005d5302640e0054d600515e4140073650264140054d600502607e", + "0x260160054d600501600530f02643e0054d600543e00508a02640c0054d6", + "0x48401643e00a00540c0054d600540c0055040264840054d600548400501b", + "0x264d600500a0054590260264d60050264d00260264d600502600702640c", + "0x4d600544f0054f30260264d60050d60054f30260264d60050e40054f3026", + "0x4d60050263530260264d60054c40054590260264d6005450005bef026026", + "0x735f0264080054d60054080053180264080054d600502640802640b005", + "0x4d60054071630073650261630054d600502607e0264070054d600540840b", + "0x30f02610b0054d600510b00508a0261650054d6005587005d53026587005", + "0x4d60051650055040264840054d600548400501b0260160054d6005016005", + "0x264d60050264d00260264d600502600702616548401610b00a005165005", + "0x4d60050d60054f30260264d60050e40054f30260264d600500a005459026", + "0x54c40054590260264d600545a0054f30260264d600545b005bef026026", + "0x4050053180264050054d60050264080261670054d60050263530260264d6", + "0x16c0054d600502607e02616b0054d600540516700735f0264050054d6005", + "0x508a0264040054d600516e005d5302616e0054d600516b16c007365026", + "0x54d600548400501b0260160054d600501600530f0264530054d6005453", + "0x4d600502600702640448401645300a0054040054d6005404005504026484", + "0x4d60050e40054f30260264d600500a0054590260264d60050264d0026026", + "0x5466005bef0260264d60054650054f30260264d60050d60054f3026026", + "0x50264080264030054d60050263530260264d60054c40054590260264d6", + "0x4010054d600540240300735f0264020054d60054020053180264020054d6", + "0x3ff005d530263ff0054d60054014000073650264000054d600502607e026", + "0x160054d600501600530f02645e0054d600545e00508a0261750054d6005", + "0x1645e00a0051750054d60051750055040264840054d600548400501b026", + "0x4d600500a0054590260264d60050264d00260264d6005026007026175484", + "0x5471005bef0260264d60050d60054f30260264d60050e40054f3026026", + "0x50263530260264d60054c40054590260264d60054700054f30260264d6", + "0x35f0263fe0054d60053fe0053180263fe0054d60050264080261770054d6", + "0x517a17b00736502617b0054d600502607e02617a0054d60053fe177007", + "0x264690054d600546900508a0263fd0054d600517d005d5302617d0054d6", + "0x53fd0055040264840054d600548400501b0260160054d600501600530f", + "0x4d60050264d00260264d60050260070263fd48401646900a0053fd0054d6", + "0x50d60054f30260264d60050e40054f30260264d600500a005459026026", + "0x4c40054590260264d60054a20054f30260264d60054b9005dc10260264d6", + "0x263530260264d60054af0054590260264d60054a40054590260264d6005", + "0x263fb0054d60053fb0053180263fb0054d60050264080263fc0054d6005", + "0x17f17e00736502617e0054d600502607e02617f0054d60053fb3fc00735f", + "0x49d0054d600549d00508a0263f40054d6005186005d530261860054d6005", + "0x3f40055040264bb0054d60054bb00501b0260160054d600501600530f026", + "0x50264d00260264d60050260070263f44bb01649d00a0053f40054d6005", + "0xd60054f30260264d60050e40054f30260264d600500a0054590260264d6", + "0x54590260264d60054af0054590260264d60054b9005dc10260264d6005", + "0x4080263f10054d60050263530260264d60050840054f30260264d60054c4", + "0x4d60053f03f100735f0263f00054d60053f00053180263f00054d6005026", + "0xd530263ec0054d60053ef3ed0073650263ed0054d600502607e0263ef005", + "0x4d600501600530f0264a50054d60054a500508a0263eb0054d60053ec005", + "0xa0053eb0054d60053eb0055040264bb0054d60054bb00501b026016005", + "0xa0054590260264d60050264d00260264d60050260070263eb4bb0164a5", + "0x5dc10260264d60050d60054f30260264d60050e40054f30260264d6005", + "0x3530260264d60054c40054590260264d60054b70054f30260264d60054b9", + "0x3e90054d60053e90053180263e90054d60050264080263ea0054d6005026", + "0x18f00736502618f0054d600502607e02618d0054d60053e93ea00735f026", + "0x54d60054b000508a0263e70054d60053e8005d530263e80054d600518d", + "0x55040264bb0054d60054bb00501b0260160054d600501600530f0264b0", + "0x264d00260264d60050260070263e74bb0164b000a0053e70054d60053e7", + "0x54f30260264d60050e40054f30260264d600500a0054590260264d6005", + "0xd530260264d60054c40054590260264d60054c30054f30260264d60050d6", + "0x4d600501600530f0264bc0054d60054bc00508a0263e60054d60054b8005", + "0xa0053e60054d60053e60055040264bb0054d60054bb00501b026016005", + "0xa0054590260264d60050264d00260264d60050260070263e64bb0164bc", + "0x54f30260264d60050d60054f30260264d60050e40054f30260264d6005", + "0x4080263e50054d60050263530260264d60054c40054590260264d60054c3", + "0x4d60053e43e500735f0263e40054d60053e40053180263e40054d6005026", + "0xd530261980054d60051ad1960073650261960054d600502607e0261ad005", + "0x4d600501600530f0260aa0054d60050aa00508a0261990054d6005198005", + "0xa0051990054d60051990055040260f90054d60050f900501b026016005", + "0xa0054590260264d60050264d00260264d60050260070261990f90160aa", + "0x54f30260264d60050d60054f30260264d60050e40054f30260264d6005", + "0x4080261a50054d60050263530260264d60050060054590260264d60050f5", + "0x4d600519c1a500735f02619c0054d600519c00531802619c0054d6005026", + "0xd5302619f0054d600519d1a60073650261a60054d600502607e02619d005", + "0x4d600501600530f02601a0054d600501a00508a0261a20054d600519f005", + "0xa0051a20054d60051a20055040260f90054d60050f900501b026016005", + "0xa0054590260264d60050264d00260264d60050260070261a20f901601a", + "0x54f30260264d60050c00054f30260264d60050e40054f30260264d6005", + "0x4080261a30054d60050263530260264d60050e50054590260264d60050f5", + "0x4d60051a71a300735f0261a70054d60051a70053180261a70054d6005026", + "0xd530261aa0054d60051ae1a80073650261a80054d600502607e0261ae005", + "0x4d600501600530f0260dd0054d60050dd00508a0261af0054d60051aa005", + "0xa0051af0054d60051af0055040260f90054d60050f900501b026016005", + "0x54f30260264d600500a0054590260264d60050260070261af0f90160dd", + "0x4590260264d60050f50054f30260264d60050c00054f30260264d600508a", + "0x261b00054d60050263530260264d6005036005dc10260264d60050f7005", + "0x53e21b000735f0263e20054d60053e20053180263e20054d6005026408", + "0x261b30054d60053e33df0073650263df0054d600502607e0263e30054d6", + "0x501600530f0260ee0054d60050ee00508a0261b50054d60051b3005d53", + "0x51b50054d60051b50055040260f90054d60050f900501b0260160054d6", + "0x4f30260264d600500a0054590260264d60050260070261b50f90160ee00a", + "0x260264d60050d10054f30260264d60050c00054f30260264d600508a005", + "0x264d600535f0054590260264d60050d20054590260264d6005036005dc1", + "0x4d60053dd0053180263dd0054d60050264080263de0054d6005026353026", + "0x3650263e00054d600502607e0263e10054d60053dd3de00735f0263dd005", + "0x53a400508a0263db0054d60053dc005d530263dc0054d60053e13e0007", + "0x260380054d600503800501b0260160054d600501600530f0263a40054d6", + "0x260264d60050260070263db0380163a400a0053db0054d60053db005504", + "0x264d60050c00054f30260264d600508a0054f30260264d600500a005459", + "0x4d600507e0054f30260264d6005036005dc10260264d600535f005459026", + "0x51bb0053180261bb0054d60050264080263d90054d6005026353026026", + "0x263d80054d600502607e0261bd0054d60051bb3d900735f0261bb0054d6", + "0xd300508a0263d60054d60051c0005d530261c00054d60051bd3d8007365", + "0x380054d600503800501b0260160054d600501600530f0260d30054d6005", + "0x264d60050260070263d60380160d300a0053d60054d60053d6005504026", + "0x4d60050c00054f30260264d600508a0054f30260264d600500a005459026", + "0x4d60050263530260264d6005036005dc10260264d60050bc0054f3026026", + "0x735f0263d20054d60053d20053180263d20054d60050264080263d5005", + "0x4d60055c91c40073650261c40054d600502607e0265c90054d60053d23d5", + "0x30f0263580054d600535800508a0263ce0054d60053cf005d530263cf005", + "0x4d60053ce0055040260380054d600503800501b0260160054d6005016005", + "0x4d600500a0054590260264d60050260070263ce03801635800a0053ce005", + "0x530f0054f30260264d60050c00054f30260264d600508a0054f3026026", + "0x30f02601b0054d600501b00508a0263cd0054d6005039005d530260264d6", + "0x4d60053cd0055040260380054d600503800501b0260160054d6005016005", + "0x4d600500a0054590260264d60050260070263cd03801601b00a0053cd005", + "0x530f0054f30260264d60050c00054f30260264d600508a0054f3026026", + "0x3ca0053180263ca0054d60050264080263cb0054d60050263530260264d6", + "0x3c80054d600502607e0263c90054d60053ca3cb00735f0263ca0054d6005", + "0x508a0262560054d60053c7005d530263c70054d60053c93c8007365026", + "0x54d600500700501b0260160054d600501600530f02602c0054d600502c", + "0x4d600502600702625600701602c00a0052560054d6005256005504026007", + "0x500a0054590260264d60050c00054f30260264d60050890054f3026026", + "0x50261060262550054d60050263530260264d600508a0054f30260264d6", + "0x1d00054d60051ce25500735f0261ce0054d60051ce0053180261ce0054d6", + "0x3c4005d530263c40054d60051d03c50073650263c50054d600502607e026", + "0x40d0054d600540d00530f0264d40054d60054d400508a0263c30054d6005", + "0x40d4d400a0053c30054d60053c30055040260070054d600500700501b026", + "0x566202600a0054d6005026de90260c00054d6005007005c0e0263c3007", + "0x4d600502600702608a005dea0264d600700a00582102600a0054d600500a", + "0x4d6005026b000260890054d60050263530260264d60050c000545b026026", + "0x260160054d600508808900735f0260880054d6005088005318026088005", + "0x540d005cb502640d0054d60050164d40073650264d40054d600502607e", + "0x260050054d600500500501b0260260054d600502600508a0264d30054d6", + "0x35b0260264d60050260070264d30050260c00054d30054d60054d3005cb6", + "0x2601c4d04d10c04d600508a4d20260c08250264d20c00074d60050c0005", + "0x74d60050c000535b0261c50054d6005026deb0260264d600501c00545b", + "0x30f3090c04d60051c508b007c190261c50054d60051c500566202608b0c0", + "0x8a0263180054d60053090057c10263140054d60053124d10079b9026312", + "0x5026007026319005dec0264d60073180050810263140054d6005314005", + "0x502b00545b02633102c02b31b00a4d600530f4d00050c097f0260264d6", + "0x320056620260320054d6005026ded0260264d600502c00545b0260264d6", + "0x3310054d600533100566202631b0054d600531b00501b0260320054d6005", + "0xc000545b0260264d600502600702601b005dee0264d6007032005821026", + "0x26b000260380054d60050263530260264d600533100545b0260264d6005", + "0x54d600503503800735f0260350054d60050350053180260350054d6005", + "0x5cb50260bc0054d60050360390073650260390054d600502607e026036", + "0x54d600531b00501b0263140054d600531400508a0260bb0054d60050bc", + "0x264d60050260070260bb31b3140c00050bb0054d60050bb005cb602631b", + "0x34b0c30c04d600501b0ba3140c08250260ba0c00074d60050c000535b026", + "0x50c000535b0263530054d6005026def0260264d600534e00545b02634e", + "0xc04d6005353358007c190263530054d60053530056620263580c00074d6", + "0x3680054d600535f0057c10261710054d60053650c30079b902636507e35f", + "0x702636a005df00264d60073680050810261710054d600517100508a026", + "0x545b0260d20d30d40d500a4d600507e34b31b0c097f0260264d6005026", + "0x6620260d10054d6005026df10260264d60050d300545b0260264d60050d4", + "0x4d60050d20056620260d50054d60050d500501b0260d10054d60050d1005", + "0x45b0260264d60050260070260d0005df20264d60070d10058210260d2005", + "0x260264d60050c000545b0260264d60050d200545b0260264d6005331005", + "0x54d60050ce0053180260ce0054d6005026b000260cf0054d6005026353", + "0x73650260cc0054d600502607e0260cd0054d60050ce0cf00735f0260ce", + "0x4d600517100508a0263a40054d6005394005cb50263940054d60050cd0cc", + "0xc00053a40054d60053a4005cb60260d50054d60050d500501b026171005", + "0xc43a70c04d60050d00c01710c08250260264d60050260070263a40d5171", + "0x10600e0ca00a4d60050d23310d50c097f0260264d60053ae00545b0263ae", + "0x51060056620260264d600510500545b0260264d600500e00545b026105", + "0x10300545b02610110210310400a4d60050c41060ca0c097f0261060054d6", + "0x5c0e0261000054d6005026b8c0260264d600510100545b0260264d6005", + "0x54d60050ff0056620261020054d60051020056620260ff0054d6005100", + "0x4d60050fc00545b0260fb0fc0fd0fe00a4d60050ff1021040c097f0260ff", + "0xfe00501b0260fd0054d60050fd0056620260264d60050fb00545b026026", + "0x260070260f8005df30f90fa0074d60070fd3a7007b490260fe0054d6005", + "0x260f60054d60050f7005cbd0260f70054d60050f9005cbc0260264d6005", + "0x50f6005cb60260fe0054d60050fe00501b0260fa0054d60050fa00508a", + "0x54d60050263530260264d60050260070260f60fe0fa0c00050f60054d6", + "0xf500735f0260f40054d60050f40053180260f40054d60050265870260f5", + "0x54d60050f30f20073650260f20054d600502607e0260f30054d60050f4", + "0x501b0260f80054d60050f800508a0260f00054d60050f1005cb50260f1", + "0x70260f00fe0f80c00050f00054d60050f0005cb60260fe0054d60050fe", + "0x45b0260264d60050c000545b0260264d600536a0054ca0260264d6005026", + "0x260264d600534b00545b0260264d600507e00545b0260264d6005331005", + "0x54d60050ee0053180260ee0054d6005026df40260ef0054d6005026353", + "0x73650264360054d600502607e0260ed0054d60050ee0ef00735f0260ee", + "0x4d600517100508a02643f0054d6005439005cb50264390054d60050ed436", + "0xc000543f0054d600543f005cb602631b0054d600531b00501b026171005", + "0xc000545b0260264d60053190054ca0260264d600502600702643f31b171", + "0x263530260264d60054d000545b0260264d600530f00545b0260264d6005", + "0x261700054d60051700053180261700054d6005026df40264480054d6005", + "0x4970ec0073650260ec0054d600502607e0264970054d600517044800735f", + "0x3140054d600531400508a0260ea0054d60050eb005cb50260eb0054d6005", + "0x53140c00050ea0054d60050ea005cb60260050054d600500500501b026", + "0xa00566202600a0054d6005026df50260c00054d6005007005c0e0260ea", + "0x264d600502600702608a005df60264d600700a00582102600a0054d6005", + "0x54d6005026b000260890054d60050263530260264d60050c000545b026", + "0x7e0260160054d600508808900735f0260880054d6005088005318026088", + "0x4d600540d005cb502640d0054d60050164d40073650264d40054d6005026", + "0xcb60260050054d600500500501b0260260054d600502600508a0264d3005", + "0x535b0260264d60050260070264d30050260c00054d30054d60054d3005", + "0x45b02601c4d04d10c04d600508a4d20260c08250264d20c00074d60050c0", + "0xc00074d60050c000535b0261c50054d6005026df70260264d600501c005", + "0x31230f3090c04d60051c508b007c190261c50054d60051c500566202608b", + "0x508a0263180054d60053090057c10263140054d60053124d10079b9026", + "0x4d6005026007026319005df80264d60073180050810263140054d6005314", + "0x4d600502b00545b02633102c02b31b00a4d600530f4d00050c097f026026", + "0x50320056620260320054d6005026df90260264d600502c00545b026026", + "0x263310054d600533100566202631b0054d600531b00501b0260320054d6", + "0x50c000545b0260264d600502600702601b005dfa0264d6007032005821", + "0x5026b000260380054d60050263530260264d600533100545b0260264d6", + "0x360054d600503503800735f0260350054d60050350053180260350054d6", + "0xbc005cb50260bc0054d60050360390073650260390054d600502607e026", + "0x31b0054d600531b00501b0263140054d600531400508a0260bb0054d6005", + "0x260264d60050260070260bb31b3140c00050bb0054d60050bb005cb6026", + "0x34e34b0c30c04d600501b0ba3140c08250260ba0c00074d60050c000535b", + "0x4d60050c000535b0263530054d60050264fd0260264d600534e00545b026", + "0x35f0c04d6005353358007c190263530054d60053530056620263580c0007", + "0x263680054d600535f0057c10261710054d60053650c30079b902636507e", + "0x2600702636a005dfb0264d60073680050810261710054d600517100508a", + "0xd400545b0260d20d30d40d500a4d600507e34b31b0c097f0260264d6005", + "0x56620260d10054d6005026dfc0260264d60050d300545b0260264d6005", + "0x54d60050d20056620260d50054d60050d500501b0260d10054d60050d1", + "0x545b0260264d60050260070260d0005dfd0264d60070d10058210260d2", + "0x3530260264d60050c000545b0260264d60050d200545b0260264d6005331", + "0xce0054d60050ce0053180260ce0054d6005026b000260cf0054d6005026", + "0xcc0073650260cc0054d600502607e0260cd0054d60050ce0cf00735f026", + "0x54d600517100508a0263a40054d6005394005cb50263940054d60050cd", + "0x1710c00053a40054d60053a4005cb60260d50054d60050d500501b026171", + "0x3ae0c43a70c04d60050d00c01710c08250260264d60050260070263a40d5", + "0x10510600e0ca00a4d60050d23310d50c097f0260264d60053ae00545b026", + "0x4d60051060056620260264d600510500545b0260264d600500e00545b026", + "0x510300545b02610110210310400a4d60050c41060ca0c097f026106005", + "0x100005c0e0261000054d6005026b8c0260264d600510100545b0260264d6", + "0xff0054d60050ff0056620261020054d60051020056620260ff0054d6005", + "0x264d60050fc00545b0260fb0fc0fd0fe00a4d60050ff1021040c097f026", + "0x50fe00501b0260fd0054d60050fd0056620260264d60050fb00545b026", + "0x50260070260f8005dfe0f90fa0074d60070fd3a7007b490260fe0054d6", + "0x8a0260f60054d60050f7005cbd0260f70054d60050f9005cbc0260264d6", + "0x4d60050f6005cb60260fe0054d60050fe00501b0260fa0054d60050fa005", + "0xf50054d60050263530260264d60050260070260f60fe0fa0c00050f6005", + "0xf40f500735f0260f40054d60050f40053180260f40054d6005026587026", + "0xf10054d60050f30f20073650260f20054d600502607e0260f30054d6005", + "0xfe00501b0260f80054d60050f800508a0260f00054d60050f1005cb5026", + "0x260070260f00fe0f80c00050f00054d60050f0005cb60260fe0054d6005", + "0x545b0260264d60050c000545b0260264d600536a0054ca0260264d6005", + "0x3530260264d600534b00545b0260264d600507e00545b0260264d6005331", + "0xee0054d60050ee0053180260ee0054d6005026df40260ef0054d6005026", + "0x4360073650264360054d600502607e0260ed0054d60050ee0ef00735f026", + "0x54d600517100508a02643f0054d6005439005cb50264390054d60050ed", + "0x1710c000543f0054d600543f005cb602631b0054d600531b00501b026171", + "0x50c000545b0260264d60053190054ca0260264d600502600702643f31b", + "0x50263530260264d60054d000545b0260264d600530f00545b0260264d6", + "0x35f0261700054d60051700053180261700054d6005026df40264480054d6", + "0x54970ec0073650260ec0054d600502607e0264970054d6005170448007", + "0x263140054d600531400508a0260ea0054d60050eb005cb50260eb0054d6", + "0xea0053140c00050ea0054d60050ea005cb60260050054d600500500501b", + "0x500a00566202600a0054d6005026dff0260c00054d6005007005c0e026", + "0x260264d600502600702608a005e000264d600700a00582102600a0054d6", + "0x880054d6005026b000260890054d60050263530260264d60050c000545b", + "0x2607e0260160054d600508808900735f0260880054d6005088005318026", + "0x54d600540d005cb502640d0054d60050164d40073650264d40054d6005", + "0x5cb60260050054d600500500501b0260260054d600502600508a0264d3", + "0xc000535b0260264d60050260070264d30050260c00054d30054d60054d3", + "0x545b02601c4d04d10c04d600508a4d20260c08250264d20c00074d6005", + "0x8b0c00074d60050c000535b0261c50054d6005026e010260264d600501c", + "0x2631230f3090c04d60051c508b007c190261c50054d60051c5005662026", + "0x31400508a0263180054d60053090057c10263140054d60053124d10079b9", + "0x264d6005026007026319005e020264d60073180050810263140054d6005", + "0x264d600502b00545b02633102c02b31b00a4d600530f4d00050c097f026", + "0x4d60050320056620260320054d6005026e030260264d600502c00545b026", + "0x8210263310054d600533100566202631b0054d600531b00501b026032005", + "0x4d600533100545b0260264d600502600702601b005e040264d6007032005", + "0x4d6005026b000260380054d60050263530260264d60050c000545b026026", + "0x260360054d600503503800735f0260350054d6005035005318026035005", + "0x50bc005cb50260bc0054d60050360390073650260390054d600502607e", + "0x2631b0054d600531b00501b0263140054d600531400508a0260bb0054d6", + "0x35b0260264d60050260070260bb31b3140c00050bb0054d60050bb005cb6", + "0x2634e34b0c30c04d600501b0ba3140c08250260ba0c00074d60050c0005", + "0x74d60050c000535b0263530054d6005026e050260264d600534e00545b", + "0x7e35f0c04d6005353358007c190263530054d60053530056620263580c0", + "0x8a0263680054d600535f0057c10261710054d60053650c30079b9026365", + "0x502600702636a005e060264d60073680050810261710054d6005171005", + "0x50d400545b0260d20d30d40d500a4d600507e34b31b0c097f0260264d6", + "0xd10056620260d10054d6005026deb0260264d60050d300545b0260264d6", + "0xd20054d60050d20056620260d50054d60050d500501b0260d10054d6005", + "0xc000545b0260264d60050260070260d0005e070264d60070d1005821026", + "0x263530260264d60050d200545b0260264d600533100545b0260264d6005", + "0x260ce0054d60050ce0053180260ce0054d6005026b000260cf0054d6005", + "0xcd0cc0073650260cc0054d600502607e0260cd0054d60050ce0cf00735f", + "0x1710054d600517100508a0263a40054d6005394005cb50263940054d6005", + "0xd51710c00053a40054d60053a4005cb60260d50054d60050d500501b026", + "0x1710c08250263a70c00074d60050c000535b0260264d60050260070263a4", + "0x4d6005026de90260264d60050ca00545b0260ca3ae0c40c04d60050d03a7", + "0x1051060c04d600500e0c0007c1902600e0054d600500e00566202600e005", + "0x8a0261020054d60051060057c10261030054d60051040c40079b9026104", + "0x5026007026101005e080264d60071020050810261030054d6005103005", + "0x50ff00545b0260fd0fe0ff10000a4d60051053ae0d50c097f0260264d6", + "0xfb0fc00a4d60050d23311000c097f0260264d60050fe00545b0260264d6", + "0xfa0056620260264d60050f900545b0260264d60050fb00545b0260f90fa", + "0x4d60050fd0fa0fc0c097f0260fd0054d60050fd0056620260fa0054d6005", + "0x260264d60050f500545b0260264d60050f700545b0260f50f60f70f800a", + "0x4d60050f60056620260f30054d60050f4005c0e0260f40054d6005026b8c", + "0xf200a4d60050f30f60f80c097f0260f30054d60050f30056620260f6005", + "0x56620260264d60050ef00545b0260264d60050f000545b0260ef0f00f1", + "0x4d60070f1103007b490260f20054d60050f200501b0260f10054d60050f1", + "0x4390054d60050ed005cbc0260264d6005026007026436005e090ed0ee007", + "0xf200501b0260ee0054d60050ee00508a02643f0054d6005439005cbd026", + "0x2600702643f0f20ee0c000543f0054d600543f005cb60260f20054d6005", + "0x53180261700054d60050265870264480054d60050263530260264d6005", + "0x54d600502607e0264970054d600517044800735f0261700054d6005170", + "0x8a0260ea0054d60050eb005cb50260eb0054d60054970ec0073650260ec", + "0x4d60050ea005cb60260f20054d60050f200501b0264360054d6005436005", + "0x264d60051010054ca0260264d60050260070260ea0f24360c00050ea005", + "0x4d600510500545b0260264d60050d200545b0260264d600533100545b026", + "0x4d6005026df40260e90054d60050263530260264d60053ae00545b026026", + "0x260e70054d60050e80e900735f0260e80054d60050e80053180260e8005", + "0x50e5005cb50260e50054d60050e70e60073650260e60054d600502607e", + "0x260d50054d60050d500501b0261030054d600510300508a0260e40054d6", + "0x4ca0260264d60050260070260e40d51030c00050e40054d60050e4005cb6", + "0x260264d60050c000545b0260264d600533100545b0260264d600536a005", + "0xe30054d60050263530260264d600534b00545b0260264d600507e00545b", + "0xe20e300735f0260e20054d60050e20053180260e20054d6005026df4026", + "0xdf0054d60050e10e00073650260e00054d600502607e0260e10054d6005", + "0x31b00501b0261710054d600517100508a0260de0054d60050df005cb5026", + "0x260070260de31b1710c00050de0054d60050de005cb602631b0054d6005", + "0x545b0260264d60050c000545b0260264d60053190054ca0260264d6005", + "0xdf40260dd0054d60050263530260264d60054d000545b0260264d600530f", + "0x4d60050dc0dd00735f0260dc0054d60050dc0053180260dc0054d6005026", + "0xcb50260d90054d60050db0da0073650260da0054d600502607e0260db005", + "0x4d600500500501b0263140054d600531400508a02608d0054d60050d9005", + "0x5007005c0e02608d0053140c000508d0054d600508d005cb6026005005", + "0x82102600a0054d600500a00566202600a0054d6005026e0a0260c00054d6", + "0x4d60050c000545b0260264d600502600702608a005e0b0264d600700a005", + "0x50880053180260880054d6005026b000260890054d6005026353026026", + "0x264d40054d600502607e0260160054d600508808900735f0260880054d6", + "0x2600508a0264d30054d600540d005cb502640d0054d60050164d4007365", + "0x4d30054d60054d3005cb60260050054d600500500501b0260260054d6005", + "0x4d20c00074d60050c000535b0260264d60050260070264d30050260c0005", + "0x260264d600501c00545b02601c4d04d10c04d600508a4d20260c0825026", + "0x51c500566202608b0c00074d60050c000535b0261c50054d6005026e0c", + "0x53124d10079b902631230f3090c04d60051c508b007c190261c50054d6", + "0x263140054d600531400508a0263180054d60053090057c10263140054d6", + "0x4d00050c097f0260264d6005026007026319005e0d0264d6007318005081", + "0x502c00545b0260264d600502b00545b02633102c02b31b00a4d600530f", + "0x501b0260320054d60050320056620260320054d60050264fd0260264d6", + "0x264d60070320058210263310054d600533100566202631b0054d600531b", + "0xc000545b0260264d600533100545b0260264d600502600702601b005e0e", + "0x53180260350054d6005026b000260380054d60050263530260264d6005", + "0x54d600502607e0260360054d600503503800735f0260350054d6005035", + "0x8a0260bb0054d60050bc005cb50260bc0054d6005036039007365026039", + "0x4d60050bb005cb602631b0054d600531b00501b0263140054d6005314005", + "0x74d60050c000535b0260264d60050260070260bb31b3140c00050bb005", + "0x4d600534e00545b02634e34b0c30c04d600501b0ba3140c08250260ba0c0", + "0x56620263580c00074d60050c000535b0263530054d6005026df9026026", + "0xc30079b902636507e35f0c04d6005353358007c190263530054d6005353", + "0x54d600517100508a0263680054d600535f0057c10261710054d6005365", + "0xc097f0260264d600502600702636a005e0f0264d6007368005081026171", + "0x545b0260264d60050d400545b0260d20d30d40d500a4d600507e34b31b", + "0x260d10054d60050d10056620260d10054d6005026e100260264d60050d3", + "0x70d10058210260d20054d60050d20056620260d50054d60050d500501b", + "0x45b0260264d60050c000545b0260264d60050260070260d0005e110264d6", + "0x260cf0054d60050263530260264d60050d200545b0260264d6005331005", + "0x50ce0cf00735f0260ce0054d60050ce0053180260ce0054d6005026b00", + "0x263940054d60050cd0cc0073650260cc0054d600502607e0260cd0054d6", + "0x50d500501b0261710054d600517100508a0263a40054d6005394005cb5", + "0x50260070263a40d51710c00053a40054d60053a4005cb60260d50054d6", + "0xc04d60050d03a71710c08250263a70c00074d60050c000535b0260264d6", + "0x566202600e0054d6005026dfc0260264d60050ca00545b0260ca3ae0c4", + "0xc40079b90261041051060c04d600500e0c0007c1902600e0054d600500e", + "0x54d600510300508a0261020054d60051060057c10261030054d6005104", + "0xc097f0260264d6005026007026101005e120264d6007102005081026103", + "0x545b0260264d60050ff00545b0260fd0fe0ff10000a4d60051053ae0d5", + "0x545b0260f90fa0fb0fc00a4d60050d23311000c097f0260264d60050fe", + "0x260fa0054d60050fa0056620260264d60050f900545b0260264d60050fb", + "0xf50f60f70f800a4d60050fd0fa0fc0c097f0260fd0054d60050fd005662", + "0x54d6005026b8c0260264d60050f500545b0260264d60050f700545b026", + "0x56620260f60054d60050f60056620260f30054d60050f4005c0e0260f4", + "0x45b0260ef0f00f10f200a4d60050f30f60f80c097f0260f30054d60050f3", + "0xf10054d60050f10056620260264d60050ef00545b0260264d60050f0005", + "0x5e130ed0ee0074d60070f1103007b490260f20054d60050f200501b026", + "0x5439005cbd0264390054d60050ed005cbc0260264d6005026007026436", + "0x260f20054d60050f200501b0260ee0054d60050ee00508a02643f0054d6", + "0x3530260264d600502600702643f0f20ee0c000543f0054d600543f005cb6", + "0x1700054d60051700053180261700054d60050265870264480054d6005026", + "0xec0073650260ec0054d600502607e0264970054d600517044800735f026", + "0x54d600543600508a0260ea0054d60050eb005cb50260eb0054d6005497", + "0x4360c00050ea0054d60050ea005cb60260f20054d60050f200501b026436", + "0x533100545b0260264d60051010054ca0260264d60050260070260ea0f2", + "0x3ae00545b0260264d600510500545b0260264d60050d200545b0260264d6", + "0x53180260e80054d6005026df40260e90054d60050263530260264d6005", + "0x54d600502607e0260e70054d60050e80e900735f0260e80054d60050e8", + "0x8a0260e40054d60050e5005cb50260e50054d60050e70e60073650260e6", + "0x4d60050e4005cb60260d50054d60050d500501b0261030054d6005103005", + "0x264d600536a0054ca0260264d60050260070260e40d51030c00050e4005", + "0x4d600507e00545b0260264d60050c000545b0260264d600533100545b026", + "0x4d6005026df40260e30054d60050263530260264d600534b00545b026026", + "0x260e10054d60050e20e300735f0260e20054d60050e20053180260e2005", + "0x50df005cb50260df0054d60050e10e00073650260e00054d600502607e", + "0x2631b0054d600531b00501b0261710054d600517100508a0260de0054d6", + "0x4ca0260264d60050260070260de31b1710c00050de0054d60050de005cb6", + "0x260264d600530f00545b0260264d60050c000545b0260264d6005319005", + "0xdc0054d6005026df40260dd0054d60050263530260264d60054d000545b", + "0x2607e0260db0054d60050dc0dd00735f0260dc0054d60050dc005318026", + "0x54d60050d9005cb50260d90054d60050db0da0073650260da0054d6005", + "0x5cb60260050054d600500500501b0263140054d600531400508a02608d", + "0x11d2d62f72a22a02a40262a60160d808d0053140c000508d0054d600508d", + "0x2600a02608808908a00a0c00070050262fa2d62f72a22a02a40262a6016", + "0x2f72a22a02a40262a601648d0c00070050262fa2d62f702600a11d2d62f7", + "0x3e508808908a00a0c00070050262fa2d62f72a22a02a40262a601611d2d6", + "0x50262fa2d62f72a22a02a40262a601611d2d62f72a22a02a40262a6016", + "0x2a40262a601611d2d62f72a22a02a40262a60162a008808908a00a0c0007", + "0xa11d2d62f702600a7fb08808908a00a0c00070050262fa2d62f72a22a0", + "0x262fa2d62f702600a11d2d62f702600a93c0c00070050262fa2d62f7026", + "0x2f72a22a02a40262a601611d2d62f72a22a02a40262a60169f30c0007005", + "0x2d62f702600a11d2d62f702600aaf008808908a00a0c00070050262fa2d6", + "0x50262fa2d62f70262a608a11d2d62f70262a608ac520c00070050262fa", + "0xc00070050262fa2d62f70262a608a11d2d62f70262a608ae1400a0c0007", + "0x2fa2d62f72a22a02a40262a601611d2d62f72a22a02a40262a6016e1500a", + "0x2d62f72a202608a11d2d62f72a202608ae1608808908a00a0c0007005026", + "0x262fa2d62f70262a608a11d2d62f70262a608ae1700a0c00070050262fa", + "0xe190c00070050262fa2d62f702600a11d2d62f702600ae1800a0c0007005", + "0x8a00a0c00070050262fa2d62f72a20262a608911d2d62f72a20262a6089", + "0x2a00264d4e1b00a0c00070050262f92f70260c001413311d2f702608ae1a", + "0xc00070050263022d62a22a62a42f72a00260161332c22d62a22a62a42f7", + "0x700502630b2d62f702600a1332c22d62f702608ae1c01608808908a00a", + "0x2f702608ae1e0c00070050263102f70260c00361af2f702600ae1d00a0c0", + "0x2a22a62a42f72a002640de1f00a0c00070050263132f70260c001403611d", + "0x8908a00a0c00070050263152d62a22a62a42f72a00260160360142c22d6", + "0x2a62a42f72a00260160142c22d62a22a62a42f72a00264d4e204d4016088", + "0x2f70260c011d2f70260c0e2101608808908a00a0c00070050263022d62a2", + "0x2a42f72a00260161ae2c22d62a22a62a42f72a00264d4e2200700502631a", + "0x2a62a42f72a00264d3e2301608808908a00a0c000700502631c2d62a22a6", + "0xa0c00070050263152d62a22a62a42f72a00260160140140142c22d62a2", + "0x502632f2d62f702600a23a2ae2d62f702608ae2440d4d401608808908a", + "0x70050263322d62a62f702608a01420a2d62a62f7026089e2500a0c0007", + "0x70050263332d62a62f702608a01420a2d62a62f7026089e2608a00a0c0", + "0x711d026007e280070050263342f70260c011d2f70260c0e2708a00a0c0", + "0x70050263152d62a22f702608a29b2d62a22f702608ae29005026335026", + "0x2a42f72a002601611d01429b2922d62a22a62a42f72a00264d3e2a00a0c0", + "0x11d2f70260c0e2b40d4d401608808908a00a0c000700502633a2d62a22a6", + "0xe2d0070050263442f70260c011d2f70260c0e2c0070050263432f70260c0", + "0xc000700502631c2d62a22a62f702608928624a2c22d62a22a62f7026016", + "0x2a62a42f72a00264d3e2f00502634602600711d026007e2e08808908a00a", + "0xa0c000700502634a2d62a22a62a42f72a00260160141bb11d20a2d62a2", + "0x9411d0141bb2c22d62a22a62a42f72a00264d1e3040d4d401608808908a", + "0x4d401608808908a00a0c000700502631c2d62a22a62a42f72a00260161e4", + "0xa0c000700502634f2d62f702600a1a81bb2d62f702608ae314d24d340d", + "0x26b11d2f702608ae330c00070050263102f70260c003611d2f702600ae32", + "0x2c22d62a22a62a42f72a002640de3400a0c00070050263592f70260c0014", + "0x1608808908a00a0c00070050263332d62a22a62a42f72a00260161ae014", + "0x2a22a62a42f72a002601626b0142c22d62a22a62a42f72a002640de354d4", + "0xe3702636611d00711d005e364d401608808908a00a0c00070050263632d6", + "0x70050263692f70260c011d2f70260c0e3800502636702600711d026007", + "0x2a22a62a42f72a00264d4e3a00700502636b2f70260c011d2f70260c0e39", + "0x8808908a00a0c00070050263632d62a22a62a42f72a00260161ae2c22d6", + "0x2f7026089e3c0c00070050263152a22f702600a24a2a22f702600ae3b016", + "0x2f702608ae3d08a00a0c000700502631c2d62a62f702608a1db2c22d62a6", + "0x2600a1db2a22f702600ae3e00a0c00070050263722f70260c0036036371", + "0xc000700502637602600701b01424202600ae3f0c00070050263152a22f7", + "0x9400537f37f007e410c00070050263102f70260c003637a2f702600ae40", + "0x2600ae430c00070050263152a22f702600a29b2a22f702600ae42005026", + "0x11d1253002a22f7026089e440c00070050263152a22f702600a3932a22f7", + "0x2f70260c01e41bb2f702600ae4508a00a0c00070050263952a22f702600a", + "0x264d3e470070050263a82f70260c011d2f70260c0e460c00070050263a5", + "0x263a92d62a22a62a42f72a00260160141bb1b020a2d62a22a62a42f72a0", + "0x260c00140140140142a0026089e4840d4d401608808908a00a0c0007005", + "0x2f702608a17519d0812d62a42f7026088e4908a00a0c00070050263332a0", + "0x140ab01b01b01b2a42f70264d4e4a08908a00a0c00070050263af2d62a4", + "0x2a42f702600ae4b01608808908a00a0c00070050263b02a42f702600a0ab", + "0x2f702600a19d0812d62f702608ae4c0c00070050263b12a42f702600a1a3", + "0x2608ae4e0050263b911d0260c011d026007e4d00a0c00070050263b22d6", + "0x1da2d62a62f7026089e4f00a0c00070050263ba2f70260c001409c11d2f7", + "0x1ce0ab2a22f702608ae5008a00a0c00070050263bf2d62a62f702608a2c2", + "0x2f70260c00360362532f702608ae5100a0c00070050263c52a22f702600a", + "0x2a22f702608ae530050263cf02600701b026007e5200a0c0007005026372", + "0x3dd11d0260c011d026007e5400a0c00070050263d82a22f702600a0361bb", + "0x8ae5600a0c00070050263de2f70260c00141a811d2f702608ae55005026", + "0x2a002640de5700a0c00070050263152d62a22f702608a1ad2d62a22f7026", + "0x70050263332d62a22a62a42f72a002601611d0142c22d62a22a62a42f7", + "0x2a22f702600a0141af1bb01b2a22f7026088e584d401608808908a00a0c0", + "0x3fd2d62f702600a19d0812d62f702608ae5908908a00a0c00070050263e8", + "0x50263fe2d62a42f702608a17a2d62a42f702608ae5a00a0c0007005026", + "0x264032a42f702600a0ab0142a42f702608ae5c09c005026e5b00a0c0007", + "0x70050264042f70260c009c01b0ab01b01b2f7026088e5d00a0c0007005", + "0xe5f0c00070050264052a42f702600a0ab2a42f702600ae5e08908a00a0c0", + "0xa09c2a42f702600ae600c000700502640f2f70260c009c0ab2f702600a", + "0x50264102f70260c009c09c2f702600ae610c00070050264032a42f7026", + "0xc00070050264122a42f702600a01b0aa08101b2a42f7026088e620c0007", + "0x2f702600ae640c000700502608102600719f08108102600ae6308908a00a", + "0x2a22f702600a1322a22f702600ae650c00070050263102f70260c00361a2", + "0x263152d62a22f702608a1ad1252d62a22f7026089e660c0007005026315", + "0x50264402a22f702600a11e01411d2a22f7026089e6708a00a0c0007005", + "0xc00070050264492a42f702600a01e10e2a42f702608ae6808a00a0c0007", + "0x26089e6a00a0c000700502644b2f70260c001b08401e2f702608ae6900a", + "0x2f70260c0e6b08a00a0c00070050264982a42f702600a0ab09c0812a42f7", + "0x502640f2f70260c009c0ab2f702600ae6c0070050264992f70260c009c", + "0xae6e00a0c000700502649d2f70260c00ab09c01b2f702608ae6d0c0007", + "0x2f70260c009c2f70260c0e6f0c00070050264a12f70260c001b01b2f7026", + "0x26e710c00070050264bc2f70260c00320ab2f702600ae70007005026499", + "0xc00070050264c52a42f702600a09b09b01b09b2a42f7026088e72032005", + "0xa0c00070050264c62a42f702600a09c09b2a42f702608ae7308908a00a", + "0x70810810260c0e750c00070050263b12f70260c00810812f702600ae74", + "0xe770c00070050263102f70260c00360ab2f702600ae760070050264ca026", + "0xc001b01e2f702600ae780c000700502644b2a40260c008101e2a402600a", + "0x260bc2f70260c001b09b03201b2f7026089e790c000700502644b2f7026", + "0x70050260bc2a42f702600a03201b2a42f702608ae7a08a00a0c0007005", + "0xc00070050264c52a42f702600a09b09b01b09b2a42f7026088e7b00a0c0", + "0x1b2a40260c0e7d0070050264a12a40260c001b2a40260c0e7c08908a00a", + "0xe7f0070050264a12a40260c001b2a40260c0e7e0070050264a12a40260c0", + "0xe800070050264a12a40260c001b2a40260c0" + ], + "sierra_program_debug_info": { + "type_names": [ + [ + 0, + "RangeCheck" + ], + [ + 1, + "Const" + ], + [ + 2, + "Const" + ], + [ + 3, + "Const" + ], + [ + 4, + "Const" + ], + [ + 5, + "Const" + ], + [ + 6, + "Const" + ], + [ + 7, + "Const" + ], + [ + 8, + "Const" + ], + [ + 9, + "Const" + ], + [ + 10, + "Const" + ], + [ + 11, + "Const" + ], + [ + 12, + "Const" + ], + [ + 13, + "Const" + ], + [ + 14, + "Const" + ], + [ + 15, + "Const" + ], + [ + 16, + "Const" + ], + [ + 17, + "Const" + ], + [ + 18, + "Const" + ], + [ + 19, + "Const" + ], + [ + 20, + "Const" + ], + [ + 21, + "Const" + ], + [ + 22, + "Const" + ], + [ + 23, + "Const" + ], + [ + 24, + "Const" + ], + [ + 25, + "Box" + ], + [ + 26, + "Unit" + ], + [ + 27, + "core::option::Option::>" + ], + [ + 28, + "Array" + ], + [ + 29, + "u32" + ], + [ + 30, + "Tuple, u32, Unit>" + ], + [ + 31, + "core::panics::Panic" + ], + [ + 32, + "Array" + ], + [ + 33, + "Tuple>" + ], + [ + 34, + "core::panics::PanicResult::<(core::array::Array::, core::integer::u32, ())>" + ], + [ + 35, + "Const" + ], + [ + 36, + "Const" + ], + [ + 37, + "Const" + ], + [ + 38, + "Const" + ], + [ + 39, + "Const" + ], + [ + 40, + "Const" + ], + [ + 41, + "Const" + ], + [ + 42, + "Const" + ], + [ + 43, + "Const" + ], + [ + 44, + "Const" + ], + [ + 45, + "Const" + ], + [ + 46, + "Const" + ], + [ + 47, + "Const" + ], + [ + 48, + "Const" + ], + [ + 49, + "Const" + ], + [ + 50, + "Const" + ], + [ + 51, + "Const" + ], + [ + 52, + "Const" + ], + [ + 53, + "Const" + ], + [ + 54, + "Const" + ], + [ + 55, + "Const" + ], + [ + 56, + "Const" + ], + [ + 57, + "Const" + ], + [ + 58, + "Const" + ], + [ + 59, + "Const" + ], + [ + 60, + "Const" + ], + [ + 61, + "Const" + ], + [ + 62, + "Const" + ], + [ + 63, + "Const" + ], + [ + 64, + "Const" + ], + [ + 65, + "Const" + ], + [ + 66, + "Const" + ], + [ + 67, + "Const" + ], + [ + 68, + "Const" + ], + [ + 69, + "Const" + ], + [ + 70, + "Const" + ], + [ + 71, + "Const" + ], + [ + 72, + "Const" + ], + [ + 73, + "Const" + ], + [ + 74, + "Const" + ], + [ + 75, + "Const" + ], + [ + 76, + "Const" + ], + [ + 77, + "Const" + ], + [ + 78, + "Const" + ], + [ + 79, + "Const" + ], + [ + 80, + "Const" + ], + [ + 81, + "Const" + ], + [ + 82, + "Const" + ], + [ + 83, + "Const" + ], + [ + 84, + "Const" + ], + [ + 85, + "Const" + ], + [ + 86, + "Const" + ], + [ + 87, + "Const" + ], + [ + 88, + "Const" + ], + [ + 89, + "Const" + ], + [ + 90, + "Const" + ], + [ + 91, + "Const" + ], + [ + 92, + "Const" + ], + [ + 93, + "Const" + ], + [ + 94, + "Const" + ], + [ + 95, + "Const" + ], + [ + 96, + "Const" + ], + [ + 97, + "Const" + ], + [ + 98, + "Const" + ], + [ + 99, + "Const" + ], + [ + 100, + "Const" + ], + [ + 101, + "Const" + ], + [ + 102, + "Const" + ], + [ + 103, + "Const" + ], + [ + 104, + "Const" + ], + [ + 105, + "Const" + ], + [ + 106, + "Const" + ], + [ + 107, + "Const" + ], + [ + 108, + "Const, Const>" + ], + [ + 109, + "Const" + ], + [ + 110, + "Const" + ], + [ + 111, + "Const" + ], + [ + 112, + "Const" + ], + [ + 113, + "Const" + ], + [ + 114, + "Const" + ], + [ + 115, + "Const" + ], + [ + 116, + "Const" + ], + [ + 117, + "Box" + ], + [ + 118, + "core::option::Option::>" + ], + [ + 119, + "Const" + ], + [ + 120, + "u128" + ], + [ + 121, + "core::integer::u512" + ], + [ + 122, + "core::integer::u256" + ], + [ + 123, + "core::bool" + ], + [ + 124, + "Tuple" + ], + [ + 125, + "Const, Const>" + ], + [ + 126, + "u8" + ], + [ + 127, + "core::option::Option::" + ], + [ + 128, + "Const" + ], + [ + 129, + "Snapshot>" + ], + [ + 130, + "core::array::Span::" + ], + [ + 131, + "Array" + ], + [ + 132, + "Tuple, Array, Unit>" + ], + [ + 133, + "core::panics::PanicResult::<(core::array::Span::, core::array::Array::, ())>" + ], + [ + 134, + "Tuple>" + ], + [ + 135, + "core::panics::PanicResult::<(core::array::Span::,)>" + ], + [ + 136, + "Const" + ], + [ + 137, + "Const" + ], + [ + 138, + "Const" + ], + [ + 139, + "Const" + ], + [ + 140, + "Const" + ], + [ + 141, + "Const" + ], + [ + 142, + "Const" + ], + [ + 143, + "Const" + ], + [ + 144, + "Snapshot>" + ], + [ + 145, + "core::array::Span::" + ], + [ + 146, + "Tuple, Array, Unit>" + ], + [ + 147, + "core::panics::PanicResult::<(core::array::Span::, core::array::Array::, ())>" + ], + [ + 148, + "Const" + ], + [ + 149, + "Const" + ], + [ + 150, + "Const" + ], + [ + 151, + "Const" + ], + [ + 152, + "Const" + ], + [ + 153, + "Const" + ], + [ + 154, + "Const" + ], + [ + 155, + "Const" + ], + [ + 156, + "Const" + ], + [ + 157, + "Const" + ], + [ + 158, + "Const" + ], + [ + 159, + "Const" + ], + [ + 160, + "Const" + ], + [ + 161, + "u64" + ], + [ + 162, + "NonZero" + ], + [ + 163, + "Const" + ], + [ + 164, + "Const" + ], + [ + 165, + "Const" + ], + [ + 166, + "Uninitialized" + ], + [ + 167, + "Const" + ], + [ + 168, + "Const" + ], + [ + 169, + "Const" + ], + [ + 170, + "Const" + ], + [ + 171, + "Tuple" + ], + [ + 172, + "core::panics::PanicResult::<(core::integer::u32,)>" + ], + [ + 173, + "Const" + ], + [ + 174, + "Const" + ], + [ + 175, + "Const" + ], + [ + 176, + "Tuple, u32, Unit>" + ], + [ + 177, + "core::panics::PanicResult::<(core::array::Array::, core::integer::u32, ())>" + ], + [ + 178, + "Const" + ], + [ + 179, + "Uninitialized" + ], + [ + 180, + "Uninitialized, u32, Unit>>" + ], + [ + 181, + "Uninitialized" + ], + [ + 182, + "Const" + ], + [ + 183, + "Tuple, Unit>" + ], + [ + 184, + "core::panics::PanicResult::<(core::array::Array::, ())>" + ], + [ + 185, + "Tuple, core::integer::u256, Unit>" + ], + [ + 186, + "core::panics::PanicResult::<(core::array::Array::, core::integer::u256, ())>" + ], + [ + 187, + "Const" + ], + [ + 188, + "Const" + ], + [ + 189, + "NonZero" + ], + [ + 190, + "Const" + ], + [ + 191, + "Const, Const>" + ], + [ + 192, + "Const" + ], + [ + 193, + "Const" + ], + [ + 194, + "Const" + ], + [ + 195, + "Const" + ], + [ + 196, + "Const" + ], + [ + 197, + "Const" + ], + [ + 198, + "Const" + ], + [ + 199, + "Const" + ], + [ + 200, + "Const" + ], + [ + 201, + "Const" + ], + [ + 202, + "Const" + ], + [ + 203, + "Const" + ], + [ + 204, + "Const" + ], + [ + 205, + "Const" + ], + [ + 206, + "Const" + ], + [ + 207, + "Const" + ], + [ + 208, + "Const" + ], + [ + 209, + "Const" + ], + [ + 210, + "Const" + ], + [ + 211, + "Const" + ], + [ + 212, + "Const" + ], + [ + 213, + "Const" + ], + [ + 214, + "Const" + ], + [ + 215, + "Const" + ], + [ + 216, + "Const" + ], + [ + 217, + "Const" + ], + [ + 218, + "Const" + ], + [ + 219, + "Const" + ], + [ + 220, + "Const" + ], + [ + 221, + "Const" + ], + [ + 222, + "Const" + ], + [ + 223, + "Const" + ], + [ + 224, + "Const" + ], + [ + 225, + "Const" + ], + [ + 226, + "Const" + ], + [ + 227, + "Const" + ], + [ + 228, + "Const" + ], + [ + 229, + "Const" + ], + [ + 230, + "Const" + ], + [ + 231, + "Const" + ], + [ + 232, + "Const" + ], + [ + 233, + "Const" + ], + [ + 234, + "Const" + ], + [ + 235, + "Const" + ], + [ + 236, + "Const" + ], + [ + 237, + "Const" + ], + [ + 238, + "Const" + ], + [ + 239, + "Const" + ], + [ + 240, + "Const" + ], + [ + 241, + "Const" + ], + [ + 242, + "Const" + ], + [ + 243, + "Const" + ], + [ + 244, + "Const" + ], + [ + 245, + "Const" + ], + [ + 246, + "Const" + ], + [ + 247, + "Const" + ], + [ + 248, + "Const" + ], + [ + 249, + "Const" + ], + [ + 250, + "Const" + ], + [ + 251, + "Const" + ], + [ + 252, + "Const" + ], + [ + 253, + "Const" + ], + [ + 254, + "Const" + ], + [ + 255, + "Array" + ], + [ + 256, + "Snapshot>" + ], + [ + 257, + "core::array::Span::" + ], + [ + 258, + "Tuple, Unit>" + ], + [ + 259, + "core::panics::PanicResult::<(core::array::Array::, ())>" + ], + [ + 260, + "Const" + ], + [ + 261, + "Array" + ], + [ + 262, + "Snapshot>" + ], + [ + 263, + "core::array::Span::" + ], + [ + 264, + "Tuple, Array, Unit>" + ], + [ + 265, + "core::panics::PanicResult::<(core::array::Span::, core::array::Array::, ())>" + ], + [ + 266, + "Const, Const>" + ], + [ + 267, + "Const, Const>" + ], + [ + 268, + "Const" + ], + [ + 269, + "Const" + ], + [ + 270, + "Const" + ], + [ + 271, + "Const" + ], + [ + 272, + "Snapshot>" + ], + [ + 273, + "core::array::Span::" + ], + [ + 274, + "alexandria_merkle_tree::merkle_tree::Hasher" + ], + [ + 275, + "felt252" + ], + [ + 276, + "Tuple, alexandria_merkle_tree::merkle_tree::Hasher, felt252, Unit>" + ], + [ + 277, + "core::panics::PanicResult::<(core::array::Span::, alexandria_merkle_tree::merkle_tree::Hasher, core::felt252, ())>" + ], + [ + 278, + "Const" + ], + [ + 279, + "Const" + ], + [ + 280, + "Const" + ], + [ + 281, + "Const" + ], + [ + 282, + "Const, Const, Const, Const>" + ], + [ + 283, + "Const, Const, Const, Const>" + ], + [ + 284, + "Const" + ], + [ + 285, + "Const" + ], + [ + 286, + "Const" + ], + [ + 287, + "Const" + ], + [ + 288, + "Const" + ], + [ + 289, + "Const" + ], + [ + 290, + "Array" + ], + [ + 291, + "Snapshot>" + ], + [ + 292, + "Uninitialized>>" + ], + [ + 293, + "Const" + ], + [ + 294, + "Const" + ], + [ + 295, + "Const" + ], + [ + 296, + "Const" + ], + [ + 297, + "Const" + ], + [ + 298, + "Const" + ], + [ + 299, + "Const" + ], + [ + 300, + "Const" + ], + [ + 301, + "Const" + ], + [ + 302, + "Const" + ], + [ + 303, + "Const" + ], + [ + 304, + "Const" + ], + [ + 305, + "Const" + ], + [ + 306, + "Const" + ], + [ + 307, + "Const" + ], + [ + 308, + "Const" + ], + [ + 309, + "index_enum_type<16>" + ], + [ + 310, + "BoundedInt<0, 15>" + ], + [ + 311, + "Box" + ], + [ + 312, + "core::option::Option::>" + ], + [ + 313, + "Const" + ], + [ + 314, + "Box" + ], + [ + 315, + "core::option::Option::>" + ], + [ + 316, + "Const" + ], + [ + 317, + "Const" + ], + [ + 318, + "U128MulGuarantee" + ], + [ + 319, + "Const, Const>" + ], + [ + 320, + "Const, Const>" + ], + [ + 321, + "Const" + ], + [ + 322, + "Const" + ], + [ + 323, + "Const" + ], + [ + 324, + "Const" + ], + [ + 325, + "Const, Const>" + ], + [ + 326, + "Const" + ], + [ + 327, + "Const" + ], + [ + 328, + "Const" + ], + [ + 329, + "Tuple" + ], + [ + 330, + "core::panics::PanicResult::<(core::integer::u256, core::integer::u32, ())>" + ], + [ + 331, + "Const" + ], + [ + 332, + "Tuple, Array, Unit>" + ], + [ + 333, + "core::panics::PanicResult::<(core::array::Array::, core::array::Array::, ())>" + ], + [ + 334, + "Tuple, Array, Unit>" + ], + [ + 335, + "core::panics::PanicResult::<(core::array::Span::, core::array::Array::, ())>" + ], + [ + 336, + "Tuple>" + ], + [ + 337, + "Uninitialized>>" + ], + [ + 338, + "Const" + ], + [ + 339, + "Const" + ], + [ + 340, + "Const" + ], + [ + 341, + "Const" + ], + [ + 342, + "Const" + ], + [ + 343, + "controller_auth::types::AuthenticatorData" + ], + [ + 344, + "Snapshot" + ], + [ + 345, + "core::option::Option::" + ], + [ + 346, + "Tuple>" + ], + [ + 347, + "core::panics::PanicResult::<(core::option::Option::,)>" + ], + [ + 348, + "controller_auth::errors::AuthnError" + ], + [ + 349, + "core::result::Result::<(), controller_auth::errors::AuthnError>" + ], + [ + 350, + "Tuple>" + ], + [ + 351, + "core::panics::PanicResult::<(core::integer::u32, core::result::Result::<(), controller_auth::errors::AuthnError>)>" + ], + [ + 352, + "core::panics::PanicResult::<(core::array::Array::,)>" + ], + [ + 353, + "Const" + ], + [ + 354, + "Const" + ], + [ + 355, + "Const" + ], + [ + 356, + "Const" + ], + [ + 357, + "core::starknet::eth_address::EthAddress" + ], + [ + 358, + "Tuple" + ], + [ + 359, + "core::panics::PanicResult::<(core::starknet::eth_address::EthAddress,)>" + ], + [ + 360, + "Secp256k1Point" + ], + [ + 361, + "core::option::Option::" + ], + [ + 362, + "Tuple>" + ], + [ + 363, + "core::panics::PanicResult::<(core::option::Option::,)>" + ], + [ + 364, + "Const, Const>" + ], + [ + 365, + "Const, Const>" + ], + [ + 366, + "Const" + ], + [ + 367, + "Const" + ], + [ + 368, + "EcPoint" + ], + [ + 369, + "EcState" + ], + [ + 370, + "Const" + ], + [ + 371, + "Const" + ], + [ + 372, + "NonZero" + ], + [ + 373, + "Const" + ], + [ + 374, + "Const" + ], + [ + 375, + "Const" + ], + [ + 376, + "Const" + ], + [ + 377, + "Const" + ], + [ + 378, + "core::result::Result::<(), ()>" + ], + [ + 379, + "Tuple>" + ], + [ + 380, + "core::panics::PanicResult::<(core::integer::u32, core::result::Result::<(), ()>)>" + ], + [ + 381, + "Const" + ], + [ + 382, + "Const" + ], + [ + 383, + "Const" + ], + [ + 384, + "Const" + ], + [ + 385, + "controller_session::interface::Session" + ], + [ + 386, + "NonZero" + ], + [ + 387, + "controller_auth::signer::StarknetSigner" + ], + [ + 388, + "controller_auth::signer::StarknetSignature" + ], + [ + 389, + "Tuple" + ], + [ + 390, + "controller_auth::signer::Secp256k1Signer" + ], + [ + 391, + "core::starknet::secp256_trait::Signature" + ], + [ + 392, + "Tuple" + ], + [ + 393, + "NonZero" + ], + [ + 394, + "controller_auth::signer::WebauthnSigner" + ], + [ + 395, + "controller_auth::webauthn::WebauthnAssertion" + ], + [ + 396, + "Tuple" + ], + [ + 397, + "controller_auth::signer::SignerSignature" + ], + [ + 398, + "Array>" + ], + [ + 399, + "Snapshot>>" + ], + [ + 400, + "core::array::Span::>" + ], + [ + 401, + "controller_session::interface::SessionToken" + ], + [ + 402, + "Uninitialized" + ], + [ + 403, + "Uninitialized>>" + ], + [ + 404, + "core::option::Option::>>" + ], + [ + 405, + "core::option::Option::>>" + ], + [ + 406, + "Tuple, core::option::Option::>>>" + ], + [ + 407, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>>)>" + ], + [ + 408, + "core::option::Option::" + ], + [ + 409, + "Uninitialized" + ], + [ + 410, + "Uninitialized" + ], + [ + 411, + "Const" + ], + [ + 412, + "Const" + ], + [ + 413, + "Const" + ], + [ + 414, + "core::array::Span::" + ], + [ + 415, + "Tuple, Array, Unit>" + ], + [ + 416, + "core::panics::PanicResult::<(core::array::Span::, core::array::Array::, ())>" + ], + [ + 417, + "Box" + ], + [ + 418, + "core::option::Option::>" + ], + [ + 419, + "Const" + ], + [ + 420, + "Const" + ], + [ + 421, + "NonZero" + ], + [ + 422, + "Tuple" + ], + [ + 423, + "core::panics::PanicResult::<(core::integer::u128,)>" + ], + [ + 424, + "Const" + ], + [ + 425, + "Const" + ], + [ + 426, + "Const" + ], + [ + 427, + "Const" + ], + [ + 428, + "Const" + ], + [ + 429, + "Const" + ], + [ + 430, + "Const" + ], + [ + 431, + "controller::src5::src5_component::Event" + ], + [ + 432, + "controller::outside_execution::outside_execution::outside_execution_component::Event" + ], + [ + 433, + "core::poseidon::HashState" + ], + [ + 434, + "Tuple, core::poseidon::HashState, Unit>" + ], + [ + 435, + "core::panics::PanicResult::<(core::array::Span::, core::poseidon::HashState, ())>" + ], + [ + 436, + "Const" + ], + [ + 437, + "Const" + ], + [ + 438, + "Const" + ], + [ + 439, + "Const" + ], + [ + 440, + "Array" + ], + [ + 441, + "Snapshot>" + ], + [ + 442, + "core::array::Span::" + ], + [ + 443, + "controller_auth::signer::SignerType" + ], + [ + 444, + "controller_auth::signer::SignerStorageValue" + ], + [ + 445, + "Tuple, controller_auth::signer::SignerStorageValue>" + ], + [ + 446, + "core::panics::PanicResult::<(core::array::Span::, controller_auth::signer::SignerStorageValue)>" + ], + [ + 447, + "ContractAddress" + ], + [ + 448, + "Array" + ], + [ + 449, + "Snapshot>" + ], + [ + 450, + "core::array::Span::" + ], + [ + 451, + "core::starknet::info::v2::TxInfo" + ], + [ + 452, + "Uninitialized" + ], + [ + 453, + "Uninitialized>" + ], + [ + 454, + "core::starknet::info::v2::ResourceBounds" + ], + [ + 455, + "core::option::Option::" + ], + [ + 456, + "core::option::Option::>" + ], + [ + 457, + "core::option::Option::>" + ], + [ + 458, + "Tuple, core::option::Option::>>" + ], + [ + 459, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>)>" + ], + [ + 460, + "core::option::Option::" + ], + [ + 461, + "core::option::Option::" + ], + [ + 462, + "core::option::Option::" + ], + [ + 463, + "Const" + ], + [ + 464, + "Const" + ], + [ + 465, + "Const" + ], + [ + 466, + "Secp256r1Point" + ], + [ + 467, + "core::option::Option::" + ], + [ + 468, + "Tuple>" + ], + [ + 469, + "core::panics::PanicResult::<(core::option::Option::,)>" + ], + [ + 470, + "Tuple" + ], + [ + 471, + "core::panics::PanicResult::<(core::integer::u256,)>" + ], + [ + 472, + "Tuple>" + ], + [ + 473, + "core::panics::PanicResult::<(core::result::Result::<(), controller_auth::errors::AuthnError>,)>" + ], + [ + 474, + "core::result::Result::<(), core::felt252>" + ], + [ + 475, + "Tuple>" + ], + [ + 476, + "core::panics::PanicResult::<(core::result::Result::<(), core::felt252>,)>" + ], + [ + 477, + "Const" + ], + [ + 478, + "Box" + ], + [ + 479, + "core::option::Option::>" + ], + [ + 480, + "Const" + ], + [ + 481, + "controller_session::session_component::__member_module_session_states::ComponentMemberState" + ], + [ + 482, + "controller_session::session_component::ComponentState::" + ], + [ + 483, + "Tuple, core::result::Result::<(), core::felt252>>" + ], + [ + 484, + "core::panics::PanicResult::<(controller_session::session_component::ComponentState::, core::result::Result::<(), core::felt252>)>" + ], + [ + 485, + "core::option::Option::" + ], + [ + 486, + "Tuple, core::option::Option::>" + ], + [ + 487, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 488, + "Const" + ], + [ + 489, + "Tuple, Unit>" + ], + [ + 490, + "core::panics::PanicResult::<(core::array::Span::, ())>" + ], + [ + 491, + "Const" + ], + [ + 492, + "Const" + ], + [ + 493, + "Const" + ], + [ + 494, + "Const" + ], + [ + 495, + "Const" + ], + [ + 496, + "Const, Const>" + ], + [ + 497, + "Const" + ], + [ + 498, + "Const" + ], + [ + 499, + "Const" + ], + [ + 500, + "core::starknet::info::BlockInfo" + ], + [ + 501, + "Const" + ], + [ + 502, + "Tuple, felt252>" + ], + [ + 503, + "core::panics::PanicResult::<(core::array::Span::, core::felt252)>" + ], + [ + 504, + "controller_session::hash::StarknetDomain" + ], + [ + 505, + "Const" + ], + [ + 506, + "Const" + ], + [ + 507, + "Const, Const, Const, Const>" + ], + [ + 508, + "Const" + ], + [ + 509, + "Const" + ], + [ + 510, + "Const" + ], + [ + 511, + "Const" + ], + [ + 512, + "Const, Const, Const, Const>" + ], + [ + 513, + "Tuple" + ], + [ + 514, + "Const" + ], + [ + 515, + "Const" + ], + [ + 516, + "Const" + ], + [ + 517, + "Const" + ], + [ + 518, + "Uninitialized" + ], + [ + 519, + "Uninitialized>" + ], + [ + 520, + "Const" + ], + [ + 521, + "core::option::Option::>" + ], + [ + 522, + "Const" + ], + [ + 523, + "Const" + ], + [ + 524, + "controller_session::session_component::SessionRevoked" + ], + [ + 525, + "controller_session::session_component::Event" + ], + [ + 526, + "controller_session::interface::SessionState" + ], + [ + 527, + "Const" + ], + [ + 528, + "ClassHash" + ], + [ + 529, + "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded" + ], + [ + 530, + "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event" + ], + [ + 531, + "Const" + ], + [ + 532, + "Array" + ], + [ + 533, + "Snapshot>" + ], + [ + 534, + "core::array::Span::" + ], + [ + 535, + "core::byte_array::ByteArray" + ], + [ + 536, + "Snapshot" + ], + [ + 537, + "Const" + ], + [ + 538, + "Tuple" + ], + [ + 539, + "core::panics::PanicResult::<(core::byte_array::ByteArray, ())>" + ], + [ + 540, + "Const" + ], + [ + 541, + "Const" + ], + [ + 542, + "bytes31" + ], + [ + 543, + "controller_auth::signer::Signer" + ], + [ + 544, + "controller::account::CartridgeAccount::SignerLinked" + ], + [ + 545, + "controller::account::CartridgeAccount::OwnerChangedGuid" + ], + [ + 546, + "Tuple, Array, Unit>" + ], + [ + 547, + "core::panics::PanicResult::<(core::array::Array::, core::array::Array::, ())>" + ], + [ + 548, + "controller::account::CartridgeAccount::OwnerChanged" + ], + [ + 549, + "controller::account::CartridgeAccount::Event" + ], + [ + 550, + "Uninitialized" + ], + [ + 551, + "Uninitialized" + ], + [ + 552, + "Uninitialized" + ], + [ + 553, + "core::option::Option::<(controller_auth::signer::WebauthnSigner, controller_auth::webauthn::WebauthnAssertion)>" + ], + [ + 554, + "core::option::Option::" + ], + [ + 555, + "Tuple, core::option::Option::>" + ], + [ + 556, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 557, + "core::option::Option::" + ], + [ + 558, + "Tuple, core::option::Option::>" + ], + [ + 559, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 560, + "core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>" + ], + [ + 561, + "Tuple, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>>" + ], + [ + 562, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>)>" + ], + [ + 563, + "core::option::Option::<(controller_auth::signer::StarknetSigner, controller_auth::signer::StarknetSignature)>" + ], + [ + 564, + "Uninitialized" + ], + [ + 565, + "Tuple" + ], + [ + 566, + "core::panics::PanicResult::<((),)>" + ], + [ + 567, + "Const" + ], + [ + 568, + "Const" + ], + [ + 569, + "Const" + ], + [ + 570, + "Box" + ], + [ + 571, + "Array" + ], + [ + 572, + "Snapshot>" + ], + [ + 573, + "Const" + ], + [ + 574, + "Const" + ], + [ + 575, + "Const" + ], + [ + 576, + "core::option::Option::>" + ], + [ + 577, + "Tuple, core::option::Option::>>" + ], + [ + 578, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>)>" + ], + [ + 579, + "Const" + ], + [ + 580, + "Const" + ], + [ + 581, + "Box>" + ], + [ + 582, + "core::option::Option::>>" + ], + [ + 583, + "Uninitialized>>>" + ], + [ + 584, + "Const" + ], + [ + 585, + "Const" + ], + [ + 586, + "Tuple, Array>, Unit>" + ], + [ + 587, + "core::panics::PanicResult::<(core::array::Span::, core::array::Array::>, ())>" + ], + [ + 588, + "Const" + ], + [ + 589, + "Const" + ], + [ + 590, + "Tuple, felt252>" + ], + [ + 591, + "core::panics::PanicResult::<(controller_session::session_component::ComponentState::, core::felt252)>" + ], + [ + 592, + "Const" + ], + [ + 593, + "Const" + ], + [ + 594, + "core::starknet::account::Call" + ], + [ + 595, + "core::option::Option::" + ], + [ + 596, + "Tuple, core::option::Option::>" + ], + [ + 597, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 598, + "core::option::Option::" + ], + [ + 599, + "core::option::Option::>" + ], + [ + 600, + "Tuple, core::option::Option::>>" + ], + [ + 601, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>)>" + ], + [ + 602, + "Tuple, core::option::Option::>" + ], + [ + 603, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 604, + "Uninitialized" + ], + [ + 605, + "Const" + ], + [ + 606, + "Const" + ], + [ + 607, + "Const" + ], + [ + 608, + "controller::outside_execution::outside_execution::outside_execution_component::__member_module_outside_nonces::ComponentMemberState" + ], + [ + 609, + "controller::outside_execution::outside_execution::outside_execution_component::ComponentState::" + ], + [ + 610, + "Tuple, Array>>" + ], + [ + 611, + "core::panics::PanicResult::<(controller::outside_execution::outside_execution::outside_execution_component::ComponentState::, core::array::Array::>)>" + ], + [ + 612, + "core::option::Option::>" + ], + [ + 613, + "Tuple, core::option::Option::>>" + ], + [ + 614, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>)>" + ], + [ + 615, + "controller::outside_execution::interface::OutsideExecution" + ], + [ + 616, + "core::option::Option::" + ], + [ + 617, + "Tuple, core::option::Option::>" + ], + [ + 618, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 619, + "Uninitialized" + ], + [ + 620, + "Uninitialized>" + ], + [ + 621, + "EcOp" + ], + [ + 622, + "Uninitialized" + ], + [ + 623, + "Poseidon" + ], + [ + 624, + "Uninitialized" + ], + [ + 625, + "Bitwise" + ], + [ + 626, + "Uninitialized" + ], + [ + 627, + "Pedersen" + ], + [ + 628, + "Uninitialized" + ], + [ + 629, + "Tuple" + ], + [ + 630, + "core::panics::PanicResult::<(core::bool,)>" + ], + [ + 631, + "Tuple, Unit>" + ], + [ + 632, + "core::panics::PanicResult::<(controller_session::session_component::ComponentState::, ())>" + ], + [ + 633, + "Const" + ], + [ + 634, + "openzeppelin::upgrades::upgradeable::UpgradeableComponent::ComponentState::" + ], + [ + 635, + "Tuple, Unit>" + ], + [ + 636, + "core::panics::PanicResult::<(openzeppelin::upgrades::upgradeable::UpgradeableComponent::ComponentState::, ())>" + ], + [ + 637, + "Box" + ], + [ + 638, + "Box" + ], + [ + 639, + "core::starknet::info::v2::ExecutionInfo" + ], + [ + 640, + "Box" + ], + [ + 641, + "Const" + ], + [ + 642, + "Const" + ], + [ + 643, + "Const" + ], + [ + 644, + "Const" + ], + [ + 645, + "Const" + ], + [ + 646, + "Const" + ], + [ + 647, + "Const" + ], + [ + 648, + "StorageAddress" + ], + [ + 649, + "StorageBaseAddress" + ], + [ + 650, + "controller::account::CartridgeAccount::__member_module__owner::ContractMemberState" + ], + [ + 651, + "controller::account::CartridgeAccount::__member_module__owner_non_stark::ContractMemberState" + ], + [ + 652, + "controller::src5::src5_component::ComponentState::" + ], + [ + 653, + "controller::account::CartridgeAccount::ContractState" + ], + [ + 654, + "Tuple" + ], + [ + 655, + "core::panics::PanicResult::<(controller::account::CartridgeAccount::ContractState, ())>" + ], + [ + 656, + "core::option::Option::" + ], + [ + 657, + "Tuple, core::option::Option::>" + ], + [ + 658, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::)>" + ], + [ + 659, + "Const" + ], + [ + 660, + "Tuple" + ], + [ + 661, + "core::panics::PanicResult::<(core::felt252,)>" + ], + [ + 662, + "core::option::Option::>" + ], + [ + 663, + "Tuple, core::option::Option::>>" + ], + [ + 664, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>)>" + ], + [ + 665, + "core::option::Option::" + ], + [ + 666, + "Uninitialized" + ], + [ + 667, + "Tuple, Unit>" + ], + [ + 668, + "core::panics::PanicResult::<(core::array::Array::, ())>" + ], + [ + 669, + "Tuple>>" + ], + [ + 670, + "core::panics::PanicResult::<(controller::account::CartridgeAccount::ContractState, core::array::Array::>)>" + ], + [ + 671, + "System" + ], + [ + 672, + "Uninitialized" + ], + [ + 673, + "Const" + ], + [ + 674, + "Const" + ], + [ + 675, + "Tuple>" + ], + [ + 676, + "Tuple" + ], + [ + 677, + "core::panics::PanicResult::<(controller::account::CartridgeAccount::ContractState, core::felt252)>" + ], + [ + 678, + "BuiltinCosts" + ], + [ + 679, + "Const" + ], + [ + 680, + "core::panics::PanicResult::<(core::array::Span::,)>" + ], + [ + 681, + "core::option::Option::>" + ], + [ + 682, + "Tuple, core::option::Option::>>" + ], + [ + 683, + "core::panics::PanicResult::<(core::array::Span::, core::option::Option::>)>" + ], + [ + 684, + "Box" + ], + [ + 685, + "core::option::Option::>" + ], + [ + 686, + "GasBuiltin" + ] + ], + "libfunc_names": [ + [ + 0, + "revoke_ap_tracking" + ], + [ + 1, + "withdraw_gas" + ], + [ + 2, + "branch_align" + ], + [ + 3, + "struct_deconstruct>" + ], + [ + 4, + "enable_ap_tracking" + ], + [ + 5, + "store_temp" + ], + [ + 6, + "array_snapshot_pop_front" + ], + [ + 7, + "enum_init>, 0>" + ], + [ + 8, + "store_temp>>" + ], + [ + 9, + "store_temp>>" + ], + [ + 10, + "jump" + ], + [ + 11, + "struct_construct" + ], + [ + 12, + "enum_init>, 1>" + ], + [ + 13, + "enum_match>>" + ], + [ + 14, + "disable_ap_tracking" + ], + [ + 15, + "unbox" + ], + [ + 16, + "array_new" + ], + [ + 17, + "struct_construct>" + ], + [ + 18, + "rename" + ], + [ + 19, + "store_temp" + ], + [ + 20, + "store_temp>" + ], + [ + 21, + "store_temp>" + ], + [ + 22, + "store_temp" + ], + [ + 23, + "function_call>" + ], + [ + 24, + "enum_match, core::option::Option::>)>>" + ], + [ + 25, + "struct_deconstruct, core::option::Option::>>>" + ], + [ + 26, + "store_temp>>" + ], + [ + 27, + "enum_init,)>, 1>" + ], + [ + 28, + "store_temp" + ], + [ + 29, + "store_temp" + ], + [ + 30, + "store_temp" + ], + [ + 31, + "store_temp" + ], + [ + 32, + "store_temp" + ], + [ + 33, + "store_temp,)>>" + ], + [ + 34, + "drop" + ], + [ + 35, + "enum_init>, 1>" + ], + [ + 36, + "enum_match>>" + ], + [ + 37, + "drop>>" + ], + [ + 38, + "drop>" + ], + [ + 39, + "drop>" + ], + [ + 40, + "array_new" + ], + [ + 41, + "const_as_immediate>" + ], + [ + 42, + "array_append" + ], + [ + 43, + "struct_construct" + ], + [ + 44, + "struct_construct>>" + ], + [ + 45, + "get_builtin_costs" + ], + [ + 46, + "store_temp" + ], + [ + 47, + "withdraw_gas_all" + ], + [ + 48, + "struct_construct" + ], + [ + 49, + "struct_construct" + ], + [ + 50, + "struct_construct" + ], + [ + 51, + "struct_construct>" + ], + [ + 52, + "struct_construct" + ], + [ + 53, + "struct_construct>" + ], + [ + 54, + "struct_construct>" + ], + [ + 55, + "struct_construct>" + ], + [ + 56, + "struct_construct" + ], + [ + 57, + "function_call" + ], + [ + 58, + "enum_match>" + ], + [ + 59, + "struct_deconstruct>" + ], + [ + 60, + "drop" + ], + [ + 61, + "snapshot_take>" + ], + [ + 62, + "drop>" + ], + [ + 63, + "struct_construct>>" + ], + [ + 64, + "enum_init,)>, 0>" + ], + [ + 65, + "const_as_immediate>" + ], + [ + 66, + "const_as_immediate>" + ], + [ + 67, + "drop>" + ], + [ + 68, + "alloc_local" + ], + [ + 69, + "finalize_locals" + ], + [ + 70, + "drop>" + ], + [ + 71, + "function_call" + ], + [ + 72, + "store_local" + ], + [ + 73, + "enum_match>)>>" + ], + [ + 74, + "struct_deconstruct>>>" + ], + [ + 75, + "snapshot_take>>" + ], + [ + 76, + "drop>>" + ], + [ + 77, + "dup>>>" + ], + [ + 78, + "array_len>" + ], + [ + 79, + "u32_to_felt252" + ], + [ + 80, + "struct_construct>>" + ], + [ + 81, + "store_temp>>" + ], + [ + 82, + "store_temp>" + ], + [ + 83, + "function_call, core::array::SpanFelt252Serde, core::array::SpanDrop::>>" + ], + [ + 84, + "enum_match, ())>>" + ], + [ + 85, + "struct_deconstruct, Unit>>" + ], + [ + 86, + "alloc_local" + ], + [ + 87, + "enum_init, 0>" + ], + [ + 88, + "store_temp>" + ], + [ + 89, + "enum_init, 1>" + ], + [ + 90, + "enum_match>" + ], + [ + 91, + "store_local" + ], + [ + 92, + "function_call>" + ], + [ + 93, + "enum_match, core::option::Option::>)>>" + ], + [ + 94, + "struct_deconstruct, core::option::Option::>>>" + ], + [ + 95, + "store_temp>>" + ], + [ + 96, + "drop" + ], + [ + 97, + "enum_init>, 1>" + ], + [ + 98, + "enum_match>>" + ], + [ + 99, + "snapshot_take" + ], + [ + 100, + "function_call" + ], + [ + 101, + "enum_match>" + ], + [ + 102, + "struct_deconstruct>" + ], + [ + 103, + "const_as_immediate>" + ], + [ + 104, + "drop>" + ], + [ + 105, + "function_call" + ], + [ + 106, + "function_call" + ], + [ + 107, + "enum_match, core::option::Option::)>>" + ], + [ + 108, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 109, + "enum_match>" + ], + [ + 110, + "drop" + ], + [ + 111, + "store_temp" + ], + [ + 112, + "function_call" + ], + [ + 113, + "enum_match>" + ], + [ + 114, + "drop>" + ], + [ + 115, + "storage_base_address_const<784875164039100399579447185504448607377760708865195644450792957979080027814>" + ], + [ + 116, + "storage_address_from_base" + ], + [ + 117, + "const_as_immediate>" + ], + [ + 118, + "store_temp" + ], + [ + 119, + "store_temp" + ], + [ + 120, + "storage_read_syscall" + ], + [ + 121, + "dup" + ], + [ + 122, + "felt252_is_zero" + ], + [ + 123, + "const_as_immediate>" + ], + [ + 124, + "drop>" + ], + [ + 125, + "enum_init" + ], + [ + 126, + "store_temp" + ], + [ + 127, + "enum_init" + ], + [ + 128, + "snapshot_take" + ], + [ + 129, + "drop" + ], + [ + 130, + "enum_match" + ], + [ + 131, + "const_as_immediate>" + ], + [ + 132, + "const_as_immediate>" + ], + [ + 133, + "const_as_immediate>" + ], + [ + 134, + "const_as_immediate>" + ], + [ + 135, + "function_call" + ], + [ + 136, + "const_as_immediate>" + ], + [ + 137, + "class_hash_try_from_felt252" + ], + [ + 138, + "drop" + ], + [ + 139, + "get_execution_info_v2_syscall" + ], + [ + 140, + "store_temp>" + ], + [ + 141, + "unbox" + ], + [ + 142, + "store_temp" + ], + [ + 143, + "struct_deconstruct" + ], + [ + 144, + "drop>" + ], + [ + 145, + "drop>" + ], + [ + 146, + "drop" + ], + [ + 147, + "contract_address_to_felt252" + ], + [ + 148, + "felt252_sub" + ], + [ + 149, + "store_temp" + ], + [ + 150, + "function_call::_upgrade>" + ], + [ + 151, + "enum_match, ())>>" + ], + [ + 152, + "drop, Unit>>" + ], + [ + 153, + "struct_deconstruct>>" + ], + [ + 154, + "drop" + ], + [ + 155, + "const_as_immediate>" + ], + [ + 156, + "drop" + ], + [ + 157, + "function_call::revoke_session>" + ], + [ + 158, + "enum_match, ())>>" + ], + [ + 159, + "drop, Unit>>" + ], + [ + 160, + "struct_deconstruct" + ], + [ + 161, + "drop" + ], + [ + 162, + "drop" + ], + [ + 163, + "drop>" + ], + [ + 164, + "drop>" + ], + [ + 165, + "drop>" + ], + [ + 166, + "function_call::is_session_revoked>" + ], + [ + 167, + "enum_match>" + ], + [ + 168, + "struct_deconstruct>" + ], + [ + 169, + "enum_match" + ], + [ + 170, + "alloc_local" + ], + [ + 171, + "alloc_local" + ], + [ + 172, + "alloc_local" + ], + [ + 173, + "alloc_local" + ], + [ + 174, + "alloc_local>" + ], + [ + 175, + "alloc_local" + ], + [ + 176, + "function_call" + ], + [ + 177, + "enum_match, core::option::Option::)>>" + ], + [ + 178, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 179, + "enum_match>" + ], + [ + 180, + "function_call" + ], + [ + 181, + "store_local" + ], + [ + 182, + "enum_match, core::option::Option::>)>>" + ], + [ + 183, + "struct_deconstruct, core::option::Option::>>>" + ], + [ + 184, + "enum_match>>" + ], + [ + 185, + "store_local>" + ], + [ + 186, + "drop>" + ], + [ + 187, + "drop>" + ], + [ + 188, + "drop>" + ], + [ + 189, + "drop>" + ], + [ + 190, + "drop" + ], + [ + 191, + "snapshot_take" + ], + [ + 192, + "store_temp" + ], + [ + 193, + "function_call" + ], + [ + 194, + "function_call::assert_valid_outside_execution>" + ], + [ + 195, + "store_local" + ], + [ + 196, + "store_local" + ], + [ + 197, + "store_local" + ], + [ + 198, + "store_local" + ], + [ + 199, + "enum_match, core::array::Array::>)>>" + ], + [ + 200, + "struct_deconstruct, Array>>>" + ], + [ + 201, + "store_temp>>" + ], + [ + 202, + "drop>>" + ], + [ + 203, + "drop>" + ], + [ + 204, + "const_as_immediate>" + ], + [ + 205, + "pedersen" + ], + [ + 206, + "storage_base_address_from_felt252" + ], + [ + 207, + "enum_init" + ], + [ + 208, + "store_temp" + ], + [ + 209, + "enum_init" + ], + [ + 210, + "bool_not_impl" + ], + [ + 211, + "const_as_immediate>" + ], + [ + 212, + "const_as_immediate>" + ], + [ + 213, + "alloc_local" + ], + [ + 214, + "function_call" + ], + [ + 215, + "enum_match, core::option::Option::)>>" + ], + [ + 216, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 217, + "enum_match>" + ], + [ + 218, + "store_local" + ], + [ + 219, + "function_call>::deserialize>" + ], + [ + 220, + "enum_match, core::option::Option::>)>>" + ], + [ + 221, + "struct_deconstruct, core::option::Option::>>>" + ], + [ + 222, + "enum_match>>" + ], + [ + 223, + "drop>" + ], + [ + 224, + "drop" + ], + [ + 225, + "store_temp" + ], + [ + 226, + "store_temp>" + ], + [ + 227, + "function_call" + ], + [ + 228, + "drop>" + ], + [ + 229, + "enum_init>, 0>" + ], + [ + 230, + "struct_construct, core::option::Option::>>>" + ], + [ + 231, + "enum_init, core::option::Option::>)>, 0>" + ], + [ + 232, + "store_temp, core::option::Option::>)>>" + ], + [ + 233, + "function_call" + ], + [ + 234, + "enum_match, core::option::Option::)>>" + ], + [ + 235, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 236, + "enum_match>" + ], + [ + 237, + "array_append" + ], + [ + 238, + "enum_init, core::option::Option::>)>, 1>" + ], + [ + 239, + "store_temp>" + ], + [ + 240, + "unbox" + ], + [ + 241, + "struct_deconstruct" + ], + [ + 242, + "drop" + ], + [ + 243, + "drop>" + ], + [ + 244, + "drop" + ], + [ + 245, + "const_as_immediate>" + ], + [ + 246, + "enum_init, 1>" + ], + [ + 247, + "store_temp>" + ], + [ + 248, + "dup>" + ], + [ + 249, + "array_get" + ], + [ + 250, + "store_temp>" + ], + [ + 251, + "const_as_immediate>" + ], + [ + 252, + "snapshot_take>" + ], + [ + 253, + "struct_construct>" + ], + [ + 254, + "store_temp>" + ], + [ + 255, + "function_call::validate_session_serialized>" + ], + [ + 256, + "enum_match, core::felt252)>>" + ], + [ + 257, + "struct_deconstruct, felt252>>" + ], + [ + 258, + "rename" + ], + [ + 259, + "rename" + ], + [ + 260, + "rename>" + ], + [ + 261, + "rename>" + ], + [ + 262, + "rename>" + ], + [ + 263, + "rename>" + ], + [ + 264, + "store_temp" + ], + [ + 265, + "function_call" + ], + [ + 266, + "struct_deconstruct>" + ], + [ + 267, + "const_as_immediate>" + ], + [ + 268, + "struct_construct>" + ], + [ + 269, + "enum_init, 0>" + ], + [ + 270, + "const_as_immediate>" + ], + [ + 271, + "array_new>" + ], + [ + 272, + "store_temp>>" + ], + [ + 273, + "function_call" + ], + [ + 274, + "enum_match, core::array::Array::>, ())>>" + ], + [ + 275, + "struct_deconstruct, Array>, Unit>>" + ], + [ + 276, + "drop>" + ], + [ + 277, + "struct_construct>>>" + ], + [ + 278, + "enum_init>)>, 0>" + ], + [ + 279, + "store_temp>)>>" + ], + [ + 280, + "enum_init>)>, 1>" + ], + [ + 281, + "const_as_immediate>" + ], + [ + 282, + "const_as_immediate>" + ], + [ + 283, + "alloc_local>>>" + ], + [ + 284, + "struct_deconstruct>>" + ], + [ + 285, + "array_snapshot_pop_front>" + ], + [ + 286, + "enum_init>>, 0>" + ], + [ + 287, + "store_temp>>>" + ], + [ + 288, + "store_temp>>>" + ], + [ + 289, + "enum_init>>, 1>" + ], + [ + 290, + "store_local>>>" + ], + [ + 291, + "enum_match>>>" + ], + [ + 292, + "unbox>" + ], + [ + 293, + "rename>" + ], + [ + 294, + "array_len" + ], + [ + 295, + "function_call>" + ], + [ + 296, + "drop>>>" + ], + [ + 297, + "enum_init, ())>, 1>" + ], + [ + 298, + "store_temp, ())>>" + ], + [ + 299, + "struct_construct, Unit>>" + ], + [ + 300, + "enum_init, ())>, 0>" + ], + [ + 301, + "drop>>>>" + ], + [ + 302, + "drop>>" + ], + [ + 303, + "enum_init>, 0>" + ], + [ + 304, + "struct_construct, core::option::Option::>>>" + ], + [ + 305, + "enum_init, core::option::Option::>)>, 0>" + ], + [ + 306, + "store_temp, core::option::Option::>)>>" + ], + [ + 307, + "enum_init, core::option::Option::>)>, 1>" + ], + [ + 308, + "dup>>" + ], + [ + 309, + "const_as_immediate>" + ], + [ + 310, + "u32_eq" + ], + [ + 311, + "const_as_immediate>" + ], + [ + 312, + "array_new" + ], + [ + 313, + "store_temp>" + ], + [ + 314, + "function_call>" + ], + [ + 315, + "enum_match, core::option::Option::>)>>" + ], + [ + 316, + "struct_deconstruct, core::option::Option::>>>" + ], + [ + 317, + "store_temp>>" + ], + [ + 318, + "enum_init>, 1>" + ], + [ + 319, + "enum_match>>" + ], + [ + 320, + "drop>" + ], + [ + 321, + "const_as_immediate>" + ], + [ + 322, + "const_as_immediate>" + ], + [ + 323, + "const_as_immediate>" + ], + [ + 324, + "struct_construct" + ], + [ + 325, + "struct_construct" + ], + [ + 326, + "struct_construct>" + ], + [ + 327, + "enum_init" + ], + [ + 328, + "dup" + ], + [ + 329, + "array_append" + ], + [ + 330, + "snapshot_take>" + ], + [ + 331, + "array_len" + ], + [ + 332, + "u32_overflowing_sub" + ], + [ + 333, + "array_get" + ], + [ + 334, + "store_temp>" + ], + [ + 335, + "unbox" + ], + [ + 336, + "rename" + ], + [ + 337, + "function_call" + ], + [ + 338, + "struct_construct>" + ], + [ + 339, + "enum_init, 0>" + ], + [ + 340, + "store_temp>" + ], + [ + 341, + "const_as_immediate>" + ], + [ + 342, + "enum_init, 1>" + ], + [ + 343, + "drop" + ], + [ + 344, + "const_as_immediate>" + ], + [ + 345, + "const_as_immediate>" + ], + [ + 346, + "struct_construct" + ], + [ + 347, + "store_temp" + ], + [ + 348, + "drop>" + ], + [ + 349, + "function_call" + ], + [ + 350, + "enum_match>" + ], + [ + 351, + "drop>" + ], + [ + 352, + "alloc_local" + ], + [ + 353, + "drop>" + ], + [ + 354, + "function_call::deserialize>" + ], + [ + 355, + "enum_match>" + ], + [ + 356, + "enum_init, 1>" + ], + [ + 357, + "struct_construct, core::option::Option::>>" + ], + [ + 358, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 359, + "store_temp, core::option::Option::)>>" + ], + [ + 360, + "function_call::deserialize>" + ], + [ + 361, + "enum_match, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>)>>" + ], + [ + 362, + "struct_deconstruct, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>>>" + ], + [ + 363, + "enum_match>" + ], + [ + 364, + "enum_init" + ], + [ + 365, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 366, + "function_call" + ], + [ + 367, + "enum_match, core::option::Option::)>>" + ], + [ + 368, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 369, + "enum_match>" + ], + [ + 370, + "store_local" + ], + [ + 371, + "function_call" + ], + [ + 372, + "enum_match, core::option::Option::)>>" + ], + [ + 373, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 374, + "enum_match>" + ], + [ + 375, + "struct_construct>" + ], + [ + 376, + "enum_init, 0>" + ], + [ + 377, + "store_temp>" + ], + [ + 378, + "drop" + ], + [ + 379, + "enum_init, 1>" + ], + [ + 380, + "enum_match>" + ], + [ + 381, + "enum_init" + ], + [ + 382, + "enum_init" + ], + [ + 383, + "enum_init, 0>" + ], + [ + 384, + "alloc_local" + ], + [ + 385, + "alloc_local" + ], + [ + 386, + "alloc_local" + ], + [ + 387, + "enum_match" + ], + [ + 388, + "struct_deconstruct>" + ], + [ + 389, + "drop" + ], + [ + 390, + "enum_init" + ], + [ + 391, + "struct_deconstruct>" + ], + [ + 392, + "drop" + ], + [ + 393, + "enum_init" + ], + [ + 394, + "struct_deconstruct>" + ], + [ + 395, + "drop" + ], + [ + 396, + "enum_init" + ], + [ + 397, + "enum_init" + ], + [ + 398, + "function_call" + ], + [ + 399, + "dup" + ], + [ + 400, + "enum_match" + ], + [ + 401, + "struct_deconstruct" + ], + [ + 402, + "unwrap_non_zero" + ], + [ + 403, + "enum_init" + ], + [ + 404, + "struct_deconstruct" + ], + [ + 405, + "struct_deconstruct" + ], + [ + 406, + "function_call" + ], + [ + 407, + "drop>" + ], + [ + 408, + "drop>" + ], + [ + 409, + "drop>" + ], + [ + 410, + "enum_init, 1>" + ], + [ + 411, + "store_temp>" + ], + [ + 412, + "enum_init" + ], + [ + 413, + "store_local" + ], + [ + 414, + "dup" + ], + [ + 415, + "struct_construct" + ], + [ + 416, + "store_local" + ], + [ + 417, + "dup" + ], + [ + 418, + "store_temp" + ], + [ + 419, + "function_call" + ], + [ + 420, + "struct_construct" + ], + [ + 421, + "enum_init" + ], + [ + 422, + "snapshot_take" + ], + [ + 423, + "drop" + ], + [ + 424, + "store_temp" + ], + [ + 425, + "function_call" + ], + [ + 426, + "enum_match, core::array::Array::, ())>>" + ], + [ + 427, + "struct_deconstruct, Array, Unit>>" + ], + [ + 428, + "emit_event_syscall" + ], + [ + 429, + "drop" + ], + [ + 430, + "function_call" + ], + [ + 431, + "struct_construct" + ], + [ + 432, + "enum_init" + ], + [ + 433, + "struct_construct" + ], + [ + 434, + "enum_init" + ], + [ + 435, + "struct_construct>" + ], + [ + 436, + "enum_init, 0>" + ], + [ + 437, + "array_new" + ], + [ + 438, + "const_as_immediate>" + ], + [ + 439, + "const_as_immediate>" + ], + [ + 440, + "struct_construct" + ], + [ + 441, + "store_temp" + ], + [ + 442, + "function_call" + ], + [ + 443, + "enum_match>" + ], + [ + 444, + "const_as_immediate>" + ], + [ + 445, + "struct_deconstruct>" + ], + [ + 446, + "store_local" + ], + [ + 447, + "snapshot_take" + ], + [ + 448, + "drop" + ], + [ + 449, + "dup>" + ], + [ + 450, + "struct_snapshot_deconstruct" + ], + [ + 451, + "dup>>" + ], + [ + 452, + "array_len" + ], + [ + 453, + "struct_construct>" + ], + [ + 454, + "store_temp>" + ], + [ + 455, + "function_call, core::bytes_31::bytes31Drop>>" + ], + [ + 456, + "drop>>" + ], + [ + 457, + "rename" + ], + [ + 458, + "drop>" + ], + [ + 459, + "dup" + ], + [ + 460, + "class_hash_to_felt252" + ], + [ + 461, + "const_as_immediate>" + ], + [ + 462, + "enum_init, ())>, 1>" + ], + [ + 463, + "store_temp, ())>>" + ], + [ + 464, + "replace_class_syscall" + ], + [ + 465, + "struct_construct" + ], + [ + 466, + "enum_init" + ], + [ + 467, + "enum_init" + ], + [ + 468, + "struct_construct, Unit>>" + ], + [ + 469, + "enum_init, ())>, 0>" + ], + [ + 470, + "const_as_immediate>" + ], + [ + 471, + "enum_init" + ], + [ + 472, + "store_temp" + ], + [ + 473, + "enum_init" + ], + [ + 474, + "enum_init" + ], + [ + 475, + "snapshot_take" + ], + [ + 476, + "drop" + ], + [ + 477, + "function_call::eq>" + ], + [ + 478, + "storage_write_syscall" + ], + [ + 479, + "struct_construct" + ], + [ + 480, + "enum_init" + ], + [ + 481, + "enum_init" + ], + [ + 482, + "struct_construct, Unit>>" + ], + [ + 483, + "enum_init, ())>, 0>" + ], + [ + 484, + "store_temp, ())>>" + ], + [ + 485, + "enum_init, ())>, 1>" + ], + [ + 486, + "const_as_immediate>" + ], + [ + 487, + "const_as_immediate>" + ], + [ + 488, + "enum_match" + ], + [ + 489, + "struct_construct>" + ], + [ + 490, + "enum_init, 0>" + ], + [ + 491, + "store_temp>" + ], + [ + 492, + "enum_init, 1>" + ], + [ + 493, + "contract_address_try_from_felt252" + ], + [ + 494, + "u64_try_from_felt252" + ], + [ + 495, + "enum_init>, 0>" + ], + [ + 496, + "store_temp>>" + ], + [ + 497, + "enum_init>, 1>" + ], + [ + 498, + "drop" + ], + [ + 499, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 500, + "store_temp, core::option::Option::)>>" + ], + [ + 501, + "enum_match>>" + ], + [ + 502, + "struct_construct" + ], + [ + 503, + "enum_init, 0>" + ], + [ + 504, + "struct_construct, core::option::Option::>>" + ], + [ + 505, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 506, + "enum_init, 1>" + ], + [ + 507, + "u32_try_from_felt252" + ], + [ + 508, + "dup" + ], + [ + 509, + "array_slice" + ], + [ + 510, + "enum_init>, 0>" + ], + [ + 511, + "struct_construct, core::option::Option::>>>" + ], + [ + 512, + "enum_init, core::option::Option::>)>, 0>" + ], + [ + 513, + "store_temp, core::option::Option::>)>>" + ], + [ + 514, + "enum_init, core::option::Option::>)>, 1>" + ], + [ + 515, + "const_as_immediate>" + ], + [ + 516, + "enum_init>, 1>" + ], + [ + 517, + "alloc_local>" + ], + [ + 518, + "alloc_local" + ], + [ + 519, + "const_as_immediate>" + ], + [ + 520, + "drop>" + ], + [ + 521, + "drop>>" + ], + [ + 522, + "store_local" + ], + [ + 523, + "rename" + ], + [ + 524, + "function_call" + ], + [ + 525, + "const_as_immediate, Const, Const, Const>>" + ], + [ + 526, + "struct_deconstruct>" + ], + [ + 527, + "felt252_add" + ], + [ + 528, + "hades_permutation" + ], + [ + 529, + "const_as_immediate>" + ], + [ + 530, + "const_as_immediate, Const, Const, Const>>" + ], + [ + 531, + "const_as_immediate>" + ], + [ + 532, + "const_as_immediate>" + ], + [ + 533, + "struct_construct" + ], + [ + 534, + "snapshot_take" + ], + [ + 535, + "drop" + ], + [ + 536, + "store_temp" + ], + [ + 537, + "store_local>" + ], + [ + 538, + "function_call" + ], + [ + 539, + "struct_construct>" + ], + [ + 540, + "store_temp>" + ], + [ + 541, + "function_call" + ], + [ + 542, + "enum_match, core::felt252)>>" + ], + [ + 543, + "struct_deconstruct, felt252>>" + ], + [ + 544, + "struct_deconstruct" + ], + [ + 545, + "dup" + ], + [ + 546, + "const_as_immediate>" + ], + [ + 547, + "store_temp>" + ], + [ + 548, + "unbox" + ], + [ + 549, + "struct_deconstruct" + ], + [ + 550, + "store_temp" + ], + [ + 551, + "dup" + ], + [ + 552, + "u64_overflowing_sub" + ], + [ + 553, + "const_as_immediate>" + ], + [ + 554, + "enum_init, core::array::Array::>)>, 1>" + ], + [ + 555, + "store_temp, core::array::Array::>)>>" + ], + [ + 556, + "bool_to_felt252" + ], + [ + 557, + "drop" + ], + [ + 558, + "dup>" + ], + [ + 559, + "drop, felt252>>" + ], + [ + 560, + "struct_construct, Array>>>" + ], + [ + 561, + "enum_init, core::array::Array::>)>, 0>" + ], + [ + 562, + "drop" + ], + [ + 563, + "const_as_immediate>" + ], + [ + 564, + "const_as_immediate>" + ], + [ + 565, + "enum_init, 1>" + ], + [ + 566, + "struct_construct, core::option::Option::>>" + ], + [ + 567, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 568, + "store_temp, core::option::Option::)>>" + ], + [ + 569, + "const_as_immediate, Const>>" + ], + [ + 570, + "u128s_from_felt252" + ], + [ + 571, + "const_as_immediate>" + ], + [ + 572, + "store_temp" + ], + [ + 573, + "struct_deconstruct" + ], + [ + 574, + "dup" + ], + [ + 575, + "u128_overflowing_sub" + ], + [ + 576, + "u128_eq" + ], + [ + 577, + "rename" + ], + [ + 578, + "const_as_immediate>" + ], + [ + 579, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 580, + "struct_construct" + ], + [ + 581, + "struct_construct" + ], + [ + 582, + "enum_init, 0>" + ], + [ + 583, + "enum_init>, 1>" + ], + [ + 584, + "struct_construct, core::option::Option::>>>" + ], + [ + 585, + "enum_init, core::option::Option::>)>, 0>" + ], + [ + 586, + "store_temp, core::option::Option::>)>>" + ], + [ + 587, + "enum_init, core::option::Option::>)>, 1>" + ], + [ + 588, + "enum_init>, 0>" + ], + [ + 589, + "const_as_immediate>" + ], + [ + 590, + "const_as_immediate>" + ], + [ + 591, + "const_as_immediate>" + ], + [ + 592, + "enum_init, 0>" + ], + [ + 593, + "struct_construct, core::option::Option::>>" + ], + [ + 594, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 595, + "store_temp, core::option::Option::)>>" + ], + [ + 596, + "enum_init, 1>" + ], + [ + 597, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 598, + "function_call" + ], + [ + 599, + "enum_match, ())>>" + ], + [ + 600, + "drop, Unit>>" + ], + [ + 601, + "const_as_immediate>" + ], + [ + 602, + "function_call" + ], + [ + 603, + "enum_match, core::option::Option::)>>" + ], + [ + 604, + "struct_deconstruct, core::option::Option::>>" + ], + [ + 605, + "enum_match>" + ], + [ + 606, + "store_temp" + ], + [ + 607, + "function_call::validate_signature>" + ], + [ + 608, + "enum_match, core::result::Result::<(), core::felt252>)>>" + ], + [ + 609, + "struct_deconstruct, core::result::Result::<(), core::felt252>>>" + ], + [ + 610, + "enum_match>" + ], + [ + 611, + "struct_construct, felt252>>" + ], + [ + 612, + "enum_init, core::felt252)>, 0>" + ], + [ + 613, + "store_temp, core::felt252)>>" + ], + [ + 614, + "enum_init, core::felt252)>, 1>" + ], + [ + 615, + "const_as_immediate>" + ], + [ + 616, + "drop" + ], + [ + 617, + "struct_deconstruct>" + ], + [ + 618, + "array_snapshot_pop_front" + ], + [ + 619, + "enum_init>, 0>" + ], + [ + 620, + "store_temp>>" + ], + [ + 621, + "store_temp>>" + ], + [ + 622, + "enum_init>, 1>" + ], + [ + 623, + "enum_match>>" + ], + [ + 624, + "unbox" + ], + [ + 625, + "struct_deconstruct" + ], + [ + 626, + "rename" + ], + [ + 627, + "call_contract_syscall" + ], + [ + 628, + "array_append>" + ], + [ + 629, + "const_as_immediate>" + ], + [ + 630, + "enum_init, core::array::Array::>, ())>, 1>" + ], + [ + 631, + "store_temp, core::array::Array::>, ())>>" + ], + [ + 632, + "struct_construct, Array>, Unit>>" + ], + [ + 633, + "enum_init, core::array::Array::>, ())>, 0>" + ], + [ + 634, + "enum_init>, 0>" + ], + [ + 635, + "struct_construct, core::option::Option::>>>" + ], + [ + 636, + "enum_init, core::option::Option::>)>, 0>" + ], + [ + 637, + "store_temp, core::option::Option::>)>>" + ], + [ + 638, + "enum_init, core::option::Option::>)>, 1>" + ], + [ + 639, + "struct_deconstruct" + ], + [ + 640, + "function_call" + ], + [ + 641, + "struct_construct" + ], + [ + 642, + "store_temp" + ], + [ + 643, + "store_temp" + ], + [ + 644, + "store_temp" + ], + [ + 645, + "function_call" + ], + [ + 646, + "enum_match,)>>" + ], + [ + 647, + "struct_deconstruct>>" + ], + [ + 648, + "snapshot_take>" + ], + [ + 649, + "drop>" + ], + [ + 650, + "dup" + ], + [ + 651, + "struct_deconstruct" + ], + [ + 652, + "store_temp>" + ], + [ + 653, + "function_call" + ], + [ + 654, + "enum_match,)>>" + ], + [ + 655, + "struct_deconstruct>>" + ], + [ + 656, + "enum_match>" + ], + [ + 657, + "store_temp" + ], + [ + 658, + "function_call" + ], + [ + 659, + "enum_match>" + ], + [ + 660, + "struct_deconstruct>" + ], + [ + 661, + "function_call>" + ], + [ + 662, + "enum_match,)>>" + ], + [ + 663, + "struct_deconstruct>>" + ], + [ + 664, + "enum_match>" + ], + [ + 665, + "secp256r1_get_xy_syscall" + ], + [ + 666, + "drop" + ], + [ + 667, + "struct_deconstruct" + ], + [ + 668, + "drop>" + ], + [ + 669, + "drop>" + ], + [ + 670, + "unwrap_non_zero" + ], + [ + 671, + "snapshot_take" + ], + [ + 672, + "dup" + ], + [ + 673, + "rename" + ], + [ + 674, + "const_as_immediate>" + ], + [ + 675, + "drop" + ], + [ + 676, + "const_as_immediate>" + ], + [ + 677, + "const_as_immediate>" + ], + [ + 678, + "enum_init, 1>" + ], + [ + 679, + "store_temp>" + ], + [ + 680, + "struct_construct>" + ], + [ + 681, + "enum_init, 0>" + ], + [ + 682, + "enum_init, 0>" + ], + [ + 683, + "store_temp>" + ], + [ + 684, + "enum_init, 1>" + ], + [ + 685, + "enum_match>" + ], + [ + 686, + "enum_init, 0>" + ], + [ + 687, + "store_temp>" + ], + [ + 688, + "enum_init, 1>" + ], + [ + 689, + "enum_init, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>)>, 1>" + ], + [ + 690, + "store_temp, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>)>>" + ], + [ + 691, + "enum_init, 0>" + ], + [ + 692, + "store_temp>" + ], + [ + 693, + "enum_init, 1>" + ], + [ + 694, + "enum_match>" + ], + [ + 695, + "function_call" + ], + [ + 696, + "enum_match>" + ], + [ + 697, + "struct_construct>" + ], + [ + 698, + "enum_init, 0>" + ], + [ + 699, + "struct_construct, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>>>" + ], + [ + 700, + "enum_init, core::option::Option::<(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)>)>, 0>" + ], + [ + 701, + "drop" + ], + [ + 702, + "enum_init, 1>" + ], + [ + 703, + "array_new" + ], + [ + 704, + "store_temp>" + ], + [ + 705, + "function_call, core::integer::u8Drop>>" + ], + [ + 706, + "enum_match, core::option::Option::>)>>" + ], + [ + 707, + "struct_deconstruct, core::option::Option::>>>" + ], + [ + 708, + "enum_match>>" + ], + [ + 709, + "snapshot_take>" + ], + [ + 710, + "drop>" + ], + [ + 711, + "struct_construct>" + ], + [ + 712, + "enum_init>, 0>" + ], + [ + 713, + "store_temp>>" + ], + [ + 714, + "enum_init>, 1>" + ], + [ + 715, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 716, + "store_temp, core::option::Option::)>>" + ], + [ + 717, + "enum_match>>" + ], + [ + 718, + "enum_init, 0>" + ], + [ + 719, + "store_temp>" + ], + [ + 720, + "enum_init, 1>" + ], + [ + 721, + "enum_match>" + ], + [ + 722, + "u256_is_zero" + ], + [ + 723, + "struct_construct" + ], + [ + 724, + "enum_init, 0>" + ], + [ + 725, + "struct_construct, core::option::Option::>>" + ], + [ + 726, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 727, + "enum_init, 1>" + ], + [ + 728, + "alloc_local>" + ], + [ + 729, + "drop>>" + ], + [ + 730, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 731, + "store_temp, core::option::Option::)>>" + ], + [ + 732, + "store_local>" + ], + [ + 733, + "struct_construct" + ], + [ + 734, + "enum_init, 0>" + ], + [ + 735, + "struct_construct, core::option::Option::>>" + ], + [ + 736, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 737, + "enum_init, 1>" + ], + [ + 738, + "alloc_local" + ], + [ + 739, + "array_new" + ], + [ + 740, + "array_append" + ], + [ + 741, + "snapshot_take>" + ], + [ + 742, + "drop>" + ], + [ + 743, + "struct_construct>" + ], + [ + 744, + "store_temp>" + ], + [ + 745, + "store_local" + ], + [ + 746, + "function_call" + ], + [ + 747, + "enum_match, controller_auth::signer::SignerStorageValue)>>" + ], + [ + 748, + "struct_deconstruct, controller_auth::signer::SignerStorageValue>>" + ], + [ + 749, + "drop>" + ], + [ + 750, + "const_as_immediate>" + ], + [ + 751, + "drop>" + ], + [ + 752, + "drop" + ], + [ + 753, + "drop>" + ], + [ + 754, + "const_as_immediate>" + ], + [ + 755, + "const_as_immediate>" + ], + [ + 756, + "const_as_immediate>" + ], + [ + 757, + "dup>" + ], + [ + 758, + "struct_deconstruct>" + ], + [ + 759, + "array_len" + ], + [ + 760, + "struct_construct" + ], + [ + 761, + "store_temp" + ], + [ + 762, + "function_call" + ], + [ + 763, + "enum_match, core::poseidon::HashState, ())>>" + ], + [ + 764, + "u128_to_felt252" + ], + [ + 765, + "struct_deconstruct, core::poseidon::HashState, Unit>>" + ], + [ + 766, + "struct_deconstruct" + ], + [ + 767, + "struct_deconstruct" + ], + [ + 768, + "rename" + ], + [ + 769, + "enum_match" + ], + [ + 770, + "const_as_immediate>" + ], + [ + 771, + "struct_deconstruct" + ], + [ + 772, + "const_as_immediate>" + ], + [ + 773, + "struct_deconstruct" + ], + [ + 774, + "const_as_immediate>" + ], + [ + 775, + "store_temp" + ], + [ + 776, + "function_call" + ], + [ + 777, + "enum_match" + ], + [ + 778, + "const_as_immediate>" + ], + [ + 779, + "struct_deconstruct" + ], + [ + 780, + "enum_match" + ], + [ + 781, + "enum_match" + ], + [ + 782, + "enum_match" + ], + [ + 783, + "const_as_immediate>" + ], + [ + 784, + "struct_deconstruct" + ], + [ + 785, + "rename" + ], + [ + 786, + "struct_construct, Array, Unit>>" + ], + [ + 787, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 788, + "store_temp, core::array::Array::, ())>>" + ], + [ + 789, + "struct_deconstruct" + ], + [ + 790, + "u32_overflowing_add" + ], + [ + 791, + "const_as_immediate>" + ], + [ + 792, + "const_as_immediate>" + ], + [ + 793, + "function_call" + ], + [ + 794, + "enum_match>" + ], + [ + 795, + "struct_deconstruct>" + ], + [ + 796, + "u128_is_zero" + ], + [ + 797, + "drop>" + ], + [ + 798, + "u128_safe_divmod" + ], + [ + 799, + "const_as_immediate>" + ], + [ + 800, + "felt252_mul" + ], + [ + 801, + "bytes31_try_from_felt252" + ], + [ + 802, + "array_append" + ], + [ + 803, + "rename>" + ], + [ + 804, + "enum_init, 1>" + ], + [ + 805, + "store_temp>" + ], + [ + 806, + "rename" + ], + [ + 807, + "struct_construct>" + ], + [ + 808, + "enum_init, 0>" + ], + [ + 809, + "const_as_immediate>" + ], + [ + 810, + "struct_deconstruct>" + ], + [ + 811, + "array_snapshot_pop_front" + ], + [ + 812, + "enum_init>, 0>" + ], + [ + 813, + "store_temp>>" + ], + [ + 814, + "store_temp>>" + ], + [ + 815, + "enum_init>, 1>" + ], + [ + 816, + "enum_match>>" + ], + [ + 817, + "unbox" + ], + [ + 818, + "rename" + ], + [ + 819, + "bytes31_to_felt252" + ], + [ + 820, + "drop>" + ], + [ + 821, + "rename" + ], + [ + 822, + "function_call" + ], + [ + 823, + "enum_match, core::array::Array::, ())>>" + ], + [ + 824, + "const_as_immediate>" + ], + [ + 825, + "u64_to_felt252" + ], + [ + 826, + "struct_deconstruct, Array, Unit>>" + ], + [ + 827, + "const_as_immediate>" + ], + [ + 828, + "dup" + ], + [ + 829, + "struct_deconstruct" + ], + [ + 830, + "dup" + ], + [ + 831, + "drop" + ], + [ + 832, + "enum_init, core::felt252)>, 1>" + ], + [ + 833, + "store_temp, core::felt252)>>" + ], + [ + 834, + "struct_construct, felt252>>" + ], + [ + 835, + "enum_init, core::felt252)>, 0>" + ], + [ + 836, + "drop>" + ], + [ + 837, + "dup" + ], + [ + 838, + "drop" + ], + [ + 839, + "const_as_immediate>" + ], + [ + 840, + "enum_init, ())>, 1>" + ], + [ + 841, + "store_temp, ())>>" + ], + [ + 842, + "struct_construct, Unit>>" + ], + [ + 843, + "enum_init, ())>, 0>" + ], + [ + 844, + "alloc_local" + ], + [ + 845, + "alloc_local" + ], + [ + 846, + "function_call" + ], + [ + 847, + "enum_match>" + ], + [ + 848, + "store_local" + ], + [ + 849, + "store_local" + ], + [ + 850, + "function_call, core::array::SpanFelt252Serde, core::array::SpanDrop::>>" + ], + [ + 851, + "enum_match, core::option::Option::>>)>>" + ], + [ + 852, + "struct_deconstruct, core::option::Option::>>>>" + ], + [ + 853, + "enum_match>>>" + ], + [ + 854, + "enum_init>>, 0>" + ], + [ + 855, + "store_temp>>>" + ], + [ + 856, + "enum_init>>, 1>" + ], + [ + 857, + "drop" + ], + [ + 858, + "enum_init, core::option::Option::)>, 1>" + ], + [ + 859, + "store_temp, core::option::Option::)>>" + ], + [ + 860, + "enum_match>>>" + ], + [ + 861, + "struct_construct" + ], + [ + 862, + "enum_init, 0>" + ], + [ + 863, + "struct_construct, core::option::Option::>>" + ], + [ + 864, + "enum_init, core::option::Option::)>, 0>" + ], + [ + 865, + "enum_init, 1>" + ], + [ + 866, + "drop>" + ], + [ + 867, + "drop>" + ], + [ + 868, + "alloc_local>>" + ], + [ + 869, + "alloc_local" + ], + [ + 870, + "struct_deconstruct" + ], + [ + 871, + "dup>>" + ], + [ + 872, + "array_len" + ], + [ + 873, + "drop>" + ], + [ + 874, + "drop>>>" + ], + [ + 875, + "const_as_immediate>" + ], + [ + 876, + "enum_init, 1>" + ], + [ + 877, + "struct_construct, core::result::Result::<(), core::felt252>>>" + ], + [ + 878, + "enum_init, core::result::Result::<(), core::felt252>)>, 0>" + ], + [ + 879, + "store_temp, core::result::Result::<(), core::felt252>)>>" + ], + [ + 880, + "dup" + ], + [ + 881, + "struct_deconstruct" + ], + [ + 882, + "const_as_immediate>" + ], + [ + 883, + "snapshot_take" + ], + [ + 884, + "store_temp" + ], + [ + 885, + "function_call" + ], + [ + 886, + "function_call" + ], + [ + 887, + "const_as_immediate>" + ], + [ + 888, + "enum_init, core::result::Result::<(), core::felt252>)>, 1>" + ], + [ + 889, + "store_local" + ], + [ + 890, + "snapshot_take" + ], + [ + 891, + "struct_deconstruct>" + ], + [ + 892, + "rename" + ], + [ + 893, + "drop" + ], + [ + 894, + "const_as_immediate>" + ], + [ + 895, + "store_local>>" + ], + [ + 896, + "function_call" + ], + [ + 897, + "enum_match)>>" + ], + [ + 898, + "struct_deconstruct>>" + ], + [ + 899, + "snapshot_take>" + ], + [ + 900, + "drop>" + ], + [ + 901, + "enum_match>" + ], + [ + 902, + "enum_init, 0>" + ], + [ + 903, + "const_as_immediate>" + ], + [ + 904, + "const_as_immediate>" + ], + [ + 905, + "const_as_immediate>" + ], + [ + 906, + "const_as_immediate>" + ], + [ + 907, + "const_as_immediate>" + ], + [ + 908, + "ec_point_from_x_nz" + ], + [ + 909, + "store_temp>" + ], + [ + 910, + "const_as_immediate>" + ], + [ + 911, + "const_as_immediate>" + ], + [ + 912, + "ec_point_try_new_nz" + ], + [ + 913, + "ec_state_init" + ], + [ + 914, + "dup" + ], + [ + 915, + "ec_state_add_mul" + ], + [ + 916, + "store_temp" + ], + [ + 917, + "ec_state_try_finalize_nz" + ], + [ + 918, + "ec_point_unwrap" + ], + [ + 919, + "dup>" + ], + [ + 920, + "ec_state_add" + ], + [ + 921, + "drop" + ], + [ + 922, + "drop>" + ], + [ + 923, + "unwrap_non_zero" + ], + [ + 924, + "ec_neg" + ], + [ + 925, + "store_temp" + ], + [ + 926, + "ec_point_is_zero" + ], + [ + 927, + "dup" + ], + [ + 928, + "struct_deconstruct" + ], + [ + 929, + "const_as_immediate, Const>>" + ], + [ + 930, + "const_as_immediate, Const>>" + ], + [ + 931, + "drop" + ], + [ + 932, + "function_call>" + ], + [ + 933, + "enum_match,)>>" + ], + [ + 934, + "struct_deconstruct>>" + ], + [ + 935, + "enum_match>" + ], + [ + 936, + "store_temp" + ], + [ + 937, + "function_call>" + ], + [ + 938, + "enum_match>" + ], + [ + 939, + "struct_deconstruct>" + ], + [ + 940, + "snapshot_take" + ], + [ + 941, + "struct_construct>>" + ], + [ + 942, + "enum_init,)>, 0>" + ], + [ + 943, + "store_temp,)>>" + ], + [ + 944, + "const_as_immediate>" + ], + [ + 945, + "enum_init,)>, 1>" + ], + [ + 946, + "const_as_immediate>" + ], + [ + 947, + "function_call" + ], + [ + 948, + "const_as_immediate>" + ], + [ + 949, + "store_temp" + ], + [ + 950, + "array_append" + ], + [ + 951, + "const_as_immediate>" + ], + [ + 952, + "function_call" + ], + [ + 953, + "enum_match,)>>" + ], + [ + 954, + "struct_deconstruct>>" + ], + [ + 955, + "function_call" + ], + [ + 956, + "enum_match)>>" + ], + [ + 957, + "struct_deconstruct>>" + ], + [ + 958, + "function_call" + ], + [ + 959, + "enum_match,)>>" + ], + [ + 960, + "struct_deconstruct>>" + ], + [ + 961, + "enum_match>" + ], + [ + 962, + "snapshot_take" + ], + [ + 963, + "drop" + ], + [ + 964, + "struct_snapshot_deconstruct" + ], + [ + 965, + "drop>>" + ], + [ + 966, + "rename" + ], + [ + 967, + "upcast" + ], + [ + 968, + "const_as_immediate>" + ], + [ + 969, + "const_as_immediate>" + ], + [ + 970, + "u8_overflowing_add" + ], + [ + 971, + "bitwise" + ], + [ + 972, + "const_as_immediate>" + ], + [ + 973, + "enum_init,)>, 1>" + ], + [ + 974, + "store_temp,)>>" + ], + [ + 975, + "enum_init, 0>" + ], + [ + 976, + "struct_construct>>" + ], + [ + 977, + "enum_init,)>, 0>" + ], + [ + 978, + "drop" + ], + [ + 979, + "const_as_immediate>" + ], + [ + 980, + "enum_init" + ], + [ + 981, + "enum_init, 1>" + ], + [ + 982, + "const_as_immediate>" + ], + [ + 983, + "alloc_local>>" + ], + [ + 984, + "function_call" + ], + [ + 985, + "enum_match, core::array::Array::, ())>>" + ], + [ + 986, + "struct_deconstruct, Array, Unit>>" + ], + [ + 987, + "function_call" + ], + [ + 988, + "store_local>>" + ], + [ + 989, + "function_call::append_all>" + ], + [ + 990, + "enum_match, core::array::Array::, ())>>" + ], + [ + 991, + "struct_deconstruct, Array, Unit>>" + ], + [ + 992, + "dup>>" + ], + [ + 993, + "const_as_immediate>" + ], + [ + 994, + "store_temp>>" + ], + [ + 995, + "function_call" + ], + [ + 996, + "enum_match>" + ], + [ + 997, + "struct_deconstruct>" + ], + [ + 998, + "struct_construct>" + ], + [ + 999, + "enum_init, 0>" + ], + [ + 1000, + "store_temp>" + ], + [ + 1001, + "const_as_immediate>" + ], + [ + 1002, + "enum_init, 1>" + ], + [ + 1003, + "drop>>" + ], + [ + 1004, + "drop>>>" + ], + [ + 1005, + "secp256r1_get_point_from_x_syscall" + ], + [ + 1006, + "store_temp>" + ], + [ + 1007, + "const_as_immediate, Const>>" + ], + [ + 1008, + "const_as_immediate, Const>>" + ], + [ + 1009, + "secp256r1_new_syscall" + ], + [ + 1010, + "const_as_immediate, Const>>" + ], + [ + 1011, + "drop" + ], + [ + 1012, + "enum_init,)>, 1>" + ], + [ + 1013, + "store_temp,)>>" + ], + [ + 1014, + "dup>" + ], + [ + 1015, + "u256_guarantee_inv_mod_n" + ], + [ + 1016, + "u128_mul_guarantee_verify" + ], + [ + 1017, + "store_temp>" + ], + [ + 1018, + "function_call" + ], + [ + 1019, + "const_as_immediate>" + ], + [ + 1020, + "secp256r1_mul_syscall" + ], + [ + 1021, + "store_temp" + ], + [ + 1022, + "secp256r1_add_syscall" + ], + [ + 1023, + "enum_init, 0>" + ], + [ + 1024, + "struct_construct>>" + ], + [ + 1025, + "enum_init,)>, 0>" + ], + [ + 1026, + "const_as_immediate>" + ], + [ + 1027, + "enum_init, 1>" + ], + [ + 1028, + "struct_construct" + ], + [ + 1029, + "enum_init, 0>" + ], + [ + 1030, + "store_temp>" + ], + [ + 1031, + "enum_init, 1>" + ], + [ + 1032, + "enum_init>, 0>" + ], + [ + 1033, + "struct_construct, core::option::Option::>>>" + ], + [ + 1034, + "enum_init, core::option::Option::>)>, 0>" + ], + [ + 1035, + "store_temp, core::option::Option::>)>>" + ], + [ + 1036, + "u8_try_from_felt252" + ], + [ + 1037, + "enum_init>, 1>" + ], + [ + 1038, + "enum_init, core::option::Option::>)>, 1>" + ], + [ + 1039, + "struct_deconstruct>" + ], + [ + 1040, + "array_snapshot_pop_front" + ], + [ + 1041, + "enum_init>, 0>" + ], + [ + 1042, + "store_temp>>" + ], + [ + 1043, + "store_temp>>" + ], + [ + 1044, + "enum_init>, 1>" + ], + [ + 1045, + "enum_match>>" + ], + [ + 1046, + "unbox" + ], + [ + 1047, + "rename" + ], + [ + 1048, + "enum_init, controller_auth::signer::SignerStorageValue)>, 1>" + ], + [ + 1049, + "store_temp, controller_auth::signer::SignerStorageValue)>>" + ], + [ + 1050, + "struct_construct, controller_auth::signer::SignerStorageValue>>" + ], + [ + 1051, + "enum_init, controller_auth::signer::SignerStorageValue)>, 0>" + ], + [ + 1052, + "drop>>" + ], + [ + 1053, + "const_as_immediate>" + ], + [ + 1054, + "array_snapshot_pop_front" + ], + [ + 1055, + "enum_init>, 0>" + ], + [ + 1056, + "store_temp>>" + ], + [ + 1057, + "enum_init>, 1>" + ], + [ + 1058, + "enum_match>>" + ], + [ + 1059, + "unbox" + ], + [ + 1060, + "u8_to_felt252" + ], + [ + 1061, + "struct_construct, core::poseidon::HashState, Unit>>" + ], + [ + 1062, + "enum_init, core::poseidon::HashState, ())>, 0>" + ], + [ + 1063, + "store_temp, core::poseidon::HashState, ())>>" + ], + [ + 1064, + "drop" + ], + [ + 1065, + "enum_init, core::poseidon::HashState, ())>, 1>" + ], + [ + 1066, + "dup" + ], + [ + 1067, + "struct_deconstruct" + ], + [ + 1068, + "rename>" + ], + [ + 1069, + "store_temp" + ], + [ + 1070, + "function_call" + ], + [ + 1071, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1072, + "downcast>" + ], + [ + 1073, + "enum_from_bounded_int>" + ], + [ + 1074, + "store_temp>" + ], + [ + 1075, + "enum_match>" + ], + [ + 1076, + "const_as_immediate>" + ], + [ + 1077, + "const_as_immediate>" + ], + [ + 1078, + "const_as_immediate>" + ], + [ + 1079, + "const_as_immediate>" + ], + [ + 1080, + "const_as_immediate>" + ], + [ + 1081, + "const_as_immediate>" + ], + [ + 1082, + "const_as_immediate>" + ], + [ + 1083, + "const_as_immediate>" + ], + [ + 1084, + "const_as_immediate>" + ], + [ + 1085, + "const_as_immediate>" + ], + [ + 1086, + "const_as_immediate>" + ], + [ + 1087, + "const_as_immediate>" + ], + [ + 1088, + "const_as_immediate>" + ], + [ + 1089, + "const_as_immediate>" + ], + [ + 1090, + "const_as_immediate>" + ], + [ + 1091, + "struct_construct>" + ], + [ + 1092, + "enum_init, 0>" + ], + [ + 1093, + "store_temp>" + ], + [ + 1094, + "const_as_immediate>" + ], + [ + 1095, + "enum_init, 1>" + ], + [ + 1096, + "alloc_local>>" + ], + [ + 1097, + "store_local>>" + ], + [ + 1098, + "function_call" + ], + [ + 1099, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1100, + "store_temp, core::array::Array::, ())>>" + ], + [ + 1101, + "struct_construct, Array, Unit>>" + ], + [ + 1102, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 1103, + "drop>>>" + ], + [ + 1104, + "struct_construct" + ], + [ + 1105, + "enum_init, 0>" + ], + [ + 1106, + "store_temp>" + ], + [ + 1107, + "enum_init, 1>" + ], + [ + 1108, + "enum_init>>, 0>" + ], + [ + 1109, + "struct_construct, core::option::Option::>>>>" + ], + [ + 1110, + "enum_init, core::option::Option::>>)>, 0>" + ], + [ + 1111, + "store_temp, core::option::Option::>>)>>" + ], + [ + 1112, + "enum_init>>, 1>" + ], + [ + 1113, + "enum_init, core::option::Option::>>)>, 1>" + ], + [ + 1114, + "const_as_immediate, Const, Const, Const>>" + ], + [ + 1115, + "rename" + ], + [ + 1116, + "function_call>" + ], + [ + 1117, + "const_as_immediate, Const, Const, Const>>" + ], + [ + 1118, + "const_as_immediate>" + ], + [ + 1119, + "const_as_immediate>" + ], + [ + 1120, + "const_as_immediate>" + ], + [ + 1121, + "enum_init, 0>" + ], + [ + 1122, + "struct_construct>>" + ], + [ + 1123, + "enum_init)>, 0>" + ], + [ + 1124, + "store_temp)>>" + ], + [ + 1125, + "array_get" + ], + [ + 1126, + "store_temp>" + ], + [ + 1127, + "const_as_immediate>" + ], + [ + 1128, + "array_get>" + ], + [ + 1129, + "store_temp>>" + ], + [ + 1130, + "struct_construct" + ], + [ + 1131, + "function_call" + ], + [ + 1132, + "enum_match, alexandria_merkle_tree::merkle_tree::Hasher, core::felt252, ())>>" + ], + [ + 1133, + "struct_deconstruct, alexandria_merkle_tree::merkle_tree::Hasher, felt252, Unit>>" + ], + [ + 1134, + "drop" + ], + [ + 1135, + "snapshot_take" + ], + [ + 1136, + "enum_init)>, 1>" + ], + [ + 1137, + "enum_init, 1>" + ], + [ + 1138, + "drop, felt252>>" + ], + [ + 1139, + "secp256k1_get_point_from_x_syscall" + ], + [ + 1140, + "store_temp>" + ], + [ + 1141, + "const_as_immediate, Const>>" + ], + [ + 1142, + "const_as_immediate, Const>>" + ], + [ + 1143, + "secp256k1_new_syscall" + ], + [ + 1144, + "drop" + ], + [ + 1145, + "enum_init,)>, 1>" + ], + [ + 1146, + "store_temp,)>>" + ], + [ + 1147, + "secp256k1_mul_syscall" + ], + [ + 1148, + "secp256k1_add_syscall" + ], + [ + 1149, + "enum_init, 0>" + ], + [ + 1150, + "struct_construct>>" + ], + [ + 1151, + "enum_init,)>, 0>" + ], + [ + 1152, + "enum_init, 1>" + ], + [ + 1153, + "secp256k1_get_xy_syscall" + ], + [ + 1154, + "array_new" + ], + [ + 1155, + "array_append" + ], + [ + 1156, + "array_new" + ], + [ + 1157, + "snapshot_take>" + ], + [ + 1158, + "drop>" + ], + [ + 1159, + "struct_construct>" + ], + [ + 1160, + "store_temp>" + ], + [ + 1161, + "store_temp>" + ], + [ + 1162, + "function_call" + ], + [ + 1163, + "enum_match, core::array::Array::, ())>>" + ], + [ + 1164, + "struct_deconstruct, Array, Unit>>" + ], + [ + 1165, + "drop>" + ], + [ + 1166, + "const_as_immediate>" + ], + [ + 1167, + "function_call" + ], + [ + 1168, + "enum_match, ())>>" + ], + [ + 1169, + "struct_deconstruct, Unit>>" + ], + [ + 1170, + "snapshot_take>" + ], + [ + 1171, + "drop>" + ], + [ + 1172, + "struct_construct>" + ], + [ + 1173, + "keccak_syscall" + ], + [ + 1174, + "u128_byte_reverse" + ], + [ + 1175, + "const_as_immediate>" + ], + [ + 1176, + "enum_init, 1>" + ], + [ + 1177, + "store_temp>" + ], + [ + 1178, + "struct_construct>" + ], + [ + 1179, + "enum_init, 0>" + ], + [ + 1180, + "const_as_immediate>" + ], + [ + 1181, + "const_as_immediate>" + ], + [ + 1182, + "const_as_immediate>" + ], + [ + 1183, + "const_as_immediate>" + ], + [ + 1184, + "const_as_immediate>" + ], + [ + 1185, + "const_as_immediate>" + ], + [ + 1186, + "const_as_immediate>" + ], + [ + 1187, + "const_as_immediate>" + ], + [ + 1188, + "const_as_immediate>" + ], + [ + 1189, + "const_as_immediate>" + ], + [ + 1190, + "const_as_immediate>" + ], + [ + 1191, + "const_as_immediate>" + ], + [ + 1192, + "const_as_immediate>" + ], + [ + 1193, + "const_as_immediate>" + ], + [ + 1194, + "const_as_immediate>" + ], + [ + 1195, + "const_as_immediate>" + ], + [ + 1196, + "const_as_immediate>" + ], + [ + 1197, + "const_as_immediate>" + ], + [ + 1198, + "const_as_immediate>" + ], + [ + 1199, + "const_as_immediate>" + ], + [ + 1200, + "const_as_immediate>" + ], + [ + 1201, + "const_as_immediate>" + ], + [ + 1202, + "const_as_immediate>" + ], + [ + 1203, + "const_as_immediate>" + ], + [ + 1204, + "const_as_immediate>" + ], + [ + 1205, + "const_as_immediate>" + ], + [ + 1206, + "const_as_immediate>" + ], + [ + 1207, + "const_as_immediate>" + ], + [ + 1208, + "const_as_immediate>" + ], + [ + 1209, + "const_as_immediate>" + ], + [ + 1210, + "const_as_immediate>" + ], + [ + 1211, + "const_as_immediate>" + ], + [ + 1212, + "const_as_immediate>" + ], + [ + 1213, + "const_as_immediate>" + ], + [ + 1214, + "const_as_immediate>" + ], + [ + 1215, + "const_as_immediate>" + ], + [ + 1216, + "const_as_immediate>" + ], + [ + 1217, + "const_as_immediate>" + ], + [ + 1218, + "const_as_immediate>" + ], + [ + 1219, + "const_as_immediate>" + ], + [ + 1220, + "const_as_immediate>" + ], + [ + 1221, + "const_as_immediate>" + ], + [ + 1222, + "const_as_immediate>" + ], + [ + 1223, + "const_as_immediate>" + ], + [ + 1224, + "const_as_immediate>" + ], + [ + 1225, + "const_as_immediate>" + ], + [ + 1226, + "const_as_immediate>" + ], + [ + 1227, + "const_as_immediate>" + ], + [ + 1228, + "const_as_immediate>" + ], + [ + 1229, + "const_as_immediate>" + ], + [ + 1230, + "const_as_immediate>" + ], + [ + 1231, + "const_as_immediate>" + ], + [ + 1232, + "const_as_immediate>" + ], + [ + 1233, + "const_as_immediate>" + ], + [ + 1234, + "const_as_immediate>" + ], + [ + 1235, + "const_as_immediate>" + ], + [ + 1236, + "const_as_immediate>" + ], + [ + 1237, + "const_as_immediate>" + ], + [ + 1238, + "const_as_immediate>" + ], + [ + 1239, + "const_as_immediate>" + ], + [ + 1240, + "const_as_immediate>" + ], + [ + 1241, + "const_as_immediate>" + ], + [ + 1242, + "const_as_immediate, Const>>" + ], + [ + 1243, + "enum_init,)>, 1>" + ], + [ + 1244, + "store_temp,)>>" + ], + [ + 1245, + "u256_safe_divmod" + ], + [ + 1246, + "downcast" + ], + [ + 1247, + "const_as_immediate>" + ], + [ + 1248, + "u32_is_zero" + ], + [ + 1249, + "u32_safe_divmod" + ], + [ + 1250, + "const_as_immediate>" + ], + [ + 1251, + "u32_bitwise" + ], + [ + 1252, + "u32_wide_mul" + ], + [ + 1253, + "downcast" + ], + [ + 1254, + "snapshot_take>" + ], + [ + 1255, + "rename>>" + ], + [ + 1256, + "array_get" + ], + [ + 1257, + "store_temp>" + ], + [ + 1258, + "const_as_immediate>" + ], + [ + 1259, + "function_call" + ], + [ + 1260, + "enum_match, core::integer::u256, ())>>" + ], + [ + 1261, + "struct_deconstruct, core::integer::u256, Unit>>" + ], + [ + 1262, + "function_call" + ], + [ + 1263, + "enum_match, ())>>" + ], + [ + 1264, + "struct_deconstruct, Unit>>" + ], + [ + 1265, + "function_call" + ], + [ + 1266, + "const_as_immediate>" + ], + [ + 1267, + "struct_construct>>" + ], + [ + 1268, + "enum_init,)>, 0>" + ], + [ + 1269, + "struct_construct>>" + ], + [ + 1270, + "enum_init)>, 0>" + ], + [ + 1271, + "store_temp)>>" + ], + [ + 1272, + "u8_eq" + ], + [ + 1273, + "enum_init" + ], + [ + 1274, + "enum_init)>, 1>" + ], + [ + 1275, + "alloc_local" + ], + [ + 1276, + "alloc_local, u32, Unit>>" + ], + [ + 1277, + "alloc_local" + ], + [ + 1278, + "const_as_immediate>" + ], + [ + 1279, + "function_call" + ], + [ + 1280, + "enum_match, core::integer::u32, ())>>" + ], + [ + 1281, + "store_local, u32, Unit>>" + ], + [ + 1282, + "const_as_immediate>" + ], + [ + 1283, + "store_local" + ], + [ + 1284, + "upcast" + ], + [ + 1285, + "const_as_immediate>" + ], + [ + 1286, + "const_as_immediate>" + ], + [ + 1287, + "function_call, core::integer::u32Drop, core::integer::u32Copy>>" + ], + [ + 1288, + "enum_match>" + ], + [ + 1289, + "const_as_immediate>" + ], + [ + 1290, + "upcast" + ], + [ + 1291, + "struct_deconstruct>" + ], + [ + 1292, + "u64_bitwise" + ], + [ + 1293, + "const_as_immediate>" + ], + [ + 1294, + "store_local" + ], + [ + 1295, + "const_as_immediate>" + ], + [ + 1296, + "const_as_immediate>" + ], + [ + 1297, + "struct_deconstruct, u32, Unit>>" + ], + [ + 1298, + "struct_construct" + ], + [ + 1299, + "enum_init, 0>" + ], + [ + 1300, + "struct_construct>>" + ], + [ + 1301, + "enum_init,)>, 0>" + ], + [ + 1302, + "store_temp,)>>" + ], + [ + 1303, + "drop, u32, Unit>>" + ], + [ + 1304, + "enum_init,)>, 1>" + ], + [ + 1305, + "drop>" + ], + [ + 1306, + "drop>" + ], + [ + 1307, + "drop, u32, Unit>>>" + ], + [ + 1308, + "enum_init, 1>" + ], + [ + 1309, + "struct_construct, Array, Unit>>" + ], + [ + 1310, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 1311, + "store_temp, core::array::Array::, ())>>" + ], + [ + 1312, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1313, + "alloc_local" + ], + [ + 1314, + "store_local" + ], + [ + 1315, + "const_as_immediate>" + ], + [ + 1316, + "function_call" + ], + [ + 1317, + "const_as_immediate>" + ], + [ + 1318, + "const_as_immediate>" + ], + [ + 1319, + "u64_is_zero" + ], + [ + 1320, + "drop, Unit>>" + ], + [ + 1321, + "u64_safe_divmod" + ], + [ + 1322, + "downcast" + ], + [ + 1323, + "const_as_immediate>" + ], + [ + 1324, + "const_as_immediate>" + ], + [ + 1325, + "const_as_immediate>" + ], + [ + 1326, + "const_as_immediate>" + ], + [ + 1327, + "const_as_immediate>" + ], + [ + 1328, + "const_as_immediate>" + ], + [ + 1329, + "const_as_immediate>" + ], + [ + 1330, + "const_as_immediate>" + ], + [ + 1331, + "const_as_immediate>" + ], + [ + 1332, + "const_as_immediate>" + ], + [ + 1333, + "const_as_immediate>" + ], + [ + 1334, + "const_as_immediate>" + ], + [ + 1335, + "const_as_immediate>" + ], + [ + 1336, + "array_new" + ], + [ + 1337, + "store_temp>" + ], + [ + 1338, + "function_call" + ], + [ + 1339, + "enum_match, core::array::Array::, ())>>" + ], + [ + 1340, + "const_as_immediate>" + ], + [ + 1341, + "array_append" + ], + [ + 1342, + "const_as_immediate>" + ], + [ + 1343, + "const_as_immediate>" + ], + [ + 1344, + "const_as_immediate>" + ], + [ + 1345, + "const_as_immediate>" + ], + [ + 1346, + "const_as_immediate>" + ], + [ + 1347, + "const_as_immediate>" + ], + [ + 1348, + "const_as_immediate>" + ], + [ + 1349, + "function_call" + ], + [ + 1350, + "struct_deconstruct, Array, Unit>>" + ], + [ + 1351, + "snapshot_take>" + ], + [ + 1352, + "drop>" + ], + [ + 1353, + "struct_construct>" + ], + [ + 1354, + "store_temp>" + ], + [ + 1355, + "function_call" + ], + [ + 1356, + "enum_match,)>>" + ], + [ + 1357, + "struct_deconstruct>>" + ], + [ + 1358, + "function_call" + ], + [ + 1359, + "enum_match, core::array::Array::, ())>>" + ], + [ + 1360, + "struct_deconstruct, Array, Unit>>" + ], + [ + 1361, + "drop>" + ], + [ + 1362, + "array_pop_front" + ], + [ + 1363, + "enum_init, 0>" + ], + [ + 1364, + "store_temp>" + ], + [ + 1365, + "enum_init, 1>" + ], + [ + 1366, + "enum_match>" + ], + [ + 1367, + "struct_construct, Array, Unit>>" + ], + [ + 1368, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 1369, + "store_temp, core::array::Array::, ())>>" + ], + [ + 1370, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1371, + "upcast" + ], + [ + 1372, + "const_as_immediate, Const>>" + ], + [ + 1373, + "function_call>" + ], + [ + 1374, + "function_call" + ], + [ + 1375, + "struct_deconstruct>" + ], + [ + 1376, + "enum_init, 1>" + ], + [ + 1377, + "store_temp>" + ], + [ + 1378, + "struct_construct>" + ], + [ + 1379, + "enum_init, 0>" + ], + [ + 1380, + "u128_guarantee_mul" + ], + [ + 1381, + "u128_overflowing_add" + ], + [ + 1382, + "struct_construct" + ], + [ + 1383, + "store_temp" + ], + [ + 1384, + "u512_safe_divmod_by_u256" + ], + [ + 1385, + "drop" + ], + [ + 1386, + "dup" + ], + [ + 1387, + "rename>" + ], + [ + 1388, + "function_call, core::integer::u8Drop>>" + ], + [ + 1389, + "rename>" + ], + [ + 1390, + "const_as_immediate>" + ], + [ + 1391, + "struct_construct, alexandria_merkle_tree::merkle_tree::Hasher, felt252, Unit>>" + ], + [ + 1392, + "enum_init, alexandria_merkle_tree::merkle_tree::Hasher, core::felt252, ())>, 0>" + ], + [ + 1393, + "store_temp, alexandria_merkle_tree::merkle_tree::Hasher, core::felt252, ())>>" + ], + [ + 1394, + "enum_init, alexandria_merkle_tree::merkle_tree::Hasher, core::felt252, ())>, 1>" + ], + [ + 1395, + "struct_deconstruct>" + ], + [ + 1396, + "array_snapshot_pop_front" + ], + [ + 1397, + "enum_init>, 0>" + ], + [ + 1398, + "store_temp>>" + ], + [ + 1399, + "store_temp>>" + ], + [ + 1400, + "enum_init>, 1>" + ], + [ + 1401, + "enum_match>>" + ], + [ + 1402, + "unbox" + ], + [ + 1403, + "rename" + ], + [ + 1404, + "function_call" + ], + [ + 1405, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1406, + "store_temp, core::array::Array::, ())>>" + ], + [ + 1407, + "struct_construct, Array, Unit>>" + ], + [ + 1408, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 1409, + "const_as_immediate>" + ], + [ + 1410, + "enum_init, ())>, 1>" + ], + [ + 1411, + "store_temp, ())>>" + ], + [ + 1412, + "array_len" + ], + [ + 1413, + "const_as_immediate>" + ], + [ + 1414, + "const_as_immediate>" + ], + [ + 1415, + "const_as_immediate>" + ], + [ + 1416, + "const_as_immediate>" + ], + [ + 1417, + "rename" + ], + [ + 1418, + "u64_overflowing_add" + ], + [ + 1419, + "const_as_immediate>" + ], + [ + 1420, + "const_as_immediate>" + ], + [ + 1421, + "array_append" + ], + [ + 1422, + "function_call" + ], + [ + 1423, + "const_as_immediate>" + ], + [ + 1424, + "struct_construct, Unit>>" + ], + [ + 1425, + "enum_init, ())>, 0>" + ], + [ + 1426, + "const_as_immediate, Const>>" + ], + [ + 1427, + "enum_init, core::integer::u256, ())>, 1>" + ], + [ + 1428, + "store_temp, core::integer::u256, ())>>" + ], + [ + 1429, + "const_as_immediate>" + ], + [ + 1430, + "const_as_immediate>" + ], + [ + 1431, + "const_as_immediate>" + ], + [ + 1432, + "struct_construct, core::integer::u256, Unit>>" + ], + [ + 1433, + "enum_init, core::integer::u256, ())>, 0>" + ], + [ + 1434, + "const_as_immediate>" + ], + [ + 1435, + "struct_construct, Unit>>" + ], + [ + 1436, + "enum_init, ())>, 0>" + ], + [ + 1437, + "store_temp, ())>>" + ], + [ + 1438, + "enum_init, ())>, 1>" + ], + [ + 1439, + "array_snapshot_pop_back" + ], + [ + 1440, + "enum_init, core::integer::u32, ())>, 1>" + ], + [ + 1441, + "store_temp, core::integer::u32, ())>>" + ], + [ + 1442, + "struct_construct, u32, Unit>>" + ], + [ + 1443, + "enum_init, core::integer::u32, ())>, 0>" + ], + [ + 1444, + "const_as_immediate>" + ], + [ + 1445, + "const_as_immediate>" + ], + [ + 1446, + "enum_init, 1>" + ], + [ + 1447, + "store_temp>" + ], + [ + 1448, + "struct_construct>" + ], + [ + 1449, + "enum_init, 0>" + ], + [ + 1450, + "const_as_immediate>" + ], + [ + 1451, + "const_as_immediate>" + ], + [ + 1452, + "const_as_immediate>" + ], + [ + 1453, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1454, + "store_temp, core::array::Array::, ())>>" + ], + [ + 1455, + "struct_construct, Array, Unit>>" + ], + [ + 1456, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 1457, + "const_as_immediate>" + ], + [ + 1458, + "const_as_immediate>" + ], + [ + 1459, + "const_as_immediate>" + ], + [ + 1460, + "const_as_immediate>" + ], + [ + 1461, + "const_as_immediate>" + ], + [ + 1462, + "const_as_immediate>" + ], + [ + 1463, + "const_as_immediate>" + ], + [ + 1464, + "const_as_immediate>" + ], + [ + 1465, + "const_as_immediate>" + ], + [ + 1466, + "const_as_immediate>" + ], + [ + 1467, + "const_as_immediate>" + ], + [ + 1468, + "const_as_immediate>" + ], + [ + 1469, + "const_as_immediate>" + ], + [ + 1470, + "const_as_immediate>" + ], + [ + 1471, + "const_as_immediate>" + ], + [ + 1472, + "const_as_immediate>" + ], + [ + 1473, + "const_as_immediate>" + ], + [ + 1474, + "const_as_immediate>" + ], + [ + 1475, + "const_as_immediate>" + ], + [ + 1476, + "const_as_immediate>" + ], + [ + 1477, + "const_as_immediate>" + ], + [ + 1478, + "const_as_immediate>" + ], + [ + 1479, + "const_as_immediate>" + ], + [ + 1480, + "const_as_immediate>" + ], + [ + 1481, + "const_as_immediate>" + ], + [ + 1482, + "const_as_immediate>" + ], + [ + 1483, + "const_as_immediate>" + ], + [ + 1484, + "const_as_immediate>" + ], + [ + 1485, + "const_as_immediate>" + ], + [ + 1486, + "const_as_immediate>" + ], + [ + 1487, + "const_as_immediate>" + ], + [ + 1488, + "const_as_immediate>" + ], + [ + 1489, + "const_as_immediate>" + ], + [ + 1490, + "const_as_immediate>" + ], + [ + 1491, + "const_as_immediate>" + ], + [ + 1492, + "const_as_immediate>" + ], + [ + 1493, + "const_as_immediate>" + ], + [ + 1494, + "const_as_immediate>" + ], + [ + 1495, + "const_as_immediate>" + ], + [ + 1496, + "const_as_immediate>" + ], + [ + 1497, + "const_as_immediate>" + ], + [ + 1498, + "const_as_immediate>" + ], + [ + 1499, + "const_as_immediate>" + ], + [ + 1500, + "const_as_immediate>" + ], + [ + 1501, + "const_as_immediate>" + ], + [ + 1502, + "const_as_immediate>" + ], + [ + 1503, + "const_as_immediate>" + ], + [ + 1504, + "const_as_immediate>" + ], + [ + 1505, + "const_as_immediate>" + ], + [ + 1506, + "const_as_immediate>" + ], + [ + 1507, + "const_as_immediate>" + ], + [ + 1508, + "const_as_immediate>" + ], + [ + 1509, + "const_as_immediate>" + ], + [ + 1510, + "const_as_immediate>" + ], + [ + 1511, + "const_as_immediate>" + ], + [ + 1512, + "const_as_immediate>" + ], + [ + 1513, + "const_as_immediate>" + ], + [ + 1514, + "const_as_immediate>" + ], + [ + 1515, + "const_as_immediate>" + ], + [ + 1516, + "const_as_immediate>" + ], + [ + 1517, + "const_as_immediate>" + ], + [ + 1518, + "const_as_immediate>" + ], + [ + 1519, + "const_as_immediate>" + ], + [ + 1520, + "const_as_immediate>" + ], + [ + 1521, + "dup>" + ], + [ + 1522, + "struct_deconstruct>" + ], + [ + 1523, + "array_len" + ], + [ + 1524, + "struct_construct>>" + ], + [ + 1525, + "enum_init,)>, 0>" + ], + [ + 1526, + "store_temp,)>>" + ], + [ + 1527, + "function_call" + ], + [ + 1528, + "enum_match, core::integer::u32, ())>>" + ], + [ + 1529, + "struct_deconstruct, u32, Unit>>" + ], + [ + 1530, + "function_call" + ], + [ + 1531, + "function_call" + ], + [ + 1532, + "snapshot_take>" + ], + [ + 1533, + "rename>>" + ], + [ + 1534, + "array_get" + ], + [ + 1535, + "store_temp>" + ], + [ + 1536, + "unbox" + ], + [ + 1537, + "enum_init,)>, 1>" + ], + [ + 1538, + "drop>>" + ], + [ + 1539, + "array_snapshot_pop_front" + ], + [ + 1540, + "enum_init>, 0>" + ], + [ + 1541, + "store_temp>>" + ], + [ + 1542, + "store_temp>>" + ], + [ + 1543, + "enum_init>, 1>" + ], + [ + 1544, + "enum_match>>" + ], + [ + 1545, + "const_as_immediate>" + ], + [ + 1546, + "enum_init, core::array::Array::, ())>, 1>" + ], + [ + 1547, + "store_temp, core::array::Array::, ())>>" + ], + [ + 1548, + "downcast" + ], + [ + 1549, + "const_as_immediate>" + ], + [ + 1550, + "const_as_immediate>" + ], + [ + 1551, + "const_as_immediate>" + ], + [ + 1552, + "struct_construct, Array, Unit>>" + ], + [ + 1553, + "enum_init, core::array::Array::, ())>, 0>" + ], + [ + 1554, + "const_as_immediate>" + ], + [ + 1555, + "rename" + ], + [ + 1556, + "struct_construct>" + ], + [ + 1557, + "store_temp>" + ], + [ + 1558, + "downcast" + ], + [ + 1559, + "struct_construct, u32, Unit>>" + ], + [ + 1560, + "enum_init, core::integer::u32, ())>, 0>" + ], + [ + 1561, + "store_temp, core::integer::u32, ())>>" + ], + [ + 1562, + "enum_init, core::integer::u32, ())>, 1>" + ], + [ + 1563, + "const_as_immediate>" + ], + [ + 1564, + "function_call" + ], + [ + 1565, + "function_call" + ], + [ + 1566, + "drop>>" + ], + [ + 1567, + "drop>" + ], + [ + 1568, + "function_call" + ], + [ + 1569, + "function_call" + ], + [ + 1570, + "const_as_immediate>" + ], + [ + 1571, + "const_as_immediate>" + ], + [ + 1572, + "const_as_immediate>" + ], + [ + 1573, + "const_as_immediate>" + ], + [ + 1574, + "const_as_immediate>" + ], + [ + 1575, + "const_as_immediate>" + ], + [ + 1576, + "const_as_immediate>" + ], + [ + 1577, + "const_as_immediate>" + ], + [ + 1578, + "const_as_immediate>" + ], + [ + 1579, + "const_as_immediate>" + ], + [ + 1580, + "const_as_immediate>" + ], + [ + 1581, + "const_as_immediate>" + ], + [ + 1582, + "const_as_immediate>" + ], + [ + 1583, + "const_as_immediate>" + ], + [ + 1584, + "const_as_immediate>" + ], + [ + 1585, + "const_as_immediate>" + ], + [ + 1586, + "const_as_immediate>" + ], + [ + 1587, + "const_as_immediate>" + ] + ], + "user_func_names": [ + [ + 0, + "controller::account::CartridgeAccount::__wrapper__AccountImpl____validate__" + ], + [ + 1, + "controller::account::CartridgeAccount::__wrapper__AccountImpl____execute__" + ], + [ + 2, + "controller::account::CartridgeAccount::__wrapper__AccountImpl__is_valid_signature" + ], + [ + 3, + "controller::account::CartridgeAccount::__wrapper__DeclarerImpl____validate_declare__" + ], + [ + 4, + "controller::account::CartridgeAccount::__wrapper__UserAccountImpl__change_owner" + ], + [ + 5, + "controller::account::CartridgeAccount::__wrapper__UserAccountImpl__get_owner" + ], + [ + 6, + "controller::account::CartridgeAccount::__wrapper__UserAccountImpl__get_owner_type" + ], + [ + 7, + "controller::account::CartridgeAccount::__wrapper__DeployableImpl____validate_deploy__" + ], + [ + 8, + "controller::account::CartridgeAccount::__wrapper__UpgradeableImpl__upgrade" + ], + [ + 9, + "controller_session::session_component::__wrapper__SessionComponent__revoke_session::" + ], + [ + 10, + "controller_session::session_component::__wrapper__SessionComponent__is_session_revoked::" + ], + [ + 11, + "controller::outside_execution::outside_execution::outside_execution_component::__wrapper__OutsideExecutionImpl__execute_from_outside_v2::" + ], + [ + 12, + "controller::outside_execution::outside_execution::outside_execution_component::__wrapper__OutsideExecutionImpl__get_outside_execution_message_hash_rev_1::" + ], + [ + 13, + "controller::outside_execution::outside_execution::outside_execution_component::__wrapper__OutsideExecutionImpl__is_valid_outside_execution_nonce::" + ], + [ + 14, + "controller::src5::src5_component::__wrapper__SRC5Impl__supports_interface::" + ], + [ + 15, + "controller::account::CartridgeAccount::__wrapper__constructor" + ], + [ + 16, + "core::array::deserialize_array_helper::" + ], + [ + 17, + "controller::account::CartridgeAccount::AccountImpl::__validate__" + ], + [ + 18, + "controller::account::CartridgeAccount::AccountImpl::__execute__" + ], + [ + 19, + "core::array::serialize_array_helper::, core::array::SpanFelt252Serde, core::array::SpanDrop::>" + ], + [ + 20, + "core::array::deserialize_array_helper::" + ], + [ + 21, + "controller::account::CartridgeAccount::AccountImpl::is_valid_signature" + ], + [ + 22, + "controller::account::CartridgeAccount::DeclarerImpl::__validate_declare__" + ], + [ + 23, + "controller_auth::signer::SignerSignatureSerde::deserialize" + ], + [ + 24, + "controller::account::CartridgeAccount::UserAccountImpl::change_owner" + ], + [ + 25, + "controller::account::CartridgeAccount::DeployableImpl::__validate_deploy__" + ], + [ + 26, + "openzeppelin::upgrades::upgradeable::UpgradeableComponent::InternalImpl::::_upgrade" + ], + [ + 27, + "controller_session::session_component::SessionImpl::::revoke_session" + ], + [ + 28, + "controller_session::session_component::SessionImpl::::is_session_revoked" + ], + [ + 29, + "controller::outside_execution::interface::OutsideExecutionSerde::deserialize" + ], + [ + 30, + "core::array::SpanFelt252Serde::deserialize" + ], + [ + 31, + "controller::outside_execution::outside_execution_hash::get_message_hash_rev_1" + ], + [ + 32, + "controller::outside_execution::outside_execution::outside_execution_component::Internal::::assert_valid_outside_execution" + ], + [ + 33, + "controller_auth::signer::SignerSerde::deserialize" + ], + [ + 34, + "core::option::OptionSerde::>::deserialize" + ], + [ + 35, + "controller::account::CartridgeAccount::constructor" + ], + [ + 36, + "core::starknet::account::CallSerde::deserialize" + ], + [ + 37, + "controller_session::session_component::InternalImpl::::validate_session_serialized" + ], + [ + 38, + "controller::account::CartridgeAccount::ContractInternalImpl::assert_valid_calls_and_signature" + ], + [ + 39, + "controller::account::CartridgeAccount::_execute_calls[expr13]" + ], + [ + 40, + "core::array::serialize_array_helper::" + ], + [ + 41, + "core::array::deserialize_array_helper::" + ], + [ + 42, + "controller::account::CartridgeAccount::ContractInternalImpl::is_valid_owner_signature" + ], + [ + 43, + "controller::account::CartridgeAccount::ContractInternalImpl::assert_valid_span_signature" + ], + [ + 44, + "core::serde::TupleSize2Serde::::deserialize" + ], + [ + 45, + "core::serde::TupleSize2Serde::::deserialize" + ], + [ + 46, + "controller_auth::signer::WebauthnSignerSerde::deserialize" + ], + [ + 47, + "controller_auth::webauthn::WebauthnAssertionSerde::deserialize" + ], + [ + 48, + "controller::account::CartridgeAccount::ContractInternalImpl::assert_valid_new_owner_signature" + ], + [ + 49, + "controller_auth::signer::SignerTraitImpl::into_guid" + ], + [ + 50, + "controller::account::CartridgeAccount::ContractInternalImpl::write_owner" + ], + [ + 51, + "controller::account::CartridgeAccount::EventIsEvent::append_keys_and_data" + ], + [ + 52, + "controller_auth::signer::SignerStorageValueImpl::into_guid" + ], + [ + 53, + "core::byte_array::ByteArrayImpl::append_word" + ], + [ + 54, + "core::array::serialize_array_helper::, core::bytes_31::bytes31Drop>" + ], + [ + 55, + "core::traits::PartialEqSnap::::eq" + ], + [ + 56, + "controller::outside_execution::outside_execution_hash::StructHashOutsideExecutionRev1::get_struct_hash_rev_1" + ], + [ + 57, + "controller_session::hash::StructHashStarknetDomain::get_struct_hash_rev_1" + ], + [ + 58, + "core::poseidon::_poseidon_hash_span_inner" + ], + [ + 59, + "controller_auth::assert_no_self_call[expr21]" + ], + [ + 60, + "controller_session::interface::SessionTokenSerde::deserialize" + ], + [ + 61, + "controller_session::session_component::InternalImpl::::validate_signature" + ], + [ + 62, + "core::ecdsa::check_ecdsa_signature" + ], + [ + 63, + "core::starknet::eth_signature::is_eth_signature_valid" + ], + [ + 64, + "controller_auth::webauthn::verify" + ], + [ + 65, + "controller_auth::webauthn::get_webauthn_hash" + ], + [ + 66, + "core::starknet::secp256_trait::recover_public_key::" + ], + [ + 67, + "core::starknet::secp256_trait::SignatureSerde::deserialize" + ], + [ + 68, + "core::array::deserialize_array_helper::, core::integer::u8Drop>" + ], + [ + 69, + "controller::account::CartridgeAccount::ContractInternalImpl::read_owner[expr46]" + ], + [ + 70, + "controller_auth::signer::SignerTraitImpl::into_guid[expr36]" + ], + [ + 71, + "controller::account::CartridgeAccount::SignerLinkedIsEvent::append_keys_and_data" + ], + [ + 72, + "core::bytes_31::one_shift_left_bytes_u128" + ], + [ + 73, + "controller::outside_execution::outside_execution_hash::StructHashOutsideExecutionRev1::get_struct_hash_rev_1[expr15]" + ], + [ + 74, + "controller_session::interface::SessionSerde::deserialize" + ], + [ + 75, + "core::array::deserialize_array_helper::, core::array::SpanFelt252Serde, core::array::SpanDrop::>" + ], + [ + 76, + "controller_session::hash::get_message_hash_rev_1" + ], + [ + 77, + "controller::account::CartridgeAccount::SessionCallbackImpl::session_callback" + ], + [ + 78, + "controller_session::check_policy[expr35]" + ], + [ + 79, + "core::starknet::secp256_trait::recover_public_key::" + ], + [ + 80, + "core::starknet::eth_signature::public_key_point_to_eth_address::" + ], + [ + 81, + "alexandria_encoding::base64::get_base64_char_set" + ], + [ + 82, + "alexandria_encoding::base64::encode_felt" + ], + [ + 83, + "controller_auth::webauthn::verify_challenge[expr38]" + ], + [ + 84, + "controller_auth::webauthn::ImplArrayu8TryIntoAuthData::try_into" + ], + [ + 85, + "core::array::ArrayTCloneImpl::clone[expr14]" + ], + [ + 86, + "alexandria_math::sha256::sha256" + ], + [ + 87, + "alexandria_data_structures::array_ext::ArrayImpl::::append_all" + ], + [ + 88, + "controller_auth::helpers::extract_u256_from_u8_array[expr44]" + ], + [ + 89, + "core::math::u256_mul_mod_n" + ], + [ + 90, + "controller_auth::signer::WebauthnSignerSerde::serialize" + ], + [ + 91, + "controller::outside_execution::outside_execution_hash::StructHashCallRev1::get_struct_hash_rev_1" + ], + [ + 92, + "controller_session::hash::get_message_hash_rev_1_with_precalc::" + ], + [ + 93, + "alexandria_merkle_tree::merkle_tree::MerkleTreeImpl::verify[expr26]" + ], + [ + 94, + "core::keccak::keccak_u256s_be_inputs[expr12]" + ], + [ + 95, + "core::keccak::add_padding" + ], + [ + 96, + "alexandria_encoding::base64::encode_felt[expr121]" + ], + [ + 97, + "alexandria_encoding::base64::encode_felt[expr131]" + ], + [ + 98, + "alexandria_data_structures::array_ext::SpanImpl::reverse[expr14]" + ], + [ + 99, + "controller_auth::webauthn::ImplArrayu8TryIntoAuthData::try_into[expr31]" + ], + [ + 100, + "alexandria_math::pow::, core::integer::u32Drop, core::integer::u32Copy>" + ], + [ + 101, + "alexandria_math::sha256::sha256[expr32]" + ], + [ + 102, + "alexandria_math::sha256::from_u8Array_to_u32Array[expr49]" + ], + [ + 103, + "alexandria_math::sha256::get_k" + ], + [ + 104, + "alexandria_math::sha256::sha256_inner" + ], + [ + 105, + "alexandria_math::sha256::from_u32Array_to_u8Array[expr55]" + ], + [ + 106, + "alexandria_math::pow::" + ], + [ + 107, + "core::integer::u256_overflow_mul" + ], + [ + 108, + "core::array::serialize_array_helper::, core::integer::u8Drop>" + ], + [ + 109, + "core::keccak::keccak_add_u256_be" + ], + [ + 110, + "core::keccak::finalize_padding" + ], + [ + 111, + "alexandria_math::sha256::create_message_schedule[expr23]" + ], + [ + 112, + "alexandria_math::sha256::create_message_schedule[expr70]" + ], + [ + 113, + "alexandria_math::sha256::compression" + ], + [ + 114, + "alexandria_math::sha256::ssig0" + ], + [ + 115, + "alexandria_math::sha256::ssig1" + ], + [ + 116, + "alexandria_math::sha256::bsig1" + ], + [ + 117, + "alexandria_math::sha256::bsig0" + ] + ] + }, + "contract_class_version": "0.1.0", + "entry_points_by_type": { + "EXTERNAL": [ + { + "selector": "0xae4c53adcf230c976273bd2a636233f06e97b1d4a68208d3d10a80d2f8a0a4", + "function_idx": 6 + }, + { + "selector": "0xf2f7c15cbe06c8d94597cd91fd7f3369eae842359235712def5584f8d270cd", + "function_idx": 8 + }, + { + "selector": "0xfe80f537b66d12a00b6d3c072b44afbb716e78dde5c3f0ef116ee93d3e3283", + "function_idx": 14 + }, + { + "selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", + "function_idx": 1 + }, + { + "selector": "0x162da33a4585851fe8d3af3c2a9c60b557814e221e0d4f30ff0b2189d9c7775", + "function_idx": 0 + }, + { + "selector": "0x1746f7542cac71b5c88f0b2301e87cd9b0896dab1c83b8b515762697e521040", + "function_idx": 4 + }, + { + "selector": "0x1e6d35df2b9d989fb4b6bbcebda1314e4254cbe5e589dd94ff4f29ea935e91c", + "function_idx": 13 + }, + { + "selector": "0x2620178518fa69a7e40c870eddc33994e24fdfd1f953b56d4c848bd7a2003ac", + "function_idx": 12 + }, + { + "selector": "0x28420862938116cb3bbdbedee07451ccc54d4e9412dbef71142ad1980a30941", + "function_idx": 2 + }, + { + "selector": "0x289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3", + "function_idx": 3 + }, + { + "selector": "0x34cc13b274446654ca3233ed2c1620d4c5d1d32fd20b47146a3371064bdc57d", + "function_idx": 11 + }, + { + "selector": "0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895", + "function_idx": 7 + }, + { + "selector": "0x39092635a112019062c4ee4c367f7db9a22fdb8b6cde59e906f197c24ab6e35", + "function_idx": 10 + }, + { + "selector": "0x3ee0bfaf5b124501fef19bbd1312e71f6966d186c42eeb91d1bff729b91d1d4", + "function_idx": 5 + }, + { + "selector": "0x3fab092e963914fd624eedd965d67f571fea93cae38bbacb48be7db091be933", + "function_idx": 9 + } + ], + "L1_HANDLER": [], + "CONSTRUCTOR": [ + { + "selector": "0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194", + "function_idx": 15 + } + ] + }, + "abi": [ + { + "type": "impl", + "name": "AccountImpl", + "interface_name": "controller::account::IAccount" + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::starknet::account::Call", + "members": [ + { + "name": "to", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "calldata", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "controller::account::IAccount", + "items": [ + { + "type": "function", + "name": "__validate__", + "inputs": [ + { + "name": "calls", + "type": "core::array::Array::" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "__execute__", + "inputs": [ + { + "name": "calls", + "type": "core::array::Array::" + } + ], + "outputs": [ + { + "type": "core::array::Array::>" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_valid_signature", + "inputs": [ + { + "name": "hash", + "type": "core::felt252" + }, + { + "name": "signature", + "type": "core::array::Array::" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "DeclarerImpl", + "interface_name": "controller::account::IDeclarer" + }, + { + "type": "interface", + "name": "controller::account::IDeclarer", + "items": [ + { + "type": "function", + "name": "__validate_declare__", + "inputs": [ + { + "name": "class_hash", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "UserAccountImpl", + "interface_name": "controller::account::IUserAccount" + }, + { + "type": "struct", + "name": "controller_auth::signer::StarknetSigner", + "members": [ + { + "name": "pubkey", + "type": "core::zeroable::NonZero::" + } + ] + }, + { + "type": "struct", + "name": "controller_auth::signer::StarknetSignature", + "members": [ + { + "name": "r", + "type": "core::felt252" + }, + { + "name": "s", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "core::starknet::eth_address::EthAddress", + "members": [ + { + "name": "address", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "controller_auth::signer::Secp256k1Signer", + "members": [ + { + "name": "pubkey_hash", + "type": "core::starknet::eth_address::EthAddress" + } + ] + }, + { + "type": "struct", + "name": "core::integer::u256", + "members": [ + { + "name": "low", + "type": "core::integer::u128" + }, + { + "name": "high", + "type": "core::integer::u128" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::starknet::secp256_trait::Signature", + "members": [ + { + "name": "r", + "type": "core::integer::u256" + }, + { + "name": "s", + "type": "core::integer::u256" + }, + { + "name": "y_parity", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "controller_auth::signer::WebauthnSigner", + "members": [ + { + "name": "origin", + "type": "core::array::Span::" + }, + { + "name": "rp_id_hash", + "type": "core::zeroable::NonZero::" + }, + { + "name": "pubkey", + "type": "core::zeroable::NonZero::" + } + ] + }, + { + "type": "struct", + "name": "controller_auth::webauthn::WebauthnAssertion", + "members": [ + { + "name": "authenticator_data", + "type": "core::array::Span::" + }, + { + "name": "client_data_json", + "type": "core::array::Span::" + }, + { + "name": "signature", + "type": "core::starknet::secp256_trait::Signature" + }, + { + "name": "type_offset", + "type": "core::integer::u32" + }, + { + "name": "challenge_offset", + "type": "core::integer::u32" + }, + { + "name": "challenge_length", + "type": "core::integer::u32" + }, + { + "name": "origin_offset", + "type": "core::integer::u32" + }, + { + "name": "origin_length", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "controller_auth::signer::SignerSignature", + "variants": [ + { + "name": "Starknet", + "type": "(controller_auth::signer::StarknetSigner, controller_auth::signer::StarknetSignature)" + }, + { + "name": "Secp256k1", + "type": "(controller_auth::signer::Secp256k1Signer, core::starknet::secp256_trait::Signature)" + }, + { + "name": "Webauthn", + "type": "(controller_auth::signer::WebauthnSigner, controller_auth::webauthn::WebauthnAssertion)" + }, + { + "name": "Unimplemented", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "controller_auth::signer::SignerType", + "variants": [ + { + "name": "Starknet", + "type": "()" + }, + { + "name": "Secp256k1", + "type": "()" + }, + { + "name": "Webauthn", + "type": "()" + }, + { + "name": "Unimplemented", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "controller::account::IUserAccount", + "items": [ + { + "type": "function", + "name": "change_owner", + "inputs": [ + { + "name": "signer_signature", + "type": "controller_auth::signer::SignerSignature" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_owner", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_owner_type", + "inputs": [], + "outputs": [ + { + "type": "controller_auth::signer::SignerType" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "DeployableImpl", + "interface_name": "openzeppelin::account::interface::IDeployable" + }, + { + "type": "interface", + "name": "openzeppelin::account::interface::IDeployable", + "items": [ + { + "type": "function", + "name": "__validate_deploy__", + "inputs": [ + { + "name": "class_hash", + "type": "core::felt252" + }, + { + "name": "contract_address_salt", + "type": "core::felt252" + }, + { + "name": "public_key", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradeableImpl", + "interface_name": "openzeppelin::upgrades::interface::IUpgradeable" + }, + { + "type": "interface", + "name": "openzeppelin::upgrades::interface::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "SessionImpl", + "interface_name": "controller_session::interface::ISession" + }, + { + "type": "interface", + "name": "controller_session::interface::ISession", + "items": [ + { + "type": "function", + "name": "revoke_session", + "inputs": [ + { + "name": "session_hash", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_session_revoked", + "inputs": [ + { + "name": "session_hash", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "ExecuteFromOutside", + "interface_name": "controller::outside_execution::interface::IOutsideExecution" + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "controller::outside_execution::interface::OutsideExecution", + "members": [ + { + "name": "caller", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "nonce", + "type": "core::felt252" + }, + { + "name": "execute_after", + "type": "core::integer::u64" + }, + { + "name": "execute_before", + "type": "core::integer::u64" + }, + { + "name": "calls", + "type": "core::array::Span::" + } + ] + }, + { + "type": "interface", + "name": "controller::outside_execution::interface::IOutsideExecution", + "items": [ + { + "type": "function", + "name": "execute_from_outside_v2", + "inputs": [ + { + "name": "outside_execution", + "type": "controller::outside_execution::interface::OutsideExecution" + }, + { + "name": "signature", + "type": "core::array::Span::" + } + ], + "outputs": [ + { + "type": "core::array::Array::>" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_valid_outside_execution_nonce", + "inputs": [ + { + "name": "nonce", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_outside_execution_message_hash_rev_1", + "inputs": [ + { + "name": "outside_execution", + "type": "controller::outside_execution::interface::OutsideExecution" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "SRC5", + "interface_name": "controller::src5::ISRC5" + }, + { + "type": "interface", + "name": "controller::src5::ISRC5", + "items": [ + { + "type": "function", + "name": "supports_interface", + "inputs": [ + { + "name": "interface_id", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "enum", + "name": "controller_auth::signer::Signer", + "variants": [ + { + "name": "Starknet", + "type": "controller_auth::signer::StarknetSigner" + }, + { + "name": "Secp256k1", + "type": "controller_auth::signer::Secp256k1Signer" + }, + { + "name": "Webauthn", + "type": "controller_auth::signer::WebauthnSigner" + }, + { + "name": "Unimplemented", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "controller_auth::signer::Signer" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "owner", + "type": "controller_auth::signer::Signer" + }, + { + "name": "guardian", + "type": "core::option::Option::" + } + ] + }, + { + "type": "event", + "name": "controller::account::CartridgeAccount::OwnerChanged", + "kind": "struct", + "members": [ + { + "name": "new_owner", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "controller::account::CartridgeAccount::OwnerChangedGuid", + "kind": "struct", + "members": [ + { + "name": "new_owner_guid", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "controller::account::CartridgeAccount::SignerLinked", + "kind": "struct", + "members": [ + { + "name": "signer_guid", + "type": "core::felt252", + "kind": "key" + }, + { + "name": "signer", + "type": "controller_auth::signer::Signer", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "controller_session::session_component::SessionRevoked", + "kind": "struct", + "members": [ + { + "name": "session_hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "controller_session::session_component::Event", + "kind": "enum", + "variants": [ + { + "name": "SessionRevoked", + "type": "controller_session::session_component::SessionRevoked", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "controller::outside_execution::outside_execution::outside_execution_component::Event", + "kind": "enum", + "variants": [] + }, + { + "type": "event", + "name": "controller::src5::src5_component::Event", + "kind": "enum", + "variants": [] + }, + { + "type": "event", + "name": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "controller::account::CartridgeAccount::Event", + "kind": "enum", + "variants": [ + { + "name": "OwnerChanged", + "type": "controller::account::CartridgeAccount::OwnerChanged", + "kind": "nested" + }, + { + "name": "OwnerChangedGuid", + "type": "controller::account::CartridgeAccount::OwnerChangedGuid", + "kind": "nested" + }, + { + "name": "SignerLinked", + "type": "controller::account::CartridgeAccount::SignerLinked", + "kind": "nested" + }, + { + "name": "SessionEvent", + "type": "controller_session::session_component::Event", + "kind": "flat" + }, + { + "name": "ExecuteFromOutsideEvents", + "type": "controller::outside_execution::outside_execution::outside_execution_component::Event", + "kind": "flat" + }, + { + "name": "SRC5Events", + "type": "controller::src5::src5_component::Event", + "kind": "flat" + }, + { + "name": "UpgradeableEvent", + "type": "openzeppelin::upgrades::upgradeable::UpgradeableComponent::Event", + "kind": "flat" + } + ] + } + ] +} diff --git a/crates/katana/controller/Cargo.toml b/crates/katana/controller/Cargo.toml new file mode 100644 index 0000000000..84f2206ee0 --- /dev/null +++ b/crates/katana/controller/Cargo.toml @@ -0,0 +1,19 @@ +[package] +edition.workspace = true +name = "katana-slot-controller" +repository.workspace = true +version.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +account_sdk.workspace = true +alloy-primitives.workspace = true +anyhow.workspace = true +base64 = "0.22.1" +coset = "0.3.7" +katana-primitives.workspace = true +serde_json.workspace = true +slot.workspace = true +starknet.workspace = true +tracing.workspace = true diff --git a/crates/katana/controller/src/lib.rs b/crates/katana/controller/src/lib.rs new file mode 100644 index 0000000000..b187bcf52c --- /dev/null +++ b/crates/katana/controller/src/lib.rs @@ -0,0 +1,256 @@ +use std::collections::HashMap; +use std::sync::Arc; + +use account_sdk::abigen::controller::{Signer, SignerType}; +use account_sdk::signers::webauthn::{DeviceSigner, WebauthnAccountSigner}; +use account_sdk::signers::SignerTrait; +use account_sdk::wasm_webauthn::CredentialID; +use alloy_primitives::U256; +use anyhow::Result; +use coset::CoseKey; +use katana_primitives::class::{ClassHash, CompiledClass, SierraCompiledClass}; +use katana_primitives::contract::{ContractAddress, StorageKey, StorageValue}; +use katana_primitives::genesis::allocation::{GenesisAllocation, GenesisContractAlloc}; +use katana_primitives::genesis::{Genesis, GenesisClass}; +use katana_primitives::utils::class::{parse_compiled_class_v1, parse_sierra_class}; +use katana_primitives::FieldElement; +use slot::credential::Credentials; +use starknet::core::utils::get_storage_var_address; +use tracing::trace; + +mod webauthn; + +const LOG_TARGET: &str = "katana::controller"; + +const CONTROLLER_SIERRA_ARTIFACT: &str = + include_str!("../../contracts/compiled/controller_CartridgeAccount.contract_class.json"); + +const WEBAUTHN_RP_ID: &str = "cartridge.gg"; +const WEBAUTHN_ORIGIN: &str = "https://x.cartridge.gg"; + +pub fn add_controller_account(genesis: &mut Genesis) -> Result<()> { + // bouncer that checks if there is an authenticated slot user + let credentials = Credentials::load()?; + add_controller_account_inner(genesis, credentials.account) +} + +fn add_controller_class(genesis: &mut Genesis) -> Result { + let sierra = parse_sierra_class(CONTROLLER_SIERRA_ARTIFACT)?; + let casm = read_compiled_class_artifact(CONTROLLER_SIERRA_ARTIFACT)?; + + let class_hash = sierra.class_hash()?; + let flattened_sierra = sierra.flatten()?; + let casm_hash = FieldElement::from_bytes_be(&casm.casm.compiled_class_hash().to_be_bytes())?; + + trace!( + target: LOG_TARGET, + class_hash = format!("{class_hash:#x}"), + casm_hash = format!("{casm_hash:#x}"), + "Adding Cartridge Controller account class to genesis." + ); + + genesis.classes.insert( + class_hash, + GenesisClass { + sierra: Some(Arc::new(flattened_sierra)), + compiled_class_hash: casm_hash, + casm: Arc::new(CompiledClass::Class(casm)), + }, + ); + + Ok(class_hash) +} + +fn add_controller_account_inner(genesis: &mut Genesis, user: slot::account::Account) -> Result<()> { + let cred = user.credentials.webauthn.first().unwrap(); + + trace!( + target: LOG_TARGET, + username = user.id, + address = format!("{:#x}", user.contract_address), + "Adding Cartridge Controller account to genesis." + ); + + let class_hash = add_controller_class(genesis)?; + + let credential_id = webauthn::credential::from_base64(&cred.id)?; + let public_key = webauthn::cose_key::from_base64(&cred.public_key)?; + + let (address, contract) = { + let account = GenesisContractAlloc { + nonce: None, + class_hash: Some(class_hash), + balance: Some(U256::from(0xfffffffffffffffu128)), + storage: Some(get_contract_storage(credential_id, public_key, SignerType::Webauthn)?), + }; + + (ContractAddress::from(user.contract_address), GenesisAllocation::Contract(account)) + }; + + genesis.extend_allocations([(address, contract)]); + + trace!( + target: LOG_TARGET, + username = user.id, + address = format!("{:#x}", user.contract_address), + "Cartridge Controller account added to genesis." + ); + + Ok(()) +} + +pub mod json { + use anyhow::Result; + use katana_primitives::genesis::json::{ + ClassNameOrHash, GenesisClassJson, GenesisContractJson, GenesisJson, + }; + use serde_json::Value; + + use super::*; + + const CONTROLLER_CLASS_NAME: &str = "controller"; + + // TODO(kariy): should accept the whole account struct instead of individual fields + // build the genesis json file + pub fn add_controller_account_json(genesis: &mut GenesisJson) -> Result<()> { + // bouncer that checks if there is an authenticated slot user + let user = Credentials::load()?; + let cred = user.account.credentials.webauthn.first().unwrap(); + + let credential_id = webauthn::credential::from_base64(&cred.id)?; + let public_key = webauthn::cose_key::from_base64(&cred.public_key)?; + + add_controller_class_json(genesis)?; + + let (address, contract) = { + let account = GenesisContractJson { + nonce: None, + balance: None, + class: Some(ClassNameOrHash::Name(CONTROLLER_CLASS_NAME.to_string())), + storage: Some(get_contract_storage( + credential_id, + public_key, + SignerType::Webauthn, + )?), + }; + + (ContractAddress::from(user.account.contract_address), account) + }; + + genesis.contracts.insert(address, contract); + + Ok(()) + } + + fn add_controller_class_json(genesis: &mut GenesisJson) -> Result<()> { + // parse the controller class json file + let json = serde_json::from_str::(CONTROLLER_SIERRA_ARTIFACT)?; + + let class = GenesisClassJson { + class_hash: None, + class: json.into(), + name: Some(CONTROLLER_CLASS_NAME.to_string()), + }; + + genesis.classes.push(class); + + Ok(()) + } +} + +fn get_contract_storage( + credential_id: CredentialID, + public_key: CoseKey, + signer_type: SignerType, +) -> Result> { + let type_value: u16 = match signer_type { + SignerType::Starknet => 0, + SignerType::Secp256k1 => 1, + SignerType::Webauthn => 4, + SignerType::Unimplemented => 999, + }; + + let signer = DeviceSigner::new( + WEBAUTHN_RP_ID.to_string(), + WEBAUTHN_ORIGIN.to_string(), + credential_id, + public_key, + ); + + let signer = Signer::Webauthn(signer.signer_pub_data()); + let guid = signer.guid(); + + // the storage variable name for webauthn signer + const NON_STARK_OWNER_VAR_NAME: &str = "_owner_non_stark"; + let type_value = FieldElement::from(type_value); + let storage = get_storage_var_address(NON_STARK_OWNER_VAR_NAME, &[type_value])?; + + Ok(HashMap::from([(storage, guid)])) +} + +fn read_compiled_class_artifact(artifact: &str) -> Result { + let value = serde_json::from_str(artifact)?; + parse_compiled_class_v1(value) +} + +#[cfg(test)] +mod tests { + use slot::account::WebAuthnCredential; + use starknet::macros::felt; + + use super::*; + + // Test data for Controller with WebAuthn Signer. + // + // Username: johnsmith + // Controller address: 0x0260ab0352da372054ed9dc586f024f6a259b9ea64a8e09b16147201220f88d2 + // + + const STORAGE_KEY: FieldElement = + felt!("0x058c7ee1e9bb09b0d728314f36629772ef7a3c6773a823064d5a7e5651bcb890"); + const STORAGE_VALUE: FieldElement = + felt!("0x5d7709b0a485e64a549ada9bd14d30419364127dfd351e01f38871c82500cd7"); + + const WEBAUTHN_CREDENTIAL_ID: &str = "ja0NkHny-dlfPnClYECdmce0xTCuGT0xFjeuStaVqCI"; + const WEBAUTHN_PUBLIC_KEY: &str = "pQECAyYgASFYIBLHWNmpxCtO47cfOXw9nFCGftMq57xhvQC98aY_zQchIlggIgGHmWwQe1_FGi9GYqcYYpoPC9mkkf0f1rVD5UoGPEA"; + + #[test] + fn test_add_controller_account() { + let mut genesis = Genesis::default(); + + let account = slot::account::Account { + id: "johnsmith".to_string(), + name: None, + contract_address: felt!("1337"), + credentials: slot::account::AccountCredentials { + webauthn: vec![WebAuthnCredential { + id: WEBAUTHN_CREDENTIAL_ID.to_string(), + public_key: WEBAUTHN_PUBLIC_KEY.to_string(), + }], + }, + }; + + let controller_class_hash = add_controller_class(&mut Genesis::default()).unwrap(); + add_controller_account_inner(&mut genesis, account.clone()).unwrap(); + + let address = ContractAddress::from(account.contract_address); + let allocation = genesis.allocations.get(&address).unwrap(); + + assert!(genesis.allocations.contains_key(&address)); + assert_eq!(allocation.class_hash(), Some(controller_class_hash)); + assert_eq!(allocation.balance(), Some(U256::from(0xfffffffffffffffu128))); + } + + #[test] + fn test_get_contract_storage() { + let credential_id = webauthn::credential::from_base64(WEBAUTHN_CREDENTIAL_ID).unwrap(); + let public_key = webauthn::cose_key::from_base64(WEBAUTHN_PUBLIC_KEY).unwrap(); + + let storage = + get_contract_storage(credential_id.clone(), public_key.clone(), SignerType::Webauthn) + .unwrap(); + + assert_eq!(storage.len(), 1); + assert_eq!(storage.get(&STORAGE_KEY), Some(&STORAGE_VALUE)); + } +} diff --git a/crates/katana/controller/src/webauthn.rs b/crates/katana/controller/src/webauthn.rs new file mode 100644 index 0000000000..64b75dce69 --- /dev/null +++ b/crates/katana/controller/src/webauthn.rs @@ -0,0 +1,22 @@ +pub mod credential { + use account_sdk::wasm_webauthn::CredentialID; + use base64::engine::general_purpose; + use base64::{DecodeError, Engine}; + + pub fn from_base64(base64: &str) -> Result { + let bytes = general_purpose::URL_SAFE_NO_PAD.decode(base64)?; + Ok(CredentialID(bytes)) + } +} + +pub mod cose_key { + use anyhow::Result; + use base64::engine::general_purpose; + use base64::Engine; + use coset::{CborSerializable, CoseKey}; + + pub fn from_base64(base64: &str) -> Result { + let bytes = general_purpose::URL_SAFE_NO_PAD.decode(base64)?; + Ok(CoseKey::from_slice(&bytes)?) + } +} From 962579be8af9bc0dd311e5c3a9e8c27191f06fc4 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Tue, 25 Jun 2024 07:57:03 -0500 Subject: [PATCH 54/88] Prepare release: v0.7.3-alpha.0 (#2103) Co-authored-by: kariy --- Cargo.lock | 92 ++++++++++---------- Cargo.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d97ffe98d5..e7ff5a67af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1384,7 +1384,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "clap", @@ -3899,7 +3899,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -4741,7 +4741,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "async-trait", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", @@ -4759,15 +4759,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.2" +version = "0.7.3-alpha.0" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.2" +version = "0.7.3-alpha.0" [[package]] name = "dojo-lang" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -4818,7 +4818,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "cairo-lang-language-server", "clap", @@ -4827,7 +4827,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "hyper 0.14.28", @@ -4845,7 +4845,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -4879,7 +4879,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "crypto-bigint", @@ -4895,7 +4895,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -4934,7 +4934,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8045,7 +8045,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8053,7 +8053,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.2", + "common 0.7.3-alpha.0", "console", "dojo-metrics", "katana-core", @@ -8073,7 +8073,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -8086,7 +8086,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "bytes", "katana-primitives", @@ -8094,7 +8094,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "proc-macro2", "quote", @@ -8104,7 +8104,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-contract", "alloy-network", @@ -8152,7 +8152,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8174,7 +8174,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8201,7 +8201,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8226,7 +8226,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8252,7 +8252,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "assert_matches", @@ -8290,7 +8290,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8301,7 +8301,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8322,7 +8322,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "katana-executor", @@ -8334,7 +8334,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -8353,7 +8353,7 @@ dependencies = [ [[package]] name = "katana-slot-controller" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "account_sdk", "alloy-primitives", @@ -8369,7 +8369,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "futures", "rayon", @@ -11753,7 +11753,7 @@ checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" [[package]] name = "runner-macro" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "quote", "syn 2.0.64", @@ -12021,7 +12021,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "cairo-proof-parser", @@ -12042,7 +12042,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -12084,7 +12084,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -12256,7 +12256,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "clap", "clap_complete", @@ -12938,7 +12938,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "account_sdk", "anyhow", @@ -13000,7 +13000,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -13056,7 +13056,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "starknet", @@ -14327,7 +14327,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -14335,7 +14335,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.2", + "common 0.7.3-alpha.0", "ctrlc", "dojo-metrics", "dojo-types", @@ -14372,7 +14372,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "async-trait", "camino", @@ -14400,7 +14400,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -14439,7 +14439,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "async-graphql", @@ -14480,7 +14480,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "bytes", "camino", @@ -14524,7 +14524,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -14560,7 +14560,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.2" +version = "0.7.3-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -14883,7 +14883,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.2" +version = "0.7.3-alpha.0" [[package]] name = "u256-literal" diff --git a/Cargo.toml b/Cargo.toml index 9c6cd18dab..e59576672f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.2" +version = "0.7.3-alpha.0" [profile.performance] codegen-units = 1 diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 19dab27834..e50bd02830 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.2" +version = "0.7.3-alpha.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From f6d721246c3fb9a7598fe1cb6591998f3d7094d5 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Tue, 25 Jun 2024 08:42:00 -0600 Subject: [PATCH 55/88] chore(torii-libp2p): use rev (#2104) --- Cargo.lock | 130 ++++++++++++++++----------------- crates/torii/libp2p/Cargo.toml | 10 +-- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7ff5a67af..48fa4677e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8554,7 +8554,7 @@ dependencies = [ [[package]] name = "libp2p" version = "0.54.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "bytes", "either", @@ -8564,9 +8564,9 @@ dependencies = [ "instant", "libp2p-allow-block-list", "libp2p-connection-limits", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-dns", - "libp2p-gossipsub 0.46.1 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-gossipsub 0.46.1 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identify", "libp2p-identity", "libp2p-mdns", @@ -8575,35 +8575,35 @@ dependencies = [ "libp2p-ping", "libp2p-quic", "libp2p-relay", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-tcp", "libp2p-upnp", "libp2p-yamux", "multiaddr 0.18.1", "pin-project", - "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p)", + "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "thiserror", ] [[package]] name = "libp2p-allow-block-list" version = "0.3.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "void", ] [[package]] name = "libp2p-connection-limits" version = "0.3.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "void", ] @@ -8638,7 +8638,7 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.41.2" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "either", "fnv", @@ -8648,13 +8648,13 @@ dependencies = [ "libp2p-identity", "multiaddr 0.18.1", "multihash 0.19.1", - "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p)", + "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "once_cell", "parking_lot 0.12.2", "pin-project", "quick-protobuf", "rand", - "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p)", + "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "smallvec", "thiserror", "tracing", @@ -8665,12 +8665,12 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.41.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "async-trait", "futures", "hickory-resolver", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "parking_lot 0.12.2", "smallvec", @@ -8711,7 +8711,7 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.46.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "asynchronous-codec", "base64 0.22.1", @@ -8724,12 +8724,12 @@ dependencies = [ "getrandom", "hex_fmt", "instant", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "rand", "regex", "sha2 0.10.8", @@ -8741,19 +8741,19 @@ dependencies = [ [[package]] name = "libp2p-identify" version = "0.44.2" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "asynchronous-codec", "either", "futures", "futures-bounded", "futures-timer", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "lru", "quick-protobuf", - "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "smallvec", "thiserror", "tracing", @@ -8781,15 +8781,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.45.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "data-encoding", "futures", "hickory-proto", "if-watch", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "rand", "smallvec", "socket2 0.5.7", @@ -8801,17 +8801,17 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.14.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "futures", "instant", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", - "libp2p-gossipsub 0.46.1 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", + "libp2p-gossipsub 0.46.1 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identify", "libp2p-identity", "libp2p-ping", "libp2p-relay", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "pin-project", "prometheus-client", ] @@ -8819,13 +8819,13 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.44.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "asynchronous-codec", "bytes", "curve25519-dalek", "futures", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "multiaddr 0.18.1", "multihash 0.19.1", @@ -8844,15 +8844,15 @@ dependencies = [ [[package]] name = "libp2p-ping" version = "0.44.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "either", "futures", "futures-timer", "instant", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "rand", "tracing", "void", @@ -8861,13 +8861,13 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.10.3" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "libp2p-tls", "parking_lot 0.12.2", @@ -8884,7 +8884,7 @@ dependencies = [ [[package]] name = "libp2p-relay" version = "0.17.2" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "asynchronous-codec", "bytes", @@ -8892,11 +8892,11 @@ dependencies = [ "futures", "futures-bounded", "futures-timer", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "quick-protobuf", - "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "rand", "static_assertions", "thiserror", @@ -8930,7 +8930,7 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.44.2" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "either", "fnv", @@ -8938,11 +8938,11 @@ dependencies = [ "futures-timer", "getrandom", "instant", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "libp2p-swarm-derive", "lru", - "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p)", + "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "once_cell", "rand", "smallvec", @@ -8955,7 +8955,7 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" version = "0.34.2" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -8966,13 +8966,13 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.41.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "futures", "futures-timer", "if-watch", "libc", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "socket2 0.5.7", "tokio", @@ -8982,11 +8982,11 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.3.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "futures", "futures-rustls", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "rcgen", "ring 0.17.8", @@ -9000,13 +9000,13 @@ dependencies = [ [[package]] name = "libp2p-upnp" version = "0.2.2" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "futures", "futures-timer", "igd-next", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", - "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", + "libp2p-swarm 0.44.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "tokio", "tracing", "void", @@ -9015,7 +9015,7 @@ dependencies = [ [[package]] name = "libp2p-webrtc" version = "0.7.1-alpha" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "async-trait", "bytes", @@ -9023,7 +9023,7 @@ dependencies = [ "futures-timer", "hex", "if-watch", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "libp2p-noise", "libp2p-webrtc-utils", @@ -9043,17 +9043,17 @@ dependencies = [ [[package]] name = "libp2p-webrtc-utils" version = "0.2.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "asynchronous-codec", "bytes", "futures", "hex", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "libp2p-noise", "quick-protobuf", - "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "rand", "serde", "sha2 0.10.8", @@ -9065,14 +9065,14 @@ dependencies = [ [[package]] name = "libp2p-webrtc-websys" version = "0.3.0-alpha" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "bytes", "futures", "getrandom", "hex", "js-sys", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "libp2p-webrtc-utils", "send_wrapper 0.6.0", @@ -9086,11 +9086,11 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.45.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "either", "futures", - "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "thiserror", "tracing", "yamux 0.12.1", @@ -9572,7 +9572,7 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.13.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "bytes", "futures", @@ -11050,7 +11050,7 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" version = "0.3.1" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "asynchronous-codec", "bytes", @@ -11959,7 +11959,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.4.0" -source = "git+https://github.com/libp2p/rust-libp2p#451bcb60bb472262f96071006b19e5d236b1dd54" +source = "git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54#451bcb60bb472262f96071006b19e5d236b1dd54" dependencies = [ "futures", "pin-project", diff --git a/crates/torii/libp2p/Cargo.toml b/crates/torii/libp2p/Cargo.toml index 08c0472988..e6cf3466f9 100644 --- a/crates/torii/libp2p/Cargo.toml +++ b/crates/torii/libp2p/Cargo.toml @@ -14,6 +14,7 @@ serde.workspace = true # preserve order anyhow.workspace = true async-trait.workspace = true +cainome.workspace = true chrono.workspace = true crypto-bigint.workspace = true dojo-types.workspace = true @@ -26,22 +27,21 @@ starknet.workspace = true thiserror.workspace = true tracing-subscriber = { version = "0.3", features = [ "env-filter" ] } tracing.workspace = true -cainome.workspace = true [dev-dependencies] dojo-test-utils.workspace = true tempfile.workspace = true [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -libp2p = { git = "https://github.com/libp2p/rust-libp2p", features = [ "ed25519", "gossipsub", "identify", "macros", "noise", "ping", "quic", "relay", "tcp", "tokio", "yamux" ] } -libp2p-webrtc = { git = "https://github.com/libp2p/rust-libp2p", features = [ "pem", "tokio" ] } +libp2p = { git = "https://github.com/libp2p/rust-libp2p", features = [ "ed25519", "gossipsub", "identify", "macros", "noise", "ping", "quic", "relay", "tcp", "tokio", "yamux" ], rev = "451bcb60bb472262f96071006b19e5d236b1dd54" } +libp2p-webrtc = { git = "https://github.com/libp2p/rust-libp2p", features = [ "pem", "tokio" ], rev = "451bcb60bb472262f96071006b19e5d236b1dd54" } sqlx.workspace = true tokio.workspace = true torii-core.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] -libp2p = { git = "https://github.com/libp2p/rust-libp2p", features = [ "ed25519", "gossipsub", "identify", "macros", "ping", "tcp", "wasm-bindgen" ] } -libp2p-webrtc-websys = { git = "https://github.com/libp2p/rust-libp2p" } +libp2p = { git = "https://github.com/libp2p/rust-libp2p", features = [ "ed25519", "gossipsub", "identify", "macros", "ping", "tcp", "wasm-bindgen" ], rev = "451bcb60bb472262f96071006b19e5d236b1dd54" } +libp2p-webrtc-websys = { git = "https://github.com/libp2p/rust-libp2p", rev = "451bcb60bb472262f96071006b19e5d236b1dd54" } tracing-wasm = "0.2.1" wasm-bindgen-futures = "0.4.40" wasm-bindgen-test = "0.3.40" From e87118db9bf5d9f4086d09e397637a1ad4eef703 Mon Sep 17 00:00:00 2001 From: fab Date: Tue, 25 Jun 2024 11:48:32 -0600 Subject: [PATCH 56/88] test(katana): messaging e2e test (#1925) * -Runner creation -L1 -> L2 Messaging * L2 -> L1 messaging * clippy and fmt * style * apply kari's cool formatting * fmt * Applying more change from Code review * tests * Delete debug from Sol! and not used B256 * Merge remote-tracking branch 'origin/main' into katana/Messaging-Intregation-Testing * Cleaning cargo.lock * Add new option to Katnna Runner Config * consume message and check msg fee * clippy and fmt * - Use alloy Anvil Binding Object to spawn an instance - Delete Manual created Anvil Runner object - Delete unnecesary libraries from Cargo.toml * Add step to install anvil in Dockerfile * Remove profile local from Anvil installation command * Delete step to install anvil * Point CI to devcontainer that has Anvil installed * Update Alloy * fix: fix test with pre-computed tx hash * ci: increment cores for clippy * ci: pre-build latest sozo to re-use in jobs * ci: fix missing dependency * ci: fix missing x permission * ci: remove unused cached to save time * restore lockfile * revert l1 handler tx hash computation changes * revert some changes * revert test case --------- Co-authored-by: Ammar Arif Co-authored-by: glihm --- .github/workflows/ci.yml | 44 +- Cargo.lock | 490 +++++- Cargo.toml | 4 +- .../compiler_cairo/Scarb.lock | 6 +- .../core/src/service/messaging/ethereum.rs | 5 + .../primitives/src/utils/transaction.rs | 9 + crates/katana/rpc/rpc/Cargo.toml | 14 +- crates/katana/rpc/rpc/tests/messaging.rs | 313 ++++ .../test_data/cairo_l1_msg_contract.json | 1470 +++++++++++++++++ .../test_data/solidity/Contract1Compiled.json | 76 + .../StarknetMessagingLocalCompiled.json | 457 +++++ crates/katana/runner/Cargo.toml | 2 +- crates/katana/runner/src/lib.rs | 7 + examples/spawn-and-move/Scarb.lock | 2 +- 14 files changed, 2816 insertions(+), 83 deletions(-) create mode 100644 crates/katana/rpc/rpc/tests/messaging.rs create mode 100644 crates/katana/rpc/rpc/tests/test_data/cairo_l1_msg_contract.json create mode 100644 crates/katana/rpc/rpc/tests/test_data/solidity/Contract1Compiled.json create mode 100644 crates/katana/rpc/rpc/tests/test_data/solidity/StarknetMessagingLocalCompiled.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a01131d856..8b7a4170ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,13 @@ jobs: - uses: Swatinem/rust-cache@v2 - run: | cargo build -r --bin katana + cargo build -r --bin sozo mkdir -p bins cp ./target/release/katana bins/ + cp ./target/release/sozo bins/ - uses: actions/upload-artifact@v4 with: - name: katana-binary + name: dojo-bins path: bins test: @@ -35,7 +37,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - uses: actions/download-artifact@v4 with: - name: katana-binary + name: dojo-bins path: /tmp/bins - run: | chmod +x /tmp/bins/katana @@ -83,7 +85,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: katana-binary + name: dojo-bins - run: | chmod +x ./katana ./katana & @@ -107,22 +109,34 @@ jobs: scarb --manifest-path crates/dojo-core/Scarb.toml fmt --check dojo-core-test: + needs: build runs-on: ubuntu-latest container: image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: + - uses: actions/download-artifact@v4 + with: + name: dojo-bins + path: /tmp/bins - uses: actions/checkout@v3 - - uses: Swatinem/rust-cache@v2 - - run: cargo run --bin sozo -- --manifest-path crates/dojo-core/Scarb.toml test + - run: | + chmod +x /tmp/bins/sozo + /tmp/bins/sozo --manifest-path crates/dojo-core/Scarb.toml test dojo-spawn-and-move-example-test: + needs: build runs-on: ubuntu-latest container: image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: + - uses: actions/download-artifact@v4 + with: + name: dojo-bins + path: /tmp/bins - uses: actions/checkout@v3 - - uses: Swatinem/rust-cache@v2 - - run: cargo run --bin sozo -- --manifest-path examples/spawn-and-move/Scarb.toml test + - run: | + chmod +x /tmp/bins/sozo + /tmp/bins/sozo --manifest-path examples/spawn-and-move/Scarb.toml test dojo-world-bindings-check: runs-on: ubuntu-latest @@ -134,7 +148,7 @@ jobs: - run: cargo run --bin dojo-world-abigen -- --check clippy: - runs-on: ubuntu-latest + runs-on: ubuntu-latest-4-cores container: image: ghcr.io/dojoengine/dojo-dev:v0.7.2 steps: @@ -162,17 +176,17 @@ jobs: scripts/docs.sh test-hurl: + needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master + - uses: actions/download-artifact@v4 with: - toolchain: ${{ env.RUST_VERSION }} - - uses: Swatinem/rust-cache@v2 + name: dojo-bins + path: /tmp/bins + - uses: actions/checkout@v3 - run: | curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/3.0.0/hurl_3.0.0_amd64.deb sudo apt update && sudo apt install ./hurl_3.0.0_amd64.deb - - run: | - cargo build --bin katana - nohup target/debug/katana --accounts 2 --disable-fee & + chmod +x /tmp/bins/katana + nohup /tmp/bins/katana --accounts 2 --disable-fee & - run: hurl --test examples/rpc/**/*.hurl diff --git a/Cargo.lock b/Cargo.lock index 48fa4677e8..eabe1a67a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,15 +141,60 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-contract 0.1.2", + "alloy-core", + "alloy-eips 0.1.2", + "alloy-genesis 0.1.2", + "alloy-network 0.1.2", + "alloy-node-bindings", + "alloy-provider 0.1.2", + "alloy-rpc-client 0.1.2", + "alloy-serde 0.1.2", + "alloy-signer 0.1.2", + "alloy-signer-local", + "alloy-transport 0.1.2", + "alloy-transport-http 0.1.2", + "reqwest 0.12.4", +] + +[[package]] +name = "alloy-chains" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +dependencies = [ + "num_enum", + "strum 0.26.3", +] + [[package]] name = "alloy-consensus" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-eips", + "alloy-eips 0.1.0", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.0", + "c-kzg", + "serde", +] + +[[package]] +name = "alloy-consensus" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-eips 0.1.2", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.2", "c-kzg", "serde", ] @@ -161,22 +206,52 @@ source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60 dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-network", + "alloy-network 0.1.0", "alloy-primitives", - "alloy-provider", + "alloy-provider 0.1.0", "alloy-rpc-types", "alloy-sol-types", - "alloy-transport", + "alloy-transport 0.1.0", + "futures", + "futures-util", + "thiserror", +] + +[[package]] +name = "alloy-contract" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network 0.1.2", + "alloy-primitives", + "alloy-provider 0.1.2", + "alloy-rpc-types-eth", + "alloy-sol-types", + "alloy-transport 0.1.2", "futures", "futures-util", "thiserror", ] +[[package]] +name = "alloy-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5af3faff14c12c8b11037e0a093dd157c3702becb8435577a2408534d0758315" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-types", +] + [[package]] name = "alloy-dyn-abi" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8425a283510106b1a6ad25dd4bb648ecde7da3fd2baeb9400a85ad62f51ec90b" +checksum = "cb6e6436a9530f25010d13653e206fab4c9feddacf21a54de8d7311b275bc56b" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -196,7 +271,21 @@ source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60 dependencies = [ "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.0", + "c-kzg", + "once_cell", + "serde", + "sha2 0.10.8", +] + +[[package]] +name = "alloy-eips" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.2", "c-kzg", "once_cell", "serde", @@ -209,16 +298,26 @@ version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ "alloy-primitives", - "alloy-serde", + "alloy-serde 0.1.0", "serde", "serde_json", ] +[[package]] +name = "alloy-genesis" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-primitives", + "alloy-serde 0.1.2", + "serde", +] + [[package]] name = "alloy-json-abi" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30946aa6173020259055a44971f5cf40a7d76c931d209caeb51b333263df4f" +checksum = "aaeaccd50238126e3a0ff9387c7c568837726ad4f4e399b528ca88104d6c25ef" dependencies = [ "alloy-primitives", "alloy-sol-type-parser", @@ -238,28 +337,74 @@ dependencies = [ "tracing", ] +[[package]] +name = "alloy-json-rpc" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "alloy-network" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-json-rpc", + "alloy-consensus 0.1.0", + "alloy-eips 0.1.0", + "alloy-json-rpc 0.1.0", "alloy-primitives", "alloy-rpc-types", - "alloy-signer", + "alloy-signer 0.1.0", "alloy-sol-types", "async-trait", "futures-utils-wasm", "thiserror", ] +[[package]] +name = "alloy-network" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", + "alloy-json-rpc 0.1.2", + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde 0.1.2", + "alloy-signer 0.1.2", + "alloy-sol-types", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", +] + +[[package]] +name = "alloy-node-bindings" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-genesis 0.1.2", + "alloy-primitives", + "k256", + "serde_json", + "tempfile", + "thiserror", + "tracing", + "url", +] + [[package]] name = "alloy-primitives" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8aa973e647ec336810a9356af8aea787249c9d00b1525359f3db29a68d231b" +checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" dependencies = [ "alloy-rlp", "bytes", @@ -282,15 +427,15 @@ name = "alloy-provider" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-eips", - "alloy-json-rpc", - "alloy-network", + "alloy-eips 0.1.0", + "alloy-json-rpc 0.1.0", + "alloy-network 0.1.0", "alloy-primitives", - "alloy-rpc-client", + "alloy-rpc-client 0.1.0", "alloy-rpc-types", "alloy-rpc-types-trace", - "alloy-transport", - "alloy-transport-http", + "alloy-transport 0.1.0", + "alloy-transport-http 0.1.0", "async-stream", "async-trait", "auto_impl", @@ -306,6 +451,40 @@ dependencies = [ "url", ] +[[package]] +name = "alloy-provider" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-chains", + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", + "alloy-json-rpc 0.1.2", + "alloy-network 0.1.2", + "alloy-node-bindings", + "alloy-primitives", + "alloy-rpc-client 0.1.2", + "alloy-rpc-types-anvil", + "alloy-rpc-types-eth", + "alloy-signer-local", + "alloy-transport 0.1.2", + "alloy-transport-http 0.1.2", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "futures", + "futures-utils-wasm", + "lru", + "pin-project", + "reqwest 0.12.4", + "serde", + "serde_json", + "tokio", + "tracing", + "url", +] + [[package]] name = "alloy-rlp" version = "0.3.4" @@ -333,9 +512,29 @@ name = "alloy-rpc-client" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-json-rpc", - "alloy-transport", - "alloy-transport-http", + "alloy-json-rpc 0.1.0", + "alloy-transport 0.1.0", + "alloy-transport-http 0.1.0", + "futures", + "pin-project", + "reqwest 0.12.4", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-json-rpc 0.1.2", + "alloy-transport 0.1.2", + "alloy-transport-http 0.1.2", "futures", "pin-project", "reqwest 0.12.4", @@ -353,12 +552,12 @@ name = "alloy-rpc-types" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-consensus", - "alloy-eips", - "alloy-genesis", + "alloy-consensus 0.1.0", + "alloy-eips 0.1.0", + "alloy-genesis 0.1.0", "alloy-primitives", "alloy-rlp", - "alloy-serde", + "alloy-serde 0.1.0", "alloy-sol-types", "itertools 0.12.1", "serde", @@ -366,6 +565,33 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-rpc-types-anvil" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-primitives", + "alloy-serde 0.1.2", + "serde", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-eips 0.1.2", + "alloy-primitives", + "alloy-rlp", + "alloy-serde 0.1.2", + "alloy-sol-types", + "itertools 0.13.0", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "alloy-rpc-types-trace" version = "0.1.0" @@ -373,7 +599,7 @@ source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60 dependencies = [ "alloy-primitives", "alloy-rpc-types", - "alloy-serde", + "alloy-serde 0.1.0", "serde", "serde_json", ] @@ -388,6 +614,16 @@ dependencies = [ "serde_json", ] +[[package]] +name = "alloy-serde" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + [[package]] name = "alloy-signer" version = "0.1.0" @@ -401,15 +637,43 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-signer" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", + "thiserror", +] + +[[package]] +name = "alloy-signer-local" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-consensus 0.1.2", + "alloy-network 0.1.2", + "alloy-primitives", + "alloy-signer 0.1.2", + "async-trait", + "k256", + "rand", + "thiserror", +] + [[package]] name = "alloy-signer-wallet" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-consensus", - "alloy-network", + "alloy-consensus 0.1.0", + "alloy-network 0.1.0", "alloy-primitives", - "alloy-signer", + "alloy-signer 0.1.0", "async-trait", "k256", "rand", @@ -418,9 +682,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dbd17d67f3e89478c8a634416358e539e577899666c927bc3d2b1328ee9b6ca" +checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", @@ -432,14 +696,14 @@ dependencies = [ [[package]] name = "alloy-sol-macro-expander" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6da95adcf4760bb4b108fefa51d50096c5e5fdd29ee72fed3e86ee414f2e34" +checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" dependencies = [ "alloy-json-abi", "alloy-sol-macro-input", "const-hex", - "heck 0.4.1", + "heck 0.5.0", "indexmap 2.2.6", "proc-macro-error", "proc-macro2", @@ -451,9 +715,9 @@ dependencies = [ [[package]] name = "alloy-sol-macro-input" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32c8da04c1343871fb6ce5a489218f9c85323c8340a36e9106b5fc98d4dd59d5" +checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" dependencies = [ "alloy-json-abi", "const-hex", @@ -468,18 +732,18 @@ dependencies = [ [[package]] name = "alloy-sol-type-parser" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368cae4dc052cad1d8f72eb2ae0c38027116933eeb49213c200a9e9875f208d7" +checksum = "baa2fbd22d353d8685bd9fee11ba2d8b5c3b1d11e56adb3265fcf1f32bfdf404" dependencies = [ "winnow 0.6.8", ] [[package]] name = "alloy-sol-types" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a64d2d2395c1ac636b62419a7b17ec39031d6b2367e66e9acbf566e6055e9c" +checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -493,7 +757,7 @@ name = "alloy-transport" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-json-rpc", + "alloy-json-rpc 0.1.0", "base64 0.22.1", "futures-util", "futures-utils-wasm", @@ -506,13 +770,44 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "alloy-transport" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-json-rpc 0.1.2", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "url", +] + [[package]] name = "alloy-transport-http" version = "0.1.0" source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" dependencies = [ - "alloy-json-rpc", - "alloy-transport", + "alloy-json-rpc 0.1.0", + "alloy-transport 0.1.0", + "reqwest 0.12.4", + "serde_json", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-transport-http" +version = "0.1.2" +source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +dependencies = [ + "alloy-json-rpc 0.1.2", + "alloy-transport 0.1.2", "reqwest 0.12.4", "serde_json", "tower", @@ -7177,6 +7472,22 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.3" @@ -7665,6 +7976,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -8106,15 +8426,15 @@ dependencies = [ name = "katana-core" version = "0.7.3-alpha.0" dependencies = [ - "alloy-contract", - "alloy-network", + "alloy-contract 0.1.0", + "alloy-network 0.1.0", "alloy-primitives", - "alloy-provider", + "alloy-provider 0.1.0", "alloy-rpc-types", - "alloy-signer", + "alloy-signer 0.1.0", "alloy-signer-wallet", "alloy-sol-types", - "alloy-transport", + "alloy-transport 0.1.0", "anyhow", "assert_matches", "async-trait", @@ -8254,8 +8574,10 @@ dependencies = [ name = "katana-rpc" version = "0.7.3-alpha.0" dependencies = [ + "alloy", "anyhow", "assert_matches", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "dojo-metrics", @@ -8273,13 +8595,16 @@ dependencies = [ "katana-rpc-api", "katana-rpc-types", "katana-rpc-types-builder", + "katana-runner", "katana-tasks", "metrics", + "rand", "serde", "serde_json", "serde_with 2.3.3", "starknet", "starknet_api", + "tempfile", "thiserror", "tokio", "tower", @@ -9949,6 +10274,26 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.64", +] + [[package]] name = "num_threads" version = "0.1.7" @@ -11348,7 +11693,7 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.28", "hyper-rustls 0.24.2", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -11397,11 +11742,13 @@ dependencies = [ "http-body-util", "hyper 1.3.1", "hyper-rustls 0.26.0", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -11413,6 +11760,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", + "tokio-native-tls", "tokio-rustls 0.25.0", "tower-service", "url", @@ -11723,9 +12071,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -11747,9 +12095,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "runner-macro" @@ -13627,6 +13975,15 @@ dependencies = [ "strum_macros 0.25.3", ] +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", +] + [[package]] name = "strum_macros" version = "0.24.3" @@ -13653,6 +14010,19 @@ dependencies = [ "syn 2.0.64", ] +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.64", +] + [[package]] name = "stun" version = "0.5.1" @@ -13749,9 +14119,9 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8db114c44cf843a8bacd37a146e37987a0b823a0e8bc4fdc610c9c72ab397a5" +checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" dependencies = [ "paste", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index e59576672f..aa06e92b8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -212,8 +212,8 @@ wasm-prost = { version = "0.11.9", package = "prost" } wasm-tonic = { version = "0.9.2", default-features = false, features = [ "codegen", "gzip", "prost" ], package = "tonic" } wasm-tonic-build = { version = "0.9.2", default-features = false, features = [ "prost" ], package = "tonic-build" } -alloy-primitives = { version = "0.7.2", default-features = false } -alloy-sol-types = { version = "0.7.2", default-features = false } +alloy-primitives = { version = "0.7.6", default-features = false } +alloy-sol-types = { version = "0.7.6", default-features = false } criterion = "0.5.1" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock index 440bb61dbe..815d300273 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock @@ -10,12 +10,12 @@ dependencies = [ [[package]] name = "dojo" -version = "0.7.0" +version = "0.7.2" dependencies = [ "dojo_plugin", ] [[package]] name = "dojo_plugin" -version = "0.3.11" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7d8aa29a92062fcb9e6659" +version = "0.4.1" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" diff --git a/crates/katana/core/src/service/messaging/ethereum.rs b/crates/katana/core/src/service/messaging/ethereum.rs index 8a6cf4d733..40990876dc 100644 --- a/crates/katana/core/src/service/messaging/ethereum.rs +++ b/crates/katana/core/src/service/messaging/ethereum.rs @@ -86,6 +86,9 @@ impl EthereumMessaging { address: FilterSet::

::from(self.messaging_contract_address), topics: [ Topic::from( + // LogMessageToL2 (index_topic_1 address fromAddress, index_topic_2 uint256 + // toAddress, index_topic_3 uint256 selector, uint256[] + // payload, uint256 nonce, uint256 fee) "0xdb80dd488acf86d17c747445b0eabb5d57c541d3bd7b6b87af987858e5066b2b" .parse::() .unwrap(), @@ -125,6 +128,7 @@ impl Messenger for EthereumMessaging { chain_id: ChainId, ) -> MessengerResult<(u64, Vec)> { let chain_latest_block: u64 = self.provider.get_block_number().await?; + trace!(target: LOG_TARGET, from_block, max_blocks, ?chain_id, latest_block = chain_latest_block, "Gathering messages ethereum."); // +1 as the from_block counts as 1 block fetched. let to_block = if from_block + max_blocks + 1 < chain_latest_block { @@ -135,6 +139,7 @@ impl Messenger for EthereumMessaging { let mut l1_handler_txs = vec![]; + trace!(target: LOG_TARGET, from_block, to_block, "Fetching logs from {from_block} to {to_block}."); self.fetch_logs(from_block, to_block).await?.into_iter().for_each( |(block_number, block_logs)| { debug!( diff --git a/crates/katana/primitives/src/utils/transaction.rs b/crates/katana/primitives/src/utils/transaction.rs index 752c6a7fd4..0157c3a15c 100644 --- a/crates/katana/primitives/src/utils/transaction.rs +++ b/crates/katana/primitives/src/utils/transaction.rs @@ -241,6 +241,15 @@ pub fn compute_invoke_v3_tx_hash( /// Computes the hash of a L1 handler transaction /// from the fields involved in the computation, /// as felts values. +/// +/// The [Starknet docs] seem to be different than how it's implemented by Starknet node client +/// implementations - [Juno], [Pathfinder], and [Deoxys]. So, we follow those implementations +/// instead. +/// +/// [Juno]: https://github.com/NethermindEth/juno/blob/d9e64106a3a6d81d217d3c8baf28749f4f0bdd71/core/transaction.go#L561-L569 +/// [Pathfinder]: https://github.com/eqlabs/pathfinder/blob/677fd40fbae7b5b659bf169e56f055c59cbb3f52/crates/common/src/transaction.rs#L556 +/// [Deoxys]: https://github.com/KasarLabs/deoxys/blob/82c49acdaa1167bc8dc67a3f6ad3d6856c6c7e89/crates/primitives/transactions/src/compute_hash.rs#L142-L151 +/// [Starknet docs]: https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/#hashing_l1-l2 pub fn compute_l1_handler_tx_hash( version: FieldElement, contract_address: FieldElement, diff --git a/crates/katana/rpc/rpc/Cargo.toml b/crates/katana/rpc/rpc/Cargo.toml index b455d5c465..0b0ef25f66 100644 --- a/crates/katana/rpc/rpc/Cargo.toml +++ b/crates/katana/rpc/rpc/Cargo.toml @@ -7,6 +7,7 @@ repository.workspace = true version.workspace = true [dependencies] +dojo-world = { workspace = true } dojo-metrics.workspace = true katana-core.workspace = true katana-executor.workspace = true @@ -16,7 +17,7 @@ katana-rpc-api.workspace = true katana-rpc-types-builder.workspace = true katana-rpc-types.workspace = true katana-tasks.workspace = true - +tempfile = "3.8.1" anyhow.workspace = true flate2.workspace = true futures.workspace = true @@ -24,6 +25,7 @@ hex = { workspace = true } hyper.workspace = true jsonrpsee = { workspace = true, features = [ "server" ] } metrics.workspace = true +rand.workspace = true serde.workspace = true serde_json.workspace = true serde_with.workspace = true @@ -34,6 +36,7 @@ tokio.workspace = true tower = { workspace = true, features = [ "full" ] } tower-http = { workspace = true, features = [ "full" ] } tracing.workspace = true +cainome.workspace = true [dev-dependencies] assert_matches.workspace = true @@ -43,4 +46,13 @@ dojo-test-utils.workspace = true dojo-world.workspace = true jsonrpsee = { workspace = true, features = [ "client" ] } katana-rpc-api = { workspace = true, features = [ "client" ] } +katana-runner.workspace = true url.workspace = true +alloy = { git = "https://github.com/alloy-rs/alloy", features = [ + "contract", + "network", + "providers", + "signer-local", + "provider-http", + "node-bindings" +] } \ No newline at end of file diff --git a/crates/katana/rpc/rpc/tests/messaging.rs b/crates/katana/rpc/rpc/tests/messaging.rs new file mode 100644 index 0000000000..a2dffb8538 --- /dev/null +++ b/crates/katana/rpc/rpc/tests/messaging.rs @@ -0,0 +1,313 @@ +use std::path::PathBuf; +use std::str::FromStr; +use std::time::Duration; + +use alloy::primitives::{Uint, U256}; +use alloy::providers::{ProviderBuilder, WalletProvider}; +use alloy::sol; +use cainome::cairo_serde::EthAddress; +use cainome::rs::abigen; +use dojo_world::utils::TransactionWaiter; +use katana_primitives::utils::transaction::{ + compute_l1_handler_tx_hash, compute_l1_to_l2_message_hash, compute_l2_to_l1_message_hash, +}; +use katana_runner::{KatanaRunner, KatanaRunnerConfig}; +use rand::Rng; +use serde_json::json; +use starknet::accounts::{Account, ConnectedAccount}; +use starknet::contract::ContractFactory; +use starknet::core::types::{ + BlockId, BlockTag, ContractClass, FieldElement, Hash256, MaybePendingTransactionReceipt, + Transaction, TransactionFinalityStatus, TransactionReceipt, +}; +use starknet::core::utils::get_contract_address; +use starknet::macros::selector; +use starknet::providers::Provider; +use tempfile::tempdir; + +mod common; + +sol!( + #[allow(missing_docs)] + #[sol(rpc)] + StarknetContract, + "tests/test_data/solidity/StarknetMessagingLocalCompiled.json" +); + +sol!( + #[allow(missing_docs)] + #[sol(rpc)] + Contract1, + "tests/test_data/solidity/Contract1Compiled.json" +); + +abigen!(CairoMessagingContract, "crates/katana/rpc/rpc/tests/test_data/cairo_l1_msg_contract.json"); + +#[tokio::test(flavor = "multi_thread")] +async fn test_messaging() { + // TODO: If there's a way to get the endpoint of anvil from the `l1_provider`, we could + // remove that and use default anvil to let the OS assign the port. + let port: u16 = rand::thread_rng().gen_range(35000..65000); + + let l1_provider = { + ProviderBuilder::new() + .with_recommended_fillers() + .on_anvil_with_wallet_and_config(|anvil| anvil.port(port)) + }; + + // Deploy the core messaging contract on L1 + let core_contract = StarknetContract::deploy(&l1_provider).await.unwrap(); + + // Deploy test contract on L1 used to send/receive messages to/from L2 + let l1_test_contract = Contract1::deploy(&l1_provider, *core_contract.address()).await.unwrap(); + + // Prepare Katana + Messaging Contract + let messaging_config = json!({ + "chain": "ethereum", + "rpc_url": format!("http://localhost:{}", port), + "contract_address": core_contract.address().to_string(), + "sender_address": l1_provider.default_signer_address(), + "private_key": "", + "interval": 2, + "from_block": 0 + }) + .to_string(); + + let dir = tempdir().expect("failed creating temp dir"); + let path = dir.path().join("temp-anvil-messaging.json"); + std::fs::write(&path, messaging_config.as_bytes()).expect("failed to write config to file"); + + let katana_runner = KatanaRunner::new_with_config(KatanaRunnerConfig { + n_accounts: 2, + messaging: Some(path.to_str().unwrap().to_string()), + ..Default::default() + }) + .unwrap(); + + let katana_account = katana_runner.account(0); + + // Deploy test L2 contract that can send/receive messages to/from L1 + let l2_test_contract = { + // Prepare contract declaration params + let path = PathBuf::from("tests/test_data/cairo_l1_msg_contract.json"); + let (contract, compiled_hash) = common::prepare_contract_declaration_params(&path).unwrap(); + + // Declare the contract + let class_hash = contract.class_hash(); + let res = katana_account.declare(contract.into(), compiled_hash).send().await.unwrap(); + + // The waiter already checks that the transaction is accepted and succeeded on L2. + TransactionWaiter::new(res.transaction_hash, katana_account.provider()) + .await + .expect("declare tx failed"); + + // Checks that the class was indeed declared + let block_id = BlockId::Tag(BlockTag::Latest); + let actual_class = katana_account.provider().get_class(block_id, class_hash).await.unwrap(); + + let ContractClass::Sierra(class) = actual_class else { panic!("Invalid class type") }; + assert_eq!(class.class_hash(), class_hash, "invalid declared class"); // just to make sure the rpc returns the correct class + + // Compute the contract address + let address = get_contract_address(FieldElement::ZERO, class_hash, &[], FieldElement::ZERO); + + // Deploy the contract using UDC + let res = ContractFactory::new(class_hash, &katana_account) + .deploy(Vec::new(), FieldElement::ZERO, false) + .send() + .await + .expect("Unable to deploy contract"); + + // The waiter already checks that the transaction is accepted and succeeded on L2. + TransactionWaiter::new(res.transaction_hash, katana_account.provider()) + .await + .expect("deploy tx failed"); + + // Checks that the class was indeed deployed with the correct class + let actual_class_hash = katana_account + .provider() + .get_class_hash_at(block_id, address) + .await + .expect("failed to get class hash at address"); + + assert_eq!(actual_class_hash, class_hash, "invalid deployed class"); + + address + }; + + // Send message from L1 to L2 + { + // The L1 sender address + let sender = l1_test_contract.address(); + // The L2 contract address to send the message to + let recipient = l2_test_contract; + // The L2 contract function to call + let selector = selector!("msg_handler_value"); + // The L2 contract function arguments + let calldata = [123u8]; + // Get the current L1 -> L2 message nonce + let nonce = core_contract.l1ToL2MessageNonce().call().await.expect("get nonce")._0; + + // Send message to L2 + let call = l1_test_contract + .sendMessage( + U256::from_str(&recipient.to_string()).unwrap(), + U256::from_str(&selector.to_string()).unwrap(), + calldata.iter().map(|x| U256::from(*x)).collect::>(), + ) + .gas(12000000) + .value(Uint::from(1)); + + let receipt = call + .send() + .await + .expect("failed to send tx") + .get_receipt() + .await + .expect("error getting transaction receipt"); + + assert!(receipt.status(), "failed to send L1 -> L2 message"); + + // Wait for the tx to be mined on L2 (Katana) + tokio::time::sleep(Duration::from_secs(5)).await; + + // In an l1_handler transaction, the first element of the calldata is always the Ethereum + // address of the sender (msg.sender). + let mut l1_tx_calldata = vec![FieldElement::from_byte_slice_be(sender.as_slice()).unwrap()]; + l1_tx_calldata.extend(calldata.iter().map(|x| FieldElement::from(*x))); + + // Compute transaction hash + let tx_hash = compute_l1_handler_tx_hash( + FieldElement::ZERO, + recipient, + selector, + &l1_tx_calldata, + katana_runner.provider().chain_id().await.unwrap(), + nonce.to::().into(), + ); + + // fetch the transaction + let tx = katana_account + .provider() + .get_transaction_by_hash(tx_hash) + .await + .expect("failed to get l1 handler tx"); + + let Transaction::L1Handler(ref tx) = tx else { + panic!("invalid transaction type"); + }; + + // Assert the transaction fields + assert_eq!(tx.contract_address, recipient); + assert_eq!(tx.entry_point_selector, selector); + assert_eq!(tx.calldata, l1_tx_calldata); + + // fetch the receipt + let receipt = katana_account + .provider() + .get_transaction_receipt(tx.transaction_hash) + .await + .expect("failed to get receipt"); + + match receipt { + MaybePendingTransactionReceipt::Receipt(receipt) => { + let TransactionReceipt::L1Handler(receipt) = receipt else { + panic!("invalid receipt type"); + }; + + let msg_hash = compute_l1_to_l2_message_hash( + sender.as_slice().try_into().unwrap(), + recipient, + selector, + &calldata.iter().map(|x| FieldElement::from(*x)).collect::>(), + nonce.to::(), + ); + + let msg_fee = core_contract + .l1ToL2Messages(msg_hash) + .call() + .await + .expect("failed to get msg fee"); + + assert_ne!(msg_fee._0, U256::ZERO, "msg fee must be non-zero if exist"); + assert_eq!(receipt.message_hash, Hash256::from_bytes(msg_hash.0)); + } + + _ => { + panic!("Error, No Receipt TransactionReceipt") + } + } + } + + // Send message from L2 to L1 + { + // The L1 contract address to send the message to + let l1_contract_address = l1_test_contract.address(); + let l1_contract_address = FieldElement::from_str(&l1_contract_address.to_string()).unwrap(); + + let l2_contract = CairoMessagingContract::new(l2_test_contract, &katana_account); + + // Send message to L1 + let res = l2_contract + .send_message_value(&EthAddress::from(l1_contract_address), &FieldElement::TWO) + .send() + .await + .expect("Call to send_message_value failed"); + + TransactionWaiter::new(res.transaction_hash, katana_account.provider()) + .with_tx_status(TransactionFinalityStatus::AcceptedOnL2) + .await + .expect("send message to l1 tx failed"); + + // Wait for the tx to be mined on L1 (Anvil) + tokio::time::sleep(Duration::from_secs(3)).await; + + // Query the core messaging contract to check that the l2 -> l1 message hash have been + // registered. If the message is registered, calling `l2ToL1Messages` of the L1 core + // contract with the message hash should return a non-zero value. + + let l2_l1_msg_hash = compute_l2_to_l1_message_hash( + l2_test_contract, + l1_contract_address, + &[FieldElement::TWO], + ); + + let msg_fee = core_contract + .l2ToL1Messages(l2_l1_msg_hash) + .call() + .await + .expect("failed to get msg fee"); + + assert_ne!(msg_fee._0, U256::ZERO, "msg fee must be non-zero if exist"); + + // We then consume the message. + // Upon consuming the message, the value returned by `l2ToL1Messages` should be zeroed. + + // The L2 contract address that sent the message + let from_address = U256::from_str(&l2_test_contract.to_string()).unwrap(); + // The message payload + let payload = vec![U256::from(2)]; + + let receipt = l1_test_contract + .consumeMessage(from_address, payload) + .gas(12000000) + .nonce(4) + .send() + .await + .expect("failed to send tx") + .get_receipt() + .await + .expect("error getting transaction receipt"); + + assert!(receipt.status(), "failed to consume L2 message from L1"); + + // Check that the message fee is zero after consuming the message. + let msg_fee = core_contract + .l2ToL1Messages(l2_l1_msg_hash) + .call() + .await + .expect("failed to get msg fee"); + + assert_eq!(msg_fee._0, U256::ZERO, "msg fee must be zero after consuming"); + } +} diff --git a/crates/katana/rpc/rpc/tests/test_data/cairo_l1_msg_contract.json b/crates/katana/rpc/rpc/tests/test_data/cairo_l1_msg_contract.json new file mode 100644 index 0000000000..f786472b2e --- /dev/null +++ b/crates/katana/rpc/rpc/tests/test_data/cairo_l1_msg_contract.json @@ -0,0 +1,1470 @@ +{ + "sierra_program": [ + "0x1", + "0x3", + "0x0", + "0x2", + "0x3", + "0x1", + "0x117", + "0xe9", + "0x1f", + "0x52616e6765436865636b", + "0x800000000000000100000000000000000000000000000000", + "0x537472756374", + "0x800000000000000f00000000000000000000000000000001", + "0x0", + "0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3", + "0x456e756d", + "0x800000000000000700000000000000000000000000000003", + "0x3288d594b9a45d15bb2fcb7903f06cdb06b27f0ba88186ec4cfaa98307cb972", + "0x1", + "0x75313238", + "0x800000000000000700000000000000000000000000000000", + "0x25e2ca4b84968c2d8b83ef476ca8549410346b00836ce79beaf538155990bb2", + "0x3", + "0x66656c74323532", + "0x4e6f6e5a65726f", + "0x800000000000000700000000000000000000000000000001", + "0x5", + "0x800000000000000f00000000000000000000000000000002", + "0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672", + "0x4172726179", + "0x800000000000000300000000000000000000000000000001", + "0x800000000000000300000000000000000000000000000003", + "0x8", + "0x9", + "0xcc5e86243f861d2d64b08c35db21013e773ac5cf10097946fe0011304886d5", + "0x7", + "0xa", + "0x101dc0399934cc08fa0d6f6f2daead4e4a38cabeea1c743e1fc28d2d6e58e99", + "0x426f78", + "0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7", + "0xd", + "0x11768e87c7f29225e23c46e30970edb33966ba325a7d2df7260c3cdb94d3f78", + "0x299f0c4933082841c64290acfbe838708dc2dc846019e755118fa1c060cdfec", + "0xf", + "0x536e617073686f74", + "0x800000000000000700000000000000000000000000000002", + "0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62", + "0x11", + "0x12", + "0xa36ef284c59d4c2496d87a0fe05fee3cff63de196cbbe95c938850566623c5", + "0x800000000000000f00000000000000000000000000000003", + "0x14", + "0x234dfb0689b56ce38e8b6ebca818da25abc7465d761179bbffdc52129c51d4", + "0x15", + "0x4275696c74696e436f737473", + "0x53797374656d", + "0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6", + "0x13", + "0x753332", + "0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511", + "0x3233063c5dc6197e9bf4ddc53b925e10907665cf58255b7899f8212442d4605", + "0x24d668d7ede46c87d2cddfbcf73195c96f0ca8075ae10c8a468054b80120d78", + "0x1c", + "0x4761734275696c74696e", + "0x8a", + "0x7265766f6b655f61705f747261636b696e67", + "0x77697468647261775f676173", + "0x6272616e63685f616c69676e", + "0x73746f72655f74656d70", + "0x66756e6374696f6e5f63616c6c", + "0x4", + "0x656e756d5f6d61746368", + "0x1d", + "0x1b", + "0x7374727563745f6465636f6e737472756374", + "0x61727261795f6c656e", + "0x736e617073686f745f74616b65", + "0x1a", + "0x64726f70", + "0x7533325f636f6e7374", + "0x2", + "0x72656e616d65", + "0x7533325f6571", + "0x61727261795f6e6577", + "0x66656c743235325f636f6e7374", + "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473", + "0x61727261795f617070656e64", + "0x7374727563745f636f6e737472756374", + "0x656e756d5f696e6974", + "0x19", + "0x1e", + "0x18", + "0x6765745f6275696c74696e5f636f737473", + "0x17", + "0x77697468647261775f6761735f616c6c", + "0x6", + "0x16", + "0x4f7574206f6620676173", + "0x4661696c656420746f20646573657269616c697a6520706172616d202332", + "0x4661696c656420746f20646573657269616c697a6520706172616d202331", + "0x10", + "0xb", + "0x61727261795f736e617073686f745f706f705f66726f6e74", + "0xe", + "0x6a756d70", + "0x756e626f78", + "0xc", + "0x73656e645f6d6573736167655f746f5f6c315f73797363616c6c", + "0x7b", + "0x66656c743235325f737562", + "0x66656c743235325f69735f7a65726f", + "0x496e76616c69642076616c7565", + "0x646174612e6220697320696e76616c6964", + "0x646174612e6120697320696e76616c6964", + "0x647570", + "0x753132385f636f6e7374", + "0x100000000", + "0x75313238735f66726f6d5f66656c74323532", + "0x753132385f6f766572666c6f77696e675f737562", + "0x753132385f6571", + "0x37f", + "0xffffffffffffffff", + "0x76", + "0x67", + "0x57", + "0x26", + "0x20", + "0x21", + "0x22", + "0x23", + "0x24", + "0x25", + "0x27", + "0x28", + "0x29", + "0x48", + "0x2a", + "0x2b", + "0x2c", + "0x30", + "0x31", + "0x32", + "0x33", + "0x34", + "0x2d", + "0x2e", + "0x2f", + "0x35", + "0x41", + "0x36", + "0x37", + "0x38", + "0x39", + "0x3a", + "0x3b", + "0x3c", + "0x3d", + "0x3e", + "0x3f", + "0x40", + "0x42", + "0x43", + "0x44", + "0x45", + "0x46", + "0x47", + "0x49", + "0x4a", + "0x4b", + "0x4c", + "0x4d", + "0x4e", + "0x4f", + "0x50", + "0x51", + "0x52", + "0x53", + "0x54", + "0x55", + "0x56", + "0x58", + "0x59", + "0x5a", + "0x5b", + "0x5c", + "0x5d", + "0x5e", + "0x5f", + "0x60", + "0x61", + "0x62", + "0x63", + "0x64", + "0x65", + "0x66", + "0x68", + "0x69", + "0x6a", + "0x6b", + "0x6c", + "0x6d", + "0xfa", + "0xeb", + "0xdb", + "0xaa", + "0xcc", + "0xc5", + "0x17c", + "0x16d", + "0x15d", + "0x12e", + "0x14e", + "0x147", + "0x1fe", + "0x1ef", + "0x1df", + "0x1b0", + "0x1d0", + "0x1c9", + "0x217", + "0x224", + "0x229", + "0x233", + "0x24a", + "0x24f", + "0x25b", + "0x275", + "0x26f", + "0x28f", + "0x294", + "0x2a0", + "0x2b8", + "0x2ed", + "0x2e1", + "0x6e", + "0x6f", + "0x70", + "0x30d", + "0x312", + "0x71", + "0x72", + "0x73", + "0x74", + "0x31e", + "0x75", + "0x77", + "0x78", + "0x79", + "0x7a", + "0x7c", + "0x7d", + "0x33a", + "0x33e", + "0x7e", + "0x7f", + "0x80", + "0x36c", + "0x81", + "0x82", + "0x83", + "0x84", + "0x358", + "0x85", + "0x86", + "0x369", + "0x361", + "0x367", + "0x87", + "0x88", + "0x376", + "0x89", + "0x108", + "0x18a", + "0x20c", + "0x21d", + "0x23a", + "0x262", + "0x27a", + "0x2a7", + "0x2c4", + "0x2fa", + "0x315", + "0x318", + "0x324", + "0x333", + "0x341", + "0x379", + "0x1ea5", + "0x301e0e05038140d02820060c05828140a050240a08038180a04018080200", + "0x1c320a0c0280c050b80c240a0b05428050200c140a030142603090282210", + "0x2814200507c0a080384814110f064140a050740a1703870141b050680a17", + "0xc4e0a130144a030c828222405028460a11014100709028240a108141003", + "0x305c1c050b4142c0285c0e0a050ac1406028a80629028100628050180a25", + "0x1c240a1a0144a0305028240a198141007060c8380a1882860050b81c042f", + "0x38143d14028143c02828143c028ec0a3a028e470021b8281436050d40a08", + "0x288c45050288812050288628050288441050287e12070287a40050287e3e", + "0x28144b1b0281446090281446029288a0a050f08a0a051240a480511c8a0a", + "0x28905105120a01c050289e18050289e12050289c1205028784d240289812", + "0x28143c15828144f02958aa0a050f00a5428828143c29828143c29028143c", + "0x289e19050288c1905028882d050288c58050287e57070287a3605028782b", + "0x120144c1402814460502814462c920144c02920a20a24140620a0513c500a", + "0x287a18070287a23050287823050288c5c050287e1b070287a5b24028985a", + "0x28905009028145e05120800a24140800a050f0ba0e050f4380e050f4320e", + "0x17c140a1f828905f05120a00a050289e053017c140a1e09c140a1e014905f", + "0x38143d05120820a24140820a050f00a48208289050090281449090281461", + "0x801c0a1e988140a24828906205120a06205028780524188144828014c662", + "0x140560a05118b00a050f00a482c028905016828144f0d82814462e828143f", + "0x28880a24170144828170140a1e014905c05120a023050289e0a241601448", + "0x130ae0a051180a6602994c84805130240a05110be0e050f4320a050f0460a", + "0x48140a351a4900a261a0900a26120900a26028900a2608c140a2119c900a", + "0x28143c1f02814490282814491f028144f36120146b02920146b11838143d", + "0x188140a1f8d8140a21014904005120a036050289e48050287e5c070287a3e", + "0x38143d11828146a05120ba0a24140ba0a050f00a482e82890500d828144f", + "0x28880e050288c0537038140a350f8140a21014da0a050289219050289227", + "0x28144905120900a24140900a050f00a48240289050029bc1c0a051241c0a", + "0x143657241c8243e241c4900a029201405029c4140502814e00a050287848", + "0x28c45d240480a62051c4140e050f80a5d051c4143e050380a05388280a48", + "0x28320a1f0140a710501490052f828e620051c4901c0515c0a1c0c8601c71", + "0x280a48028c4147414028e2482e02830052e08c90710509c141b0289c1471", + "0x154b048388285a0a2e8145a0a38828560a0e014560a38828460a0c8140a71", + "0x144146202914a24838828a60a2e814a60a388280a2002814e20a2c028c405", + "0x1041471051041423028d8147105114145f02904147105154145f02814e20a", + "0x80142802814e20a140284e05029c41405240140a75029c4903620920b805", + "0x1600a52051c41452050b40a52051c4140515814800a388280a3102814e20a", + "0x1dc1451029dc147105000ec4829814ec0a388280a55028001471051488048", + "0x28e20a2402882053d028e20a090288a053c828e20a0c0281c053c028e20a", + "0x28e20a029000a05388280a48029d4f67a3c8f81475051c41478050d80a7b", + "0x14900540a00907f3f1f49071241f02418070000a7c051c4147c051480a7c", + "0x15080a38828900a20815060a38828fc0a22815040a388280a7602814e20a", + "0x20c247902a1c1471050a0142d02a18147105080147802a141471052081477", + "0x231160a38921140a3d014fa0a38828fa0a07015148944038e20a43a190a84", + "0x291c0a3a8151c0a388280a3102814e20a45828f605029c41405240151a0a", + "0x248147105244147e02a44147105240147d02814e20a47828f8054823c9071", + "0x2882054a828e20a440288a054a028e20a3e8281c0549828e20a490290005", + "0x1440a05388280a4802a5d2c954a0f81497051c41493050d80a96051c41489", + "0x29120a20815320a38829100a22815300a38828fa0a07015180a388291a0a", + "0xa0142702814e20a029200a9b4d265303e0526c147105230143602a681471", + "0x285a054e828e20a02a040a9c051c41405188140a7105080142802814e20a", + "0x28fe9e2414c0a9e051c414052a814fe0a388293a9c241600a9d051c4149d", + "0x288147105204144502a84147105200140e02a8014710527c145102a7c1471", + "0x1c414052401548a3512847c0a52028e20a500286c0551828e20a240288205", + "0x1c41405188140a7105080142802814e20a118291005029c41431052080a05", + "0x154e0a388294ca5241600aa6051c414a6050b40aa6051c41405448154a0a", + "0x60140e02aa81471052a4145102aa414710529d504829815500a388280a55", + "0x28e20a550286c0556028e20a2402882053a028e20a090288a0555828e20a", + "0x14e20a0c8291005029c4145f052080a05388280a4802ab55874558f814ad", + "0x2bd5c482c0155e0a388295e0a168155e0a388280a8a02ab81471050146205", + "0x28e20a59028a20559028e20a582c4905302ac4147105014aa0558028e20a", + "0xd80ab6051c41448051040ab5051c41412051140ab4051c41418050380ab3", + "0xc40a05388281c0a440140a710501490055bad96ab41f0296e0a38829660a", + "0x1c414b95c120b0055c828e20a5c8285a055c828e20a02a040ab8051c41405", + "0x15780a38829760a28815760a3882974732414c0a73051c414052a815740a", + "0x2f0143602afc147105120144102af814710506c144502af414710515c140e", + "0x304243e241c4900a029201405029c414050281580bf5f2f47c0a60028e20a", + "0x480a62051c4140e050f80a5d051c4143e050380a05388280a480286cae48", + "0x140a710501490052f8298420051c4901c0515c0a1c0c8601c7105188ba48", + "0xc414c314028e2482e02908052e08c90710509c14830289c147105064143e", + "0x285a0a2e8145a0a38828560a0e014560a38828460a0c8140a71050149005", + "0x114a24838828a60a2e814a60a388280a2002814e20a2c028c4052a9609071", + "0x1041423028d8147105114145f02904147105154145f02814e20a28828c405", + "0x14e20a140290a05029c41405240140ac4029c4903620920b80520828e20a", + "0x1c41452050b40a52051c4140515814800a388280a3102814e20a100285005", + "0x1dc147105000ec4829814ec0a388280a550280014710514880482c014a40a", + "0x2882053d028e20a090288a053c828e20a0c0281c053c028e20a3b828a205", + "0x1000a05388280a48029d4f67a3c8f81475051c41478050d80a7b051c41448", + "0x20090c53f1f49071241f02418070000a7c051c4147c051480a7c051c41405", + "0x28900a20815060a38828fc0a22815040a388280a7602814e20a029200a81", + "0x21c1471050a0148602a18147105080147802a14147105208147702a101471", + "0x121140a3d014fa0a38828fa0a07015148944038e20a43a190a84418490e05", + "0x151c0a388280a3102814e20a45828f605029c41405240151a0a6322c1471", + "0x244147e02a44147105240147d02814e20a47828f8054823c9071052381475", + "0x28e20a440288a054a028e20a3e8281c0549828e20a49029000549028e20a", + "0x280a4802a5d2c954a0f81497051c41493050d80a96051c41489051040a95", + "0x15320a38829100a22815300a38828fa0a07015180a388291a0a288140a71", + "0x14e20a029200a9b4d265303e0526c147105230143602a681471052241441", + "0x28e20a02a040a9c051c41405188140a7105080142802814e20a140290a05", + "0x14c0a9e051c414052a814fe0a388293a9c241600a9d051c4149d050b40a9d", + "0x204144502a84147105200140e02a8014710527c145102a7c1471051fd3c48", + "0x1548a3512847c0a52028e20a500286c0551828e20a24028820551028e20a", + "0x140a7105080142802814e20a118291005029c41431052080a05388280a48", + "0x294ca5241600aa6051c414a6050b40aa6051c41405448154a0a388280a31", + "0x2a81471052a4145102aa414710529d504829815500a388280a5502a9c1471", + "0x286c0556028e20a2402882053a028e20a090288a0555828e20a0c0281c05", + "0x291005029c4145f052080a05388280a4802ab55874558f814ad051c414aa", + "0x155e0a388295e0a168155e0a388280a8a02ab81471050146205029c41419", + "0x28a20559028e20a582c4905302ac4147105014aa0558028e20a57ab89058", + "0x1c41448051040ab5051c41412051140ab4051c41418050380ab3051c414b2", + "0x281c0a440140a710501490055bad96ab41f0296e0a38829660a1b0156c0a", + "0x120b0055c828e20a5c8285a055c828e20a02a040ab8051c41405188140a71", + "0x29760a28815760a3882974732414c0a73051c414052a815740a3882972b8", + "0x2fc147105120144102af814710506c144502af414710515c140e02af01471", + "0x1c4900a029201405029c414050281580bf5f2f47c0a60028e20a5e0286c05", + "0x1c4141c0506c0a1c051c4140e050f80a05388280a480286cae48638487c48", + "0x1c4140524014c40a641741471240641418028f81471050f8140e028643048", + "0x324b80a38920be0a0c014be20241c414230506c0a23051c41418050f80a05", + "0x28ba0518828e20a14028380514028e20a100283205029c41405240144e0a", + "0x120e20a2c028ba052c028e20a028800a0538828560a310145a2b241c41431", + "0x8c0a45051c414530517c0a51051c4142d0517c0a0538828aa0a31014a655", + "0x28ba0a138140a7105014900502b280a7124114a2482e014a20a38828a20a", + "0xd8142d028d8147105014560520828e20a028c40a0538828b80a138140a71", + "0x1c4144029120a60529028e20a029540a40051c4143620920b0051b028e20a", + "0x14f00a38828240a22814ee0a388287c0a07014ec0a38828000a28814000a", + "0x14e20a029200a7a3c9e0ee3e051e81471051d81436029e41471051201441", + "0x32cf875241c4907b090f81c00029ec1471051ec1452029ec1471050148005", + "0x285a0541028e20a40028ee0540028e20a029d80a05388280a48029f8fa48", + "0x1d4140e02a0414710522510820722c0a89051c4145c050b40a88051c4145d", + "0x1c4148a051ec0a05388280a4802a0c14cc45028e24840828f4053a828e20a", + "0x28fa05029c41485051f00a8642920e20a42028ea0542028e20a028c40a05", + "0x1c41475050380a8d051c4148b052000a8b051c41487051f80a87051c41486", + "0x29220a388291a0a1b015200a38828900a208151e0a38828f80a228151c0a", + "0x24c1471051d4140e02a4814710520c145102814e20a029200a914823d1c3e", + "0x24c7c0a4b028e20a490286c054a828e20a2402882054a028e20a3e0288a05", + "0x280a3102814e20a2e0284e05029c4145d0509c0a05388280a4802a592a94", + "0x2601471052312e482c015180a38829180a16815180a388280a8102a5c1471", + "0x281c054d828e20a4d028a2054d028e20a4c264905302a64147105014aa05", + "0x1c4149b050d80a7f051c41448051040a9d051c4147e051140a9c051c4147d", + "0x1c4145d0509c0a05388284e0a410140a710501490054f1fd3a9c1f0293c0a", + "0x29400a16815400a388280a8902a7c1471050146205029c41420052200a05", + "0x28e20a50a88905302a88147105014aa0550828e20a5027c905802a801471", + "0x1040aa6051c41412051140aa5051c4143e050380aa4051c414a3051440aa3", + "0x140a710501490055429d4ca51f029500a38829480a1b0154e0a38828900a", + "0x2a8147105015140554828e20a028c40a0538828300a440140a71051881482", + "0x120a6053a028e20a029540aab051c414aa54920b00555028e20a550285a05", + "0x28240a228155c0a388287c0a070155a0a38829580a28815580a388295674", + "0x1200ab1582bd5c3e052c41471052b4143602ac0147105120144102abc1471", + "0xb40ab3051c4140540815640a388280a3102814e20a070291005029c41405", + "0x2d16a48298156a0a388280a5502ad01471052cd64482c015660a38829660a", + "0x28e20a0d8288a055c028e20a2b8281c055b828e20a5b028a2055b028e20a", + "0x280a05029cd74b95c0f81473051c414b7050d80aba051c41448051040ab9", + "0x281c0a1f0140a710501490050d95c90cd090f89071240280a48050140a71", + "0x28e2480c82830051f028e20a1f0281c050c860907105070141b028701471", + "0x17c404838828460a41814460a38828300a1f0140a71050149005310299c5d", + "0x700a28051c41420050640a05388280a480289c14cf2e028e2482f8290805", + "0x1c41405100140a71050ac1462028b4564838828620a2e814620a38828500a", + "0x14a20a388285a0a2f8140a710515414620294caa4838828b00a2e814b00a", + "0x1200a0568014e24822944905c0294414710514414230291414710514c145f", + "0xac0a41051c41405188140a7105170148502814e20a2e8284e05029c41405", + "0x1c414052a814800a388286c41241600a36051c41436050b40a36051c41405", + "0x1dc1471050f8140e029d8147105000145102800147105100a44829814a40a", + "0x1dc7c0a3d028e20a3b0286c053c828e20a2402882053c028e20a090288a05", + "0x3800053d828e20a3d828a4053d828e20a029000a05388280a48029e8f278", + "0x1dc0a80051c414053b0140a710501490053f1f490d13e1d49071241ec243e", + "0x221040e46815120a38828b80a43015100a38828ba0a16815040a38829000a", + "0x14900541829a48a051c49081051e80a75051c41475050380a81051c41489", + "0x150c85241c41484051d40a84051c41405188140a7105228147b02814e20a", + "0x29160a40015160a388290e0a3f0150e0a388290c0a3e8140a7105214147c", + "0x240147105120144102a3c1471051f0144502a381471051d4140e02a341471", + "0x28e20a41828a205029c4140524015229047a387c0a48828e20a468286c05", + "0xd80a95051c41448051040a94051c4147c051140a93051c41475050380a92", + "0x2140a0538828ba0a138140a710501490054b25528931f0292c0a38829240a", + "0x230147105230142d02a3014710501502054b828e20a028c40a0538828b80a", + "0x1440a9a051c414984c920a6054c828e20a029540a98051c4148c4b920b005", + "0x28900a208153a0a38828fc0a22815380a38828fa0a07015360a38829340a", + "0x9c148202814e20a029200a9e3fa75383e0527814710526c1436029fc1471", + "0x1512054f828e20a028c40a0538828400a440140a7105174142702814e20a", + "0x28e20a029540aa1051c414a04f920b00550028e20a500285a0550028e20a", + "0x154a0a388287c0a07015480a38829460a28815460a3882942a22414c0aa2", + "0x2994a3e052a0147105290143602a9c147105120144102a981471050481445", + "0x1c41405188140a7105060148802814e20a310290405029c414052401550a7", + "0x15560a3882954a9241600aaa051c414aa050b40aaa051c4140545015520a", + "0xf8140e02ab41471052b0145102ab01471052ace84829814e80a388280a55", + "0x28e20a568286c0558028e20a24028820557828e20a090288a0557028e20a", + "0x2c81471050146205029c4140e052200a05388280a4802ac560af570f814b1", + "0x14aa055a028e20a59ac8905802acc1471052cc142d02acc1471050150205", + "0x1c41457050380ab7051c414b6051440ab6051c414b45a920a6055a828e20a", + "0x28e60a388296e0a1b015740a38828900a20815720a38828360a22815700a", + "0x1201c0a0c0141c48241c4143e0506c0a3e051c4140a050f80a735d2e5703e", + "0x28e20a090285a050c828e20a028281c05029c4140524014ae0a698481471", + "0x188147105120143e0297414710506c140e028603648388283819242380a1c", + "0x17c14710515c149002814e20a029200a20311741c0a10028e20a0c0291e05", + "0x8c1c0a13828e20a2f8291e052e028e20a240287c0511828e20a028281c05", + "0x1c41405240147c0a6a038904838920140a48814140a388280a0a0c8144e5c", + "0x2540a1b051c41412052500a57051c414480524c0a12051c4140e052480a05", + "0x24c0a19051c414180525c0a18051c414054b0140a7105014900502b541405", + "0x28380a1f014380a38828ae0a3e814360a38828320a4a014ae0a388287c0a", + "0x28e20a2e8293005029c4140524014c40a6b17414712406c148c028701471", + "0x26c0a5c051c4141c050f80a23051c4145f052680a5f051c41420052640a20", + "0x280a9602814e20a310290405029c41405240144e5c240284e0a38828460a", + "0xb41471050c4149b028ac147105070143e028c41471050a0149c028a01471", + "0x6c147105014620509028e20a2b8293a052b828e20a07028f005168ac900a", + "0x1f40a0538828320a3e0143819241c41418051d40a18051c4143e0d920b005", + "0x35c4062241c4905d090280a3e3f814ba0a38828ba0a1f014ba0a38828380a", + "0x1140a28051c41427052780a27051c414054b0140a710501490052e08cbe0e", + "0x36014054a8145a0a38828500a4f814560a38828400a20814620a38828c40a", + "0x8c1441028c414710517c14450296014710517014a002814e20a029200a05", + "0x28e20a29829440529828e20a16829420516828e20a2c0293e0515828e20a", + "0x2580a0538828a20a520140a7105014900522829b251051c490550528c0a55", + "0x28620a22814800a388286c0a530146c0a388288248242940a41051c41405", + "0x1490053b000a40e051d814710510014a7028001471050ac1441029481471", + "0x14f00a38828620a22814ee0a388288a0a548140a710512014a802814e20a", + "0x28e20a028287c053d1e4f00e051e81471051dc14a7029e41471050ac1441", + "0x14e20a029200a12053687c0a38920900a0c014900a241c4140e0506c0a0e", + "0x29b619051c4901b050600a1b2b920e20a0c02836050c028e20a050287c05", + "0x287c0531028e20a2e82956052e828e20a0c8f890aa02814e20a029200a1c", + "0xf8142702814e20a029200a5f10120145f051c41462051d00a20051c41457", + "0x9c14710508c14740297014710515c143e0288c14710507014ac02814e20a", + "0x14620a38828140a1f014500a38828240a560140a7105014900513970900a", + "0x6cae48388287c0a56814240a388280a31028ac6248050ac1471050a01474", + "0x7090af0297414710504814ae0287014710506c148602814e20a2b8290a05", + "0x1c41420052740a20051c4140e051e00a0538828320a410143218241c4145d", + "0x14b80a38828460a3e8140a710517c147c0288cbe4838828300a3a814c40a", + "0x149005168ac620e6e0a04e4838920b862050147c7f02970147105170143e", + "0x14a60a388284e0a22814aa0a38828b00a4f014b00a388280a9602814e20a", + "0x14e20a029200a056e8280a9502914147105154149f029441471050a01441", + "0x293e0528828e20a15828820529828e20a188288a0520828e20a168294005", + "0x1c490360528c0a36051c41440052880a40051c41445052840a45051c41441", + "0x2940a76051c414054b0140a710514814a402814e20a029200a0005378a40a", + "0x1441441029e414710514c1445029e01471051dc14a6029dc1471051d89048", + "0x12014a802814e20a029200a7b3d1e41c0a3d828e20a3c0294e053d028e20a", + "0x1f41471051441441029f014710514c1445029d414710500014a902814e20a", + "0x120e20a240296005029c4140a0509c0a7e3e9f01c0a3f028e20a3a8294e05", + "0x9c0a1b2b920e20a09029600509028e20a02ac40a05388281c0a138147c0e", + "0x283218242c80a19051c4141b052640a18051c4143e052640a0538828ae0a", + "0x14e20a029200a5d0537c0a712407014b302870147105070142d028701471", + "0x294e052f828e20a100294c0510028e20a3101490a5029881471050152c05", + "0x1c41405052a00a0538828ba0a5a0140a71050149005118281423051c4145f", + "0x17090580289c14710509c142d0289c1471050156a052e028e20a028c40a05", + "0x1c4142b052a40a2b051c4142818920a60518828e20a029540a28051c41427", + "0x120e20a240296c05029c4140a0509c0a5805028b00a388285a0a538145a0a", + "0x2c00a1b051c414055b8140a710504814270295c2448388281c0a580147c0e", + "0x28320a4c814380a38828ae0a4c8140a7105060142702864304838828360a", + "0x14e24831029660531028e20a310285a0531028e20a2e87090b2029741471", + "0x2e00a0538828be0a13814465f241c4143e052c00a05388280a480288014e0", + "0x1c41423052640a05388284e0a138145027241c4145c052c00a5c051c41405", + "0xb41471050b4142d028b41471050ac624859014560a38828500a4c814620a", + "0x1490a5029541471050152c05029c4140524014b00a70814e248168296605", + "0x149005228281445051c414510529c0a51051c41453052980a53051c41455", + "0x15720520828e20a028c40a05388280a0a540140a710516014b402814e20a", + "0x28e20a029540a40051c4143620920b0051b028e20a1b0285a051b028e20a", + "0x28ee0a38828ec0a53814ec0a38828000a54814000a3882880522414c0a52", + "0x287c0a138140a710501414a802814e20a100296805029c4140524014ee0a", + "0x120b0053c828e20a3c8285a053c828e20a02ae80a78051c41405188140a71", + "0x28ea0a54814ea0a38828f47b2414c0a7b051c414052a814f40a38828f278", + "0x28140a398147c0a388280a0a07014fa0a051f41471051f014a7029f01471", + "0x1c414055e0141c48241c414121f121760509028e20a090285a05090289071", + "0x14ba0a38828900a5f814300a388283657242f80a1b051c414055e814ae0a", + "0x143819241c41420311741ce30288014710506014e20298814710503814c0", + "0x28142702814e20a2f8290405029c4140524014460a7297c14712407014e4", + "0x14500a388284e0a478144e0a38828b80a48014b80a388280a9602814e20a", + "0x14620a38828140a738140a710508c148202814e20a029200a05730280a95", + "0xa0148f028b4147105064140e028a01471050ac148f028ac1471050c414e8", + "0x120140a24028e20a050285a0505028e20a02829d2052c0b4900a2c028e20a", + "0x1c80a0e051c4140a053b00a05388280a480292014eb05028e24802829d405", + "0x280a5502814e20a029200a1205028240a388287c0a768147c0a388281c0a", + "0x28e20a0c029da050c028e20a0d829dc050d828e20a2415c90530295c1471", + "0x287c0a138147c0e241c41448052d80a4802920e20a02829de050c8281419", + "0x48907105060364878014300a38828140a57014360a388281c0a168140a71", + "0x285a05029c414190509c0a1c0c920e20a028296c05029c41457052080a57", + "0x174146402988ba4838828be20243c00a5f051c41412052b80a20051c4141c", + "0x3cc1c48241c4900a02921e4052e08c900a2e028e20a31029e20511828e20a", + "0x14300a38828360e242f80a1b051c414055e0140a710501490052b8487c0e", + "0x14e20a029200a057a0280a950287014710506014e202864147105120140e", + "0x2fc0a1c051c4145d053880a19051c4143e050380a5d051c414122b9217c05", + "0xf81c4838828140a7a814406224028400a38828380a60014c40a38828320a", + "0x60ae4838828ae0a7b014363e241c4143e053d80a5709120e20a24029ea05", + "0x1c4141c053e40a05388280a4802988ba487c070324838920301b02839ee05", + "0x14b823241c41457053e80a0538828400a7c814be20241c4143e053e80a05", + "0x28320a07014500a38828b80a7d8144e0a38828be0a7d8140a710508c14f9", + "0x140a710504814f902814e20a029200a057e814e2481409c90fc028641471", + "0x1c41419050380a2b051c41431053f80a31051c414054b0140a710503814f9", + "0x38320e7b8140a7105014900502c0014054a814b00a38828560a7f8145a0a", + "0x280a9602814e20a29829f205029c41405240148a5124404a655241c49012", + "0x1481471050d814ff02900147105154140e028d814710510414fe029041471", + "0x14000a388280a9602814e20a22829f205029c41405240140b02050152a05", + "0x10014bf029481471051d814ff02900147105144140e029d81471050001503", + "0x28e20a2c02a08053b828e20a168297e052c028e20a2902a080516828e20a", + "0x14e20a1f029f205029c41462053e40a05388280a48028160a0a02a540a78", + "0x28e20a02a580a0538828ae0a7c8140a710503814f902814e20a09029f205", + "0x2fc0a78051c4147a053fc0a77051c4145d050380a7a051c414790540c0a79", + "0x14900a388280a0a4c814ea7b24028ea0a38828f00a82014f60a38828ee0a", + "0xf815060284814710503814ae028f81471050152c0507028e20a240289058", + "0x1480a3e02838900a02944a652028f85053290147c282b848900a2b828e20a", + "0x41c1c4805014a253290147c28299480a3e7e038900a02944a652028f85053", + "0xa01509050148028028385005244201c4805014a253290147c28299480a3e", + "0x14b828240a0150b1f038900a02960a652070486c2b29948250a029045048", + "0x438900a029601412090ac1d0d1f038900a02960a6520708c6c2b29948250c", + "0x1881511028481436054401405200149012029221e4805014b00a11848560e", + "0x1207c3e0283a280a028f80a4809014911305014141924064464889014ba0a", + "0x4581405050649019091222a48050149005" + ], + "sierra_program_debug_info": { + "type_names": [ + [ + 0, + "RangeCheck" + ], + [ + 1, + "Unit" + ], + [ + 2, + "core::bool" + ], + [ + 3, + "u128" + ], + [ + 4, + "core::integer::u256" + ], + [ + 5, + "felt252" + ], + [ + 6, + "NonZero" + ], + [ + 7, + "Tuple" + ], + [ + 8, + "core::panics::Panic" + ], + [ + 9, + "Array" + ], + [ + 10, + "Tuple>" + ], + [ + 11, + "core::panics::PanicResult::<((),)>" + ], + [ + 12, + "core::result::Result::<(), core::array::Array::>" + ], + [ + 13, + "Box" + ], + [ + 14, + "core::option::Option::>" + ], + [ + 15, + "katana_messaging::contract_msg_l1::MyData" + ], + [ + 16, + "core::option::Option::" + ], + [ + 17, + "Snapshot>" + ], + [ + 18, + "core::array::Span::" + ], + [ + 19, + "Tuple>" + ], + [ + 20, + "katana_messaging::contract_msg_l1::contract_msg_l1::ContractState" + ], + [ + 21, + "Tuple" + ], + [ + 22, + "core::panics::PanicResult::<(katana_messaging::contract_msg_l1::contract_msg_l1::ContractState, ())>" + ], + [ + 23, + "BuiltinCosts" + ], + [ + 24, + "System" + ], + [ + 25, + "core::panics::PanicResult::<(core::array::Span::,)>" + ], + [ + 26, + "u32" + ], + [ + 27, + "core::option::Option::" + ], + [ + 28, + "core::starknet::eth_address::EthAddress" + ], + [ + 29, + "core::option::Option::" + ], + [ + 30, + "GasBuiltin" + ] + ], + "libfunc_names": [ + [ + 0, + "revoke_ap_tracking" + ], + [ + 1, + "withdraw_gas" + ], + [ + 2, + "branch_align" + ], + [ + 3, + "store_temp" + ], + [ + 4, + "store_temp>" + ], + [ + 5, + "function_call" + ], + [ + 6, + "enum_match>" + ], + [ + 7, + "function_call" + ], + [ + 8, + "enum_match>" + ], + [ + 9, + "struct_deconstruct>" + ], + [ + 10, + "array_len" + ], + [ + 11, + "snapshot_take" + ], + [ + 12, + "drop" + ], + [ + 13, + "u32_const<0>" + ], + [ + 14, + "rename" + ], + [ + 15, + "store_temp" + ], + [ + 16, + "u32_eq" + ], + [ + 17, + "drop" + ], + [ + 18, + "drop" + ], + [ + 19, + "array_new" + ], + [ + 20, + "felt252_const<7733229381460288120802334208475838166080759535023995805565484692595>" + ], + [ + 21, + "store_temp" + ], + [ + 22, + "array_append" + ], + [ + 23, + "struct_construct" + ], + [ + 24, + "struct_construct>>" + ], + [ + 25, + "enum_init,)>, 1>" + ], + [ + 26, + "store_temp" + ], + [ + 27, + "store_temp" + ], + [ + 28, + "store_temp,)>>" + ], + [ + 29, + "get_builtin_costs" + ], + [ + 30, + "store_temp" + ], + [ + 31, + "withdraw_gas_all" + ], + [ + 32, + "struct_construct" + ], + [ + 33, + "store_temp" + ], + [ + 34, + "store_temp" + ], + [ + 35, + "function_call" + ], + [ + 36, + "enum_match>" + ], + [ + 37, + "drop>" + ], + [ + 38, + "snapshot_take>" + ], + [ + 39, + "drop>" + ], + [ + 40, + "struct_construct>" + ], + [ + 41, + "struct_construct>>" + ], + [ + 42, + "enum_init,)>, 0>" + ], + [ + 43, + "felt252_const<375233589013918064796019>" + ], + [ + 44, + "drop" + ], + [ + 45, + "drop>" + ], + [ + 46, + "felt252_const<485748461484230571791265682659113160264223489397539653310998840191492914>" + ], + [ + 47, + "felt252_const<485748461484230571791265682659113160264223489397539653310998840191492913>" + ], + [ + 48, + "function_call" + ], + [ + 49, + "enum_match>" + ], + [ + 50, + "drop" + ], + [ + 51, + "store_temp" + ], + [ + 52, + "function_call" + ], + [ + 53, + "function_call" + ], + [ + 54, + "function_call" + ], + [ + 55, + "function_call" + ], + [ + 56, + "store_temp>" + ], + [ + 57, + "enum_init, 1>" + ], + [ + 58, + "array_snapshot_pop_front" + ], + [ + 59, + "enum_init>, 0>" + ], + [ + 60, + "store_temp>>" + ], + [ + 61, + "store_temp>>" + ], + [ + 62, + "jump" + ], + [ + 63, + "struct_construct" + ], + [ + 64, + "enum_init>, 1>" + ], + [ + 65, + "enum_match>>" + ], + [ + 66, + "unbox" + ], + [ + 67, + "rename" + ], + [ + 68, + "enum_init, 0>" + ], + [ + 69, + "store_temp>" + ], + [ + 70, + "enum_init, 1>" + ], + [ + 71, + "function_call" + ], + [ + 72, + "send_message_to_l1_syscall" + ], + [ + 73, + "enum_init>, 0>" + ], + [ + 74, + "store_temp>>" + ], + [ + 75, + "enum_init>, 1>" + ], + [ + 76, + "rename>>" + ], + [ + 77, + "function_call::unwrap_syscall>" + ], + [ + 78, + "enum_match>" + ], + [ + 79, + "drop>" + ], + [ + 80, + "struct_construct>" + ], + [ + 81, + "enum_init, 0>" + ], + [ + 82, + "store_temp>" + ], + [ + 83, + "drop" + ], + [ + 84, + "enum_init, 1>" + ], + [ + 85, + "struct_construct" + ], + [ + 86, + "enum_init, 0>" + ], + [ + 87, + "store_temp>" + ], + [ + 88, + "enum_init, 1>" + ], + [ + 89, + "snapshot_take" + ], + [ + 90, + "store_temp>" + ], + [ + 91, + "function_call" + ], + [ + 92, + "snapshot_take" + ], + [ + 93, + "felt252_const<123>" + ], + [ + 94, + "felt252_sub" + ], + [ + 95, + "felt252_is_zero" + ], + [ + 96, + "drop>" + ], + [ + 97, + "felt252_const<5817842327937750557011733149029>" + ], + [ + 98, + "struct_deconstruct" + ], + [ + 99, + "felt252_const<1>" + ], + [ + 100, + "felt252_const<2>" + ], + [ + 101, + "felt252_const<34157776085189168970443141491779053578596>" + ], + [ + 102, + "felt252_const<34157776085188859485433320146710328797540>" + ], + [ + 103, + "dup" + ], + [ + 104, + "function_call" + ], + [ + 105, + "u128_const<0>" + ], + [ + 106, + "u128_const<4294967296>" + ], + [ + 107, + "struct_construct" + ], + [ + 108, + "rename" + ], + [ + 109, + "rename" + ], + [ + 110, + "store_temp" + ], + [ + 111, + "function_call" + ], + [ + 112, + "enum_match" + ], + [ + 113, + "struct_construct" + ], + [ + 114, + "enum_init, 0>" + ], + [ + 115, + "struct_deconstruct" + ], + [ + 116, + "enum_match>>" + ], + [ + 117, + "struct_construct>" + ], + [ + 118, + "enum_init, 0>" + ], + [ + 119, + "store_temp>" + ], + [ + 120, + "enum_init, 1>" + ], + [ + 121, + "dup" + ], + [ + 122, + "function_call" + ], + [ + 123, + "rename>" + ], + [ + 124, + "rename" + ], + [ + 125, + "u128s_from_felt252" + ], + [ + 126, + "struct_deconstruct" + ], + [ + 127, + "dup" + ], + [ + 128, + "u128_overflowing_sub" + ], + [ + 129, + "drop" + ], + [ + 130, + "snapshot_take" + ], + [ + 131, + "rename" + ], + [ + 132, + "u128_eq" + ], + [ + 133, + "enum_init" + ], + [ + 134, + "store_temp" + ], + [ + 135, + "enum_init" + ], + [ + 136, + "rename" + ], + [ + 137, + "store_temp" + ] + ], + "user_func_names": [ + [ + 0, + "katana_messaging::contract_msg_l1::contract_msg_l1::__wrapper__ContractL1Impl__send_message_value" + ], + [ + 1, + "katana_messaging::contract_msg_l1::contract_msg_l1::__wrapper__ContractL1Impl__send_message_struct" + ], + [ + 2, + "katana_messaging::contract_msg_l1::contract_msg_l1::__wrapper__msg_handler_value" + ], + [ + 3, + "katana_messaging::contract_msg_l1::contract_msg_l1::__wrapper__msg_handler_struct" + ], + [ + 4, + "core::starknet::eth_address::EthAddressSerde::deserialize" + ], + [ + 5, + "core::Felt252Serde::deserialize" + ], + [ + 6, + "katana_messaging::contract_msg_l1::contract_msg_l1::ContractL1Impl::send_message_value" + ], + [ + 7, + "katana_messaging::contract_msg_l1::MyDataSerde::deserialize" + ], + [ + 8, + "katana_messaging::contract_msg_l1::contract_msg_l1::ContractL1Impl::send_message_struct" + ], + [ + 9, + "katana_messaging::contract_msg_l1::contract_msg_l1::msg_handler_value" + ], + [ + 10, + "katana_messaging::contract_msg_l1::contract_msg_l1::msg_handler_struct" + ], + [ + 11, + "core::starknet::eth_address::Felt252TryIntoEthAddress::try_into" + ], + [ + 12, + "core::starknet::eth_address::EthAddressIntoFelt252::into" + ], + [ + 13, + "core::starknet::SyscallResultTraitImpl::<()>::unwrap_syscall" + ], + [ + 14, + "katana_messaging::contract_msg_l1::MyDataSerde::serialize" + ], + [ + 15, + "core::integer::u256_from_felt252" + ], + [ + 16, + "core::integer::U256PartialOrd::lt" + ], + [ + 17, + "core::Felt252Serde::serialize" + ] + ] + }, + "contract_class_version": "0.1.0", + "entry_points_by_type": { + "EXTERNAL": [ + { + "selector": "0x212a93940157a93c8f87d5c6d42475635ec6fa7e74bdcae09e26b162e3c3c8c", + "function_idx": 1 + }, + { + "selector": "0x38db96c707bc8d18f82750a60fb341e4e99c1ea20e3e902770a3b24bb039683", + "function_idx": 0 + } + ], + "L1_HANDLER": [ + { + "selector": "0x5421de947699472df434466845d68528f221a52fce7ad2934c5dae2e1f1cdc", + "function_idx": 2 + }, + { + "selector": "0xf1149cade9d692862ad41df96b108aa2c20af34f640457e781d166c98dc6b0", + "function_idx": 3 + } + ], + "CONSTRUCTOR": [] + }, + "abi": [ + { + "type": "impl", + "name": "ContractL1Impl", + "interface_name": "katana_messaging::contract_msg_l1::IContractL1" + }, + { + "type": "struct", + "name": "core::starknet::eth_address::EthAddress", + "members": [ + { + "name": "address", + "type": "core::felt252" + } + ] + }, + { + "type": "struct", + "name": "katana_messaging::contract_msg_l1::MyData", + "members": [ + { + "name": "a", + "type": "core::felt252" + }, + { + "name": "b", + "type": "core::felt252" + } + ] + }, + { + "type": "interface", + "name": "katana_messaging::contract_msg_l1::IContractL1", + "items": [ + { + "type": "function", + "name": "send_message_value", + "inputs": [ + { + "name": "to_address", + "type": "core::starknet::eth_address::EthAddress" + }, + { + "name": "value", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "send_message_struct", + "inputs": [ + { + "name": "to_address", + "type": "core::starknet::eth_address::EthAddress" + }, + { + "name": "data", + "type": "katana_messaging::contract_msg_l1::MyData" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "l1_handler", + "name": "msg_handler_value", + "inputs": [ + { + "name": "from_address", + "type": "core::felt252" + }, + { + "name": "value", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "l1_handler", + "name": "msg_handler_struct", + "inputs": [ + { + "name": "from_address", + "type": "core::felt252" + }, + { + "name": "data", + "type": "katana_messaging::contract_msg_l1::MyData" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "event", + "name": "katana_messaging::contract_msg_l1::contract_msg_l1::Event", + "kind": "enum", + "variants": [] + } + ] +} \ No newline at end of file diff --git a/crates/katana/rpc/rpc/tests/test_data/solidity/Contract1Compiled.json b/crates/katana/rpc/rpc/tests/test_data/solidity/Contract1Compiled.json new file mode 100644 index 0000000000..53d83462a6 --- /dev/null +++ b/crates/katana/rpc/rpc/tests/test_data/solidity/Contract1Compiled.json @@ -0,0 +1,76 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "snMessaging", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "hash1", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "hash2", + "type": "uint256" + } + ], + "name": "DebugEvent", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "fromAddress", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + } + ], + "name": "consumeMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "contractAddress", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + } + ], + "name": "sendMessage", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "bin": "608060405234801561001057600080fd5b5060405161047238038061047283398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610082565b600060208284031215610065578081fd5b81516001600160a01b038116811461007b578182fd5b9392505050565b6103e1806100916000396000f3fe6080604052600436106100295760003560e01c8063b66438381461002e578063c5780d6214610043575b600080fd5b61004161003c366004610230565b610063565b005b34801561004f57600080fd5b5061004161005e3660046101b7565b6100f1565b600054604051633e3aa6c560e01b81526001600160a01b0390911690633e3aa6c590349061009990879087908790600401610341565b60408051808303818588803b1580156100b157600080fd5b505af11580156100c5573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906100ea9190610194565b5050505050565b60005460405162b2775760e61b81526001600160a01b0390911690632c9dd5c090610124908690869086906004016102ff565b602060405180830381600087803b15801561013e57600080fd5b505af1158015610152573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610176919061017c565b50505050565b60006020828403121561018d578081fd5b5051919050565b600080604083850312156101a6578081fd5b505080516020909101519092909150565b6000806000604084860312156101cb578081fd5b83359250602084013567ffffffffffffffff808211156101e9578283fd5b818601915086601f8301126101fc578283fd5b81358181111561020a578384fd5b876020808302850101111561021d578384fd5b6020830194508093505050509250925092565b600080600060608486031215610244578283fd5b833592506020808501359250604085013567ffffffffffffffff8082111561026a578384fd5b818701915087601f83011261027d578384fd5b81358181111561028f5761028f610395565b838102604051858282010181811085821117156102ae576102ae610395565b604052828152858101935084860182860187018c10156102cc578788fd5b8795505b838610156102ee5780358552600195909501949386019386016102d0565b508096505050505050509250925092565b838152604060208201819052810182905260006001600160fb1b03831115610325578081fd5b6020830280856060850137919091016060019081529392505050565b60006060820185835260208581850152606060408501528185518084526080860191508287019350845b818110156103875784518352938301939183019160010161036b565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fdfea264697066735822122092633a92c2eddc5dbc1f785f0fac25951b54e95fc7ac3e6c11f2c0dc4173348f64736f6c63430008000033" +} \ No newline at end of file diff --git a/crates/katana/rpc/rpc/tests/test_data/solidity/StarknetMessagingLocalCompiled.json b/crates/katana/rpc/rpc/tests/test_data/solidity/StarknetMessagingLocalCompiled.json new file mode 100644 index 0000000000..9b56fa941f --- /dev/null +++ b/crates/katana/rpc/rpc/tests/test_data/solidity/StarknetMessagingLocalCompiled.json @@ -0,0 +1,457 @@ +{ + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "fromAddress", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + } + ], + "name": "ConsumedMessageToL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ConsumedMessageToL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "fromAddress", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + } + ], + "name": "LogMessageToL1", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "fee", + "type": "uint256" + } + ], + "name": "LogMessageToL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256[]", + "name": "hashes", + "type": "uint256[]" + } + ], + "name": "MessageHashesAddedFromL2", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MessageToL2Canceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fromAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MessageToL2CancellationStarted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "msgHashes", + "type": "uint256[]" + } + ], + "name": "addMessageHashesFromL2", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "cancelL1ToL2Message", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "fromAddress", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + } + ], + "name": "consumeMessageFromL2", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxL1MsgFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "msgHash", + "type": "bytes32" + } + ], + "name": "l1ToL2MessageCancellations", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l1ToL2MessageNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "msgHash", + "type": "bytes32" + } + ], + "name": "l1ToL2Messages", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "msgHash", + "type": "bytes32" + } + ], + "name": "l2ToL1Messages", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageCancellationDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + } + ], + "name": "sendMessageToL2", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "toAddress", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "selector", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "payload", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "startL1ToL2MessageCancellation", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bin": "608060405234801561001057600080fd5b50610e89806100206000396000f3fe60806040526004361061009c5760003560e01c806377c7d7a91161006457806377c7d7a9146101425780637a98660b146101625780638303bd8a146101825780639be446bf14610197578063a46efaf3146101b7578063db3c5270146101d75761009c565b8063018cccdf146100a15780632c9dd5c0146100cc5780633e3aa6c5146100ec57806354eccba41461010d5780636170ff1b14610122575b600080fd5b3480156100ad57600080fd5b506100b66101ec565b6040516100c39190610b9c565b60405180910390f35b3480156100d857600080fd5b506100b66100e7366004610947565b610231565b6100ff6100fa366004610991565b610323565b6040516100c3929190610ba5565b34801561011957600080fd5b506100b661044d565b34801561012e57600080fd5b506100b661013d3660046109e2565b610459565b34801561014e57600080fd5b506100b661015d36600461092f565b6105a3565b34801561016e57600080fd5b506100b661017d3660046109e2565b6105be565b34801561018e57600080fd5b506100b6610675565b3480156101a357600080fd5b506100b66101b236600461092f565b610698565b3480156101c357600080fd5b506100b66101d236600461092f565b6106a2565b6101ea6101e53660046108ef565b6106ac565b005b600061022c6040518060400160405280602081526020017f535441524b4e45545f312e305f4d5347494e475f4c31544f4c325f4e4f4e4345815250610766565b905090565b604051600090819061024f9086903390869088908290602001610ad3565b604051602081830303815290604052805190602001209050600061027161079a565b60008381526020919091526040902054116102a75760405162461bcd60e51b815260040161029e90610c93565b60405180910390fd5b336001600160a01b0316857f7a06c571aa77f34d9706c51e5d8122b5595aebeaa34233bfe866f22befb973b186866040516102e3929190610b35565b60405180910390a360016102f561079a565b600083815260200190815260200160002060008282546103159190610d65565b909155509095945050505050565b600080600034116103465760405162461bcd60e51b815260040161029e90610d0c565b61034e61044d565b34111561036d5760405162461bcd60e51b815260040161029e90610c2e565b60006103776101ec565b90506103c46040518060400160405280602081526020017f535441524b4e45545f312e305f4d5347494e475f4c31544f4c325f4e4f4e43458152508260016103bf9190610d4d565b6107bd565b8587336001600160a01b03167fdb80dd488acf86d17c747445b0eabb5d57c541d3bd7b6b87af987858e5066b2b888886346040516104059493929190610b75565b60405180910390a4600061041c88888888866107f0565b9050610429346001610d4d565b610431610831565b6000838152602091909152604090205597909650945050505050565b670de0b6b3a764000090565b60008486336001600160a01b03167f8abd2ec2e0a10c82f5b60ea00455fa96c41fd144f225fcc52b8d83d94f803ed887878760405161049a93929190610b51565b60405180910390a460006104b187878787876107f0565b905060006104bd610831565b600083815260209190915260409020549050806104ec5760405162461bcd60e51b815260040161029e90610c65565b60006104f6610854565b600084815260209190915260409020549050806105255760405162461bcd60e51b815260040161029e90610cca565b600061052f610675565b6105399083610d4d565b90508181101561055b5760405162461bcd60e51b815260040161029e90610bb3565b8042101561057b5760405162461bcd60e51b815260040161029e90610bea565b6000610585610831565b60008681526020919091526040902055509198975050505050505050565b60006105ad610831565b600092835260205250604090205490565b60008486336001600160a01b03167f2e00dccd686fd6823ec7dc3e125582aa82881b6ff5f6b5a73856e1ea8338a3be8787876040516105ff93929190610b51565b60405180910390a4600061061687878787876107f0565b90506000610622610831565b600083815260209190915260409020549050806106515760405162461bcd60e51b815260040161029e90610c65565b4261065a610854565b60008481526020919091526040902055509695505050505050565b600061022c6040518060600160405280602d8152602001610dde602d9139610766565b60006105ad610854565b60006105ad61079a565b60005b818110156107295760008383838181106106d957634e487b7160e01b600052603260045260246000fd5b9050602002013560001b905060016106ef61079a565b6000838152602001908152602001600020600082825461070f9190610d4d565b90915550829150610721905081610d7c565b9150506106af565b507e31e49c5c8cbb8204c84525dfc1a145e06e35f873b703ce44df65b9516fb17a828260405161075a929190610b35565b60405180910390a15050565b6000808260405160200161077a9190610a9a565b60408051601f198184030181529190528051602090910120549392505050565b600061022c604051806060016040528060238152602001610e0b60239139610873565b6000826040516020016107d09190610a9a565b604051602081830303815290604052805190602001209050818155505050565b60405160009061081090339088908590899088908a908290602001610afd565b60405160208183030381529060405280519060200120905095945050505050565b600061022c604051806060016040528060268152602001610e2e60269139610873565b600061022c604051806060016040528060308152602001610dae603091395b600080826040516020016108879190610a9a565b60408051601f1981840301815291905280516020909101209392505050565b60008083601f8401126108b7578182fd5b50813567ffffffffffffffff8111156108ce578182fd5b60208301915083602080830285010111156108e857600080fd5b9250929050565b60008060208385031215610901578182fd5b823567ffffffffffffffff811115610917578283fd5b610923858286016108a6565b90969095509350505050565b600060208284031215610940578081fd5b5035919050565b60008060006040848603121561095b578081fd5b83359250602084013567ffffffffffffffff811115610978578182fd5b610984868287016108a6565b9497909650939450505050565b600080600080606085870312156109a6578081fd5b8435935060208501359250604085013567ffffffffffffffff8111156109ca578182fd5b6109d6878288016108a6565b95989497509550505050565b6000806000806000608086880312156109f9578081fd5b8535945060208601359350604086013567ffffffffffffffff811115610a1d578182fd5b610a29888289016108a6565b96999598509660600135949350505050565b81835260006001600160fb1b03831115610a53578081fd5b6020830280836020870137939093016020019283525090919050565b60006001600160fb1b03831115610a84578081fd5b6020830280838637939093019283525090919050565b60008251815b81811015610aba5760208186018101518583015201610aa0565b81811115610ac85782828501525b509190910192915050565b6000868252856020830152846040830152610af2606083018486610a6f565b979650505050505050565b6000888252876020830152866040830152856060830152846080830152610b2860a083018486610a6f565b9998505050505050505050565b600060208252610b49602083018486610a3b565b949350505050565b600060408252610b65604083018587610a3b565b9050826020830152949350505050565b600060608252610b89606083018688610a3b565b6020830194909452506040015292915050565b90815260200190565b918252602082015260400190565b6020808252601c908201527f43414e43454c5f414c4c4f5745445f54494d455f4f564552464c4f5700000000604082015260600190565b60208082526024908201527f4d4553534147455f43414e43454c4c4154494f4e5f4e4f545f414c4c4f57454460408201526317d6515560e21b606082015260800190565b60208082526017908201527f4d41585f4c315f4d53475f4645455f4558434545444544000000000000000000604082015260600190565b6020808252601490820152731393d7d35154d4d051d157d513d7d0d05390d15360621b604082015260600190565b6020808252601a908201527f494e56414c49445f4d4553534147455f544f5f434f4e53554d45000000000000604082015260600190565b60208082526022908201527f4d4553534147455f43414e43454c4c4154494f4e5f4e4f545f52455155455354604082015261115160f21b606082015260800190565b60208082526021908201527f4c315f4d53475f4645455f4d5553545f42455f475245415445525f5448414e5f6040820152600360fc1b606082015260800190565b60008219821115610d6057610d60610d97565b500190565b600082821015610d7757610d77610d97565b500390565b6000600019821415610d9057610d90610d97565b5060010190565b634e487b7160e01b600052601160045260246000fdfe535441524b4e45545f312e305f4d5347494e475f4c31544f4c325f43414e43454c4c4154494f4e5f4d41505050494e47535441524b4e45545f312e305f4d5347494e475f4c31544f4c325f43414e43454c4c4154494f4e5f44454c4159535441524b4e45545f312e305f4d5347494e475f4c32544f4c315f4d41505050494e47535441524b4e45545f312e305f4d5347494e475f4c31544f4c325f4d41505050494e475f5632a264697066735822122014c7f5b33d9918daf9f7f12968ce1557fe4f2b64638fa02df4c882c38651382064736f6c63430008000033" +} \ No newline at end of file diff --git a/crates/katana/runner/Cargo.toml b/crates/katana/runner/Cargo.toml index f0a6787556..6f911fbe32 100644 --- a/crates/katana/runner/Cargo.toml +++ b/crates/katana/runner/Cargo.toml @@ -18,4 +18,4 @@ serde.workspace = true serde_json.workspace = true starknet.workspace = true tokio.workspace = true -url.workspace = true +url.workspace = true \ No newline at end of file diff --git a/crates/katana/runner/src/lib.rs b/crates/katana/runner/src/lib.rs index 3ad87a63ef..342379f87a 100644 --- a/crates/katana/runner/src/lib.rs +++ b/crates/katana/runner/src/lib.rs @@ -47,6 +47,8 @@ pub struct KatanaRunnerConfig { pub port: Option, /// The path where to log info, if None, logs are stored in a temp dir. pub log_path: Option, + /// The messaging config file + pub messaging: Option, } impl Default for KatanaRunnerConfig { @@ -59,6 +61,7 @@ impl Default for KatanaRunnerConfig { program_name: None, run_name: None, log_path: None, + messaging: None, } } } @@ -100,6 +103,10 @@ impl KatanaRunner { command.args(["--disable-fee"]); } + if let Some(messaging_file) = config.messaging { + command.args(["--messaging", messaging_file.as_str()]); + } + let mut child = command.stdout(Stdio::piped()).spawn().context("failed to start subprocess")?; diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index e9a0b90f18..aeef927011 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo_examples" -version = "0.7.1" +version = "0.7.2" dependencies = [ "dojo", ] From badeeba47ab2e3b5333079a639a71c67f4f1fc06 Mon Sep 17 00:00:00 2001 From: glihm Date: Tue, 25 Jun 2024 21:05:50 -0600 Subject: [PATCH 57/88] fix(torii): ensure torii doesn't stop on model processor fail (#2093) * fix: ensure torii does not stop on fail process * fix: update lock files * fix: ensure block and transaction processors panic * fix: use same convention as in the processor block --- crates/torii/core/src/engine.rs | 9 ++++++--- crates/torii/core/src/sql.rs | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index dcf4918c1a..530e24eb87 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -406,7 +406,7 @@ impl Engine

{ for processor in &self.processors.block { processor .process(&mut self.db, self.provider.as_ref(), block_number, block_timestamp) - .await?; + .await? } Ok(()) } @@ -457,7 +457,7 @@ impl Engine

{ || get_selector_from_name(&processor.event_key())? == event.keys[0]) && processor.validate(event) { - processor + if let Err(e) = processor .process( &self.world, &mut self.db, @@ -467,7 +467,10 @@ impl Engine

{ event_id, event, ) - .await?; + .await + { + error!(target: LOG_TARGET, event_name = processor.event_key(), error = %e, "Processing event."); + } } else { let unprocessed_event = UnprocessedEvent { keys: event.keys.iter().map(|k| format!("{:#x}", k)).collect(), diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 02fe9ccb21..9ecd7d38b8 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -304,8 +304,10 @@ impl Sql { } pub async fn model(&self, model: &str) -> Result { - let reader = ModelSQLReader::new(model, self.pool.clone()).await?; - Ok(reader) + match ModelSQLReader::new(model, self.pool.clone()).await { + Ok(reader) => Ok(reader), + Err(e) => Err(anyhow::anyhow!("Failed to get model from db for selector {model}: {e}")), + } } pub async fn entity(&self, model: String, key: FieldElement) -> Result> { From 7da96db9702b916273f05854093ed061996a47dc Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 26 Jun 2024 23:34:49 +0800 Subject: [PATCH 58/88] feat(katana): always include Controller class by default (#2107) * define and declare controller account by default * update genesis test * separate slot and controller feature * update comment * fix typo --- bin/katana/Cargo.toml | 2 +- crates/katana/controller/src/lib.rs | 50 ++--------- crates/katana/primitives/Cargo.toml | 3 + .../katana/primitives/src/genesis/constant.rs | 9 ++ crates/katana/primitives/src/genesis/json.rs | 67 ++++++++------ crates/katana/primitives/src/genesis/mod.rs | 90 +++++++++++++++---- 6 files changed, 130 insertions(+), 91 deletions(-) diff --git a/bin/katana/Cargo.toml b/bin/katana/Cargo.toml index 6f1a659af6..a9e8ec4442 100644 --- a/bin/katana/Cargo.toml +++ b/bin/katana/Cargo.toml @@ -42,5 +42,5 @@ blockifier = [ "katana-executor/blockifier" ] jemalloc = [ "dojo-metrics/jemalloc" ] messaging = [ "katana-core/messaging" ] -slot = [ "dep:katana-slot-controller" ] +slot = [ "dep:katana-slot-controller", "katana-primitives/slot" ] starknet-messaging = [ "katana-core/starknet-messaging", "messaging" ] diff --git a/crates/katana/controller/src/lib.rs b/crates/katana/controller/src/lib.rs index b187bcf52c..ec4716d891 100644 --- a/crates/katana/controller/src/lib.rs +++ b/crates/katana/controller/src/lib.rs @@ -1,5 +1,4 @@ use std::collections::HashMap; -use std::sync::Arc; use account_sdk::abigen::controller::{Signer, SignerType}; use account_sdk::signers::webauthn::{DeviceSigner, WebauthnAccountSigner}; @@ -8,11 +7,10 @@ use account_sdk::wasm_webauthn::CredentialID; use alloy_primitives::U256; use anyhow::Result; use coset::CoseKey; -use katana_primitives::class::{ClassHash, CompiledClass, SierraCompiledClass}; use katana_primitives::contract::{ContractAddress, StorageKey, StorageValue}; use katana_primitives::genesis::allocation::{GenesisAllocation, GenesisContractAlloc}; -use katana_primitives::genesis::{Genesis, GenesisClass}; -use katana_primitives::utils::class::{parse_compiled_class_v1, parse_sierra_class}; +use katana_primitives::genesis::constant::CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH; +use katana_primitives::genesis::Genesis; use katana_primitives::FieldElement; use slot::credential::Credentials; use starknet::core::utils::get_storage_var_address; @@ -22,9 +20,6 @@ mod webauthn; const LOG_TARGET: &str = "katana::controller"; -const CONTROLLER_SIERRA_ARTIFACT: &str = - include_str!("../../contracts/compiled/controller_CartridgeAccount.contract_class.json"); - const WEBAUTHN_RP_ID: &str = "cartridge.gg"; const WEBAUTHN_ORIGIN: &str = "https://x.cartridge.gg"; @@ -34,33 +29,6 @@ pub fn add_controller_account(genesis: &mut Genesis) -> Result<()> { add_controller_account_inner(genesis, credentials.account) } -fn add_controller_class(genesis: &mut Genesis) -> Result { - let sierra = parse_sierra_class(CONTROLLER_SIERRA_ARTIFACT)?; - let casm = read_compiled_class_artifact(CONTROLLER_SIERRA_ARTIFACT)?; - - let class_hash = sierra.class_hash()?; - let flattened_sierra = sierra.flatten()?; - let casm_hash = FieldElement::from_bytes_be(&casm.casm.compiled_class_hash().to_be_bytes())?; - - trace!( - target: LOG_TARGET, - class_hash = format!("{class_hash:#x}"), - casm_hash = format!("{casm_hash:#x}"), - "Adding Cartridge Controller account class to genesis." - ); - - genesis.classes.insert( - class_hash, - GenesisClass { - sierra: Some(Arc::new(flattened_sierra)), - compiled_class_hash: casm_hash, - casm: Arc::new(CompiledClass::Class(casm)), - }, - ); - - Ok(class_hash) -} - fn add_controller_account_inner(genesis: &mut Genesis, user: slot::account::Account) -> Result<()> { let cred = user.credentials.webauthn.first().unwrap(); @@ -71,16 +39,14 @@ fn add_controller_account_inner(genesis: &mut Genesis, user: slot::account::Acco "Adding Cartridge Controller account to genesis." ); - let class_hash = add_controller_class(genesis)?; - let credential_id = webauthn::credential::from_base64(&cred.id)?; let public_key = webauthn::cose_key::from_base64(&cred.public_key)?; let (address, contract) = { let account = GenesisContractAlloc { nonce: None, - class_hash: Some(class_hash), balance: Some(U256::from(0xfffffffffffffffu128)), + class_hash: Some(CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH), storage: Some(get_contract_storage(credential_id, public_key, SignerType::Webauthn)?), }; @@ -108,6 +74,8 @@ pub mod json { use super::*; + const CONTROLLER_SIERRA_ARTIFACT: &str = + include_str!("../../contracts/compiled/controller_CartridgeAccount.contract_class.json"); const CONTROLLER_CLASS_NAME: &str = "controller"; // TODO(kariy): should accept the whole account struct instead of individual fields @@ -188,11 +156,6 @@ fn get_contract_storage( Ok(HashMap::from([(storage, guid)])) } -fn read_compiled_class_artifact(artifact: &str) -> Result { - let value = serde_json::from_str(artifact)?; - parse_compiled_class_v1(value) -} - #[cfg(test)] mod tests { use slot::account::WebAuthnCredential; @@ -230,15 +193,14 @@ mod tests { }, }; - let controller_class_hash = add_controller_class(&mut Genesis::default()).unwrap(); add_controller_account_inner(&mut genesis, account.clone()).unwrap(); let address = ContractAddress::from(account.contract_address); let allocation = genesis.allocations.get(&address).unwrap(); assert!(genesis.allocations.contains_key(&address)); - assert_eq!(allocation.class_hash(), Some(controller_class_hash)); assert_eq!(allocation.balance(), Some(U256::from(0xfffffffffffffffu128))); + assert_eq!(allocation.class_hash(), Some(CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH)); } #[test] diff --git a/crates/katana/primitives/Cargo.toml b/crates/katana/primitives/Cargo.toml index 1d01902fa9..90b721a4a2 100644 --- a/crates/katana/primitives/Cargo.toml +++ b/crates/katana/primitives/Cargo.toml @@ -32,5 +32,8 @@ similar-asserts.workspace = true [features] default = [ "serde" ] + +controller = [ ] rpc = [ ] serde = [ "alloy-primitives/serde" ] +slot = [ "controller" ] diff --git a/crates/katana/primitives/src/genesis/constant.rs b/crates/katana/primitives/src/genesis/constant.rs index b5e8c555a3..affd6890ce 100644 --- a/crates/katana/primitives/src/genesis/constant.rs +++ b/crates/katana/primitives/src/genesis/constant.rs @@ -1,5 +1,6 @@ use lazy_static::lazy_static; use starknet::core::utils::get_storage_var_address; +use starknet::macros::felt; use crate::class::{ClassHash, CompiledClass, CompiledClassHash, SierraClass}; use crate::contract::{ContractAddress, StorageKey}; @@ -121,6 +122,8 @@ pub const DEFAULT_OZ_ACCOUNT_CONTRACT_COMPILED_CLASS_HASH: CompiledClassHash = 190499602541245794, ]); +pub const CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH: ClassHash = felt!("0xCC"); + // Pre-compiled contract classes lazy_static! { @@ -134,7 +137,13 @@ lazy_static! { // Default account contract pub static ref DEFAULT_OZ_ACCOUNT_CONTRACT: SierraClass = parse_sierra_class(include_str!("../../../contracts/compiled/oz_account_080.json")).unwrap(); pub static ref DEFAULT_OZ_ACCOUNT_CONTRACT_CASM: CompiledClass = read_compiled_class_artifact(include_str!("../../../contracts/compiled/oz_account_080.json")); +} +#[cfg(feature = "controller")] +lazy_static! { + // Cartridge Controller account + pub static ref CONTROLLER_ACCOUNT_CONTRACT: SierraClass = parse_sierra_class(include_str!("../../../contracts/compiled/controller_CartridgeAccount.contract_class.json")).unwrap(); + pub static ref CONTROLLER_ACCOUNT_CONTRACT_CASM: CompiledClass = read_compiled_class_artifact(include_str!("../../../contracts/compiled/oz_account_080.json")); } /// A helper function to get the base storage address for the fee token balance of a given account. diff --git a/crates/katana/primitives/src/genesis/json.rs b/crates/katana/primitives/src/genesis/json.rs index 4372a5a424..d1fa24bfd6 100644 --- a/crates/katana/primitives/src/genesis/json.rs +++ b/crates/katana/primitives/src/genesis/json.rs @@ -25,6 +25,11 @@ use starknet::core::types::FromByteArrayError; use super::allocation::{ DevGenesisAccount, GenesisAccount, GenesisAccountAlloc, GenesisContractAlloc, }; +#[cfg(feature = "slot")] +use super::constant::{ + CONTROLLER_ACCOUNT_CONTRACT, CONTROLLER_ACCOUNT_CONTRACT_CASM, + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, +}; use super::constant::{ DEFAULT_FEE_TOKEN_ADDRESS, DEFAULT_LEGACY_ERC20_CONTRACT_CASM, DEFAULT_LEGACY_ERC20_CONTRACT_CLASS_HASH, DEFAULT_LEGACY_ERC20_CONTRACT_COMPILED_CLASS_HASH, @@ -320,6 +325,19 @@ impl TryFrom for Genesis { let mut class_names: HashMap = HashMap::new(); let mut classes: HashMap = HashMap::new(); + #[cfg(feature = "slot")] + // Merely a band aid fix for now. + // Adding this by default so that we can support mounting the genesis file from k8s + // ConfigMap when we embed the Controller class, and its capacity is only limited to 1MiB. + classes.insert( + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + GenesisClass { + casm: Arc::new(CONTROLLER_ACCOUNT_CONTRACT_CASM.clone()), + compiled_class_hash: CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + sierra: Some(Arc::new(CONTROLLER_ACCOUNT_CONTRACT.clone().flatten()?)), + }, + ); + for entry in value.classes { let GenesisClassJson { class, class_hash, name } = entry; @@ -513,9 +531,7 @@ impl TryFrom for Genesis { // insert default account class to the classes map e.insert(GenesisClass { casm: Arc::new(DEFAULT_OZ_ACCOUNT_CONTRACT_CASM.clone()), - sierra: Some(Arc::new( - DEFAULT_OZ_ACCOUNT_CONTRACT.clone().flatten().unwrap(), - )), + sierra: Some(Arc::new(DEFAULT_OZ_ACCOUNT_CONTRACT.clone().flatten()?)), compiled_class_hash: DEFAULT_OZ_ACCOUNT_CONTRACT_COMPILED_CLASS_HASH, }); } @@ -662,34 +678,9 @@ fn class_artifact_at_path( #[cfg(test)] mod tests { - use std::collections::{BTreeMap, HashMap}; - use std::fs::File; - use std::io::BufReader; - use std::path::PathBuf; - use std::str::FromStr; - - use alloy_primitives::U256; use starknet::macros::felt; - use super::{from_base64, GenesisAccountJson, GenesisClassJson, GenesisJson}; - use crate::block::GasPrices; - use crate::genesis::allocation::{ - DevGenesisAccount, GenesisAccount, GenesisAccountAlloc, GenesisContractAlloc, - }; - use crate::genesis::constant::{ - DEFAULT_FEE_TOKEN_ADDRESS, DEFAULT_LEGACY_ERC20_CONTRACT_CASM, - DEFAULT_LEGACY_ERC20_CONTRACT_CLASS_HASH, - DEFAULT_LEGACY_ERC20_CONTRACT_COMPILED_CLASS_HASH, DEFAULT_LEGACY_UDC_CASM, - DEFAULT_LEGACY_UDC_CLASS_HASH, DEFAULT_LEGACY_UDC_COMPILED_CLASS_HASH, - DEFAULT_OZ_ACCOUNT_CONTRACT, DEFAULT_OZ_ACCOUNT_CONTRACT_CASM, - DEFAULT_OZ_ACCOUNT_CONTRACT_CLASS_HASH, DEFAULT_OZ_ACCOUNT_CONTRACT_COMPILED_CLASS_HASH, - DEFAULT_UDC_ADDRESS, - }; - use crate::genesis::json::{to_base64, ClassNameOrHash}; - use crate::genesis::{ - ContractAddress, FeeTokenConfig, Genesis, GenesisAllocation, GenesisClass, - UniversalDeployerConfig, - }; + use super::*; #[test] fn deserialize_from_json() { @@ -925,6 +916,15 @@ mod tests { sierra: Some(DEFAULT_OZ_ACCOUNT_CONTRACT.clone().flatten().unwrap().into()), }, ), + #[cfg(feature = "slot")] + ( + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + GenesisClass { + casm: Arc::new(CONTROLLER_ACCOUNT_CONTRACT_CASM.clone()), + compiled_class_hash: CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + sierra: Some(Arc::new(CONTROLLER_ACCOUNT_CONTRACT.clone().flatten().unwrap())), + }, + ), ]); let expected_fee_token = FeeTokenConfig { @@ -1145,6 +1145,15 @@ mod tests { sierra: Some(DEFAULT_OZ_ACCOUNT_CONTRACT.clone().flatten().unwrap().into()), }, ), + #[cfg(feature = "slot")] + ( + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + GenesisClass { + casm: Arc::new(CONTROLLER_ACCOUNT_CONTRACT_CASM.clone()), + compiled_class_hash: CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + sierra: Some(Arc::new(CONTROLLER_ACCOUNT_CONTRACT.clone().flatten().unwrap())), + }, + ), ]); let fee_token = FeeTokenConfig { diff --git a/crates/katana/primitives/src/genesis/mod.rs b/crates/katana/primitives/src/genesis/mod.rs index 5774e3407c..d8c46b5170 100644 --- a/crates/katana/primitives/src/genesis/mod.rs +++ b/crates/katana/primitives/src/genesis/mod.rs @@ -7,6 +7,11 @@ use std::fmt::Debug; use std::sync::Arc; use alloy_primitives::U256; +#[cfg(feature = "slot")] +use constant::{ + CONTROLLER_ACCOUNT_CONTRACT, CONTROLLER_ACCOUNT_CONTRACT_CASM, + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, +}; use serde::{Deserialize, Serialize}; use starknet::core::serde::unsigned_field_element::UfeHex; use starknet::core::utils::cairo_short_string_to_felt; @@ -282,6 +287,15 @@ impl Default for Genesis { compiled_class_hash: DEFAULT_OZ_ACCOUNT_CONTRACT_COMPILED_CLASS_HASH, }, ), + #[cfg(feature = "slot")] + ( + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + GenesisClass { + casm: CONTROLLER_ACCOUNT_CONTRACT_CASM.clone().into(), + compiled_class_hash: CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + sierra: Some(CONTROLLER_ACCOUNT_CONTRACT.clone().flatten().unwrap().into()), + }, + ), ]); Self { @@ -303,16 +317,8 @@ impl Default for Genesis { mod tests { use std::str::FromStr; + use allocation::GenesisAccount; use starknet::macros::felt; - use tests::allocation::GenesisAccount; - use tests::constant::{ - DEFAULT_FEE_TOKEN_ADDRESS, DEFAULT_LEGACY_ERC20_CONTRACT_CASM, - DEFAULT_LEGACY_ERC20_CONTRACT_CLASS_HASH, - DEFAULT_LEGACY_ERC20_CONTRACT_COMPILED_CLASS_HASH, DEFAULT_LEGACY_UDC_CASM, - DEFAULT_LEGACY_UDC_CLASS_HASH, DEFAULT_LEGACY_UDC_COMPILED_CLASS_HASH, - DEFAULT_OZ_ACCOUNT_CONTRACT, DEFAULT_OZ_ACCOUNT_CONTRACT_CASM, - DEFAULT_OZ_ACCOUNT_CONTRACT_CLASS_HASH, DEFAULT_OZ_ACCOUNT_CONTRACT_COMPILED_CLASS_HASH, - }; use super::*; @@ -345,6 +351,15 @@ mod tests { sierra: Some(DEFAULT_OZ_ACCOUNT_CONTRACT.clone().flatten().unwrap().into()), }, ), + #[cfg(feature = "slot")] + ( + CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + GenesisClass { + casm: CONTROLLER_ACCOUNT_CONTRACT_CASM.clone().into(), + compiled_class_hash: CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH, + sierra: Some(CONTROLLER_ACCOUNT_CONTRACT.clone().flatten().unwrap().into()), + }, + ), ]); let fee_token = FeeTokenConfig { @@ -480,14 +495,27 @@ mod tests { assert_eq!(actual_block.header.version, expected_block.header.version); assert_eq!(actual_block.body, expected_block.body); - assert!( - actual_state_updates.declared_compiled_classes.len() == 3, - "should be 3 casm classes: udc, erc20, oz account" - ); - assert!( - actual_state_updates.declared_sierra_classes.len() == 1, - "should be only 1 sierra class: oz account" - ); + if cfg!(feature = "slot") { + assert!( + actual_state_updates.declared_compiled_classes.len() == 4, + "should be 4 casm classes: udc, erc20, oz account, controller account" + ); + + assert!( + actual_state_updates.declared_sierra_classes.len() == 2, + "should be 2 sierra classes: oz account, controller account" + ); + } else { + assert!( + actual_state_updates.declared_compiled_classes.len() == 3, + "should be 3 casm classes: udc, erc20, oz account" + ); + + assert!( + actual_state_updates.declared_sierra_classes.len() == 1, + "should be only 1 sierra class: oz account" + ); + } assert_eq!( actual_state_updates.state_updates.declared_classes.get(&fee_token.class_hash), @@ -561,6 +589,34 @@ mod tests { "The default oz account contract sierra class should be declared" ); + #[cfg(feature = "slot")] + { + assert_eq!( + actual_state_updates + .state_updates + .declared_classes + .get(&CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH), + Some(&CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH), + "The controller account class should be declared" + ); + + assert_eq!( + actual_state_updates + .declared_compiled_classes + .get(&CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH), + Some(&CONTROLLER_ACCOUNT_CONTRACT_CASM.clone()), + "The controller account contract casm class should be declared" + ); + + assert_eq!( + actual_state_updates + .declared_sierra_classes + .get(&CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH), + Some(&CONTROLLER_ACCOUNT_CONTRACT.clone().flatten().unwrap()), + "The controller account contract sierra class should be declared" + ); + } + // check that all contract allocations exist in the state updates assert_eq!( From b04c0d789977ecce3503559540dc4bfd62dc45e8 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:05:38 -0400 Subject: [PATCH 59/88] feat(torii-core): add entities deletions to susbcription broker (#2106) * feat(torii-core): add entities deletions to susbcription broker * fmt * chore: return empty entities when count 0 --- crates/torii/core/src/sql.rs | 14 +++++++++++++- crates/torii/core/src/types.rs | 4 ++++ crates/torii/grpc/src/server/mod.rs | 8 ++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 9ecd7d38b8..8edf873afa 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -171,7 +171,7 @@ impl Sql { ?, ?, ?) ON CONFLICT(id) DO UPDATE SET \ executed_at=EXCLUDED.executed_at, event_id=EXCLUDED.event_id \ RETURNING *"; - let entity_updated: EntityUpdated = sqlx::query_as(insert_entities) + let mut entity_updated: EntityUpdated = sqlx::query_as(insert_entities) .bind(&entity_id) .bind(&keys_str) .bind(event_id) @@ -179,6 +179,8 @@ impl Sql { .fetch_one(&self.pool) .await?; + entity_updated.updated_model = Some(entity.clone()); + let path = vec![entity.name()]; self.build_set_entity_queries_recursive( path, @@ -253,8 +255,18 @@ impl Sql { pub async fn delete_entity(&mut self, keys: Vec, entity: Ty) -> Result<()> { let entity_id = format!("{:#x}", poseidon_hash_many(&keys)); let path = vec![entity.name()]; + // delete entity models data self.build_delete_entity_queries_recursive(path, &entity_id, &entity); self.query_queue.execute_all().await?; + + // delete entity + let entity_deleted = + sqlx::query_as::<_, EntityUpdated>("DELETE FROM entities WHERE id = ? RETURNING *") + .bind(entity_id) + .fetch_one(&self.pool) + .await?; + + SimpleBroker::publish(entity_deleted); Ok(()) } diff --git a/crates/torii/core/src/types.rs b/crates/torii/core/src/types.rs index 24f982f1e2..bef551258c 100644 --- a/crates/torii/core/src/types.rs +++ b/crates/torii/core/src/types.rs @@ -1,6 +1,7 @@ use core::fmt; use chrono::{DateTime, Utc}; +use dojo_types::schema::Ty; use serde::{Deserialize, Serialize}; use sqlx::FromRow; use starknet::core::types::FieldElement; @@ -37,6 +38,9 @@ pub struct Entity { pub executed_at: DateTime, pub created_at: DateTime, pub updated_at: DateTime, + // if updated_model is None, then the entity has been deleted + #[sqlx(skip)] + pub updated_model: Option, } #[derive(FromRow, Deserialize, Debug, Clone)] diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index 7948cc6e56..ca1eee2c79 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -239,6 +239,10 @@ impl DojoWorld { // total count of rows without limit and offset let total_count: u32 = sqlx::query_scalar(&count_query).fetch_one(&self.pool).await?; + if total_count == 0 { + return Ok((Vec::new(), 0)); + } + // query to filter with limit and offset let query = format!( r#" @@ -335,6 +339,10 @@ impl DojoWorld { let total_count = sqlx::query_scalar(&count_query).bind(&keys_pattern).fetch_one(&self.pool).await?; + if total_count == 0 { + return Ok((Vec::new(), 0)); + } + let models_query = format!( r#" SELECT group_concat({model_relation_table}.model_id) as model_ids From 48232e99126f0e153ae11d728063465ff805942c Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 26 Jun 2024 19:34:21 -0500 Subject: [PATCH 60/88] Prepare release: v0.7.3-alpha.1 (#2110) --- Cargo.lock | 92 ++++++++++---------- Cargo.toml | 2 +- crates/katana/rpc/rpc/Cargo.toml | 2 +- crates/katana/runner/Cargo.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- 5 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eabe1a67a8..d4088c6de8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1679,7 +1679,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "clap", @@ -4194,7 +4194,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "reqwest 0.12.4", @@ -5036,7 +5036,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "async-trait", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", @@ -5054,15 +5054,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" [[package]] name = "dojo-lang" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -5113,7 +5113,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "cairo-lang-language-server", "clap", @@ -5122,7 +5122,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "hyper 0.14.28", @@ -5140,7 +5140,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "assert_fs", @@ -5174,7 +5174,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "crypto-bigint", @@ -5190,7 +5190,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "assert_fs", @@ -5229,7 +5229,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8365,7 +8365,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8373,7 +8373,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.3-alpha.0", + "common 0.7.3-alpha.1", "console", "dojo-metrics", "katana-core", @@ -8393,7 +8393,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -8406,7 +8406,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "bytes", "katana-primitives", @@ -8414,7 +8414,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "proc-macro2", "quote", @@ -8424,7 +8424,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-contract 0.1.0", "alloy-network 0.1.0", @@ -8472,7 +8472,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8494,7 +8494,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8521,7 +8521,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8546,7 +8546,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8572,7 +8572,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy", "anyhow", @@ -8615,7 +8615,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8626,7 +8626,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-primitives", "anyhow", @@ -8647,7 +8647,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "katana-executor", @@ -8659,7 +8659,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "assert_fs", @@ -8678,7 +8678,7 @@ dependencies = [ [[package]] name = "katana-slot-controller" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "account_sdk", "alloy-primitives", @@ -8694,7 +8694,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "futures", "rayon", @@ -12101,7 +12101,7 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "runner-macro" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "quote", "syn 2.0.64", @@ -12369,7 +12369,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "cairo-proof-parser", @@ -12390,7 +12390,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "async-trait", @@ -12432,7 +12432,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "alloy-primitives", "anyhow", @@ -12604,7 +12604,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "clap", "clap_complete", @@ -13286,7 +13286,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "account_sdk", "anyhow", @@ -13348,7 +13348,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "assert_fs", @@ -13404,7 +13404,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "starknet", @@ -14697,7 +14697,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "async-trait", @@ -14705,7 +14705,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.3-alpha.0", + "common 0.7.3-alpha.1", "ctrlc", "dojo-metrics", "dojo-types", @@ -14742,7 +14742,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "async-trait", "camino", @@ -14770,7 +14770,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "async-trait", @@ -14809,7 +14809,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "async-graphql", @@ -14850,7 +14850,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "bytes", "camino", @@ -14894,7 +14894,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "async-trait", @@ -14930,7 +14930,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" dependencies = [ "anyhow", "async-trait", @@ -15253,7 +15253,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" [[package]] name = "u256-literal" diff --git a/Cargo.toml b/Cargo.toml index aa06e92b8d..7fc3bd1e03 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" [profile.performance] codegen-units = 1 diff --git a/crates/katana/rpc/rpc/Cargo.toml b/crates/katana/rpc/rpc/Cargo.toml index 0b0ef25f66..21bd70a416 100644 --- a/crates/katana/rpc/rpc/Cargo.toml +++ b/crates/katana/rpc/rpc/Cargo.toml @@ -55,4 +55,4 @@ alloy = { git = "https://github.com/alloy-rs/alloy", features = [ "signer-local", "provider-http", "node-bindings" -] } \ No newline at end of file +] } diff --git a/crates/katana/runner/Cargo.toml b/crates/katana/runner/Cargo.toml index 6f911fbe32..f0a6787556 100644 --- a/crates/katana/runner/Cargo.toml +++ b/crates/katana/runner/Cargo.toml @@ -18,4 +18,4 @@ serde.workspace = true serde_json.workspace = true starknet.workspace = true tokio.workspace = true -url.workspace = true \ No newline at end of file +url.workspace = true diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index e50bd02830..9b02af2242 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.3-alpha.0" +version = "0.7.3-alpha.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From ca42629540b9855a8201da49dc861a74691143bb Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:54:11 -0400 Subject: [PATCH 61/88] feat(torii-grpc): support multiple entity models in queries & complex keys clause for subscriptions + queries (#2095) * feat: start working on keys entity subscription * refactor: implementing keys subscriptions and using existing queries * refactor: finish refactor on clauses * fix: if felt bytes 0 then wildcard * fmt * feat: update torii client and fix tets * fix: clippy * refactor: do not consider overflowing key patterns * feat: fully use new keysclause & add pattern matching * feat: support pattern matching in queries * fmt * refactor: new types in torii client * clippy * fix: ignroe non matching entity keys in fixedlen * add a model to test keys clause pattern matching * fix: fix tests * fix: lock version * chore: remove debug print * fix: match fixed len for queries * chore: use regex for key pattern matching * feat: add optional model clause to keysclause * feat: add model specf to query by keys * fix: queries * feat: wrap up queries * fmt & clippy * chore: enable regexp for tests * chore: update test for new model * refactor: use array of models for keysclause --------- Co-authored-by: glihm --- crates/dojo-bindgen/src/lib.rs | 2 +- .../dojo-world/src/manifest/manifest_test.rs | 4 +- crates/torii/client/src/client/mod.rs | 45 +- .../torii/client/src/client/subscription.rs | 18 +- crates/torii/core/src/sql.rs | 4 +- crates/torii/core/src/sql_test.rs | 2 +- crates/torii/core/src/types.rs | 4 + crates/torii/grpc/proto/types.proto | 28 +- crates/torii/grpc/proto/world.proto | 8 +- crates/torii/grpc/src/client.rs | 23 +- crates/torii/grpc/src/server/mod.rs | 357 +++++++-------- .../grpc/src/server/subscriptions/entity.rs | 164 ++++--- .../grpc/src/server/subscriptions/event.rs | 65 ++- .../src/server/subscriptions/event_message.rs | 157 ++++--- .../src/server/subscriptions/model_diff.rs | 6 +- .../grpc/src/server/tests/entities_test.rs | 18 +- crates/torii/grpc/src/types/mod.rs | 110 ++++- crates/torii/types-test/Scarb.lock | 2 +- .../dojo_examples_actions_actions.json | 16 + .../dojo_examples_models_server_profile.json | 367 ++++++++++++++++ .../dojo_examples_actions_actions.json | 16 + .../dojo_examples_models_server_profile.json | 367 ++++++++++++++++ .../dojo_examples_actions_actions.toml | 4 +- .../dojo_examples_models_server_profile.toml | 20 + .../manifests/dev/manifest.json | 410 +++++++++++++++++- .../manifests/dev/manifest.toml | 26 +- examples/spawn-and-move/src/actions.cairo | 10 +- examples/spawn-and-move/src/models.cairo | 10 + 28 files changed, 1865 insertions(+), 398 deletions(-) create mode 100644 examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json create mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index c8cbe96172..97e8074868 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -283,7 +283,7 @@ mod tests { gather_dojo_data(&manifest_path, "dojo_example", "dev", dojo_metadata.skip_migration) .unwrap(); - assert_eq!(data.models.len(), 7); + assert_eq!(data.models.len(), 8); assert_eq!(data.world.name, "dojo_example"); diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index d19a69b01b..b4894c453c 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -419,10 +419,10 @@ fn fetch_remote_manifest() { DeploymentManifest::load_from_remote(provider, world_address).await.unwrap() }); - assert_eq!(local_manifest.models.len(), 7); + assert_eq!(local_manifest.models.len(), 8); assert_eq!(local_manifest.contracts.len(), 3); - assert_eq!(remote_manifest.models.len(), 7); + assert_eq!(remote_manifest.models.len(), 8); assert_eq!(remote_manifest.contracts.len(), 3); // compute diff from local and remote manifest diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index dead3ab1b0..0f7a096317 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -20,7 +20,7 @@ use tokio::sync::RwLock as AsyncRwLock; use torii_grpc::client::{EntityUpdateStreaming, EventUpdateStreaming, ModelDiffsStreaming}; use torii_grpc::proto::world::{RetrieveEntitiesResponse, RetrieveEventsResponse}; use torii_grpc::types::schema::{Entity, SchemaError}; -use torii_grpc::types::{Event, EventQuery, KeysClause, Query}; +use torii_grpc::types::{EntityKeysClause, Event, EventQuery, KeysClause, ModelKeysClause, Query}; use torii_relay::client::EventLoop; use torii_relay::types::Message; @@ -56,7 +56,6 @@ impl Client { rpc_url: String, relay_url: String, world: FieldElement, - models_keys: Option>, ) -> Result { let mut grpc_client = torii_grpc::client::WorldClient::new(torii_url, world).await?; @@ -73,23 +72,6 @@ impl Client { let provider = JsonRpcClient::new(HttpTransport::new(rpc_url)); let world_reader = WorldContractReader::new(world, provider); - if let Some(keys) = models_keys { - subbed_models.add_models(keys)?; - - // TODO: change this to querying the gRPC url instead - let subbed_models = subbed_models.models_keys.read().clone(); - for keys in subbed_models { - let model_reader = world_reader.model_reader(&keys.model).await?; - let values = model_reader.entity_storage(&keys.keys).await?; - - client_storage.set_model_storage( - cairo_short_string_to_felt(&keys.model).unwrap(), - keys.keys, - values, - )?; - } - } - Ok(Self { world_reader, storage: client_storage, @@ -123,7 +105,7 @@ impl Client { self.metadata.read() } - pub fn subscribed_models(&self) -> RwLockReadGuard<'_, HashSet> { + pub fn subscribed_models(&self) -> RwLockReadGuard<'_, HashSet> { self.subscribed_models.models_keys.read() } @@ -163,26 +145,26 @@ impl Client { /// A direct stream to grpc subscribe entities pub async fn on_entity_updated( &self, - ids: Vec, + clause: Option, ) -> Result { let mut grpc_client = self.inner.write().await; - let stream = grpc_client.subscribe_entities(ids).await?; + let stream = grpc_client.subscribe_entities(clause).await?; Ok(stream) } /// A direct stream to grpc subscribe event messages pub async fn on_event_message_updated( &self, - ids: Vec, + clause: Option, ) -> Result { let mut grpc_client = self.inner.write().await; - let stream = grpc_client.subscribe_event_messages(ids).await?; + let stream = grpc_client.subscribe_event_messages(clause).await?; Ok(stream) } pub async fn on_starknet_event( &self, - keys: Option>, + keys: Option, ) -> Result { let mut grpc_client = self.inner.write().await; let stream = grpc_client.subscribe_events(keys).await?; @@ -196,7 +178,7 @@ impl Client { /// /// If the requested model is not among the synced models, it will attempt to fetch it from /// the RPC. - pub async fn model(&self, keys: &KeysClause) -> Result, Error> { + pub async fn model(&self, keys: &ModelKeysClause) -> Result, Error> { let Some(mut schema) = self.metadata.read().model(&keys.model).map(|m| m.schema.clone()) else { return Ok(None); @@ -232,7 +214,7 @@ impl Client { /// Initiate the model subscriptions and returns a [SubscriptionService] which when await'ed /// will execute the subscription service and starts the syncing process. pub async fn start_subscription(&self) -> Result { - let models_keys: Vec = + let models_keys: Vec = self.subscribed_models.models_keys.read().clone().into_iter().collect(); let sub_res_stream = self.initiate_subscription(models_keys).await?; @@ -250,7 +232,7 @@ impl Client { /// Adds entities to the list of entities to be synced. /// /// NOTE: This will establish a new subscription stream with the server. - pub async fn add_models_to_sync(&self, models_keys: Vec) -> Result<(), Error> { + pub async fn add_models_to_sync(&self, models_keys: Vec) -> Result<(), Error> { for keys in &models_keys { self.initiate_model(&keys.model, keys.keys.clone()).await?; } @@ -271,7 +253,10 @@ impl Client { /// Removes models from the list of models to be synced. /// /// NOTE: This will establish a new subscription stream with the server. - pub async fn remove_models_to_sync(&self, models_keys: Vec) -> Result<(), Error> { + pub async fn remove_models_to_sync( + &self, + models_keys: Vec, + ) -> Result<(), Error> { self.subscribed_models.remove_models(models_keys)?; let updated_entities = @@ -291,7 +276,7 @@ impl Client { async fn initiate_subscription( &self, - keys: Vec, + keys: Vec, ) -> Result { let mut grpc_client = self.inner.write().await; let stream = grpc_client.subscribe_model_diffs(keys).await?; diff --git a/crates/torii/client/src/client/subscription.rs b/crates/torii/client/src/client/subscription.rs index ac21707104..73415975e3 100644 --- a/crates/torii/client/src/client/subscription.rs +++ b/crates/torii/client/src/client/subscription.rs @@ -12,7 +12,7 @@ use starknet::core::types::{StateDiff, StateUpdate}; use starknet::core::utils::cairo_short_string_to_felt; use starknet_crypto::FieldElement; use torii_grpc::client::ModelDiffsStreaming; -use torii_grpc::types::KeysClause; +use torii_grpc::types::ModelKeysClause; use crate::client::error::{Error, ParseError}; use crate::client::storage::ModelStorage; @@ -24,13 +24,13 @@ pub enum SubscriptionEvent { pub struct SubscribedModels { metadata: Arc>, - pub(crate) models_keys: RwLock>, + pub(crate) models_keys: RwLock>, /// All the relevant storage addresses derived from the subscribed models pub(crate) subscribed_storage_addresses: RwLock>, } impl SubscribedModels { - pub(crate) fn is_synced(&self, keys: &KeysClause) -> bool { + pub(crate) fn is_synced(&self, keys: &ModelKeysClause) -> bool { self.models_keys.read().contains(keys) } @@ -42,21 +42,21 @@ impl SubscribedModels { } } - pub(crate) fn add_models(&self, models_keys: Vec) -> Result<(), Error> { + pub(crate) fn add_models(&self, models_keys: Vec) -> Result<(), Error> { for keys in models_keys { Self::add_model(self, keys)?; } Ok(()) } - pub(crate) fn remove_models(&self, entities_keys: Vec) -> Result<(), Error> { + pub(crate) fn remove_models(&self, entities_keys: Vec) -> Result<(), Error> { for keys in entities_keys { Self::remove_model(self, keys)?; } Ok(()) } - pub(crate) fn add_model(&self, keys: KeysClause) -> Result<(), Error> { + pub(crate) fn add_model(&self, keys: ModelKeysClause) -> Result<(), Error> { if !self.models_keys.write().insert(keys.clone()) { return Ok(()); } @@ -83,7 +83,7 @@ impl SubscribedModels { Ok(()) } - pub(crate) fn remove_model(&self, keys: KeysClause) -> Result<(), Error> { + pub(crate) fn remove_model(&self, keys: ModelKeysClause) -> Result<(), Error> { if !self.models_keys.write().remove(&keys) { return Ok(()); } @@ -247,7 +247,7 @@ mod tests { use parking_lot::RwLock; use starknet::core::utils::cairo_short_string_to_felt; use starknet::macros::felt; - use torii_grpc::types::KeysClause; + use torii_grpc::types::ModelKeysClause; use crate::utils::compute_all_storage_addresses; @@ -283,7 +283,7 @@ mod tests { let metadata = self::create_dummy_metadata(); - let keys = KeysClause { model: model_name, keys }; + let keys = ModelKeysClause { model: model_name, keys }; let subscribed_models = super::SubscribedModels::new(Arc::new(RwLock::new(metadata))); subscribed_models.add_models(vec![keys.clone()]).expect("able to add model"); diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 8edf873afa..d7a692c728 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -228,7 +228,7 @@ impl Sql { VALUES (?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET \ updated_at=CURRENT_TIMESTAMP, event_id=EXCLUDED.event_id RETURNING \ *"; - let event_message_updated: EventMessageUpdated = sqlx::query_as(insert_entities) + let mut event_message_updated: EventMessageUpdated = sqlx::query_as(insert_entities) .bind(&entity_id) .bind(&keys_str) .bind(event_id) @@ -236,6 +236,8 @@ impl Sql { .fetch_one(&self.pool) .await?; + event_message_updated.updated_model = Some(entity.clone()); + let path = vec![entity.name()]; self.build_set_entity_queries_recursive( path, diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 92d45a68e8..baf7b65e6f 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -123,7 +123,7 @@ async fn test_load_from_remote() { let _block_timestamp = 1710754478_u64; let models = sqlx::query("SELECT * FROM models").fetch_all(&pool).await.unwrap(); - assert_eq!(models.len(), 7); + assert_eq!(models.len(), 8); let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'Position'", diff --git a/crates/torii/core/src/types.rs b/crates/torii/core/src/types.rs index bef551258c..f410c594c4 100644 --- a/crates/torii/core/src/types.rs +++ b/crates/torii/core/src/types.rs @@ -52,6 +52,10 @@ pub struct EventMessage { pub executed_at: DateTime, pub created_at: DateTime, pub updated_at: DateTime, + + // this should never be None. as a EventMessage cannot be deleted + #[sqlx(skip)] + pub updated_model: Option, } #[derive(FromRow, Deserialize, Debug, Clone)] diff --git a/crates/torii/grpc/proto/types.proto b/crates/torii/grpc/proto/types.proto index 7ca3b3cf17..9575820858 100644 --- a/crates/torii/grpc/proto/types.proto +++ b/crates/torii/grpc/proto/types.proto @@ -85,7 +85,7 @@ message Query { } message EventQuery { - EventKeysClause keys =1; + KeysClause keys = 1; uint32 limit = 2; uint32 offset = 3; } @@ -99,17 +99,26 @@ message Clause { } } -message HashedKeysClause { - repeated bytes hashed_keys = 1; +message ModelKeysClause { + string model = 1; + repeated bytes keys = 2; } -message EventKeysClause { - repeated bytes keys = 1; +message EntityKeysClause { + oneof clause_type { + HashedKeysClause hashed_keys = 1; + KeysClause keys = 2; + } } message KeysClause { - string model = 1; - repeated bytes keys = 2; + repeated bytes keys = 1; + PatternMatching pattern_matching = 2; + repeated string models = 3; +} + +message HashedKeysClause { + repeated bytes hashed_keys = 1; } message MemberClause { @@ -125,6 +134,11 @@ message CompositeClause { repeated Clause clauses = 3; } +enum PatternMatching { + FixedLen = 0; + VariableLen = 1; +} + enum LogicalOperator { AND = 0; OR = 1; diff --git a/crates/torii/grpc/proto/world.proto b/crates/torii/grpc/proto/world.proto index 7ab0c6f971..76b88981a7 100644 --- a/crates/torii/grpc/proto/world.proto +++ b/crates/torii/grpc/proto/world.proto @@ -43,7 +43,7 @@ message MetadataResponse { message SubscribeModelsRequest { // The list of model keys to subscribe to. - repeated types.KeysClause models_keys = 1; + repeated types.ModelKeysClause models_keys = 1; } message SubscribeModelsResponse { @@ -52,11 +52,11 @@ message SubscribeModelsResponse { } message SubscribeEntitiesRequest { - repeated bytes hashed_keys = 1; + types.EntityKeysClause clause = 1; } message SubscribeEventMessagesRequest { - repeated bytes hashed_keys = 1; + types.EntityKeysClause clause = 1; } message SubscribeEntityResponse { @@ -83,7 +83,7 @@ message RetrieveEventsResponse { } message SubscribeEventsRequest { - types.EventKeysClause keys = 1; + types.KeysClause keys = 1; } message SubscribeEventsResponse { diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index e2db66576e..2bd5bc4411 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -6,7 +6,6 @@ use futures_util::{Stream, StreamExt, TryStreamExt}; use starknet::core::types::{FromStrError, StateDiff, StateUpdate}; use starknet_crypto::FieldElement; -use crate::proto::types::EventKeysClause; use crate::proto::world::{ world_client, MetadataRequest, RetrieveEntitiesRequest, RetrieveEntitiesResponse, RetrieveEventsRequest, RetrieveEventsResponse, SubscribeEntitiesRequest, @@ -14,7 +13,7 @@ use crate::proto::world::{ SubscribeModelsRequest, SubscribeModelsResponse, }; use crate::types::schema::{self, Entity, SchemaError}; -use crate::types::{Event, EventQuery, KeysClause, Query}; +use crate::types::{EntityKeysClause, Event, EventQuery, KeysClause, ModelKeysClause, Query}; #[derive(Debug, thiserror::Error)] pub enum Error { @@ -105,12 +104,12 @@ impl WorldClient { /// Subscribe to entities updates of a World. pub async fn subscribe_entities( &mut self, - hashed_keys: Vec, + clause: Option, ) -> Result { - let hashed_keys = hashed_keys.iter().map(|hashed| hashed.to_bytes_be().to_vec()).collect(); + let clause = clause.map(|c| c.into()); let stream = self .inner - .subscribe_entities(SubscribeEntitiesRequest { hashed_keys }) + .subscribe_entities(SubscribeEntitiesRequest { clause }) .await .map_err(Error::Grpc) .map(|res| res.into_inner())?; @@ -124,12 +123,12 @@ impl WorldClient { /// Subscribe to event messages of a World. pub async fn subscribe_event_messages( &mut self, - hashed_keys: Vec, + clause: Option, ) -> Result { - let hashed_keys = hashed_keys.iter().map(|hashed| hashed.to_bytes_be().to_vec()).collect(); + let clause = clause.map(|c| c.into()); let stream = self .inner - .subscribe_event_messages(SubscribeEntitiesRequest { hashed_keys }) + .subscribe_event_messages(SubscribeEntitiesRequest { clause }) .await .map_err(Error::Grpc) .map(|res| res.into_inner())?; @@ -143,11 +142,9 @@ impl WorldClient { /// Subscribe to the events of a World. pub async fn subscribe_events( &mut self, - keys: Option>, + keys: Option, ) -> Result { - let keys = keys.map(|keys| EventKeysClause { - keys: keys.iter().map(|key| key.to_bytes_be().to_vec()).collect(), - }); + let keys = keys.map(|c| c.into()); let stream = self .inner @@ -165,7 +162,7 @@ impl WorldClient { /// Subscribe to the model diff for a set of models of a World. pub async fn subscribe_model_diffs( &mut self, - models_keys: Vec, + models_keys: Vec, ) -> Result { let stream = self .inner diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index ca1eee2c79..9d2ad65e56 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -165,8 +165,8 @@ impl DojoWorld { ENTITIES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, None, - limit, - offset, + Some(limit), + Some(offset), ) .await } @@ -181,8 +181,8 @@ impl DojoWorld { EVENT_MESSAGES_MODEL_RELATION_TABLE, EVENT_MESSAGES_ENTITY_RELATION_COLUMN, None, - limit, - offset, + Some(limit), + Some(offset), ) .await } @@ -207,8 +207,8 @@ impl DojoWorld { model_relation_table: &str, entity_relation_column: &str, hashed_keys: Option, - limit: u32, - offset: u32, + limit: Option, + offset: Option, ) -> Result<(Vec, u32), Error> { // TODO: use prepared statement for where clause let filter_ids = match hashed_keys { @@ -244,7 +244,7 @@ impl DojoWorld { } // query to filter with limit and offset - let query = format!( + let mut query = format!( r#" SELECT {table}.id, group_concat({model_relation_table}.model_id) as model_ids FROM {table} @@ -252,15 +252,22 @@ impl DojoWorld { {filter_ids} GROUP BY {table}.id ORDER BY {table}.event_id DESC - LIMIT ? OFFSET ? "# ); + if limit.is_some() { + query += " LIMIT ?" + } + + if offset.is_some() { + query += " OFFSET ?" + } + let db_entities: Vec<(String, String)> = sqlx::query_as(&query).bind(limit).bind(offset).fetch_all(&self.pool).await?; let mut entities = Vec::with_capacity(db_entities.len()); - for (entity_id, models_str) in db_entities { + for (entity_id, models_str) in &db_entities { let model_ids: Vec<&str> = models_str.split(',').collect(); let schemas = self.model_cache.schemas(model_ids).await?; @@ -272,31 +279,14 @@ impl DojoWorld { Some(&format!("{table}.id = ?")), )?; - let row = sqlx::query(&entity_query).bind(&entity_id).fetch_one(&self.pool).await?; + let row = sqlx::query(&entity_query).bind(entity_id).fetch_one(&self.pool).await?; let mut arrays_rows = HashMap::new(); for (name, query) in arrays_queries { - let rows = sqlx::query(&query).bind(&entity_id).fetch_all(&self.pool).await?; + let rows = sqlx::query(&query).bind(entity_id).fetch_all(&self.pool).await?; arrays_rows.insert(name, rows); } - let models = schemas - .into_iter() - .map(|mut s| { - map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; - - Ok(s.as_struct() - .expect("schema should be struct") - .to_owned() - .try_into() - .unwrap()) - }) - .collect::, Error>>()?; - - let hashed_keys = FieldElement::from_str(&entity_id).map_err(ParseError::FromStr)?; - entities.push(proto::types::Entity { - hashed_keys: hashed_keys.to_bytes_be().to_vec(), - models, - }) + entities.push(map_row_to_entity(&row, &arrays_rows, &schemas)?); } Ok((entities, total_count)) @@ -308,34 +298,60 @@ impl DojoWorld { model_relation_table: &str, entity_relation_column: &str, keys_clause: proto::types::KeysClause, - limit: u32, - offset: u32, + limit: Option, + offset: Option, ) -> Result<(Vec, u32), Error> { let keys = keys_clause .keys .iter() .map(|bytes| { if bytes.is_empty() { - return Ok("%".to_string()); + return Ok("0x[0-9a-fA-F]+".to_string()); } Ok(FieldElement::from_byte_slice_be(bytes) .map(|felt| format!("{felt:#x}")) .map_err(ParseError::FromByteSliceError)?) }) .collect::, Error>>()?; - let keys_pattern = keys.join("/") + "/%"; + let mut keys_pattern = format!("^{}", keys.join("/")); + + if keys_clause.pattern_matching == proto::types::PatternMatching::VariableLen as i32 { + keys_pattern += "(/0x[0-9a-fA-F]+)*"; + } + keys_pattern += "/$"; + // total count of rows that matches keys_pattern without limit and offset let count_query = format!( r#" SELECT count(*) FROM {table} - JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id - WHERE {model_relation_table}.model_id = '{:#x}' and {table}.keys LIKE ? + {} "#, - get_selector_from_name(&keys_clause.model).map_err(ParseError::NonAsciiName)? + if !keys_clause.models.is_empty() { + let model_ids = keys_clause + .models + .iter() + .map(|model| get_selector_from_name(model).map_err(ParseError::NonAsciiName)) + .collect::, _>>()?; + let model_ids_str = + model_ids.iter().map(|id| format!("'{:#x}'", id)).collect::>().join(","); + format!( + r#" + JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id + WHERE {model_relation_table}.model_id IN ({}) + AND {table}.keys REGEXP ? + "#, + model_ids_str + ) + } else { + format!( + r#" + WHERE {table}.keys REGEXP ? + "# + ) + } ); - // total count of rows that matches keys_pattern without limit and offset let total_count = sqlx::query_scalar(&count_query).bind(&keys_pattern).fetch_one(&self.pool).await?; @@ -343,83 +359,105 @@ impl DojoWorld { return Ok((Vec::new(), 0)); } - let models_query = format!( + let mut models_query = format!( r#" - SELECT group_concat({model_relation_table}.model_id) as model_ids + SELECT {table}.id, group_concat({model_relation_table}.model_id) as model_ids FROM {table} JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id - WHERE {table}.keys LIKE ? + WHERE {table}.keys REGEXP ? GROUP BY {table}.id - HAVING INSTR(model_ids, '{:#x}') > 0 - LIMIT 1 - "#, - get_selector_from_name(&keys_clause.model).map_err(ParseError::NonAsciiName)? + "# ); - let (models_str,): (String,) = - sqlx::query_as(&models_query).bind(&keys_pattern).fetch_one(&self.pool).await?; - let model_ids = models_str.split(',').collect::>(); - let schemas = self.model_cache.schemas(model_ids).await?; + if !keys_clause.models.is_empty() { + // filter by models + models_query += &format!( + "HAVING {}", + keys_clause + .models + .iter() + .map(|model| { + let model_id = + get_selector_from_name(model).map_err(ParseError::NonAsciiName)?; + Ok(format!("INSTR(model_ids, '{:#x}') > 0", model_id)) + }) + .collect::, Error>>()? + .join(" OR ") + .as_str() + ); + } - // query to filter with limit and offset - let (entities_query, arrays_queries) = build_sql_query( - &schemas, - table, - entity_relation_column, - Some(&format!("{table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?")), - Some(&format!("{table}.keys LIKE ? ORDER BY {table}.event_id DESC LIMIT ? OFFSET ?")), - )?; - let db_entities = sqlx::query(&entities_query) + models_query += &format!(" ORDER BY {table}.event_id DESC"); + + if limit.is_some() { + models_query += " LIMIT ?"; + } + if offset.is_some() { + models_query += " OFFSET ?"; + } + + let db_entities: Vec<(String, String)> = sqlx::query_as(&models_query) .bind(&keys_pattern) .bind(limit) .bind(offset) .fetch_all(&self.pool) .await?; - let mut arrays_rows = HashMap::new(); - for (name, query) in arrays_queries { - let rows = sqlx::query(&query) - .bind(&keys_pattern) - .bind(limit) - .bind(offset) - .fetch_all(&self.pool) - .await?; - arrays_rows.insert(name, rows); + + let mut entities = Vec::with_capacity(db_entities.len()); + for (entity_id, models_strs) in &db_entities { + let model_ids: Vec<&str> = models_strs.split(',').collect(); + let schemas = self.model_cache.schemas(model_ids).await?; + + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table}.id = ?")), + Some(&format!("{table}.id = ?")), + )?; + + let row = sqlx::query(&entity_query).bind(entity_id).fetch_one(&self.pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(entity_id).fetch_all(&self.pool).await?; + arrays_rows.insert(name, rows); + } + + entities.push(map_row_to_entity(&row, &arrays_rows, &schemas)?); } - Ok(( - db_entities - .iter() - .map(|row| Self::map_row_to_entity(row, &arrays_rows, &schemas)) - .collect::, Error>>()?, - total_count, - )) + Ok((entities, total_count)) } pub(crate) async fn events_by_keys( &self, - keys_clause: proto::types::EventKeysClause, - limit: u32, - offset: u32, + keys_clause: proto::types::KeysClause, + limit: Option, + offset: Option, ) -> Result, Error> { let keys = keys_clause .keys .iter() .map(|bytes| { if bytes.is_empty() { - return Ok("%".to_string()); + return Ok("0x[0-9a-fA-F]+".to_string()); } - Ok(FieldElement::from_byte_slice_be(bytes) .map(|felt| format!("{felt:#x}")) .map_err(ParseError::FromByteSliceError)?) }) .collect::, Error>>()?; - let keys_pattern = keys.join("/") + "/%"; + let mut keys_pattern = format!("^{}", keys.join("/")); + + if keys_clause.pattern_matching == proto::types::PatternMatching::VariableLen as i32 { + keys_pattern += "(/0x[0-9a-fA-F]+)*"; + } + keys_pattern += "/$"; let events_query = r#" SELECT keys, data, transaction_hash FROM events - WHERE keys LIKE ? + WHERE keys REGEXP ? ORDER BY id DESC LIMIT ? OFFSET ? "# @@ -441,8 +479,8 @@ impl DojoWorld { model_relation_table: &str, entity_relation_column: &str, member_clause: proto::types::MemberClause, - _limit: u32, - _offset: u32, + limit: Option, + offset: Option, ) -> Result<(Vec, u32), Error> { let comparison_operator = ComparisonOperator::from_repr(member_clause.operator as usize) .expect("invalid comparison operator"); @@ -489,12 +527,19 @@ impl DojoWorld { &schemas, table, entity_relation_column, - Some(&format!("{table_name}.{column_name} {comparison_operator} ?")), + Some(&format!( + "{table_name}.{column_name} {comparison_operator} ? ORDER BY {table}.event_id \ + DESC LIMIT ? OFFSET ?" + )), None, )?; - let db_entities = - sqlx::query(&entity_query).bind(comparison_value.clone()).fetch_all(&self.pool).await?; + let db_entities = sqlx::query(&entity_query) + .bind(comparison_value.clone()) + .bind(limit) + .bind(offset) + .fetch_all(&self.pool) + .await?; let mut arrays_rows = HashMap::new(); for (name, query) in arrays_queries { let rows = @@ -504,7 +549,7 @@ impl DojoWorld { let entities_collection = db_entities .iter() - .map(|row| Self::map_row_to_entity(row, &arrays_rows, &schemas)) + .map(|row| map_row_to_entity(row, &arrays_rows, &schemas)) .collect::, Error>>()?; // Since there is not limit and offset, total_count is same as number of entities let total_count = entities_collection.len() as u32; @@ -517,8 +562,8 @@ impl DojoWorld { _model_relation_table: &str, _entity_relation_column: &str, _composite: proto::types::CompositeClause, - _limit: u32, - _offset: u32, + _limit: Option, + _offset: Option, ) -> Result<(Vec, u32), Error> { // TODO: Implement Err(QueryError::UnsupportedQuery.into()) @@ -560,7 +605,7 @@ impl DojoWorld { async fn subscribe_models( &self, - models_keys: Vec, + models_keys: Vec, ) -> Result>, Error> { let mut subs = Vec::with_capacity(models_keys.len()); for keys in models_keys { @@ -584,9 +629,9 @@ impl DojoWorld { async fn subscribe_entities( &self, - hashed_keys: Vec, + keys: Option, ) -> Result>, Error> { - self.entity_manager.add_subscriber(hashed_keys).await + self.entity_manager.add_subscriber(keys.map(|keys| keys.try_into().unwrap())).await } async fn retrieve_entities( @@ -610,8 +655,8 @@ impl DojoWorld { ENTITIES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, Some(hashed_keys), - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -620,17 +665,13 @@ impl DojoWorld { return Err(QueryError::MissingParam("keys".into()).into()); } - if keys.model.is_empty() { - return Err(QueryError::MissingParam("model".into()).into()); - } - self.query_by_keys( ENTITIES_TABLE, ENTITIES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, keys, - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -640,8 +681,8 @@ impl DojoWorld { ENTITIES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, member, - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -651,8 +692,8 @@ impl DojoWorld { ENTITIES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, composite, - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -665,9 +706,9 @@ impl DojoWorld { async fn subscribe_event_messages( &self, - hashed_keys: Vec, + keys: Option, ) -> Result>, Error> { - self.event_message_manager.add_subscriber(hashed_keys).await + self.event_message_manager.add_subscriber(keys.map(|keys| keys.try_into().unwrap())).await } async fn retrieve_event_messages( @@ -691,8 +732,8 @@ impl DojoWorld { EVENT_MESSAGES_MODEL_RELATION_TABLE, EVENT_MESSAGES_ENTITY_RELATION_COLUMN, Some(hashed_keys), - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -701,17 +742,13 @@ impl DojoWorld { return Err(QueryError::MissingParam("keys".into()).into()); } - if keys.model.is_empty() { - return Err(QueryError::MissingParam("model".into()).into()); - } - self.query_by_keys( EVENT_MESSAGES_TABLE, EVENT_MESSAGES_MODEL_RELATION_TABLE, EVENT_MESSAGES_ENTITY_RELATION_COLUMN, keys, - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -721,8 +758,8 @@ impl DojoWorld { EVENT_MESSAGES_MODEL_RELATION_TABLE, EVENT_MESSAGES_ENTITY_RELATION_COLUMN, member, - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -732,8 +769,8 @@ impl DojoWorld { EVENT_MESSAGES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, composite, - query.limit, - query.offset, + Some(query.limit), + Some(query.offset), ) .await? } @@ -750,51 +787,16 @@ impl DojoWorld { ) -> Result { let events = match query.keys { None => self.events_all(query.limit, query.offset).await?, - Some(keys) => self.events_by_keys(keys, query.limit, query.offset).await?, + Some(keys) => self.events_by_keys(keys, Some(query.limit), Some(query.offset)).await?, }; Ok(RetrieveEventsResponse { events }) } async fn subscribe_events( &self, - clause: proto::types::EventKeysClause, + clause: proto::types::KeysClause, ) -> Result>, Error> { - self.event_manager - .add_subscriber( - clause - .keys - .iter() - .map(|key| { - FieldElement::from_byte_slice_be(key) - .map_err(ParseError::FromByteSliceError) - }) - .collect::, _>>()?, - ) - .await - } - - fn map_row_to_entity( - row: &SqliteRow, - arrays_rows: &HashMap>, - schemas: &[Ty], - ) -> Result { - let hashed_keys = - FieldElement::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; - let models = schemas - .iter() - .map(|schema| { - let mut schema = schema.to_owned(); - map_row_to_ty("", &schema.name(), &mut schema, row, arrays_rows)?; - Ok(schema - .as_struct() - .expect("schema should be struct") - .to_owned() - .try_into() - .unwrap()) - }) - .collect::, Error>>()?; - - Ok(proto::types::Entity { hashed_keys: hashed_keys.to_bytes_be().to_vec(), models }) + self.event_manager.add_subscriber(clause.try_into().unwrap()).await } } @@ -817,6 +819,25 @@ fn map_row_to_event(row: &(String, String, String)) -> Result>, + schemas: &[Ty], +) -> Result { + let hashed_keys = + FieldElement::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; + let models = schemas + .iter() + .map(|schema| { + let mut schema = schema.to_owned(); + map_row_to_ty("", &schema.name(), &mut schema, row, arrays_rows)?; + Ok(schema.as_struct().expect("schema should be struct").to_owned().try_into().unwrap()) + }) + .collect::, Error>>()?; + + Ok(proto::types::Entity { hashed_keys: hashed_keys.to_bytes_be().to_vec(), models }) +} + type ServiceResult = Result, Status>; type SubscribeModelsResponseStream = Pin> + Send>>; @@ -860,18 +881,9 @@ impl proto::world::world_server::World for DojoWorld { &self, request: Request, ) -> ServiceResult { - let SubscribeEntitiesRequest { hashed_keys } = request.into_inner(); - let hashed_keys = hashed_keys - .iter() - .map(|id| { - FieldElement::from_byte_slice_be(id) - .map_err(|e| Status::invalid_argument(e.to_string())) - }) - .collect::, _>>()?; - let rx = self - .subscribe_entities(hashed_keys) - .await - .map_err(|e| Status::internal(e.to_string()))?; + let SubscribeEntitiesRequest { clause } = request.into_inner(); + let rx = + self.subscribe_entities(clause).await.map_err(|e| Status::internal(e.to_string()))?; Ok(Response::new(Box::pin(ReceiverStream::new(rx)) as Self::SubscribeEntitiesStream)) } @@ -895,16 +907,9 @@ impl proto::world::world_server::World for DojoWorld { &self, request: Request, ) -> ServiceResult { - let SubscribeEntitiesRequest { hashed_keys } = request.into_inner(); - let hashed_keys = hashed_keys - .iter() - .map(|id| { - FieldElement::from_byte_slice_be(id) - .map_err(|e| Status::invalid_argument(e.to_string())) - }) - .collect::, _>>()?; + let SubscribeEntitiesRequest { clause } = request.into_inner(); let rx = self - .subscribe_event_messages(hashed_keys) + .subscribe_event_messages(clause) .await .map_err(|e| Status::internal(e.to_string()))?; diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index f9d4ae0d96..a62ee8dd69 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -1,4 +1,4 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::HashMap; use std::future::Future; use std::pin::Pin; use std::str::FromStr; @@ -14,19 +14,22 @@ use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::RwLock; use torii_core::cache::ModelCache; use torii_core::error::{Error, ParseError}; -use torii_core::model::{build_sql_query, map_row_to_ty}; +use torii_core::model::build_sql_query; use torii_core::simple_broker::SimpleBroker; +use torii_core::sql::FELT_DELIMITER; use torii_core::types::Entity; use tracing::{error, trace}; use crate::proto; use crate::proto::world::SubscribeEntityResponse; +use crate::server::map_row_to_entity; +use crate::types::{EntityKeysClause, PatternMatching}; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::entity"; pub struct EntitiesSubscriber { /// Entity ids that the subscriber is interested in - hashed_keys: HashSet, + keys: Option, /// The channel to send the response back to the subscriber. sender: Sender>, } @@ -39,7 +42,7 @@ pub struct EntityManager { impl EntityManager { pub async fn add_subscriber( &self, - hashed_keys: Vec, + keys: Option, ) -> Result>, Error> { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); @@ -49,10 +52,7 @@ impl EntityManager { // initial subscribe call let _ = sender.send(Ok(SubscribeEntityResponse { entity: None })).await; - self.subscribers.write().await.insert( - id, - EntitiesSubscriber { hashed_keys: hashed_keys.iter().cloned().collect(), sender }, - ); + self.subscribers.write().await.insert(id, EntitiesSubscriber { keys, sender }); Ok(receiver) } @@ -88,64 +88,124 @@ impl Service { subs: Arc, cache: Arc, pool: Pool, - hashed_keys: &str, + entity: &Entity, ) -> Result<(), Error> { let mut closed_stream = Vec::new(); + let hashed = FieldElement::from_str(&entity.id).map_err(ParseError::FromStr)?; + let keys = entity + .keys + .trim_end_matches(FELT_DELIMITER) + .split(FELT_DELIMITER) + .map(FieldElement::from_str) + .collect::, _>>() + .map_err(ParseError::FromStr)?; for (idx, sub) in subs.subscribers.read().await.iter() { - let hashed = FieldElement::from_str(hashed_keys).map_err(ParseError::FromStr)?; - // publish all updates if ids is empty or only ids that are subscribed to - if sub.hashed_keys.is_empty() || sub.hashed_keys.contains(&hashed) { - let models_query = r#" - SELECT group_concat(entity_model.model_id) as model_ids - FROM entities - JOIN entity_model ON entities.id = entity_model.entity_id - WHERE entities.id = ? - GROUP BY entities.id - "#; - let (model_ids,): (String,) = - sqlx::query_as(models_query).bind(hashed_keys).fetch_one(&pool).await?; - let model_ids: Vec<&str> = model_ids.split(',').collect(); - let schemas = cache.schemas(model_ids).await?; - - let (entity_query, arrays_queries) = build_sql_query( - &schemas, - "entities", - "entity_id", - Some("entities.id = ?"), - Some("entities.id = ?"), - )?; - - let row = sqlx::query(&entity_query).bind(hashed_keys).fetch_one(&pool).await?; - let mut arrays_rows = HashMap::new(); - for (name, query) in arrays_queries { - let row = sqlx::query(&query).bind(hashed_keys).fetch_all(&pool).await?; - arrays_rows.insert(name, row); + // Check if the subscriber is interested in this entity + // If we have a clause of hashed keys, then check that the id of the entity + // is in the list of hashed keys. + + // If we have a clause of keys, then check that the key pattern of the entity + // matches the key pattern of the subscriber. + match &sub.keys { + Some(EntityKeysClause::HashedKeys(hashed_keys)) => { + if !hashed_keys.contains(&hashed) { + continue; + } } + Some(EntityKeysClause::Keys(clause)) => { + // if we have a model clause, then we need to check that the entity + // has an updated model and that the model name matches the clause + if let Some(updated_model) = &entity.updated_model { + if !clause.models.is_empty() + && !clause.models.contains(&updated_model.name()) + { + continue; + } + } + + // if the key pattern doesnt match our subscribers key pattern, skip + // ["", "0x0"] would match with keys ["0x...", "0x0", ...] + if clause.pattern_matching == PatternMatching::FixedLen + && keys.len() != clause.keys.len() + { + continue; + } + + if !keys.iter().enumerate().all(|(idx, key)| { + // this is going to be None if our key pattern overflows the subscriber + // key pattern in this case we should skip + let sub_key = clause.keys.get(idx); + + match sub_key { + Some(sub_key) => { + if sub_key == &FieldElement::ZERO { + true + } else { + key == sub_key + } + } + // we overflowed the subscriber key pattern + // but we're in VariableLen pattern matching + // so we should match all next keys + None => true, + } + }) { + continue; + } + } + // if None, then we are interested in all entities + None => {} + } - let models = schemas - .into_iter() - .map(|mut s| { - map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; - - Ok(s.as_struct() - .expect("schema should be a struct") - .to_owned() - .try_into() - .unwrap()) - }) - .collect::, Error>>()?; - + if entity.updated_model.is_none() { let resp = proto::world::SubscribeEntityResponse { entity: Some(proto::types::Entity { hashed_keys: hashed.to_bytes_be().to_vec(), - models, + models: vec![], }), }; if sub.sender.send(Ok(resp)).await.is_err() { closed_stream.push(*idx); } + + continue; + } + + let models_query = r#" + SELECT group_concat(entity_model.model_id) as model_ids + FROM entities + JOIN entity_model ON entities.id = entity_model.entity_id + WHERE entities.id = ? + GROUP BY entities.id + "#; + let (model_ids,): (String,) = + sqlx::query_as(models_query).bind(&entity.id).fetch_one(&pool).await?; + let model_ids: Vec<&str> = model_ids.split(',').collect(); + let schemas = cache.schemas(model_ids).await?; + + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + "entities", + "entity_id", + Some("entities.id = ?"), + Some("entities.id = ?"), + )?; + + let row = sqlx::query(&entity_query).bind(&entity.id).fetch_one(&pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let row = sqlx::query(&query).bind(&entity.id).fetch_all(&pool).await?; + arrays_rows.insert(name, row); + } + + let resp = proto::world::SubscribeEntityResponse { + entity: Some(map_row_to_entity(&row, &arrays_rows, &schemas)?), + }; + + if sub.sender.send(Ok(resp)).await.is_err() { + closed_stream.push(*idx); } } @@ -169,7 +229,7 @@ impl Future for Service { let cache = Arc::clone(&pin.model_cache); let pool = pin.pool.clone(); tokio::spawn(async move { - if let Err(e) = Service::publish_updates(subs, cache, pool, &entity.id).await { + if let Err(e) = Service::publish_updates(subs, cache, pool, &entity).await { error!(target = LOG_TARGET, error = %e, "Publishing entity update."); } }); diff --git a/crates/torii/grpc/src/server/subscriptions/event.rs b/crates/torii/grpc/src/server/subscriptions/event.rs index 1b44ed7c23..6a0aa38924 100644 --- a/crates/torii/grpc/src/server/subscriptions/event.rs +++ b/crates/torii/grpc/src/server/subscriptions/event.rs @@ -19,12 +19,13 @@ use tracing::{error, trace}; use crate::proto; use crate::proto::world::SubscribeEventsResponse; +use crate::types::{KeysClause, PatternMatching}; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event"; pub struct EventSubscriber { /// Event keys that the subscriber is interested in - keys: Vec, + keys: KeysClause, /// The channel to send the response back to the subscriber. sender: Sender>, } @@ -37,7 +38,7 @@ pub struct EventManager { impl EventManager { pub async fn add_subscriber( &self, - keys: Vec, + keys: KeysClause, ) -> Result>, Error> { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); @@ -86,22 +87,52 @@ impl Service { .map_err(ParseError::from)?; for (idx, sub) in subs.subscribers.read().await.iter() { - // publish all updates if ids is empty or only ids that are subscribed to - if sub.keys.is_empty() || keys.starts_with(&sub.keys) { - let resp = proto::world::SubscribeEventsResponse { - event: Some(proto::types::Event { - keys: keys.iter().map(|k| k.to_bytes_be().to_vec()).collect(), - data: data.iter().map(|d| d.to_bytes_be().to_vec()).collect(), - transaction_hash: FieldElement::from_str(&event.transaction_hash) - .map_err(ParseError::from)? - .to_bytes_be() - .to_vec(), - }), - }; - - if sub.sender.send(Ok(resp)).await.is_err() { - closed_stream.push(*idx); + // if the key pattern doesnt match our subscribers key pattern, skip + // ["", "0x0"] would match with keys ["0x...", "0x0", ...] + if sub.keys.pattern_matching == PatternMatching::FixedLen + && keys.len() != sub.keys.keys.len() + { + continue; + } + + if !keys.iter().enumerate().all(|(idx, key)| { + // this is going to be None if our key pattern overflows the subscriber key pattern + // in this case we might want to list all events with the same + // key selector so we can match them all + let sub_key = sub.keys.keys.get(idx); + + // if we have a key in the subscriber, it must match the key in the event + // unless its empty, which is a wildcard + match sub_key { + Some(sub_key) => { + if sub_key == &FieldElement::ZERO { + true + } else { + key == sub_key + } + } + // we overflowed the subscriber key pattern + // but we're in VariableLen pattern matching + // so we should match all next keys + None => true, } + }) { + continue; + } + + let resp = proto::world::SubscribeEventsResponse { + event: Some(proto::types::Event { + keys: keys.iter().map(|k| k.to_bytes_be().to_vec()).collect(), + data: data.iter().map(|d| d.to_bytes_be().to_vec()).collect(), + transaction_hash: FieldElement::from_str(&event.transaction_hash) + .map_err(ParseError::from)? + .to_bytes_be() + .to_vec(), + }), + }; + + if sub.sender.send(Ok(resp)).await.is_err() { + closed_stream.push(*idx); } } diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 67cf1cf172..0b4b490ded 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -1,4 +1,4 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::HashMap; use std::future::Future; use std::pin::Pin; use std::str::FromStr; @@ -14,18 +14,21 @@ use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::RwLock; use torii_core::cache::ModelCache; use torii_core::error::{Error, ParseError}; -use torii_core::model::{build_sql_query, map_row_to_ty}; +use torii_core::model::build_sql_query; use torii_core::simple_broker::SimpleBroker; +use torii_core::sql::FELT_DELIMITER; use torii_core::types::EventMessage; use tracing::{error, trace}; use crate::proto; use crate::proto::world::SubscribeEntityResponse; +use crate::server::map_row_to_entity; +use crate::types::{EntityKeysClause, PatternMatching}; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::event_message"; pub struct EventMessagesSubscriber { - /// Entity ids that the subscriber is interested in - hashed_keys: HashSet, + /// Entity keys that the subscriber is interested in + keys: Option, /// The channel to send the response back to the subscriber. sender: Sender>, } @@ -38,7 +41,7 @@ pub struct EventMessageManager { impl EventMessageManager { pub async fn add_subscriber( &self, - hashed_keys: Vec, + keys: Option, ) -> Result>, Error> { let id = rand::thread_rng().gen::(); let (sender, receiver) = channel(1); @@ -48,10 +51,7 @@ impl EventMessageManager { // initial subscribe call let _ = sender.send(Ok(SubscribeEntityResponse { entity: None })).await; - self.subscribers.write().await.insert( - id, - EventMessagesSubscriber { hashed_keys: hashed_keys.iter().cloned().collect(), sender }, - ); + self.subscribers.write().await.insert(id, EventMessagesSubscriber { keys, sender }); Ok(receiver) } @@ -87,63 +87,110 @@ impl Service { subs: Arc, cache: Arc, pool: Pool, - hashed_keys: &str, + entity: &EventMessage, ) -> Result<(), Error> { let mut closed_stream = Vec::new(); + let hashed = FieldElement::from_str(&entity.id).map_err(ParseError::FromStr)?; + let keys = entity + .keys + .trim_end_matches(FELT_DELIMITER) + .split(FELT_DELIMITER) + .map(FieldElement::from_str) + .collect::, _>>() + .map_err(ParseError::FromStr)?; for (idx, sub) in subs.subscribers.read().await.iter() { - let hashed = FieldElement::from_str(hashed_keys).map_err(ParseError::FromStr)?; + // Check if the subscriber is interested in this entity + // If we have a clause of hashed keys, then check that the id of the entity + // is in the list of hashed keys. + + // If we have a clause of keys, then check that the key pattern of the entity + // matches the key pattern of the subscriber. + match &sub.keys { + Some(EntityKeysClause::HashedKeys(hashed_keys)) => { + if !hashed_keys.contains(&hashed) { + continue; + } + } + Some(EntityKeysClause::Keys(clause)) => { + // if we have a model clause, then we need to check that the entity + // has an updated model and that the model name matches the clause + if let Some(updated_model) = &entity.updated_model { + if !clause.models.is_empty() + && !clause.models.contains(&updated_model.name()) + { + continue; + } + } + + // if the key pattern doesnt match our subscribers key pattern, skip + // ["", "0x0"] would match with keys ["0x...", "0x0", ...] + if clause.pattern_matching == PatternMatching::FixedLen + && keys.len() != clause.keys.len() + { + continue; + } + + if !keys.iter().enumerate().all(|(idx, key)| { + // this is going to be None if our key pattern overflows the subscriber + // key pattern in this case we should skip + let sub_key = clause.keys.get(idx); + + match sub_key { + Some(sub_key) => { + if sub_key == &FieldElement::ZERO { + true + } else { + key == sub_key + } + } + // we overflowed the subscriber key pattern + // but we're in VariableLen pattern matching + // so we should match all next keys + None => true, + } + }) { + continue; + } + } + // if None, then we are interested in all entities + None => {} + } + // publish all updates if ids is empty or only ids that are subscribed to - if sub.hashed_keys.is_empty() || sub.hashed_keys.contains(&hashed) { - let models_query = r#" + let models_query = r#" SELECT group_concat(event_model.model_id) as model_ids FROM event_messages JOIN event_model ON event_messages.id = event_model.entity_id WHERE event_messages.id = ? GROUP BY event_messages.id "#; - let (model_ids,): (String,) = - sqlx::query_as(models_query).bind(hashed_keys).fetch_one(&pool).await?; - let model_ids: Vec<&str> = model_ids.split(',').collect(); - let schemas = cache.schemas(model_ids).await?; - - let (entity_query, arrays_queries) = build_sql_query( - &schemas, - "event_messages", - "event_message_id", - Some("event_messages.id = ?"), - Some("event_messages.id = ?"), - )?; - - let row = sqlx::query(&entity_query).bind(hashed_keys).fetch_one(&pool).await?; - let mut arrays_rows = HashMap::new(); - for (name, query) in arrays_queries { - let rows = sqlx::query(&query).bind(hashed_keys).fetch_all(&pool).await?; - arrays_rows.insert(name, rows); - } + let (model_ids,): (String,) = + sqlx::query_as(models_query).bind(&entity.id).fetch_one(&pool).await?; + let model_ids: Vec<&str> = model_ids.split(',').collect(); + let schemas = cache.schemas(model_ids).await?; + + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + "event_messages", + "event_message_id", + Some("event_messages.id = ?"), + Some("event_messages.id = ?"), + )?; + + let row = sqlx::query(&entity_query).bind(&entity.id).fetch_one(&pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(&entity.id).fetch_all(&pool).await?; + arrays_rows.insert(name, rows); + } - let models = schemas - .into_iter() - .map(|mut s| { - map_row_to_ty("", &s.name(), &mut s, &row, &arrays_rows)?; - Ok(s.as_struct() - .expect("schema should be a struct") - .to_owned() - .try_into() - .unwrap()) - }) - .collect::, Error>>()?; - - let resp = proto::world::SubscribeEntityResponse { - entity: Some(proto::types::Entity { - hashed_keys: hashed.to_bytes_be().to_vec(), - models, - }), - }; - - if sub.sender.send(Ok(resp)).await.is_err() { - closed_stream.push(*idx); - } + let resp = proto::world::SubscribeEntityResponse { + entity: Some(map_row_to_entity(&row, &arrays_rows, &schemas)?), + }; + + if sub.sender.send(Ok(resp)).await.is_err() { + closed_stream.push(*idx); } } @@ -167,7 +214,7 @@ impl Future for Service { let cache = Arc::clone(&pin.model_cache); let pool = pin.pool.clone(); tokio::spawn(async move { - if let Err(e) = Service::publish_updates(subs, cache, pool, &entity.id).await { + if let Err(e) = Service::publish_updates(subs, cache, pool, &entity).await { error!(target = LOG_TARGET, error = %e, "Publishing entity update."); } }); diff --git a/crates/torii/grpc/src/server/subscriptions/model_diff.rs b/crates/torii/grpc/src/server/subscriptions/model_diff.rs index 8e1f4e80cf..fbd90d01b8 100644 --- a/crates/torii/grpc/src/server/subscriptions/model_diff.rs +++ b/crates/torii/grpc/src/server/subscriptions/model_diff.rs @@ -21,7 +21,7 @@ use tracing::{debug, error, trace}; use super::error::SubscriptionError; use crate::proto; use crate::proto::world::SubscribeModelsResponse; -use crate::types::KeysClause; +use crate::types::ModelKeysClause; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::model_diff"; @@ -32,7 +32,7 @@ pub struct ModelMetadata { pub struct ModelDiffRequest { pub model: ModelMetadata, - pub keys: proto::types::KeysClause, + pub keys: proto::types::ModelKeysClause, } impl ModelDiffRequest {} @@ -62,7 +62,7 @@ impl StateDiffManager { let storage_addresses = reqs .into_iter() .map(|req| { - let keys: KeysClause = + let keys: ModelKeysClause = req.keys.try_into().map_err(ParseError::FromByteSliceError)?; let base = poseidon_hash_many(&[ diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 6d5cdbe9a1..9761d86335 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -26,14 +26,16 @@ use torii_core::processors::register_model::RegisterModelProcessor; use torii_core::processors::store_set_record::StoreSetRecordProcessor; use torii_core::sql::Sql; +use crate::proto::types::KeysClause; use crate::server::DojoWorld; use crate::types::schema::Entity; -use crate::types::KeysClause; #[tokio::test(flavor = "multi_thread")] async fn test_entities_queries() { - let options = - SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); + let options = SqliteConnectOptions::from_str("sqlite::memory:") + .unwrap() + .create_if_missing(true) + .with_regexp(); let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); @@ -116,9 +118,13 @@ async fn test_entities_queries() { "entities", "entity_model", "entity_id", - KeysClause { model: "Moves".to_string(), keys: vec![account.address()] }.into(), - 1, - 0, + KeysClause { + keys: vec![account.address().to_bytes_be().to_vec()], + pattern_matching: 0, + models: vec![], + }, + Some(1), + None, ) .await .unwrap() diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index 63c108e96b..cf00ede93f 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -30,11 +30,30 @@ pub enum Clause { } #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] -pub struct KeysClause { +pub enum EntityKeysClause { + HashedKeys(Vec), + Keys(KeysClause), +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] +pub struct ModelKeysClause { pub model: String, pub keys: Vec, } +#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] +pub struct KeysClause { + pub keys: Vec, + pub pattern_matching: PatternMatching, + pub models: Vec, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] +pub enum PatternMatching { + FixedLen, + VariableLen, +} + #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct MemberClause { pub model: String, @@ -153,6 +172,39 @@ impl From for proto::types::Query { } } +impl From for PatternMatching { + fn from(value: proto::types::PatternMatching) -> Self { + match value { + proto::types::PatternMatching::FixedLen => PatternMatching::FixedLen, + proto::types::PatternMatching::VariableLen => PatternMatching::VariableLen, + } + } +} + +impl From for proto::types::KeysClause { + fn from(value: KeysClause) -> Self { + Self { + keys: value.keys.iter().map(|k| k.to_bytes_be().into()).collect(), + pattern_matching: value.pattern_matching as i32, + models: value.models, + } + } +} + +impl TryFrom for KeysClause { + type Error = FromByteSliceError; + + fn try_from(value: proto::types::KeysClause) -> Result { + let keys = value + .keys + .iter() + .map(|k| FieldElement::from_byte_slice_be(k)) + .collect::, _>>()?; + + Ok(Self { keys, pattern_matching: value.pattern_matching().into(), models: value.models }) + } +} + impl From for proto::types::Clause { fn from(value: Clause) -> Self { match value { @@ -169,8 +221,46 @@ impl From for proto::types::Clause { } } -impl From for proto::types::KeysClause { - fn from(value: KeysClause) -> Self { +impl From for proto::types::EntityKeysClause { + fn from(value: EntityKeysClause) -> Self { + match value { + EntityKeysClause::HashedKeys(hashed_keys) => Self { + clause_type: Some(proto::types::entity_keys_clause::ClauseType::HashedKeys( + proto::types::HashedKeysClause { + hashed_keys: hashed_keys.iter().map(|k| k.to_bytes_be().into()).collect(), + }, + )), + }, + EntityKeysClause::Keys(keys) => Self { + clause_type: Some(proto::types::entity_keys_clause::ClauseType::Keys(keys.into())), + }, + } + } +} + +impl TryFrom for EntityKeysClause { + type Error = FromByteSliceError; + + fn try_from(value: proto::types::EntityKeysClause) -> Result { + match value.clause_type.expect("must have") { + proto::types::entity_keys_clause::ClauseType::HashedKeys(clause) => { + let keys = clause + .hashed_keys + .into_iter() + .map(|k| FieldElement::from_byte_slice_be(&k)) + .collect::, _>>()?; + + Ok(Self::HashedKeys(keys)) + } + proto::types::entity_keys_clause::ClauseType::Keys(clause) => { + Ok(Self::Keys(clause.try_into()?)) + } + } + } +} + +impl From for proto::types::ModelKeysClause { + fn from(value: ModelKeysClause) -> Self { Self { model: value.model, keys: value.keys.iter().map(|k| k.to_bytes_be().into()).collect(), @@ -178,10 +268,10 @@ impl From for proto::types::KeysClause { } } -impl TryFrom for KeysClause { +impl TryFrom for ModelKeysClause { type Error = FromByteSliceError; - fn try_from(value: proto::types::KeysClause) -> Result { + fn try_from(value: proto::types::ModelKeysClause) -> Result { let keys = value .keys .into_iter() @@ -314,19 +404,13 @@ impl TryFrom for Event { #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct EventQuery { - pub keys: Vec, + pub keys: KeysClause, pub limit: u32, pub offset: u32, } impl From for proto::types::EventQuery { fn from(value: EventQuery) -> Self { - Self { - keys: Some(proto::types::EventKeysClause { - keys: value.keys.iter().map(|k| k.to_bytes_be().into()).collect(), - }), - limit: value.limit, - offset: value.offset, - } + Self { keys: Some(value.keys.into()), limit: value.limit, offset: value.offset } } } diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index fbf70e2be2..eb11adee81 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -15,7 +15,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e [[package]] name = "types_test" -version = "0.7.0" +version = "0.7.2" dependencies = [ "dojo", ] diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json index 4be28b68dd..574aa89668 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json @@ -225,6 +225,22 @@ "inputs": [], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "set_player_server_profile", + "inputs": [ + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json new file mode 100644 index 0000000000..9b523d5d2b --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "server_profileImpl", + "interface_name": "dojo_examples::models::Iserver_profile" + }, + { + "type": "struct", + "name": "dojo_examples::models::ServerProfile", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iserver_profile", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::ServerProfile" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::server_profile::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json index 4be28b68dd..574aa89668 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json @@ -225,6 +225,22 @@ "inputs": [], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "set_player_server_profile", + "inputs": [ + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json new file mode 100644 index 0000000000..9b523d5d2b --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json @@ -0,0 +1,367 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "server_profileImpl", + "interface_name": "dojo_examples::models::Iserver_profile" + }, + { + "type": "struct", + "name": "dojo_examples::models::ServerProfile", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iserver_profile", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::ServerProfile" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::server_profile::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml index b1680ae07c..3e9c232447 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" -original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" +class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" +original_class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" base_class_hash = "0x0" abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml new file mode 100644 index 0000000000..e2774133c8 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml @@ -0,0 +1,20 @@ +kind = "DojoModel" +class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" +original_class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" +abi = "manifests/dev/abis/base/models/dojo_examples_models_server_profile.json" +name = "dojo_examples::models::server_profile" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "server_id" +type = "u32" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index a1a575d4aa..928d7596e1 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1020,8 +1020,8 @@ { "kind": "DojoContract", "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", - "class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3", - "original_class_hash": "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3", + "class_hash": "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f", + "original_class_hash": "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { @@ -1250,6 +1250,22 @@ "inputs": [], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "set_player_server_profile", + "inputs": [ + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, @@ -4060,6 +4076,396 @@ ], "name": "dojo_examples::models::position" }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, + { + "name": "server_id", + "type": "u32", + "key": true + }, + { + "name": "name", + "type": "ByteArray", + "key": false + } + ], + "class_hash": "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab", + "original_class_hash": "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::database::introspect::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::database::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::database::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::database::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::database::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::database::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::IModel", + "items": [ + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::database::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "server_profileImpl", + "interface_name": "dojo_examples::models::Iserver_profile" + }, + { + "type": "struct", + "name": "dojo_examples::models::ServerProfile", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ] + }, + { + "type": "interface", + "name": "dojo_examples::models::Iserver_profile", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "dojo_examples::models::ServerProfile" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::models::server_profile::Event", + "kind": "enum", + "variants": [] + } + ], + "name": "dojo_examples::models::server_profile" + }, { "kind": "DojoModel", "members": [ diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index c292ce25af..fd58cefd55 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -22,8 +22,8 @@ name = "dojo::base::base" [[contracts]] kind = "DojoContract" address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" -class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" -original_class_hash = "0x3b42f80dc8ac4628b0ed6c89af9055314c0aa2192ea0d9601f262138a1e50c3" +class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" +original_class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" reads = [] @@ -192,6 +192,28 @@ name = "vec" type = "Vec2" key = false +[[models]] +kind = "DojoModel" +class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" +original_class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" +abi = "manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json" +name = "dojo_examples::models::server_profile" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "server_id" +type = "u32" +key = true + +[[models.members]] +name = "name" +type = "ByteArray" +key = false + [[models]] kind = "DojoModel" class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 6737cdea48..241fe54ea3 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -7,6 +7,7 @@ trait IActions { fn set_player_config(ref world: IWorldDispatcher, name: ByteArray); fn get_player_position(world: @IWorldDispatcher) -> Position; fn reset_player_config(ref world: IWorldDispatcher); + fn set_player_server_profile(ref world: IWorldDispatcher, server_id: u32, name: ByteArray); } #[dojo::interface] @@ -21,7 +22,9 @@ mod actions { use super::IActionsComputed; use starknet::{ContractAddress, get_caller_address}; - use dojo_examples::models::{Position, Moves, Direction, Vec2, PlayerConfig, PlayerItem}; + use dojo_examples::models::{ + Position, Moves, Direction, Vec2, PlayerConfig, PlayerItem, ServerProfile + }; use dojo_examples::utils::next_position; #[derive(Copy, Drop, Serde)] @@ -111,6 +114,11 @@ mod actions { assert(config.name == empty_string, 'bad name'); } + fn set_player_server_profile(ref world: IWorldDispatcher, server_id: u32, name: ByteArray) { + let player = get_caller_address(); + set!(world, ServerProfile { player, server_id, name }); + } + fn get_player_position(world: @IWorldDispatcher) -> Position { let player = get_caller_address(); get!(world, player, (Position)) diff --git a/examples/spawn-and-move/src/models.cairo b/examples/spawn-and-move/src/models.cairo index 443c3a2e53..50da9c93f9 100644 --- a/examples/spawn-and-move/src/models.cairo +++ b/examples/spawn-and-move/src/models.cairo @@ -86,6 +86,16 @@ struct PlayerConfig { favorite_item: Option, } +#[derive(Drop, Serde)] +#[dojo::model] +struct ServerProfile { + #[key] + player: ContractAddress, + #[key] + server_id: u32, + name: ByteArray, +} + trait Vec2Trait { fn is_zero(self: Vec2) -> bool; fn is_equal(self: Vec2, b: Vec2) -> bool; From 10b4a551857c99857c9c0abd14cafe9533904949 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Thu, 27 Jun 2024 21:30:29 +0530 Subject: [PATCH 62/88] dev: clean up dependencies (#2102) * clean up dependencies * use root .tool-versions for examples --- .tool-versions | 2 +- Cargo.lock | 2009 ++++++++--------- Cargo.toml | 1 - bin/saya/Cargo.toml | 2 - bin/scheduler/Cargo.toml | 11 +- bin/sozo/Cargo.toml | 1 - crates/benches/Cargo.toml | 10 +- crates/katana/core/Cargo.toml | 2 - crates/katana/primitives/Cargo.toml | 1 - crates/katana/runner/Cargo.toml | 1 - .../katana/storage/codecs/derive/Cargo.toml | 3 + .../katana/storage/codecs/derive/src/lib.rs | 2 +- crates/sozo/ops/Cargo.toml | 10 +- crates/torii/core/Cargo.toml | 5 +- crates/torii/graphql/Cargo.toml | 5 +- crates/torii/server/Cargo.toml | 29 - examples/spawn-and-move/.tool-versions | 1 - 17 files changed, 1027 insertions(+), 1068 deletions(-) delete mode 100644 examples/spawn-and-move/.tool-versions diff --git a/.tool-versions b/.tool-versions index f239fe235a..e1290964bb 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -scarb 2.6.3 +scarb 2.6.4 diff --git a/Cargo.lock b/Cargo.lock index d4088c6de8..d58125d68e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,7 +38,7 @@ dependencies = [ "starknet-crypto 0.6.2", "thiserror", "tokio", - "toml 0.8.13", + "toml 0.8.14", "u256-literal", "url", "wasm-bindgen", @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -143,31 +143,30 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-contract 0.1.2", + "alloy-consensus 0.1.3", + "alloy-contract 0.1.3", "alloy-core", - "alloy-eips 0.1.2", - "alloy-genesis 0.1.2", - "alloy-network 0.1.2", + "alloy-eips 0.1.3", + "alloy-genesis 0.1.3", + "alloy-network 0.1.3", "alloy-node-bindings", - "alloy-provider 0.1.2", - "alloy-rpc-client 0.1.2", - "alloy-serde 0.1.2", - "alloy-signer 0.1.2", + "alloy-provider 0.1.3", + "alloy-rpc-client 0.1.3", + "alloy-serde 0.1.3", + "alloy-signer 0.1.3", "alloy-signer-local", - "alloy-transport 0.1.2", - "alloy-transport-http 0.1.2", - "reqwest 0.12.4", + "alloy-transport 0.1.3", + "alloy-transport-http 0.1.3", ] [[package]] name = "alloy-chains" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9a1892803b02f53e25bea3e414ddd0501f12d97456c9d5ade4edf88f9516f" +checksum = "1752d7d62e2665da650a36d84abbf239f812534475d51f072a49a533513b7cdd" dependencies = [ "num_enum", "strum 0.26.3", @@ -188,13 +187,13 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-eips 0.1.2", + "alloy-eips 0.1.3", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.2", + "alloy-serde 0.1.3", "c-kzg", "serde", ] @@ -219,17 +218,17 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-network 0.1.2", + "alloy-network 0.1.3", "alloy-primitives", - "alloy-provider 0.1.2", + "alloy-provider 0.1.3", "alloy-rpc-types-eth", "alloy-sol-types", - "alloy-transport 0.1.2", + "alloy-transport 0.1.3", "futures", "futures-util", "thiserror", @@ -261,7 +260,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -280,12 +279,12 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.2", + "alloy-serde 0.1.3", "c-kzg", "once_cell", "serde", @@ -305,11 +304,11 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-primitives", - "alloy-serde 0.1.2", + "alloy-serde 0.1.3", "serde", ] @@ -339,8 +338,8 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-primitives", "serde", @@ -368,16 +367,16 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", - "alloy-json-rpc 0.1.2", + "alloy-consensus 0.1.3", + "alloy-eips 0.1.3", + "alloy-json-rpc 0.1.3", "alloy-primitives", "alloy-rpc-types-eth", - "alloy-serde 0.1.2", - "alloy-signer 0.1.2", + "alloy-serde 0.1.3", + "alloy-signer 0.1.3", "alloy-sol-types", "async-trait", "auto_impl", @@ -387,10 +386,10 @@ dependencies = [ [[package]] name = "alloy-node-bindings" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-genesis 0.1.2", + "alloy-genesis 0.1.3", "alloy-primitives", "k256", "serde_json", @@ -444,7 +443,7 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde_json", "tokio", "tracing", @@ -453,22 +452,22 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-chains", - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", - "alloy-json-rpc 0.1.2", - "alloy-network 0.1.2", + "alloy-consensus 0.1.3", + "alloy-eips 0.1.3", + "alloy-json-rpc 0.1.3", + "alloy-network 0.1.3", "alloy-node-bindings", "alloy-primitives", - "alloy-rpc-client 0.1.2", + "alloy-rpc-client 0.1.3", "alloy-rpc-types-anvil", "alloy-rpc-types-eth", "alloy-signer-local", - "alloy-transport 0.1.2", - "alloy-transport-http 0.1.2", + "alloy-transport 0.1.3", + "alloy-transport-http 0.1.3", "async-stream", "async-trait", "auto_impl", @@ -477,7 +476,7 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -487,9 +486,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" +checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -498,13 +497,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" +checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -517,7 +516,7 @@ dependencies = [ "alloy-transport-http 0.1.0", "futures", "pin-project", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -529,15 +528,15 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-json-rpc 0.1.2", - "alloy-transport 0.1.2", - "alloy-transport-http 0.1.2", + "alloy-json-rpc 0.1.3", + "alloy-transport 0.1.3", + "alloy-transport-http 0.1.3", "futures", "pin-project", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "tokio", @@ -567,24 +566,24 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-primitives", - "alloy-serde 0.1.2", + "alloy-serde 0.1.3", "serde", ] [[package]] name = "alloy-rpc-types-eth" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-consensus 0.1.2", - "alloy-eips 0.1.2", + "alloy-consensus 0.1.3", + "alloy-eips 0.1.3", "alloy-primitives", "alloy-rlp", - "alloy-serde 0.1.2", + "alloy-serde 0.1.3", "alloy-sol-types", "itertools 0.13.0", "serde", @@ -616,8 +615,8 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-primitives", "serde", @@ -639,8 +638,8 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ "alloy-primitives", "async-trait", @@ -652,28 +651,13 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" -dependencies = [ - "alloy-consensus 0.1.2", - "alloy-network 0.1.2", - "alloy-primitives", - "alloy-signer 0.1.2", - "async-trait", - "k256", - "rand", - "thiserror", -] - -[[package]] -name = "alloy-signer-wallet" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60c3912902ee64#4655f8e4372ecc0b056e83abbc60c3912902ee64" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-consensus 0.1.0", - "alloy-network 0.1.0", + "alloy-consensus 0.1.3", + "alloy-network 0.1.3", "alloy-primitives", - "alloy-signer 0.1.0", + "alloy-signer 0.1.3", "async-trait", "k256", "rand", @@ -691,7 +675,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -708,7 +692,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", "syn-solidity", "tiny-keccak", ] @@ -726,7 +710,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.64", + "syn 2.0.68", "syn-solidity", ] @@ -736,7 +720,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baa2fbd22d353d8685bd9fee11ba2d8b5c3b1d11e56adb3265fcf1f32bfdf404" dependencies = [ - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -772,10 +756,10 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-json-rpc 0.1.2", + "alloy-json-rpc 0.1.3", "base64 0.22.1", "futures-util", "futures-utils-wasm", @@ -794,7 +778,7 @@ source = "git+https://github.com/alloy-rs/alloy?rev=4655f8e4372ecc0b056e83abbc60 dependencies = [ "alloy-json-rpc 0.1.0", "alloy-transport 0.1.0", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -803,12 +787,12 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.1.2" -source = "git+https://github.com/alloy-rs/alloy#2d26b057c64cbcc77654f4691141c308d63b286f" +version = "0.1.3" +source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" dependencies = [ - "alloy-json-rpc 0.1.2", - "alloy-transport 0.1.2", - "reqwest 0.12.4", + "alloy-json-rpc 0.1.3", + "alloy-transport 0.1.3", + "reqwest 0.12.5", "serde_json", "tower", "tracing", @@ -868,9 +852,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -887,9 +871,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" @@ -1170,7 +1154,7 @@ checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", "synstructure 0.13.1", ] @@ -1193,7 +1177,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1235,16 +1219,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-compression" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" +checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" dependencies = [ "brotli", "flate2", @@ -1258,9 +1242,9 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" dependencies = [ "async-task", "concurrent-queue", @@ -1277,8 +1261,8 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", "once_cell", @@ -1331,7 +1315,7 @@ dependencies = [ "proc-macro2", "quote", "strum 0.25.0", - "syn 2.0.64", + "syn 2.0.68", "thiserror", ] @@ -1393,17 +1377,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "tracing", @@ -1421,12 +1405,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.1", + "event-listener-strategy", "pin-project-lite", ] @@ -1438,7 +1422,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1486,7 +1470,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1503,7 +1487,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1553,7 +1537,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1575,7 +1559,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "itoa", "matchit", "memchr", @@ -1587,7 +1571,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "tokio", "tower", "tower-layer", @@ -1613,9 +1597,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -1692,7 +1676,7 @@ dependencies = [ "katana-runner", "lazy_static", "proptest", - "reqwest 0.12.4", + "reqwest 0.12.5", "scarb", "serde", "serde_json", @@ -1716,9 +1700,9 @@ dependencies = [ [[package]] name = "bigdecimal" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9324c8014cd04590682b34f1e9448d38f0674d0f7b2dc553331016ef0e4e9ebc" +checksum = "51d712318a27c7150326677b321a5fa91b55f6d9034ffd67f20319e147d40cee" dependencies = [ "autocfg", "libm", @@ -1751,7 +1735,7 @@ version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cexpr", "clang-sys", "lazy_static", @@ -1762,7 +1746,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1771,7 +1755,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cexpr", "clang-sys", "itertools 0.12.1", @@ -1782,7 +1766,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -1808,9 +1792,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -1903,12 +1887,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel 2.3.1", - "async-lock 3.3.0", "async-task", "futures-io", "futures-lite 2.3.0", @@ -1929,9 +1912,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" +checksum = "62dc83a094a71d43eeadd254b1ec2d24cb6a0bb6cadce00df51f0db594711a32" dependencies = [ "cc", "glob", @@ -1952,9 +1935,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1987,7 +1970,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.7", "serde", ] @@ -2005,9 +1988,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -2177,7 +2160,7 @@ dependencies = [ "quote", "serde_json", "starknet", - "syn 2.0.64", + "syn 2.0.68", "thiserror", ] @@ -2190,7 +2173,7 @@ dependencies = [ "quote", "serde_json", "starknet", - "syn 2.0.64", + "syn 2.0.68", "thiserror", ] @@ -2208,7 +2191,7 @@ dependencies = [ "quote", "serde_json", "starknet", - "syn 2.0.64", + "syn 2.0.68", "thiserror", ] @@ -2226,7 +2209,7 @@ dependencies = [ "quote", "serde_json", "starknet", - "syn 2.0.64", + "syn 2.0.68", "thiserror", ] @@ -2243,7 +2226,7 @@ dependencies = [ "quote", "serde_json", "starknet", - "syn 2.0.64", + "syn 2.0.68", "thiserror", ] @@ -2265,7 +2248,7 @@ version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10d9c31baeb6b52586b5adc88f01e90f86389d63d94363c562de5c79352e545b" dependencies = [ - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2299,29 +2282,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cairo-lang-compiler" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7148cb2d72a3db24a6d2ef2b2602102cc5099cb9f6b913e5047fb009cb3a22a1" -dependencies = [ - "anyhow", - "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-project 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-generator 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "salsa", - "smol_str", - "thiserror", -] - [[package]] name = "cairo-lang-compiler" version = "2.6.3" @@ -2368,12 +2328,26 @@ dependencies = [ ] [[package]] -name = "cairo-lang-debug" -version = "2.6.3" +name = "cairo-lang-compiler" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a761eb8e31ea65a2dd45f729c74f1770315f97124dad93d1f6853a10d460c6b" +checksum = "a7be5083c3328dad2248a94f0a24b3520c588e7d3bd5891770e4c91d3facade3" dependencies = [ - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-lowering 2.6.4", + "cairo-lang-parser 2.6.4", + "cairo-lang-project 2.6.4", + "cairo-lang-semantic 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-generator 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", + "salsa", + "smol_str", + "thiserror", ] [[package]] @@ -2393,20 +2367,12 @@ dependencies = [ ] [[package]] -name = "cairo-lang-defs" -version = "2.6.3" +name = "cairo-lang-debug" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d60bc5d72fe7a95ba34e041dcbdf1cf3bfccb87008a515514b74913fa8ff05" +checksum = "2a3cbf67fd766cb7ed48b72e6abf7041857518c9b9fd42475a60c138671c6603" dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.11.0", - "salsa", - "smol_str", + "cairo-lang-utils 2.6.4", ] [[package]] @@ -2442,15 +2408,20 @@ dependencies = [ ] [[package]] -name = "cairo-lang-diagnostics" -version = "2.6.3" +name = "cairo-lang-defs" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356089e1b0a0ba9e115566191745613b3806a20259ad76764df82ab534d5412a" +checksum = "7b284e41dfc158dfbdc02612dbfdb27a55547d23063bdc53105eeec41d8df006" dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-debug 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-parser 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", "itertools 0.11.0", + "salsa", + "smol_str", ] [[package]] @@ -2476,13 +2447,15 @@ dependencies = [ ] [[package]] -name = "cairo-lang-eq-solver" -version = "2.6.3" +name = "cairo-lang-diagnostics" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc43246cc2e5afd5a028bcdd63876ac3f8b1f4fb3ff785daaa0f0fbb51c9d906" +checksum = "c6314b24901af8be75cd0e1363e3ff1a8020066372501f4cfc9161726b06ec2a" dependencies = [ - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "good_lp", + "cairo-lang-debug 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-utils 2.6.4", + "itertools 0.11.0", ] [[package]] @@ -2504,17 +2477,13 @@ dependencies = [ ] [[package]] -name = "cairo-lang-filesystem" -version = "2.6.3" +name = "cairo-lang-eq-solver" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bcb9a4a40e53fa099774bd08bbcc3430f51213cc7fb1b50c2e9d01155731798" +checksum = "4f95f5c8f7ea75580d164b5304251022e3d47f43fc1c778a01381b55ca9f268c" dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "path-clean", - "salsa", - "serde", - "smol_str", + "cairo-lang-utils 2.6.4", + "good_lp", ] [[package]] @@ -2543,6 +2512,20 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-filesystem" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e58b80f0b413ef1320358fde1a0877fc3fbf740f5cead0de3e947a1bc3bfd4" +dependencies = [ + "cairo-lang-debug 2.6.4", + "cairo-lang-utils 2.6.4", + "path-clean", + "salsa", + "serde", + "smol_str", +] + [[package]] name = "cairo-lang-formatter" version = "2.6.3" @@ -2593,31 +2576,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "cairo-lang-lowering" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba60e1e2477aa0f610ccf29189097d580464607c94b51741e1c18e64d6cee5f" -dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-proc-macros 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "id-arena", - "itertools 0.11.0", - "log", - "num-bigint", - "num-traits 0.2.19", - "once_cell", - "salsa", - "smol_str", -] - [[package]] name = "cairo-lang-lowering" version = "2.6.3" @@ -2666,6 +2624,31 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-lowering" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe6d604a06ea96c05b3666f2e8fac63cb8709e13667de272912f81db004a16b" +dependencies = [ + "cairo-lang-debug 2.6.4", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-parser 2.6.4", + "cairo-lang-proc-macros 2.6.4", + "cairo-lang-semantic 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", + "id-arena", + "itertools 0.11.0", + "log", + "num-bigint", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-macro" version = "0.0.1" @@ -2683,7 +2666,7 @@ source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d8 dependencies = [ "quote", "scarb-stable-hash", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -2691,26 +2674,6 @@ name = "cairo-lang-macro-stable" version = "1.0.0" source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" -[[package]] -name = "cairo-lang-parser" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f16ba1535e0cc5e79c2eff6592859bbdac03dc53d4dcdd26dbdbc04a77c3f5c" -dependencies = [ - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax-codegen 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "colored", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.19", - "salsa", - "smol_str", - "unescaper", -] - [[package]] name = "cairo-lang-parser" version = "2.6.3" @@ -2750,22 +2713,23 @@ dependencies = [ ] [[package]] -name = "cairo-lang-plugins" -version = "2.6.3" +name = "cairo-lang-parser" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81c8cf6e0ee3d6b19429cc1663738b22f1ecea7d51bf7452e8e1086f08798baf" +checksum = "eaf1c279de47a77422f81b8a98023cd523cf0ae79f7153d60c4cf8b62b8ece2f" dependencies = [ - "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "indent", - "indoc 2.0.5", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-syntax-codegen 2.6.4", + "cairo-lang-utils 2.6.4", + "colored", "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", "salsa", "smol_str", + "unescaper", ] [[package]] @@ -2805,14 +2769,22 @@ dependencies = [ ] [[package]] -name = "cairo-lang-proc-macros" -version = "2.6.3" +name = "cairo-lang-plugins" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f9da66325ce7ed6c002360f26106fe79deb9f8a2fca30abdbb8d388da7bb46" +checksum = "a1177a07498bdf45cba62f0c727388ff7433072847dbf701c58fa3c3e358154e" dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote", - "syn 2.0.64", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-parser 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", + "indent", + "indoc 2.0.5", + "itertools 0.11.0", + "salsa", + "smol_str", ] [[package]] @@ -2822,7 +2794,7 @@ source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd dependencies = [ "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -2832,21 +2804,18 @@ source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271 dependencies = [ "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] -name = "cairo-lang-project" -version = "2.6.3" +name = "cairo-lang-proc-macros" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e198af1ab3d05c7fb8b6a9a7a2e9bce245a6c855df5f770b751d29874a23b152" +checksum = "0c90d812ec983c5a8e3173aca3fc55036b9739201c89f30271ee14a4c1189379" dependencies = [ - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde", - "smol_str", - "thiserror", - "toml 0.8.13", + "cairo-lang-debug 2.6.4", + "quote", + "syn 2.0.68", ] [[package]] @@ -2859,7 +2828,7 @@ dependencies = [ "serde", "smol_str", "thiserror", - "toml 0.8.13", + "toml 0.8.14", ] [[package]] @@ -2872,7 +2841,21 @@ dependencies = [ "serde", "smol_str", "thiserror", - "toml 0.8.13", + "toml 0.8.14", +] + +[[package]] +name = "cairo-lang-project" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3985495d7e9dc481e97135d7139cfa098024351fb51d5feef8366b5fbc104807" +dependencies = [ + "cairo-lang-filesystem 2.6.4", + "cairo-lang-utils 2.6.4", + "serde", + "smol_str", + "thiserror", + "toml 0.8.14", ] [[package]] @@ -2932,35 +2915,10 @@ dependencies = [ "sha2 0.10.8", "smol_str", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", "thiserror", ] -[[package]] -name = "cairo-lang-semantic" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7df81521c2125e3e95b683cc99374db1aebd7ddb317c5ca3dd92a235a9eb13" -dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-plugins 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-proc-macros 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "id-arena", - "indoc 2.0.5", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.19", - "once_cell", - "salsa", - "smol_str", -] - [[package]] name = "cairo-lang-semantic" version = "2.6.3" @@ -3008,33 +2966,32 @@ dependencies = [ "once_cell", "salsa", "smol_str", - "toml 0.8.13", + "toml 0.8.14", ] [[package]] -name = "cairo-lang-sierra" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07da3ca1434c62a7cc7cd77d2941ef47a1c23b37325781b59407b78d8c61d863" -dependencies = [ - "anyhow", - "cairo-felt", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "const-fnv1a-hash", - "convert_case 0.6.0", - "derivative", +name = "cairo-lang-semantic" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5cfadbb9ca3479a6b5c02c0a125a5747835ba57a2de9c4e9764f42d85abe059" +dependencies = [ + "cairo-lang-debug 2.6.4", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-parser 2.6.4", + "cairo-lang-plugins 2.6.4", + "cairo-lang-proc-macros 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", + "id-arena", + "indoc 2.0.5", "itertools 0.11.0", - "lalrpop", - "lalrpop-util", "num-bigint", "num-traits 0.2.19", - "regex", + "once_cell", "salsa", - "serde", - "serde_json", - "sha3", "smol_str", - "thiserror", ] [[package]] @@ -3083,22 +3040,33 @@ dependencies = [ "serde_json", "sha3", "smol_str", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", "thiserror", ] [[package]] -name = "cairo-lang-sierra-ap-change" -version = "2.6.3" +name = "cairo-lang-sierra" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122c9055eb609a511178e3dce577de061819fd4c4c6b7452804557f76ca43bbf" +checksum = "74a57492267a5a8891866b6e48cdefa508b5f05931a5f8eaf004b9de15b1ffd6" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow", + "cairo-felt", + "cairo-lang-utils 2.6.4", + "const-fnv1a-hash", + "convert_case 0.6.0", + "derivative", "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "num-bigint", "num-traits 0.2.19", + "regex", + "salsa", + "serde", + "serde_json", + "sha3", + "smol_str", "thiserror", ] @@ -3132,15 +3100,15 @@ dependencies = [ ] [[package]] -name = "cairo-lang-sierra-gas" -version = "2.6.3" +name = "cairo-lang-sierra-ap-change" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf049d9aea65c6e38da219a3700c72f78795d11449d9adcec28047ef8d63bd23" +checksum = "6fdbb4bd95477123653b9200bd4e9dceae95a914f6fe85b2bed83b223e36fb5a" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-eq-solver 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-type-size 2.6.4", + "cairo-lang-utils 2.6.4", "itertools 0.11.0", "num-traits 0.2.19", "thiserror", @@ -3176,26 +3144,18 @@ dependencies = [ ] [[package]] -name = "cairo-lang-sierra-generator" -version = "2.6.3" +name = "cairo-lang-sierra-gas" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e1d75e0830279ca1bd0189e3326720d6e081225f7d81ed060bbd22c6b37e980" -dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-parser 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", +checksum = "882cb178f1b79aabf70acce1d87b08d569d8a4b0ce8b1d8f538a02cdb36789db" +dependencies = [ + "cairo-lang-eq-solver 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-type-size 2.6.4", + "cairo-lang-utils 2.6.4", "itertools 0.11.0", "num-traits 0.2.19", - "once_cell", - "salsa", - "smol_str", + "thiserror", ] [[package]] @@ -3244,6 +3204,29 @@ dependencies = [ "smol_str", ] +[[package]] +name = "cairo-lang-sierra-generator" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d80c9d29e6d3f4ab60e698ebe2de84dcf90570c3dd1cfa7b01bd5c42470331c" +dependencies = [ + "cairo-lang-debug 2.6.4", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-lowering 2.6.4", + "cairo-lang-parser 2.6.4", + "cairo-lang-semantic 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", + "itertools 0.11.0", + "num-traits 0.2.19", + "once_cell", + "salsa", + "smol_str", +] + [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" @@ -3253,11 +3236,11 @@ dependencies = [ "assert_matches", "cairo-felt", "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-ap-change 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-gas 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-type-size 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-ap-change 2.6.4", + "cairo-lang-sierra-gas 2.6.4", + "cairo-lang-sierra-type-size 2.6.4", + "cairo-lang-utils 2.6.4", "indoc 2.0.5", "itertools 0.11.0", "num-bigint", @@ -3301,20 +3284,10 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", "thiserror", ] -[[package]] -name = "cairo-lang-sierra-type-size" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38da6f98c6b16945c89d2ae351c82d636ed38d3e6eb02f7c8679e3e03a63988" -dependencies = [ - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cairo-lang-sierra-type-size" version = "2.6.3" @@ -3333,6 +3306,16 @@ dependencies = [ "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", ] +[[package]] +name = "cairo-lang-sierra-type-size" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d102b10989f9637b1c916dd950cbd1bd8bb1b6a7aaa1a3035390be0683b92d85" +dependencies = [ + "cairo-lang-sierra 2.6.4", + "cairo-lang-utils 2.6.4", +] + [[package]] name = "cairo-lang-starknet" version = "2.6.3" @@ -3341,18 +3324,18 @@ checksum = "2c9ffa8b3b8c47138c36b1907cebb5047dfc4de29ec10ece5bd6d6853243ec50" dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-compiler 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-defs 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-diagnostics 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-lowering 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-plugins 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-semantic 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra-generator 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-compiler 2.6.4", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-lowering 2.6.4", + "cairo-lang-plugins 2.6.4", + "cairo-lang-semantic 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-generator 2.6.4", "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4", + "cairo-lang-utils 2.6.4", "const_format", "indent", "indoc 2.0.5", @@ -3420,7 +3403,7 @@ dependencies = [ "serde", "serde_json", "smol_str", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", "thiserror", ] @@ -3432,9 +3415,9 @@ checksum = "47c64ae2bb00173e3a88760128bf72de356fa80eb19fa47602479063648b4003" dependencies = [ "cairo-felt", "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4", "cairo-lang-sierra-to-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4", "convert_case 0.6.0", "itertools 0.11.0", "num-bigint", @@ -3493,19 +3476,18 @@ dependencies = [ "sha3", "smol_str", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", "thiserror", ] [[package]] name = "cairo-lang-syntax" version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8262c426a57e1e5ec297db24278464841500613445e2cb1c43d5f71ad91ee8d6" +source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-filesystem 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-utils 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "num-bigint", "num-traits 0.2.19", "salsa", @@ -3516,11 +3498,11 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "num-bigint", "num-traits 0.2.19", "salsa", @@ -3530,12 +3512,13 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c62f5bd74e249636e7c48d8b95e6cc0ee991206d4a6cbe5c2624184a828e70b" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-utils 2.6.4", "num-bigint", "num-traits 0.2.19", "salsa", @@ -3546,8 +3529,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e2d692eae4bb4179a4a1148fd5eb738a91653d86750c813658ffad4a99fa97" +source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ "genco", "xshell", @@ -3556,7 +3538,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ "genco", "xshell", @@ -3564,8 +3546,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a744747e9ab03b65480265304490f3e29d99e4cb297e39d0e6fdb047c1bc86a7" dependencies = [ "genco", "xshell", @@ -3595,7 +3578,7 @@ dependencies = [ "num-bigint", "num-traits 0.2.19", "serde", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", ] [[package]] @@ -3617,7 +3600,7 @@ dependencies = [ "itertools 0.12.1", "num-traits 0.2.19", "rayon", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", ] [[package]] @@ -3635,14 +3618,14 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf733a7cdc4166d0baf0ed8a98d9ada827daee6653b37d9326e334e53481c6d3" +source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ "hashbrown 0.14.5", "indexmap 2.2.6", "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", + "parity-scale-codec", "schemars", "serde", ] @@ -3650,33 +3633,33 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ + "env_logger 0.11.3", "hashbrown 0.14.5", "indexmap 2.2.6", - "itertools 0.11.0", + "itertools 0.12.1", + "log", "num-bigint", "num-traits 0.2.19", - "parity-scale-codec", "schemars", "serde", + "time", ] [[package]] name = "cairo-lang-utils" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f98e8769412907ceb106c21c70907cc0c87ca0a2a44c82b6229a695a6f9b48" dependencies = [ - "env_logger 0.11.3", "hashbrown 0.14.5", "indexmap 2.2.6", - "itertools 0.12.1", - "log", + "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", "schemars", "serde", - "time", ] [[package]] @@ -3752,7 +3735,7 @@ dependencies = [ "sha2 0.10.8", "sha3", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.2", + "starknet-types-core 0.1.4", "thiserror-no-std", "zip", ] @@ -3806,9 +3789,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" dependencies = [ "jobserver", "libc", @@ -3835,9 +3818,9 @@ checksum = "7f22a6baf972f7277acfd5c4ff9b894df7db5b0aaecdb57b9b77b5679fff323e" dependencies = [ "anyhow", "celestia-tendermint-proto", - "prost 0.12.4", - "prost-build 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-build 0.12.6", + "prost-types 0.12.6", "serde", ] @@ -3871,8 +3854,8 @@ dependencies = [ "futures", "num-traits 0.2.19", "once_cell", - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "serde", "serde_bytes", "serde_json", @@ -3895,8 +3878,8 @@ dependencies = [ "flex-error", "num-derive", "num-traits 0.2.19", - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "serde", "serde_bytes", "subtle-encoding", @@ -4049,9 +4032,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -4060,9 +4043,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -4080,9 +4063,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -4092,30 +4075,30 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.2" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" +checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clru" @@ -4197,7 +4180,7 @@ name = "common" version = "0.7.3-alpha.1" dependencies = [ "anyhow", - "reqwest 0.12.4", + "reqwest 0.12.5", "thiserror", ] @@ -4257,9 +4240,9 @@ checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" [[package]] name = "const-hex" -version = "1.11.4" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ff96486ccc291d36a958107caf2c0af8c78c0af7d31ae2f35ce055130de1a6" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", @@ -4326,13 +4309,24 @@ dependencies = [ "version_check", ] +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + [[package]] name = "cookie_store" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" dependencies = [ - "cookie", + "cookie 0.17.0", "idna 0.3.0", "log", "publicsuffix", @@ -4343,6 +4337,23 @@ dependencies = [ "url", ] +[[package]] +name = "cookie_store" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" +dependencies = [ + "cookie 0.18.1", + "idna 0.5.0", + "log", + "publicsuffix", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -4413,9 +4424,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -4482,9 +4493,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -4519,9 +4530,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -4595,16 +4606,15 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version 0.4.0", "subtle", "zeroize", @@ -4618,7 +4628,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -4679,7 +4689,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -4701,7 +4711,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core 0.20.9", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -4749,14 +4759,14 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] name = "deno_task_shell" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97e5ff66a1e89edb7ca0c36b73a8fcdc008ba426c4ad7a36e1dfb3f4a166179e" +checksum = "dd6413ffc1654cad015edb5c4ab574069acdc929a6efafed23bc947901bcff1a" dependencies = [ "anyhow", "futures", @@ -4868,7 +4878,7 @@ dependencies = [ "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -4888,20 +4898,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core 0.20.0", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.68", ] [[package]] @@ -5019,13 +5029,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -5106,7 +5116,7 @@ dependencies = [ "starknet", "test-log", "thiserror", - "toml 0.8.13", + "toml 0.8.14", "tracing", "url", ] @@ -5125,7 +5135,7 @@ name = "dojo-metrics" version = "0.7.3-alpha.1" dependencies = [ "anyhow", - "hyper 0.14.28", + "hyper 0.14.29", "jemalloc-ctl", "jemallocator", "metrics", @@ -5167,7 +5177,7 @@ dependencies = [ "starknet", "thiserror", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tracing", "url", ] @@ -5221,7 +5231,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml 0.8.13", + "toml 0.8.14", "topological-sort", "tracing", "url", @@ -5319,9 +5329,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] @@ -5398,7 +5408,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -5410,7 +5420,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -5543,43 +5553,22 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.0", + "event-listener 5.3.1", "pin-project-lite", ] @@ -5674,12 +5663,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "finl_unicode" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - [[package]] name = "fixed-hash" version = "0.8.0" @@ -5809,9 +5792,9 @@ dependencies = [ [[package]] name = "futures-bounded" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" +checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" dependencies = [ "futures-timer", "futures-util", @@ -5853,7 +5836,7 @@ checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -5898,7 +5881,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -5970,9 +5953,9 @@ checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" [[package]] name = "genco" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98d7af598790738fee616426e669360fa361273b1b9c9b7f30c92fa627605cad" +checksum = "afac3cbb14db69ac9fef9cdb60d8a87e39a7a527f85a81a923436efa40ad42c6" dependencies = [ "genco-macros", "relative-path", @@ -5981,13 +5964,13 @@ dependencies = [ [[package]] name = "genco-macros" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4cf186fea4af17825116f72932fe52cce9a13bae39ff63b4dc0cfdb3fb4bde1" +checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -6026,15 +6009,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gix" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5631c64fb4cd48eee767bf98a3cbc5c9318ef3bb71074d4c099a2371510282b6" +checksum = "984c5018adfa7a4536ade67990b3ebc6e11ab57b3d6cd9968de0947ca99b4b06" dependencies = [ "gix-actor", "gix-archive", @@ -6082,7 +6065,7 @@ dependencies = [ "gix-worktree-state", "gix-worktree-stream", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "signal-hook", "smallvec", @@ -6091,23 +6074,23 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3a3bde455ad2ee8ba8a195745241ce0b770a8a26faae59fcf409d01b28c46" +checksum = "d69c59d392c7e6c94385b6fd6089d6df0fe945f32b4357687989f3aee253cd7f" dependencies = [ "bstr 1.9.1", "gix-date", "gix-utils", "itoa", "thiserror", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] name = "gix-archive" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f28b5481bbe35de9f2eacbd8dbc61da7b8d763eaecd667018602aa805e2e2e" +checksum = "04f103e42cb054d33de74d5e9de471772b94e2bcd0759264f599ae273586ff72" dependencies = [ "bstr 1.9.1", "gix-date", @@ -6153,9 +6136,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90009020dc4b3de47beed28e1334706e0a330ddd17f5cfeb097df3b15a54b77" +checksum = "6c22e086314095c43ffe5cdc5c0922d5439da4fd726f3b0438c56147c34dc225" dependencies = [ "bstr 1.9.1", "gix-path", @@ -6179,9 +6162,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7580e05996e893347ad04e1eaceb92e1c0e6a3ffe517171af99bf6b6df0ca6e5" +checksum = "53fafe42957e11d98e354a66b6bd70aeea00faf2f62dd11164188224a507c840" dependencies = [ "bstr 1.9.1", "gix-config-value", @@ -6195,7 +6178,7 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -6204,7 +6187,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr 1.9.1", "gix-path", "libc", @@ -6230,9 +6213,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367ee9093b0c2b04fd04c5c7c8b6a1082713534eab537597ae343663a518fa99" +checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" dependencies = [ "bstr 1.9.1", "itoa", @@ -6242,9 +6225,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc24115b957346cd23fb0f47d830eb799c46c89cdcf2f5acc9bf2938c2d01" +checksum = "40b9bd8b2d07b6675a840b56a6c177d322d45fa082672b0dad8f063b25baf0a4" dependencies = [ "bstr 1.9.1", "gix-command", @@ -6262,9 +6245,9 @@ dependencies = [ [[package]] name = "gix-dir" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fcd56ffa1133f35525af890226ad0d3b2e607b4490360c94b1869e278eba3" +checksum = "60c99f8c545abd63abe541d20ab6cda347de406c0a3f1c80aadc12d9b0e94974" dependencies = [ "bstr 1.9.1", "gix-discover", @@ -6282,9 +6265,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64bab49087ed3710caf77e473dc0efc54ca33d8ccc6441359725f121211482b1" +checksum = "fc27c699b63da66b50d50c00668bc0b7e90c3a382ef302865e891559935f3dbf" dependencies = [ "bstr 1.9.1", "dunce", @@ -6298,9 +6281,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.38.1" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4254037d20a247a0367aa79333750146a369719f0c6617fec4f5752cc62b37" +checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" dependencies = [ "bytes", "bytesize", @@ -6313,7 +6296,7 @@ dependencies = [ "jwalk", "libc", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prodash", "sha1_smol", "thiserror", @@ -6322,9 +6305,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0d1f01af62bfd2fb3dd291acc2b29d4ab3e96ad52a679174626508ce98ef12" +checksum = "00ce6ea5ac8fca7adbc63c48a1b9e0492c222c386aa15f513405f1003f2f4ab2" dependencies = [ "bstr 1.9.1", "encoding_rs", @@ -6343,21 +6326,22 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2184c40e7910529677831c8b481acf788ffd92427ed21fad65b6aa637e631b8" +checksum = "c3338ff92a2164f5209f185ec0cd316f571a72676bb01d27e22f2867ba69f77a" dependencies = [ + "fastrand 2.1.0", "gix-features", "gix-utils", ] [[package]] name = "gix-glob" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "682bdc43cb3c00dbedfcc366de2a849b582efd8d886215dbad2ea662ec156bb5" +checksum = "c2a29ad0990cf02c48a7aac76ed0dbddeb5a0d070034b83675cc3bbf937eace4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr 1.9.1", "gix-features", "gix-path", @@ -6381,7 +6365,7 @@ checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" dependencies = [ "gix-hash", "hashbrown 0.14.5", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -6399,11 +6383,11 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881ab3b1fa57f497601a5add8289e72a7ae09471fc0b9bbe483b628ae8e418a1" +checksum = "2d8c5a5f1c58edcbc5692b174cda2703aba82ed17d7176ff4c1752eb48b1b167" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr 1.9.1", "filetime", "fnv", @@ -6415,6 +6399,7 @@ dependencies = [ "gix-object", "gix-traverse", "gix-utils", + "gix-validate", "hashbrown 0.14.5", "itoa", "libc", @@ -6426,9 +6411,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "13.1.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c359f81f01b8352063319bcb39789b7ea0887b406406381106e38c4a34d049" +checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" dependencies = [ "gix-tempfile", "gix-utils", @@ -6437,20 +6422,20 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" +checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "gix-mailmap" -version = "0.23.0" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a62c86c08a65f99002013d58dd3312b2987705547436bdb90c507dcd9a41b1" +checksum = "f69655c4706db2545f2d78723db30ac15738811de0bc14963135d06666392279" dependencies = [ "bstr 1.9.1", "gix-actor", @@ -6460,11 +6445,11 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ba98f8c8c06870dfc167d192ca38a38261867b836cb89ac80bc9176dba975e" +checksum = "d57dec54544d155a495e01de947da024471e1825d7d3f2724301c07a310d6184" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -6476,9 +6461,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d4f8efae72030df1c4a81d02dbe2348e748d9b9a11e108ed6efbd846326e051" +checksum = "1fe2dc4a41191c680c942e6ebd630c8107005983c4679214fdb1007dcf5ae1df" dependencies = [ "bstr 1.9.1", "gix-actor", @@ -6490,14 +6475,14 @@ dependencies = [ "itoa", "smallvec", "thiserror", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] name = "gix-odb" -version = "0.60.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8bbb43d2fefdc4701ffdf9224844d05b136ae1b9a73c2f90710c8dd27a93503" +checksum = "e92b9790e2c919166865d0825b26cc440a387c175bed1b43a2fa99c0e9d45e98" dependencies = [ "arc-swap", "gix-date", @@ -6508,16 +6493,16 @@ dependencies = [ "gix-pack", "gix-path", "gix-quote", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "tempfile", "thiserror", ] [[package]] name = "gix-pack" -version = "0.50.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58bad27c7677fa6b587aab3a1aca0b6c97373bd371a0a4290677c838c9bcaf1" +checksum = "7a8da51212dbff944713edb2141ed7e002eea326b8992070374ce13a6cb610b3" dependencies = [ "clru", "gix-chunk", @@ -6528,7 +6513,7 @@ dependencies = [ "gix-path", "gix-tempfile", "memmap2", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "smallvec", "thiserror", "uluru", @@ -6548,9 +6533,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23623cf0f475691a6d943f898c4d0b89f5c1a2a64d0f92bce0e0322ee6528783" +checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" dependencies = [ "bstr 1.9.1", "gix-trace", @@ -6561,11 +6546,11 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9f934a111e0efdf93ae06e3648427e60e783099fbebd6a53a7a2ffb10a1e65" +checksum = "a76cab098dc10ba2d89f634f66bf196dea4d7db4bf10b75c7a9c201c55a2ee19" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr 1.9.1", "gix-attributes", "gix-config-value", @@ -6576,13 +6561,13 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5325eb17ce7b5e5d25dec5c2315d642a09d55b9888b3bf46b7d72e1621a55d8" +checksum = "fddabbc7c51c241600ab3c4623b19fa53bde7c1a2f637f61043ed5fcadf000cc" dependencies = [ "gix-command", "gix-config-value", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rustix 0.38.34", "thiserror", ] @@ -6600,9 +6585,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.43.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4aba68b925101cb45d6df328979af0681364579db889098a0de75b36c77b65" +checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" dependencies = [ "gix-actor", "gix-date", @@ -6617,7 +6602,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -6636,9 +6621,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e34196e1969bd5d36e2fbc4467d893999132219d503e23474a8ad2b221cb1e8" +checksum = "63e08f8107ed1f93a83bcfbb4c38084c7cb3f6cd849793f1d5eec235f9b13b2b" dependencies = [ "bstr 1.9.1", "gix-date", @@ -6652,9 +6637,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7d393ae814eeaae41a333c0ff684b243121cc61ccdc5bbe9897094588047d" +checksum = "4181db9cfcd6d1d0fd258e91569dbb61f94cb788b441b5294dd7f1167a3e788f" dependencies = [ "gix-commitgraph", "gix-date", @@ -6671,7 +6656,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -6679,9 +6664,9 @@ dependencies = [ [[package]] name = "gix-status" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c413bfd2952e4ee92e48438dac3c696f3555e586a34d184a427f6bedd1e4f9" +checksum = "2f4373d989713809554d136f51bc7da565adf45c91aa4d86ef6a79801621bfc8" dependencies = [ "bstr 1.9.1", "filetime", @@ -6701,9 +6686,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb7ea05666362472fecd44c1fc35fe48a5b9b841b431cc4f85b95e6f20c23ec" +checksum = "921cd49924ac14b6611b22e5fb7bbba74d8780dc7ad26153304b64d1272460ac" dependencies = [ "bstr 1.9.1", "gix-config", @@ -6716,15 +6701,15 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "13.1.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a761d76594f4443b675e85928e4902dec333273836bd386906f01e7e346a0d11" +checksum = "d3b0e276cd08eb2a22e9f286a4f13a222a01be2defafa8621367515375644b99" dependencies = [ "dashmap", "gix-fs", "libc", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "signal-hook", "signal-hook-registry", "tempfile", @@ -6738,11 +6723,11 @@ checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gix-traverse" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4029ec209b0cc480d209da3837a42c63801dd8548f09c1f4502c60accb62aeb" +checksum = "f20cb69b63eb3e4827939f42c05b7756e3488ef49c25c412a876691d568ee2a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -6780,9 +6765,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e39fc6e06044985eac19dd34d474909e517307582e462b2eb4c8fa51b6241545" +checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" dependencies = [ "bstr 1.9.1", "thiserror", @@ -6790,9 +6775,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.33.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f06ca5dd164678914fc9280ba9d1ffeb66499ccc16ab1278c513828beee88401" +checksum = "53f6b7de83839274022aff92157d7505f23debf739d257984a300a35972ca94e" dependencies = [ "bstr 1.9.1", "gix-attributes", @@ -6804,13 +6789,14 @@ dependencies = [ "gix-index", "gix-object", "gix-path", + "gix-validate", ] [[package]] name = "gix-worktree-state" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b4bcac42d5b3197d38e3f15f6eb277c5e6d6a1669c7beabed8f666dba1c9b8" +checksum = "e64b2835892ce553b15aef7f6f7bb1e39e146fdf71eb99609b86710a7786cf34" dependencies = [ "bstr 1.9.1", "gix-features", @@ -6828,9 +6814,9 @@ dependencies = [ [[package]] name = "gix-worktree-stream" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e73f7f8c1354516339a244f61f0fe3080b4cf25ddcbcfefd2d56661d51e88d4" +checksum = "4c5a4d58fa1375cd40a24c9d1a501520fcba17eea109c58c7e208b309635b46a" dependencies = [ "gix-attributes", "gix-features", @@ -6840,7 +6826,7 @@ dependencies = [ "gix-object", "gix-path", "gix-traverse", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "thiserror", ] @@ -6859,8 +6845,8 @@ dependencies = [ "aho-corasick", "bstr 1.9.1", "log", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -6869,7 +6855,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "ignore", "walkdir", ] @@ -7140,6 +7126,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -7198,7 +7190,7 @@ dependencies = [ "ipconfig", "lru-cache", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "resolv-conf", "smallvec", @@ -7290,12 +7282,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -7309,9 +7301,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -7333,9 +7325,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -7384,7 +7376,7 @@ dependencies = [ "common-multipart-rfc7578", "futures-core", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", ] [[package]] @@ -7392,7 +7384,7 @@ name = "hyper-reverse-proxy" version = "0.5.2-dev" source = "git+https://github.com/tarrencev/hyper-reverse-proxy#4bfaf98b7ae61a49c6238ee1bd38ad030e7fa7f6" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.29", "lazy_static", "tokio", "tracing", @@ -7405,7 +7397,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "log", "rustls 0.20.9", "rustls-native-certs", @@ -7421,7 +7413,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "log", "rustls 0.21.12", "rustls-native-certs", @@ -7432,19 +7424,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", "hyper 1.3.1", "hyper-util", - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.3", ] [[package]] @@ -7453,7 +7446,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.28", + "hyper 0.14.29", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -7466,7 +7459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.29", "native-tls", "tokio", "tokio-native-tls", @@ -7490,9 +7483,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", @@ -7589,7 +7582,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.2", + "async-io 2.3.3", "core-foundation", "fnv", "futures", @@ -7613,7 +7606,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "log", "rand", "tokio", @@ -7631,7 +7624,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.7", "same-file", "walkdir", "winapi-util", @@ -7687,18 +7680,18 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -7813,9 +7806,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", "js-sys", @@ -7858,7 +7851,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -7885,7 +7878,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-multipart-rfc7578", "hyper-rustls 0.23.2", "ipfs-api-prelude", @@ -7938,7 +7931,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.52.0", ] @@ -8153,9 +8146,9 @@ dependencies = [ "futures-timer", "futures-util", "globset", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee-types 0.16.3", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "rustc-hash", "serde", @@ -8179,7 +8172,7 @@ dependencies = [ "beef", "futures-timer", "futures-util", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee-types 0.20.3", "rustc-hash", "serde", @@ -8196,7 +8189,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" dependencies = [ "async-trait", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-rustls 0.24.2", "jsonrpsee-core 0.16.3", "jsonrpsee-types 0.16.3", @@ -8215,7 +8208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" dependencies = [ "async-trait", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-rustls 0.24.2", "jsonrpsee-core 0.20.3", "jsonrpsee-types 0.20.3", @@ -8263,7 +8256,7 @@ dependencies = [ "futures-channel", "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee-core 0.16.3", "jsonrpsee-types 0.16.3", "serde", @@ -8419,7 +8412,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -8432,7 +8425,6 @@ dependencies = [ "alloy-provider 0.1.0", "alloy-rpc-types", "alloy-signer 0.1.0", - "alloy-signer-wallet", "alloy-sol-types", "alloy-transport 0.1.0", "anyhow", @@ -8455,9 +8447,9 @@ dependencies = [ "katana-tasks", "lazy_static", "metrics", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde", "serde_json", "serde_with 2.3.3", @@ -8480,7 +8472,7 @@ dependencies = [ "criterion", "katana-primitives", "page_size", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "postcard", "reth-libmdbx", "roaring", @@ -8506,7 +8498,7 @@ dependencies = [ "katana-primitives", "katana-provider", "katana-rpc-types", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pprof", "rstest 0.18.2", "rstest_reuse", @@ -8531,7 +8523,6 @@ dependencies = [ "katana-cairo", "lazy_static", "rand", - "rayon", "serde", "serde_json", "serde_with 2.3.3", @@ -8557,7 +8548,7 @@ dependencies = [ "katana-primitives", "katana-runner", "lazy_static", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rand", "rstest 0.18.2", "rstest_reuse", @@ -8586,7 +8577,7 @@ dependencies = [ "flate2", "futures", "hex", - "hyper 0.14.28", + "hyper 0.14.29", "jsonrpsee 0.16.3", "katana-core", "katana-executor", @@ -8664,7 +8655,6 @@ dependencies = [ "anyhow", "assert_fs", "chrono", - "home", "katana-core", "katana-primitives", "lazy_static", @@ -8773,7 +8763,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", @@ -8787,7 +8777,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.6", + "regex-automata 0.4.7", ] [[package]] @@ -8820,11 +8810,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] @@ -8846,15 +8836,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", "windows-targets 0.52.5", @@ -8868,9 +8858,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libmimalloc-sys" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81eb4061c0582dedea1cbc7aff2240300dd6982e0239d1c99e65c1dbf4a30ba7" +checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" dependencies = [ "cc", "libc", @@ -8948,7 +8938,7 @@ dependencies = [ "multihash 0.19.1", "multistream-select 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand", @@ -8975,7 +8965,7 @@ dependencies = [ "multihash 0.19.1", "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand", @@ -8997,7 +8987,7 @@ dependencies = [ "hickory-resolver", "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "smallvec", "tracing", ] @@ -9087,9 +9077,9 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" +checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" dependencies = [ "bs58", "ed25519-dalek", @@ -9195,8 +9185,8 @@ dependencies = [ "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p?rev=451bcb60bb472262f96071006b19e5d236b1dd54)", "libp2p-identity", "libp2p-tls", - "parking_lot 0.12.2", - "quinn", + "parking_lot 0.12.3", + "quinn 0.10.2", "rand", "ring 0.16.20", "rustls 0.21.12", @@ -9285,7 +9275,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -9419,7 +9409,7 @@ dependencies = [ "thiserror", "tracing", "yamux 0.12.1", - "yamux 0.13.2", + "yamux 0.13.3", ] [[package]] @@ -9439,7 +9429,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -9462,22 +9452,22 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linkme" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833222afbfe72868ac8f9770c91a33673f0d5fefc37c9dbe94aa3548b571623f" +checksum = "ccb76662d78edc9f9bf56360d6919bdacc8b7761227727e5082f128eeb90bbf5" dependencies = [ "linkme-impl", ] [[package]] name = "linkme-impl" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0dea92dbea3271557cc2e1848723967bba81f722f95026860974ec9283f08" +checksum = "f8dccda732e04fa3baf2e17cf835bfe2601c7c2edafd64417c627dabae3a8cda" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -9488,9 +9478,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -9602,9 +9592,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -9642,7 +9632,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d4fa7ce7c4862db464a37b0b31d89bca874562f034bd7993895572783d02950" dependencies = [ "base64 0.21.7", - "hyper 0.14.28", + "hyper 0.14.29", "indexmap 1.9.3", "ipnet", "metrics", @@ -9661,7 +9651,7 @@ checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -9700,9 +9690,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f41a2280ded0da56c8cf898babb86e8f10651a34adcfff190ae9a1159c6908d" +checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" dependencies = [ "libmimalloc-sys", ] @@ -9741,9 +9731,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -9909,11 +9899,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -10055,7 +10044,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "cfg_aliases", "libc", @@ -10099,7 +10088,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -10112,16 +10101,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "notify-debouncer-mini" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55ee272914f4563a2f8b8553eb6811f3c0caea81c756346bad15b7e3ef969f0" -dependencies = [ - "crossbeam-channel", - "notify", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -10270,7 +10249,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -10291,7 +10270,7 @@ checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -10320,9 +10299,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -10369,7 +10348,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -10386,7 +10365,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -10433,9 +10412,9 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.1.5" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" +checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209" dependencies = [ "libc", "windows-sys 0.52.0", @@ -10526,9 +10505,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core 0.9.10", @@ -10556,7 +10535,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -10676,7 +10655,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -10730,7 +10709,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -10774,7 +10753,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -10791,9 +10770,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -10827,17 +10806,11 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "plotters" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" dependencies = [ "num-traits 0.2.19", "plotters-backend", @@ -10848,15 +10821,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" +checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" [[package]] name = "plotters-svg" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" dependencies = [ "plotters-backend", ] @@ -10879,13 +10852,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -10953,7 +10926,7 @@ dependencies = [ "log", "nix 0.26.4", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "smallvec", "symbolic-demangle", "tempfile", @@ -11035,7 +11008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -11119,9 +11092,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -11132,7 +11105,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "hex", "lazy_static", "procfs-core", @@ -11145,7 +11118,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "hex", ] @@ -11167,7 +11140,7 @@ checksum = "c1ca959da22a332509f2a73ae9e5f23f9dcfc31fd3a54d71f159495bd5909baa" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -11179,24 +11152,24 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits 0.2.19", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -11214,12 +11187,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.4", + "prost-derive 0.12.6", ] [[package]] @@ -11246,9 +11219,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck 0.5.0", @@ -11258,10 +11231,10 @@ dependencies = [ "once_cell", "petgraph", "prettyplease 0.2.20", - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "regex", - "syn 2.0.64", + "syn 2.0.68", "tempfile", ] @@ -11280,15 +11253,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -11302,11 +11275,11 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.12.4", + "prost 0.12.6", ] [[package]] @@ -11321,7 +11294,7 @@ dependencies = [ "hyper-util", "prefix-hex", "rand", - "reqwest 0.12.4", + "reqwest 0.12.5", "reqwest_cookie_store", "serde", "serde_json", @@ -11422,8 +11395,8 @@ dependencies = [ "bytes", "futures-io", "pin-project-lite", - "quinn-proto", - "quinn-udp", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", "rustc-hash", "rustls 0.21.12", "thiserror", @@ -11431,6 +11404,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto 0.11.3", + "quinn-udp 0.5.2", + "rustc-hash", + "rustls 0.23.10", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "quinn-proto" version = "0.10.6" @@ -11448,6 +11438,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.10", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-udp" version = "0.4.1" @@ -11461,6 +11468,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -11581,9 +11601,9 @@ dependencies = [ [[package]] name = "redb" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7508e692a49b6b2290b56540384ccae9b1fb4d77065640b165835b56ffe3bb" +checksum = "a6dd20d3cdeb9c7d2366a0b16b93b35b75aec15309fbeb7ce477138c9f68c8c0" dependencies = [ "libc", ] @@ -11608,11 +11628,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -11628,14 +11648,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -11649,13 +11669,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -11666,9 +11686,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "relative-path" @@ -11691,7 +11711,7 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -11708,7 +11728,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -11726,14 +11746,14 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", "bytes", - "cookie", - "cookie_store", + "cookie 0.18.1", + "cookie_store 0.21.0", "futures-channel", "futures-core", "futures-util", @@ -11741,7 +11761,7 @@ dependencies = [ "http-body 1.0.0", "http-body-util", "hyper 1.3.1", - "hyper-rustls 0.26.0", + "hyper-rustls 0.27.2", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -11752,22 +11772,23 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", + "quinn 0.11.2", + "rustls 0.23.10", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots 0.26.3", "winreg 0.52.0", ] @@ -11778,8 +11799,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93ea5c6f30c19d766efe8d823c88f9abd1c56516648a0d4264ab2dc04cc19472" dependencies = [ "bytes", - "cookie_store", - "reqwest 0.12.4", + "cookie_store 0.20.0", + "reqwest 0.12.5", "url", ] @@ -11798,12 +11819,12 @@ name = "reth-libmdbx" version = "0.1.0-alpha.13" source = "git+https://github.com/paradigmxyz/reth.git?rev=b34b0d3#b34b0d3c8de2598b2976f7ee2fc1a166c50b1b94" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "derive_more", "indexmap 2.2.6", "libc", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "reth-mdbx-sys", "thiserror", ] @@ -11827,7 +11848,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -11900,9 +11921,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26f4c25a604fcb3a1bcd96dd6ba37c93840de95de8198d94c0d571a74a804d1" +checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8" dependencies = [ "bytemuck", "byteorder", @@ -11991,7 +12012,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.64", + "syn 2.0.68", "unicode-ident", ] @@ -12004,7 +12025,7 @@ dependencies = [ "quote", "rand", "rustc_version 0.4.0", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12104,7 +12125,7 @@ name = "runner-macro" version = "0.7.3-alpha.1" dependencies = [ "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12172,10 +12193,10 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -12205,11 +12226,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "log", + "once_cell", "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.4", @@ -12374,10 +12395,8 @@ dependencies = [ "anyhow", "cairo-proof-parser", "clap", - "clap_complete", "console", "katana-primitives", - "katana-rpc", "katana-rpc-api", "saya-core", "serde_json", @@ -12412,10 +12431,10 @@ dependencies = [ "lazy_static", "num-bigint", "num-traits 0.2.19", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prover-sdk", "rand", - "reqwest 0.12.4", + "reqwest 0.12.5", "saya-provider", "serde", "serde_json", @@ -12521,8 +12540,8 @@ dependencies = [ "tar", "thiserror", "tokio", - "toml 0.8.13", - "toml_edit 0.22.13", + "toml 0.8.14", + "toml_edit 0.22.14", "tracing", "tracing-subscriber", "typed-builder", @@ -12607,7 +12626,6 @@ name = "scheduler" version = "0.7.3-alpha.1" dependencies = [ "clap", - "clap_complete", "katana-primitives", "saya-core", "serde", @@ -12618,9 +12636,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6e7ed6919cb46507fb01ff1654309219f62b4d603822501b0b80d42f6f21ef" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "indexmap 1.9.3", @@ -12631,14 +12649,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185f2b7aa7e02d418e453790dde16890256bbd2bcd04b7dc5348811052b53f49" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12707,7 +12725,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -12768,9 +12786,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -12809,22 +12827,22 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12835,14 +12853,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -12878,7 +12896,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12945,7 +12963,7 @@ dependencies = [ "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12957,7 +12975,7 @@ dependencies = [ "darling 0.20.9", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -12980,7 +12998,7 @@ dependencies = [ "futures", "lazy_static", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "serial_test_derive", ] @@ -12992,7 +13010,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -13178,7 +13196,7 @@ dependencies = [ "axum", "dirs 5.0.1", "graphql_client", - "hyper 0.14.28", + "hyper 0.14.29", "reqwest 0.11.27", "serde", "serde_json", @@ -13292,7 +13310,7 @@ dependencies = [ "anyhow", "assert_fs", "async-trait", - "bigdecimal 0.4.3", + "bigdecimal 0.4.5", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -13322,7 +13340,6 @@ dependencies = [ "katana-rpc-api", "katana-runner", "notify", - "notify-debouncer-mini", "num-bigint", "num-integer", "prettytable-rs", @@ -13364,16 +13381,12 @@ dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-test-plugin", - "cairo-lang-test-runner", "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "camino", "clap", - "clap-verbosity-flag", - "clap_complete", "colored", "colored_json", "console", - "dojo-bindgen", "dojo-lang", "dojo-test-utils", "dojo-types", @@ -13381,8 +13394,6 @@ dependencies = [ "futures", "ipfs-api-backend-hyper", "katana-runner", - "notify", - "notify-debouncer-mini", "rpassword", "scarb", "scarb-ui", @@ -13391,14 +13402,12 @@ dependencies = [ "serde_json", "serde_with 2.3.3", "smol_str", - "snapbox", "starknet", "starknet-crypto 0.6.2", "thiserror", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tracing", - "tracing-log 0.1.4", "url", ] @@ -13448,11 +13457,10 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" dependencies = [ - "itertools 0.12.1", "nom", "unicode_categories", ] @@ -13510,7 +13518,7 @@ dependencies = [ "tokio-stream", "tracing", "url", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -13561,7 +13569,7 @@ checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "bytes", "chrono", @@ -13593,7 +13601,7 @@ dependencies = [ "stringprep", "thiserror", "tracing", - "uuid 1.8.0", + "uuid 1.9.1", "whoami", ] @@ -13605,7 +13613,7 @@ checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "byteorder", "chrono", "crc", @@ -13633,7 +13641,7 @@ dependencies = [ "stringprep", "thiserror", "tracing", - "uuid 1.8.0", + "uuid 1.9.1", "whoami", ] @@ -13660,7 +13668,7 @@ dependencies = [ "tracing", "url", "urlencoding", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -13780,7 +13788,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -13823,7 +13831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95d549d3078bdbe775d0deaa8ddb57a19942989ce7c1f2dfd60beeb322bb4945" dependencies = [ "starknet-core", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -13879,9 +13887,9 @@ dependencies = [ [[package]] name = "starknet-types-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4098ac4ad57621cc7ec133b80fe72814d2cc4bee63ca8e7be4450ba6f42a07e8" +checksum = "65799574816ba83cb04b21a3cb16f791b9882687cd9093415fd1b3821dbac29d" dependencies = [ "lambdaworks-crypto", "lambdaworks-math 0.7.0", @@ -13932,20 +13940,20 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "phf_shared 0.10.0", "precomputed-hash", ] [[package]] name = "stringprep" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -14007,7 +14015,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14020,7 +14028,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14053,9 +14061,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-encoding" @@ -14074,21 +14082,21 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "symbolic-common" -version = "12.8.0" +version = "12.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cccfffbc6bb3bb2d3a26cd2077f4d055f6808d266f9d4d158797a4c60510dfe" +checksum = "71297dc3e250f7dbdf8adb99e235da783d690f5819fdeb4cce39d9cfb0aca9f1" dependencies = [ "debugid", "memmap2", "stable_deref_trait", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] name = "symbolic-demangle" -version = "12.8.0" +version = "12.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a99812da4020a67e76c4eb41f08c87364c14170495ff780f30dd519c221a68" +checksum = "424fa2c9bf2c862891b9cfd354a752751a6730fd838a4691e7f6c2c7957b9daf" dependencies = [ "cpp_demangle", "rustc-demangle", @@ -14108,9 +14116,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.64" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11f" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -14126,7 +14134,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14135,6 +14143,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -14155,7 +14169,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14187,9 +14201,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -14253,27 +14267,27 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14369,9 +14383,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] @@ -14384,16 +14398,16 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", "socket2 0.5.7", @@ -14413,13 +14427,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14455,11 +14469,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", ] @@ -14513,14 +14527,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.14", ] [[package]] @@ -14545,15 +14559,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.13", ] [[package]] @@ -14593,11 +14607,11 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-timeout", "percent-encoding", "pin-project", - "prost 0.12.4", + "prost 0.12.6", "tokio", "tokio-stream", "tower", @@ -14627,9 +14641,9 @@ checksum = "9d021fc044c18582b9a2408cd0dd05b1596e3ecdb5c4df822bb0183545683889" dependencies = [ "prettyplease 0.2.20", "proc-macro2", - "prost-build 0.12.4", + "prost-build 0.12.6", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -14638,8 +14652,8 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fa37c513df1339d197f4ba21d28c918b9ef1ac1768265f11ecb6b7f1cba1b76" dependencies = [ - "prost 0.12.4", - "prost-types 0.12.4", + "prost 0.12.6", + "prost-types 0.12.6", "tokio", "tokio-stream", "tonic 0.10.2", @@ -14655,7 +14669,7 @@ dependencies = [ "bytes", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "pin-project", "tokio-stream", "tonic 0.10.2", @@ -14714,7 +14728,7 @@ dependencies = [ "futures", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-reverse-proxy", "indexmap 2.2.6", "lazy_static", @@ -14752,9 +14766,9 @@ dependencies = [ "futures", "futures-util", "libp2p-gossipsub 0.46.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prost 0.11.9", - "prost 0.12.4", + "prost 0.12.6", "serde", "serde_json", "starknet", @@ -14789,13 +14803,12 @@ dependencies = [ "lazy_static", "log", "once_cell", - "reqwest 0.12.4", + "reqwest 0.12.5", "scarb", "scarb-ui", "serde", "serde_json", "slab", - "sozo", "sozo-ops", "sqlx", "starknet", @@ -14830,7 +14843,6 @@ dependencies = [ "serde", "serde_json", "serial_test", - "sozo", "sozo-ops", "sqlx", "starknet", @@ -14841,7 +14853,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "toml 0.8.13", + "toml 0.8.14", "torii-core", "tracing", "url", @@ -14861,10 +14873,10 @@ dependencies = [ "futures", "futures-util", "hex", - "hyper 0.14.28", - "parking_lot 0.12.2", + "hyper 0.14.29", + "parking_lot 0.12.3", "prost 0.11.9", - "prost 0.12.4", + "prost 0.12.6", "rand", "rayon", "scarb", @@ -14932,41 +14944,20 @@ dependencies = [ name = "torii-server" version = "0.7.3-alpha.1" dependencies = [ - "anyhow", - "async-trait", "base64 0.21.7", - "camino", - "chrono", - "clap", - "ctrlc", - "dojo-metrics", - "dojo-types", - "dojo-world", - "either", - "futures", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.29", "hyper-reverse-proxy", "indexmap 2.2.6", "lazy_static", - "scarb", "serde", "serde_json", - "sqlx", - "starknet", - "starknet-crypto 0.6.2", "tokio", - "tokio-stream", "tokio-util", - "torii-core", - "torii-graphql", - "torii-grpc", "tower", "tower-http", "tracing", - "tracing-subscriber", - "url", ] [[package]] @@ -14998,7 +14989,7 @@ checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ "async-compression", "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "bytes", "futures-core", "futures-util", @@ -15017,7 +15008,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", - "uuid 1.8.0", + "uuid 1.9.1", ] [[package]] @@ -15057,7 +15048,7 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -15086,7 +15077,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -15236,7 +15227,7 @@ checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -15300,9 +15291,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unescaper" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adf6ad32eb5b3cadff915f7b770faaac8f7ff0476633aa29eb0d9584d889d34" +checksum = "c878a167baa8afd137494101a688ef8c67125089ff2249284bd2b5f9bfedb815" dependencies = [ "thiserror", ] @@ -15343,6 +15334,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-properties" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" + [[package]] name = "unicode-segmentation" version = "1.11.0" @@ -15351,9 +15348,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -15412,9 +15409,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -15436,9 +15433,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -15452,9 +15449,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ "getrandom", ] @@ -15543,7 +15540,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.29", "log", "mime", "mime_guess", @@ -15596,7 +15593,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", "wasm-bindgen-shared", ] @@ -15630,7 +15627,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -15663,7 +15660,7 @@ checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -15781,9 +15778,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -15901,7 +15898,7 @@ dependencies = [ "tokio", "turn", "url", - "uuid 1.8.0", + "uuid 1.9.1", "waitgroup", "webrtc-mdns", "webrtc-util", @@ -16319,9 +16316,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -16409,7 +16406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "rustix 0.38.34", ] @@ -16458,7 +16455,7 @@ dependencies = [ "futures", "log", "nohash-hasher", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "rand", "static_assertions", @@ -16466,18 +16463,18 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f97202f6b125031b95d83e01dc57292b529384f80bfae4677e4bbc10178cf72" +checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" dependencies = [ "futures", - "instant", "log", "nohash-hasher", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "rand", "static_assertions", + "web-time", ] [[package]] @@ -16512,14 +16509,14 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -16532,7 +16529,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.64", + "syn 2.0.68", ] [[package]] @@ -16594,9 +16591,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.11+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 7fc3bd1e03..1dbe870501 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -231,5 +231,4 @@ alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372e alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } -alloy-signer-wallet = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } diff --git a/bin/saya/Cargo.toml b/bin/saya/Cargo.toml index 1021bf1706..0cb85c01e7 100644 --- a/bin/saya/Cargo.toml +++ b/bin/saya/Cargo.toml @@ -9,11 +9,9 @@ version.workspace = true [dependencies] anyhow.workspace = true clap.workspace = true -clap_complete.workspace = true console.workspace = true katana-primitives.workspace = true katana-rpc-api.workspace = true -katana-rpc.workspace = true saya-core.workspace = true serde_json.workspace = true tokio.workspace = true diff --git a/bin/scheduler/Cargo.toml b/bin/scheduler/Cargo.toml index 2db9f60385..24c78ff1ef 100644 --- a/bin/scheduler/Cargo.toml +++ b/bin/scheduler/Cargo.toml @@ -1,18 +1,17 @@ [package] -name = "scheduler" edition.workspace = true license.workspace = true +name = "scheduler" repository.workspace = true version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -saya-core.workspace = true +clap.workspace = true katana-primitives.workspace = true -tokio.workspace = true -serde = { version = "1.0", features = ["derive"] } +saya-core.workspace = true +serde = { version = "1.0", features = [ "derive" ] } serde_json = "1.0" -clap.workspace = true -clap_complete.workspace = true +tokio.workspace = true url = "2.5.0" diff --git a/bin/sozo/Cargo.toml b/bin/sozo/Cargo.toml index cf01f1302f..64fb08de3c 100644 --- a/bin/sozo/Cargo.toml +++ b/bin/sozo/Cargo.toml @@ -38,7 +38,6 @@ hex = "0.4.3" hex-literal = "0.4.1" katana-rpc-api.workspace = true notify = "6.0.1" -notify-debouncer-mini = "0.3.0" num-bigint = "0.4.3" num-integer = "0.1.45" prettytable-rs = "0.10.0" diff --git a/crates/benches/Cargo.toml b/crates/benches/Cargo.toml index 4d0e91edd6..279b24fe50 100644 --- a/crates/benches/Cargo.toml +++ b/crates/benches/Cargo.toml @@ -7,7 +7,6 @@ version.workspace = true [dependencies] clap_builder = "4.4.6" -proptest = "1.3.1" reqwest = { workspace = true, features = [ "blocking", "json", "rustls-tls" ], default-features = false } katana-core = { path = "../katana/core" } @@ -28,8 +27,17 @@ sozo-ops.workspace = true starknet.workspace = true tokio.workspace = true +[dev-dependencies] +proptest = "1.3.1" + [features] default = [ "skip-benchmarks" ] skip-benchmarks = [ "skip-gas-benchmarks", "skip-katana-benchmarks" ] skip-gas-benchmarks = [ ] skip-katana-benchmarks = [ ] + +[package.metadata.cargo-udeps.ignore] +# proptest is needed when `skip-benchmarks` feature is turned off +# since it enabled by default and there isn't a good way to make it +# optional ignore it manually from udeps +development = [ "proptest" ] diff --git a/crates/katana/core/Cargo.toml b/crates/katana/core/Cargo.toml index e41ee5c0ce..f3bb707825 100644 --- a/crates/katana/core/Cargo.toml +++ b/crates/katana/core/Cargo.toml @@ -47,7 +47,6 @@ alloy-network = { version = "0.1.0", default-features = false, optional = true } alloy-provider = { version = "0.1.0", default-features = false, optional = true, features = [ "reqwest" ] } alloy-rpc-types = { version = "0.1.0", default-features = false, optional = true } alloy-signer = { version = "0.1.0", default-features = false, optional = true } -alloy-signer-wallet = { version = "0.1.0", default-features = false, optional = true } alloy-transport = { version = "0.1.0", default-features = false, optional = true } [dev-dependencies] @@ -62,7 +61,6 @@ messaging = [ "alloy-provider", "alloy-rpc-types", "alloy-signer", - "alloy-signer-wallet", "alloy-sol-types", "alloy-transport", ] diff --git a/crates/katana/primitives/Cargo.toml b/crates/katana/primitives/Cargo.toml index 90b721a4a2..6a4e1ed8c3 100644 --- a/crates/katana/primitives/Cargo.toml +++ b/crates/katana/primitives/Cargo.toml @@ -12,7 +12,6 @@ base64.workspace = true derive_more.workspace = true lazy_static.workspace = true rand = { workspace = true, features = [ "small_rng" ] } -rayon.workspace = true serde.workspace = true serde_json.workspace = true serde_with.workspace = true diff --git a/crates/katana/runner/Cargo.toml b/crates/katana/runner/Cargo.toml index f0a6787556..e4daf7a28c 100644 --- a/crates/katana/runner/Cargo.toml +++ b/crates/katana/runner/Cargo.toml @@ -9,7 +9,6 @@ version.workspace = true anyhow.workspace = true assert_fs.workspace = true chrono.workspace = true -home = "0.5.5" katana-core.workspace = true katana-primitives.workspace = true lazy_static.workspace = true diff --git a/crates/katana/storage/codecs/derive/Cargo.toml b/crates/katana/storage/codecs/derive/Cargo.toml index ec7fb56f75..fc00c230ee 100644 --- a/crates/katana/storage/codecs/derive/Cargo.toml +++ b/crates/katana/storage/codecs/derive/Cargo.toml @@ -13,3 +13,6 @@ proc-macro2 = "1.0.70" quote = "1.0.33" serde.workspace = true syn = { version = "2.0.41", features = [ "extra-traits", "full" ] } + +[package.metadata.cargo-udeps.ignore] +normal = [ "serde" ] diff --git a/crates/katana/storage/codecs/derive/src/lib.rs b/crates/katana/storage/codecs/derive/src/lib.rs index b4fae093f6..18cb176887 100644 --- a/crates/katana/storage/codecs/derive/src/lib.rs +++ b/crates/katana/storage/codecs/derive/src/lib.rs @@ -5,7 +5,7 @@ use syn::{parse_macro_input, DeriveInput}; #[proc_macro_attribute] #[rustfmt::skip] #[allow(unreachable_code)] -pub fn main_codec(args: TokenStream, input: TokenStream) -> TokenStream { +pub fn main_codec(args: TokenStream, input: TokenStream) -> TokenStream { #[cfg(feature = "postcard")] return use_postcard(args, input); diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index f4144ae66b..6c5ee340a7 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -19,22 +19,16 @@ cairo-lang-sierra.workspace = true cairo-lang-starknet-classes.workspace = true cairo-lang-starknet.workspace = true cairo-lang-test-plugin.workspace = true -cairo-lang-test-runner.workspace = true cairo-lang-utils.workspace = true camino.workspace = true -clap-verbosity-flag.workspace = true clap.workspace = true -clap_complete.workspace = true colored = "2.0.0" colored_json = "3.2.0" console.workspace = true -dojo-bindgen.workspace = true dojo-lang.workspace = true dojo-types.workspace = true dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] } futures.workspace = true -notify = "6.0.1" -notify-debouncer-mini = "0.3.0" rpassword.workspace = true scarb-ui.workspace = true scarb.workspace = true @@ -47,14 +41,12 @@ starknet-crypto.workspace = true starknet.workspace = true thiserror.workspace = true tokio.workspace = true -tracing-log = "0.1.3" +toml.workspace = true tracing.workspace = true url.workspace = true -toml.workspace = true [dev-dependencies] assert_fs.workspace = true dojo-test-utils = { workspace = true, features = [ "build-examples" ] } ipfs-api-backend-hyper = { git = "https://github.com/ferristseng/rust-ipfs-api", rev = "af2c17f7b19ef5b9898f458d97a90055c3605633", features = [ "with-hyper-rustls" ] } katana-runner.workspace = true -snapbox = "0.4.6" diff --git a/crates/torii/core/Cargo.toml b/crates/torii/core/Cargo.toml index cf1cb8cdd3..4f0168d20f 100644 --- a/crates/torii/core/Cargo.toml +++ b/crates/torii/core/Cargo.toml @@ -9,10 +9,10 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cainome.workspace = true anyhow.workspace = true async-trait.workspace = true base64.workspace = true +cainome.workspace = true chrono.workspace = true crypto-bigint.workspace = true dojo-types = { path = "../../dojo-types" } @@ -41,6 +41,5 @@ tracing.workspace = true [dev-dependencies] camino.workspace = true dojo-test-utils = { path = "../../dojo-test-utils" } -scarb.workspace = true -sozo = { path = "../../../bin/sozo" } katana-runner.workspace = true +scarb.workspace = true diff --git a/crates/torii/graphql/Cargo.toml b/crates/torii/graphql/Cargo.toml index d984c87047..ae43a05ba6 100644 --- a/crates/torii/graphql/Cargo.toml +++ b/crates/torii/graphql/Cargo.toml @@ -19,9 +19,11 @@ chrono.workspace = true convert_case = "0.6.0" dojo-types = { path = "../../dojo-types" } lazy_static.workspace = true +regex.workspace = true scarb-ui.workspace = true serde.workspace = true serde_json.workspace = true +sozo-ops.workspace = true sqlx.workspace = true strum.workspace = true strum_macros.workspace = true @@ -32,10 +34,8 @@ tokio.workspace = true toml.workspace = true torii-core = { path = "../core" } tracing.workspace = true -regex.workspace = true url.workspace = true warp.workspace = true -sozo-ops.workspace = true [dev-dependencies] camino.workspace = true @@ -43,6 +43,5 @@ dojo-test-utils = { path = "../../dojo-test-utils", features = [ "build-examples dojo-world = { path = "../../dojo-world" } scarb.workspace = true serial_test = "2.0.0" -sozo = { path = "../../../bin/sozo" } starknet-crypto.workspace = true starknet.workspace = true diff --git a/crates/torii/server/Cargo.toml b/crates/torii/server/Cargo.toml index 785a1648fb..40cfe1b90c 100644 --- a/crates/torii/server/Cargo.toml +++ b/crates/torii/server/Cargo.toml @@ -6,46 +6,17 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow.workspace = true -async-trait.workspace = true base64.workspace = true -camino.workspace = true -chrono.workspace = true -clap.workspace = true -ctrlc = { version = "3.4", features = [ "termination" ] } -dojo-metrics.workspace = true -dojo-types = { path = "../../dojo-types" } -dojo-world = { path = "../../dojo-world" } -either = "1.9.0" -futures.workspace = true http-body = "0.4.5" http.workspace = true hyper-reverse-proxy = { git = "https://github.com/tarrencev/hyper-reverse-proxy" } hyper.workspace = true indexmap.workspace = true lazy_static.workspace = true -scarb.workspace = true serde.workspace = true serde_json.workspace = true -sqlx.workspace = true -starknet-crypto.workspace = true -starknet.workspace = true -tokio-stream = "0.1.11" tokio-util = "0.7.7" tokio.workspace = true -torii-core = { path = "../core" } -torii-graphql = { path = "../graphql" } -torii-grpc = { path = "../grpc", features = [ "server" ] } tower-http.workspace = true tower.workspace = true -tracing-subscriber.workspace = true tracing.workspace = true -url.workspace = true - -[dev-dependencies] -camino.workspace = true - -[features] -default = [ "jemalloc", "sqlite" ] -jemalloc = [ "dojo-metrics/jemalloc" ] -sqlite = [ "sqlx/sqlite" ] diff --git a/examples/spawn-and-move/.tool-versions b/examples/spawn-and-move/.tool-versions deleted file mode 100644 index f239fe235a..0000000000 --- a/examples/spawn-and-move/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -scarb 2.6.3 From 2ea37a177fcfeedfebf6be8a55a462a752bbe4ec Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:01:43 -0400 Subject: [PATCH 63/88] fix(torii-client): emtpty sub for event message (#2115) fix: emtpty sub for event message --- crates/torii/grpc/src/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index 2bd5bc4411..e0c994283d 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -133,9 +133,9 @@ impl WorldClient { .map_err(Error::Grpc) .map(|res| res.into_inner())?; - Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| { - let entity = res.entity.expect("entity must exist"); - entity.try_into().expect("must able to serialize") + Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| match res.entity { + Some(entity) => entity.try_into().expect("must able to serialize"), + None => Entity { hashed_keys: FieldElement::ZERO, models: vec![] }, })))) } From 1fcaa7a53dd846034bdf137a7603fc6143db857d Mon Sep 17 00:00:00 2001 From: Neo <128649481+neotheprogramist@users.noreply.github.com> Date: Fri, 28 Jun 2024 22:38:05 +0200 Subject: [PATCH 64/88] feat(saya): load starknet account from CLI (#2054) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * init * parsing args earlier * chain id from string * improve error handling for input parsing * saya args cleanup * fix: clippy --------- Co-authored-by: Mateusz Chudkowski Co-authored-by: Mateusz Zając Co-authored-by: glihm --- Cargo.lock | 2 + bin/saya/Cargo.toml | 1 + bin/saya/README.md | 11 ++- bin/saya/src/args/mod.rs | 72 +++++++++++++------- bin/saya/src/args/proof.rs | 11 +++ bin/saya/src/args/starknet_account.rs | 28 ++++++++ bin/saya/src/args/test_saya_config_file.json | 12 +++- crates/saya/core/Cargo.toml | 2 +- crates/saya/core/src/dojo_os/mod.rs | 68 ++++++++++-------- crates/saya/core/src/error.rs | 2 + crates/saya/core/src/lib.rs | 32 +++++++-- crates/saya/core/src/verifier/mod.rs | 5 +- crates/saya/core/src/verifier/starknet.rs | 26 ++++--- 13 files changed, 195 insertions(+), 77 deletions(-) create mode 100644 bin/saya/src/args/starknet_account.rs diff --git a/Cargo.lock b/Cargo.lock index d58125d68e..d1b34f9938 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12400,6 +12400,7 @@ dependencies = [ "katana-rpc-api", "saya-core", "serde_json", + "starknet", "starknet-crypto 0.6.2", "tokio", "tracing", @@ -12431,6 +12432,7 @@ dependencies = [ "lazy_static", "num-bigint", "num-traits 0.2.19", + "once_cell", "parking_lot 0.12.3", "prover-sdk", "rand", diff --git a/bin/saya/Cargo.toml b/bin/saya/Cargo.toml index 0cb85c01e7..2e2816c1c0 100644 --- a/bin/saya/Cargo.toml +++ b/bin/saya/Cargo.toml @@ -14,6 +14,7 @@ katana-primitives.workspace = true katana-rpc-api.workspace = true saya-core.workspace = true serde_json.workspace = true +starknet.workspace = true tokio.workspace = true tracing-subscriber.workspace = true tracing.workspace = true diff --git a/bin/saya/README.md b/bin/saya/README.md index 913b6ad039..781b438109 100644 --- a/bin/saya/README.md +++ b/bin/saya/README.md @@ -58,6 +58,7 @@ cargo run -r --bin sozo -- \ --fee-estimate-multiplier 20 \ --name ``` + Once the migration is done, please take note of the address of the world as it will be re-used in the commands below. 1. Set world configs @@ -133,6 +134,7 @@ cargo run -r --bin sozo -- model get Position \ --rpc-url \ --world ``` + ```json // Expected on Sepolia as we've executed the transaction on the Katana shard. { @@ -163,8 +165,7 @@ If not (this includes Apple Silicon), some emulation will take place to run the It's important that the `--start-block` of Saya is the first block produced by Katana as for now Katana is not fetching events from the forked network. -**IMPORTANT NOTE:** -For now, please add your account address and account private key in `saya/core/src/dojo_os/mod.rs` as those parameters are still not exposed currently. As you are using `cargo run`, it will rebuild with your account configuration before running `saya`. +Starknet sepolia network chain id is `0x00000000000000000000000000000000000000000000534e5f5345504f4c4941`. ```bash cargo run -r --bin saya -- \ @@ -173,7 +174,11 @@ cargo run -r --bin saya -- \ --world \ --url \ --private-key \ - --start-block + --start-block \ + --starknet-url \ + --chain-id \ + --signer-address \ + --signer-key \ ``` After this command, Saya will pick up the blocks with transactions, generate the proof for the state transition, and send it to the base layer world contract. diff --git a/bin/saya/src/args/mod.rs b/bin/saya/src/args/mod.rs index f0a257d6e4..b16fce3cdc 100644 --- a/bin/saya/src/args/mod.rs +++ b/bin/saya/src/args/mod.rs @@ -6,7 +6,9 @@ use std::path::PathBuf; use clap::Parser; use saya_core::data_availability::celestia::CelestiaConfig; use saya_core::data_availability::DataAvailabilityConfig; -use saya_core::{ProverAccessKey, SayaConfig}; +use saya_core::{ProverAccessKey, SayaConfig, StarknetAccountData}; +use starknet::core::utils::cairo_short_string_to_felt; +use starknet_account::StarknetAccountOptions; use tracing::Subscriber; use tracing_subscriber::{fmt, EnvFilter}; use url::Url; @@ -16,6 +18,7 @@ use crate::args::proof::ProofOptions; mod data_availability; mod proof; +mod starknet_account; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] @@ -28,18 +31,6 @@ pub struct SayaArgs { #[arg(default_value = "http://localhost:5050")] pub rpc_url: Url, - /// Specify the Prover URL. - #[arg(long)] - #[arg(value_name = "PROVER URL")] - #[arg(help = "The Prover URL for remote proving.")] - pub url: Url, - - /// Specify the Prover Key. - #[arg(long)] - #[arg(value_name = "PROVER KEY")] - #[arg(help = "An authorized prover key for remote proving.")] - pub private_key: String, - #[arg(long)] #[arg(value_name = "STORE PROOFS")] #[arg(help = "When enabled all proofs are saved as a file.")] @@ -73,6 +64,10 @@ pub struct SayaArgs { #[command(flatten)] #[command(next_help_heading = "Choose the proof pipeline configuration")] pub proof: ProofOptions, + + #[command(flatten)] + #[command(next_help_heading = "Starknet account configuration for settlement")] + pub starknet_account: StarknetAccountOptions, } impl SayaArgs { @@ -135,14 +130,22 @@ impl TryFrom for SayaConfig { None => None, }; - let prover_key = ProverAccessKey::from_hex_string(&args.private_key).map_err(|e| { - Box::new(std::io::Error::new(std::io::ErrorKind::InvalidInput, e.to_string())) - })?; + let starknet_account = StarknetAccountData { + starknet_url: args.starknet_account.starknet_url, + chain_id: cairo_short_string_to_felt(&args.starknet_account.chain_id)?, + signer_address: args.starknet_account.signer_address, + signer_key: args.starknet_account.signer_key, + }; + + let prover_key = + ProverAccessKey::from_hex_string(&args.proof.private_key).map_err(|e| { + Box::new(std::io::Error::new(std::io::ErrorKind::InvalidInput, e.to_string())) + })?; Ok(SayaConfig { katana_rpc: args.rpc_url, - url: args.url, - private_key: prover_key, + prover_url: args.proof.prover_url, + prover_key, store_proofs: args.store_proofs, start_block: args.start_block, batch_size: args.batch_size, @@ -150,6 +153,7 @@ impl TryFrom for SayaConfig { world_address: args.proof.world_address, fact_registry_address: args.proof.fact_registry_address, skip_publishing_proof, + starknet_account, }) } } @@ -157,6 +161,8 @@ impl TryFrom for SayaConfig { #[cfg(test)] mod tests { + use katana_primitives::FieldElement; + use super::*; use crate::args::data_availability::CelestiaOptions; @@ -171,9 +177,6 @@ mod tests { let args = SayaArgs { config_file: Some(config_file_path.clone()), rpc_url: Url::parse("http://localhost:5050").unwrap(), - url: Url::parse("http://localhost:5050").unwrap(), - private_key: "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" - .into(), store_proofs: true, json_log: false, start_block: 0, @@ -190,16 +193,24 @@ mod tests { proof: ProofOptions { world_address: Default::default(), fact_registry_address: Default::default(), + prover_url: Url::parse("http://localhost:5050").unwrap(), + private_key: Default::default(), + }, + starknet_account: StarknetAccountOptions { + starknet_url: Url::parse("http://localhost:5030").unwrap(), + chain_id: "SN_SEPOLIA".to_string(), + signer_address: Default::default(), + signer_key: Default::default(), }, }; let config: SayaConfig = args.try_into().unwrap(); assert_eq!(config.katana_rpc.as_str(), "http://localhost:5050/"); - assert_eq!(config.url.as_str(), "http://localhost:1234/"); + assert_eq!(config.prover_url.as_str(), "http://localhost:1234/"); assert_eq!(config.batch_size, 4); assert_eq!( - config.private_key.signing_key_as_hex_string(), + config.prover_key.signing_key_as_hex_string(), "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027" ); assert!(!config.store_proofs); @@ -212,5 +223,20 @@ mod tests { } else { panic!("Expected Celestia config"); } + + let expected = StarknetAccountData { + starknet_url: Url::parse("http://localhost:5030").unwrap(), + chain_id: FieldElement::from_hex_be("0x534e5f5345504f4c4941").unwrap(), + signer_address: FieldElement::from_hex_be( + "0x3aa0a12c62a46a200b1a1211e8cd09b520164104e76d79648ca459cf05db94", + ) + .unwrap(), + signer_key: FieldElement::from_hex_be( + "0x6b41bfa82e791a8b4e6b3ee058cb25b89714e4a23bd9a1ad6e6ba0bbc0b145b", + ) + .unwrap(), + }; + + assert_eq!(config.starknet_account, expected); } } diff --git a/bin/saya/src/args/proof.rs b/bin/saya/src/args/proof.rs index 12c3cfed3a..23375d1dc2 100644 --- a/bin/saya/src/args/proof.rs +++ b/bin/saya/src/args/proof.rs @@ -1,5 +1,6 @@ use clap::Args; use katana_primitives::FieldElement; +use url::Url; #[derive(Debug, Args, Clone)] pub struct ProofOptions { @@ -10,4 +11,14 @@ pub struct ProofOptions { #[arg(help = "The address of the Fact Registry contract.")] #[arg(long = "registry")] pub fact_registry_address: FieldElement, + + #[arg(long)] + #[arg(value_name = "PROVER URL")] + #[arg(help = "The Prover URL for remote proving.")] + pub prover_url: Url, + + #[arg(long)] + #[arg(value_name = "PROVER KEY")] + #[arg(help = "An authorized prover key for remote proving.")] + pub private_key: String, } diff --git a/bin/saya/src/args/starknet_account.rs b/bin/saya/src/args/starknet_account.rs new file mode 100644 index 0000000000..45d772ce08 --- /dev/null +++ b/bin/saya/src/args/starknet_account.rs @@ -0,0 +1,28 @@ +//! Data availability options. + +use clap::Args; +use katana_primitives::FieldElement; +use url::Url; + +#[derive(Debug, Args, Clone)] +pub struct StarknetAccountOptions { + #[arg(long)] + #[arg(env)] + #[arg(help = "The url of the starknet node.")] + pub starknet_url: Url, + + #[arg(long)] + #[arg(env)] + #[arg(help = "The chain id of the starknet node.")] + pub chain_id: String, + + #[arg(long)] + #[arg(env)] + #[arg(help = "The address of the starknet account.")] + pub signer_address: FieldElement, + + #[arg(long)] + #[arg(env)] + #[arg(help = "The private key of the starknet account.")] + pub signer_key: FieldElement, +} diff --git a/bin/saya/src/args/test_saya_config_file.json b/bin/saya/src/args/test_saya_config_file.json index ba73f97434..dc52810d8e 100644 --- a/bin/saya/src/args/test_saya_config_file.json +++ b/bin/saya/src/args/test_saya_config_file.json @@ -1,7 +1,7 @@ { "katana_rpc": "http://localhost:5050", - "url": "http://localhost:1234", - "private_key": "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027", + "prover_url": "http://localhost:1234", + "prover_key": "0xd0fa91f4949e9a777ebec071ca3ca6acc1f5cd6c6827f123b798f94e73425027", "store_proofs": false, "batch_size": 4, "world_address": "0x332b8ff41b1b026991fa9b7f0ec352909f8bc33416b65a80527edc988a9b082", @@ -16,5 +16,11 @@ } }, "prover": "Stone", - "verifier": "StoneLocal" + "verifier": "StoneLocal", + "starknet_account": { + "starknet_url": "http://localhost:5030", + "chain_id": "SN_SEPOLIA", + "signer_address": "0x3aa0a12c62a46a200b1a1211e8cd09b520164104e76d79648ca459cf05db94", + "signer_key": "0x6b41bfa82e791a8b4e6b3ee058cb25b89714e4a23bd9a1ad6e6ba0bbc0b145b" + } } diff --git a/crates/saya/core/Cargo.toml b/crates/saya/core/Cargo.toml index b44ecbeabc..bb319cbc3a 100644 --- a/crates/saya/core/Cargo.toml +++ b/crates/saya/core/Cargo.toml @@ -38,7 +38,7 @@ thiserror.workspace = true tokio.workspace = true tracing.workspace = true url.workspace = true - +once_cell.workspace = true # TODO: use features for each possible DA. celestia-rpc = "0.2.0" celestia-types = "0.2.0" diff --git a/crates/saya/core/src/dojo_os/mod.rs b/crates/saya/core/src/dojo_os/mod.rs index bf479bc8d3..74d387539c 100644 --- a/crates/saya/core/src/dojo_os/mod.rs +++ b/crates/saya/core/src/dojo_os/mod.rs @@ -7,12 +7,14 @@ // pub mod input; // pub mod transaction; +use std::sync::Arc; use std::time::Duration; use anyhow::{bail, Context}; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use itertools::chain; +use once_cell::sync::OnceCell; use starknet::accounts::{Account, Call, ConnectedAccount, ExecutionEncoding, SingleOwnerAccount}; use starknet::core::types::{ BlockId, BlockTag, FieldElement, TransactionExecutionStatus, TransactionStatus, @@ -21,32 +23,36 @@ use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider}; use starknet::signers::{LocalWallet, SigningKey}; +use tokio::sync::Mutex; use tokio::time::sleep; -use url::Url; -// will need to be read from the environment for chains other than sepoia -pub const STARKNET_URL: &str = "https://free-rpc.nethermind.io/sepolia-juno/v0_7"; -pub const CHAIN_ID: &str = "0x00000000000000000000000000000000000000000000534e5f5345504f4c4941"; -pub const SIGNER_ADDRESS: &str = - "0x00ceE714eAF27390e630c62aa4b51319f9EdA813d6DDd12dA0ae8Ce00453cb4b"; -pub const SIGNER_KEY: &str = "0x01c49f9a0f5d2ca87fe7bb0530c611f91faf4adda6b7fcff479ce92ea13b1b4c"; -lazy_static::lazy_static!( - pub static ref STARKNET_ACCOUNT: SingleOwnerAccount, LocalWallet> = { - let provider = JsonRpcClient::new(HttpTransport::new( - Url::parse(STARKNET_URL).unwrap(), - )); +use crate::StarknetAccountData; - let signer = FieldElement::from_hex_be(SIGNER_KEY).expect("invalid signer hex"); - let signer = LocalWallet::from(SigningKey::from_secret_scalar(signer)); +type AccountType = SingleOwnerAccount, LocalWallet>; - let address = FieldElement::from_hex_be(SIGNER_ADDRESS).expect("invalid signer address"); - let chain_id = FieldElement::from_hex_be(CHAIN_ID).expect("invalid chain id"); +pub static STARKNET_ACCOUNT: OnceCell>> = OnceCell::new(); - let mut account = SingleOwnerAccount::new(provider, signer, address, chain_id, ExecutionEncoding::New); - account.set_block_id(BlockId::Tag(BlockTag::Pending)); - account - }; -); +pub fn get_starknet_account( + config: StarknetAccountData, +) -> anyhow::Result>> { + Ok(STARKNET_ACCOUNT + .get_or_init(|| { + let provider = JsonRpcClient::new(HttpTransport::new(config.starknet_url)); + let signer = LocalWallet::from(SigningKey::from_secret_scalar(config.signer_key)); + + let mut account = SingleOwnerAccount::new( + provider, + signer, + config.signer_address, + config.chain_id, + ExecutionEncoding::New, + ); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + + Arc::new(Mutex::new(account)) + }) + .clone()) +} pub async fn starknet_apply_diffs( world: FieldElement, @@ -54,6 +60,7 @@ pub async fn starknet_apply_diffs( program_output: Vec, program_hash: FieldElement, nonce: FieldElement, + starknet_account: StarknetAccountData, ) -> anyhow::Result { let calldata = chain![ vec![FieldElement::from(new_state.len() as u64 / 2)].into_iter(), @@ -63,8 +70,10 @@ pub async fn starknet_apply_diffs( ] .collect(); + let account = get_starknet_account(starknet_account)?; + let account = account.lock().await; let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; - let tx = STARKNET_ACCOUNT + let tx = account .execute(vec![Call { to: world, selector: get_selector_from_name("upgrade_state").expect("invalid selector"), @@ -82,14 +91,13 @@ pub async fn starknet_apply_diffs( bail!("Transaction not mined in {} seconds.", wait_for.as_secs()); } - let status = - match STARKNET_ACCOUNT.provider().get_transaction_status(tx.transaction_hash).await { - Ok(status) => status, - Err(_e) => { - sleep(Duration::from_secs(1)).await; - continue; - } - }; + let status = match account.provider().get_transaction_status(tx.transaction_hash).await { + Ok(status) => status, + Err(_e) => { + sleep(Duration::from_secs(1)).await; + continue; + } + }; break match status { TransactionStatus::Received => { diff --git a/crates/saya/core/src/error.rs b/crates/saya/core/src/error.rs index aba773abd5..54b7785298 100644 --- a/crates/saya/core/src/error.rs +++ b/crates/saya/core/src/error.rs @@ -14,6 +14,8 @@ pub enum Error { BlockNotFound(katana_primitives::block::BlockIdOrTag), // #[error(transparent)] // Snos(#[from] snos::error::SnOsError), + #[error("Invalid chain_id ")] + InvalidChainId, } pub type SayaResult = Result; diff --git a/crates/saya/core/src/lib.rs b/crates/saya/core/src/lib.rs index 60e4f891bd..fa982c5eb4 100644 --- a/crates/saya/core/src/lib.rs +++ b/crates/saya/core/src/lib.rs @@ -18,6 +18,7 @@ pub use prover_sdk::ProverAccessKey; use saya_provider::rpc::JsonRpcProvider; use saya_provider::Provider as SayaProvider; use serde::{Deserialize, Serialize}; +use starknet::core::utils::cairo_short_string_to_felt; use starknet_crypto::poseidon_hash_many; use tokio::fs::File; use tokio::io::AsyncWriteExt; @@ -45,8 +46,8 @@ pub struct SayaConfig { #[serde(deserialize_with = "url_deserializer")] pub katana_rpc: Url, #[serde(deserialize_with = "url_deserializer")] - pub url: Url, - pub private_key: ProverAccessKey, + pub prover_url: Url, + pub prover_key: ProverAccessKey, pub store_proofs: bool, pub start_block: u64, pub batch_size: usize, @@ -54,9 +55,20 @@ pub struct SayaConfig { pub world_address: FieldElement, pub fact_registry_address: FieldElement, pub skip_publishing_proof: bool, + pub starknet_account: StarknetAccountData, } -fn url_deserializer<'de, D>(deserializer: D) -> Result +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +pub struct StarknetAccountData { + #[serde(deserialize_with = "url_deserializer")] + pub starknet_url: Url, + #[serde(deserialize_with = "felt_string_deserializer")] + pub chain_id: FieldElement, + pub signer_address: FieldElement, + pub signer_key: FieldElement, +} + +pub fn url_deserializer<'de, D>(deserializer: D) -> Result where D: serde::Deserializer<'de>, { @@ -64,6 +76,14 @@ where Url::parse(&s).map_err(serde::de::Error::custom) } +pub fn felt_string_deserializer<'de, D>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, +{ + let s = String::deserialize(deserializer)?; + cairo_short_string_to_felt(&s).map_err(serde::de::Error::custom) +} + /// Saya. pub struct Saya { /// The main Saya configuration. @@ -120,8 +140,8 @@ impl Saya { let mut previous_block_state_root = block_before_the_first?.header.header.state_root; let prover_identifier = ProverIdentifier::Http(Arc::new(HttpProverParams { - prover_url: self.config.url.clone(), - prover_key: self.config.private_key.clone(), + prover_url: self.config.prover_url.clone(), + prover_key: self.config.prover_key.clone(), })); // The structure responsible for proving. @@ -348,6 +368,7 @@ impl Saya { let (transaction_hash, nonce_after) = verifier::verify( VerifierIdentifier::HerodotusStarknetSepolia(self.config.fact_registry_address), serialized_proof, + self.config.starknet_account.clone(), ) .await?; info!(target: LOG_TARGET, last_block, transaction_hash, "Block verified."); @@ -368,6 +389,7 @@ impl Saya { program_output, program_hash, nonce_after + 1u64.into(), + self.config.starknet_account.clone(), ) .await?; info!(target: LOG_TARGET, last_block, transaction_hash, "Diffs applied."); diff --git a/crates/saya/core/src/verifier/mod.rs b/crates/saya/core/src/verifier/mod.rs index 28323f3e30..5cad2bb643 100644 --- a/crates/saya/core/src/verifier/mod.rs +++ b/crates/saya/core/src/verifier/mod.rs @@ -10,6 +10,8 @@ use ::starknet::core::types::FieldElement; use serde::{Deserialize, Serialize}; +use crate::StarknetAccountData; + mod starknet; /// Supported verifiers. @@ -23,10 +25,11 @@ pub enum VerifierIdentifier { pub async fn verify( verifier: VerifierIdentifier, serialized_proof: Vec, + account: StarknetAccountData, ) -> anyhow::Result<(String, FieldElement)> { match verifier { VerifierIdentifier::HerodotusStarknetSepolia(fact_registry_address) => { - starknet::starknet_verify(fact_registry_address, serialized_proof).await + starknet::starknet_verify(fact_registry_address, serialized_proof, account).await } VerifierIdentifier::StoneLocal => unimplemented!("Stone Verifier not yet supported"), VerifierIdentifier::StarkwareEthereum => { diff --git a/crates/saya/core/src/verifier/starknet.rs b/crates/saya/core/src/verifier/starknet.rs index f948336575..3c8f78f38e 100644 --- a/crates/saya/core/src/verifier/starknet.rs +++ b/crates/saya/core/src/verifier/starknet.rs @@ -9,15 +9,20 @@ use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; use tokio::time::sleep; -use crate::dojo_os::STARKNET_ACCOUNT; +use crate::dojo_os::get_starknet_account; +use crate::StarknetAccountData; pub async fn starknet_verify( fact_registry_address: FieldElement, serialized_proof: Vec, + starknet_config: StarknetAccountData, ) -> anyhow::Result<(String, FieldElement)> { let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; - let nonce = STARKNET_ACCOUNT.get_nonce().await?; - let tx = STARKNET_ACCOUNT + let account = get_starknet_account(starknet_config)?; + let account = account.lock().await; + + let nonce = account.get_nonce().await?; + let tx = account .execute(vec![Call { to: fact_registry_address, selector: get_selector_from_name("verify_and_register_fact").expect("invalid selector"), @@ -35,14 +40,13 @@ pub async fn starknet_verify( anyhow::bail!("Transaction not mined in {} seconds.", wait_for.as_secs()); } - let status = - match STARKNET_ACCOUNT.provider().get_transaction_status(tx.transaction_hash).await { - Ok(status) => status, - Err(_e) => { - sleep(Duration::from_secs(1)).await; - continue; - } - }; + let status = match account.provider().get_transaction_status(tx.transaction_hash).await { + Ok(status) => status, + Err(_e) => { + sleep(Duration::from_secs(1)).await; + continue; + } + }; break match status { TransactionStatus::Received => { From 93ccf660f402cb4b3a04076a6bf27692a0406799 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:58:32 -0400 Subject: [PATCH 65/88] feat(torii-grpc): composite query (#2113) * feat(torii-grpc): composite query * chore --- crates/torii/grpc/src/server/mod.rs | 261 +++++++++++++----- .../grpc/src/server/tests/entities_test.rs | 2 +- 2 files changed, 198 insertions(+), 65 deletions(-) diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index 9d2ad65e56..f0394fb30b 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -297,28 +297,11 @@ impl DojoWorld { table: &str, model_relation_table: &str, entity_relation_column: &str, - keys_clause: proto::types::KeysClause, + keys_clause: &proto::types::KeysClause, limit: Option, offset: Option, ) -> Result<(Vec, u32), Error> { - let keys = keys_clause - .keys - .iter() - .map(|bytes| { - if bytes.is_empty() { - return Ok("0x[0-9a-fA-F]+".to_string()); - } - Ok(FieldElement::from_byte_slice_be(bytes) - .map(|felt| format!("{felt:#x}")) - .map_err(ParseError::FromByteSliceError)?) - }) - .collect::, Error>>()?; - let mut keys_pattern = format!("^{}", keys.join("/")); - - if keys_clause.pattern_matching == proto::types::PatternMatching::VariableLen as i32 { - keys_pattern += "(/0x[0-9a-fA-F]+)*"; - } - keys_pattern += "/$"; + let keys_pattern = build_keys_pattern(keys_clause)?; // total count of rows that matches keys_pattern without limit and offset let count_query = format!( @@ -431,28 +414,11 @@ impl DojoWorld { pub(crate) async fn events_by_keys( &self, - keys_clause: proto::types::KeysClause, + keys_clause: &proto::types::KeysClause, limit: Option, offset: Option, ) -> Result, Error> { - let keys = keys_clause - .keys - .iter() - .map(|bytes| { - if bytes.is_empty() { - return Ok("0x[0-9a-fA-F]+".to_string()); - } - Ok(FieldElement::from_byte_slice_be(bytes) - .map(|felt| format!("{felt:#x}")) - .map_err(ParseError::FromByteSliceError)?) - }) - .collect::, Error>>()?; - let mut keys_pattern = format!("^{}", keys.join("/")); - - if keys_clause.pattern_matching == proto::types::PatternMatching::VariableLen as i32 { - keys_pattern += "(/0x[0-9a-fA-F]+)*"; - } - keys_pattern += "/$"; + let keys_pattern = build_keys_pattern(keys_clause)?; let events_query = r#" SELECT keys, data, transaction_hash @@ -491,19 +457,7 @@ impl DojoWorld { .value_type .ok_or(QueryError::MissingParam("value_type".into()))?; - let comparison_value = match value_type { - proto::types::value::ValueType::StringValue(string) => string, - proto::types::value::ValueType::IntValue(int) => int.to_string(), - proto::types::value::ValueType::UintValue(uint) => uint.to_string(), - proto::types::value::ValueType::BoolValue(bool) => { - if bool { - "1".to_string() - } else { - "0".to_string() - } - } - _ => return Err(QueryError::UnsupportedQuery.into()), - }; + let comparison_value = value_to_string(&value_type)?; let models_query = format!( r#" @@ -558,15 +512,158 @@ impl DojoWorld { async fn query_by_composite( &self, - _table: &str, - _model_relation_table: &str, - _entity_relation_column: &str, - _composite: proto::types::CompositeClause, - _limit: Option, - _offset: Option, + table: &str, + model_relation_table: &str, + entity_relation_column: &str, + composite: proto::types::CompositeClause, + limit: Option, + offset: Option, ) -> Result<(Vec, u32), Error> { - // TODO: Implement - Err(QueryError::UnsupportedQuery.into()) + // different types of clauses + let mut where_clauses = Vec::new(); + let mut model_clauses: HashMap> = + HashMap::new(); + let mut having_clauses = Vec::new(); + + // bind valeus for prepared statement + let mut bind_values = Vec::new(); + + for clause in composite.clauses { + match clause.clause_type.unwrap() { + ClauseType::HashedKeys(hashed_keys) => { + let ids = hashed_keys + .hashed_keys + .iter() + .map(|id| { + Ok(FieldElement::from_byte_slice_be(id) + .map(|id| format!("{table}.id = '{id:#x}'")) + .map_err(ParseError::FromByteSliceError)?) + }) + .collect::, Error>>()?; + where_clauses.push(format!("({})", ids.join(" OR "))); + } + ClauseType::Keys(keys) => { + let keys_pattern = build_keys_pattern(&keys)?; + where_clauses.push(format!("{table}.keys REGEXP '{keys_pattern}'")); + } + ClauseType::Member(member) => { + let comparison_operator = + ComparisonOperator::from_repr(member.operator as usize) + .expect("invalid comparison operator"); + let value = member.value.unwrap().value_type.unwrap(); + let comparison_value = value_to_string(&value)?; + + let column_name = format!("external_{}", member.member); + + model_clauses.entry(member.model.clone()).or_default().push(( + column_name, + comparison_operator, + comparison_value, + )); + + let model_id = + get_selector_from_name(&member.model).map_err(ParseError::NonAsciiName)?; + having_clauses.push(format!("INSTR(model_ids, '{:#x}') > 0", model_id)); + } + _ => return Err(QueryError::UnsupportedQuery.into()), + } + } + + let mut join_clauses = Vec::new(); + for (model, clauses) in model_clauses { + let model_conditions = clauses + .into_iter() + .map(|(column, op, value)| { + bind_values.push(value); + format!("{}.{} {} ?", model, column, op) + }) + .collect::>() + .join(" AND "); + + join_clauses.push(format!( + "JOIN {} ON {}.id = {}.entity_id AND ({})", + model, table, model, model_conditions + )); + } + + let join_clause = join_clauses.join(" "); + let where_clause = if !where_clauses.is_empty() { + format!("WHERE {}", where_clauses.join(" AND ")) + } else { + String::new() + }; + let having_clause = if !having_clauses.is_empty() { + format!("HAVING {}", having_clauses.join(" AND ")) + } else { + String::new() + }; + + let count_query = format!( + r#" + SELECT COUNT(DISTINCT {table}.id) + FROM {table} + {join_clause} + {where_clause} + "# + ); + + let mut count_query = sqlx::query_scalar::<_, u32>(&count_query); + for value in &bind_values { + count_query = count_query.bind(value); + } + + let total_count = count_query.fetch_one(&self.pool).await?; + + if total_count == 0 { + return Ok((Vec::new(), 0)); + } + + let query = format!( + r#" + SELECT {table}.id, group_concat({model_relation_table}.model_id) as model_ids + FROM {table} + JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id + {join_clause} + {where_clause} + GROUP BY {table}.id + {having_clause} + ORDER BY {table}.event_id DESC + LIMIT ? OFFSET ? + "# + ); + + let mut db_query = sqlx::query_as(&query); + for value in bind_values { + db_query = db_query.bind(value); + } + db_query = db_query.bind(limit.unwrap_or(u32::MAX)).bind(offset.unwrap_or(0)); + + let db_entities: Vec<(String, String)> = db_query.fetch_all(&self.pool).await?; + + let mut entities = Vec::with_capacity(db_entities.len()); + for (entity_id, models_str) in &db_entities { + let model_ids: Vec<&str> = models_str.split(',').collect(); + let schemas = self.model_cache.schemas(model_ids).await?; + + let (entity_query, arrays_queries) = build_sql_query( + &schemas, + table, + entity_relation_column, + Some(&format!("{table}.id = ?")), + Some(&format!("{table}.id = ?")), + )?; + + let row = sqlx::query(&entity_query).bind(entity_id).fetch_one(&self.pool).await?; + let mut arrays_rows = HashMap::new(); + for (name, query) in arrays_queries { + let rows = sqlx::query(&query).bind(entity_id).fetch_all(&self.pool).await?; + arrays_rows.insert(name, rows); + } + + entities.push(map_row_to_entity(&row, &arrays_rows, &schemas)?); + } + + Ok((entities, total_count)) } pub async fn model_metadata(&self, model: &str) -> Result { @@ -669,7 +766,7 @@ impl DojoWorld { ENTITIES_TABLE, ENTITIES_MODEL_RELATION_TABLE, ENTITIES_ENTITY_RELATION_COLUMN, - keys, + &keys, Some(query.limit), Some(query.offset), ) @@ -746,7 +843,7 @@ impl DojoWorld { EVENT_MESSAGES_TABLE, EVENT_MESSAGES_MODEL_RELATION_TABLE, EVENT_MESSAGES_ENTITY_RELATION_COLUMN, - keys, + &keys, Some(query.limit), Some(query.offset), ) @@ -783,9 +880,9 @@ impl DojoWorld { async fn retrieve_events( &self, - query: proto::types::EventQuery, + query: &proto::types::EventQuery, ) -> Result { - let events = match query.keys { + let events = match &query.keys { None => self.events_all(query.limit, query.offset).await?, Some(keys) => self.events_by_keys(keys, Some(query.limit), Some(query.offset)).await?, }; @@ -838,6 +935,42 @@ fn map_row_to_entity( Ok(proto::types::Entity { hashed_keys: hashed_keys.to_bytes_be().to_vec(), models }) } +// this builds a sql safe regex pattern to match against for keys +fn build_keys_pattern(clause: &proto::types::KeysClause) -> Result { + let keys = clause + .keys + .iter() + .map(|bytes| { + if bytes.is_empty() { + return Ok("0x[0-9a-fA-F]+".to_string()); + } + Ok(FieldElement::from_byte_slice_be(bytes) + .map(|felt| format!("{felt:#x}")) + .map_err(ParseError::FromByteSliceError)?) + }) + .collect::, Error>>()?; + let mut keys_pattern = format!("^{}", keys.join("/")); + + if clause.pattern_matching == proto::types::PatternMatching::VariableLen as i32 { + keys_pattern += "(/0x[0-9a-fA-F]+)*"; + } + keys_pattern += "/$"; + + Ok(keys_pattern) +} + +fn value_to_string(value: &proto::types::value::ValueType) -> Result { + match value { + proto::types::value::ValueType::StringValue(string) => Ok(string.clone()), + proto::types::value::ValueType::IntValue(int) => Ok(int.to_string()), + proto::types::value::ValueType::UintValue(uint) => Ok(uint.to_string()), + proto::types::value::ValueType::BoolValue(bool) => { + Ok(if *bool { "1".to_string() } else { "0".to_string() }) + } + _ => Err(QueryError::UnsupportedQuery.into()), + } +} + type ServiceResult = Result, Status>; type SubscribeModelsResponseStream = Pin> + Send>>; @@ -943,7 +1076,7 @@ impl proto::world::world_server::World for DojoWorld { .ok_or_else(|| Status::invalid_argument("Missing query argument"))?; let events = - self.retrieve_events(query).await.map_err(|e| Status::internal(e.to_string()))?; + self.retrieve_events(&query).await.map_err(|e| Status::internal(e.to_string()))?; Ok(Response::new(events)) } diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 9761d86335..3e4b5081f1 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -118,7 +118,7 @@ async fn test_entities_queries() { "entities", "entity_model", "entity_id", - KeysClause { + &KeysClause { keys: vec![account.address().to_bytes_be().to_vec()], pattern_matching: 0, models: vec![], From 622d241e994a51b0d59327767d1567b29faff882 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:02:52 -0400 Subject: [PATCH 66/88] fix(torii-core): update entity timestamp on update (#2118) * fix(torii-core): update entity timestamp on update * chore --- crates/torii/core/src/sql.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index d7a692c728..2f972c7c43 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -169,8 +169,8 @@ impl Sql { let keys_str = felts_sql_string(&keys); let insert_entities = "INSERT INTO entities (id, keys, event_id, executed_at) VALUES (?, \ ?, ?, ?) ON CONFLICT(id) DO UPDATE SET \ - executed_at=EXCLUDED.executed_at, event_id=EXCLUDED.event_id \ - RETURNING *"; + updated_at=CURRENT_TIMESTAMP, executed_at=EXCLUDED.executed_at, \ + event_id=EXCLUDED.event_id RETURNING *"; let mut entity_updated: EntityUpdated = sqlx::query_as(insert_entities) .bind(&entity_id) .bind(&keys_str) From 6193f22ee774c22b0fe4dcd05bb0f786f2baae47 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:57:29 -0400 Subject: [PATCH 67/88] refactor(torii-client): remove storage packed size check (#2116) * refactor: remove invalid model data length check * chroe --- crates/torii/client/src/client/error.rs | 5 --- crates/torii/client/src/client/storage.rs | 54 ----------------------- 2 files changed, 59 deletions(-) diff --git a/crates/torii/client/src/client/error.rs b/crates/torii/client/src/client/error.rs index 1efc06c429..3d163da185 100644 --- a/crates/torii/client/src/client/error.rs +++ b/crates/torii/client/src/client/error.rs @@ -8,11 +8,6 @@ pub enum Error { SubscriptionUninitialized, #[error("Unknown model: {0}")] UnknownModel(String), - #[error( - "Invalid amount of values for model {model}. Expected {expected_value_len} values, got \ - {actual_value_len}" - )] - InvalidModelValuesLen { model: String, expected_value_len: usize, actual_value_len: usize }, #[error("Parsing error: {0}")] Parse(#[from] ParseError), #[error(transparent)] diff --git a/crates/torii/client/src/client/storage.rs b/crates/torii/client/src/client/storage.rs index 48541a2314..cc20ac2d92 100644 --- a/crates/torii/client/src/client/storage.rs +++ b/crates/torii/client/src/client/storage.rs @@ -1,4 +1,3 @@ -use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use std::sync::Arc; @@ -86,28 +85,6 @@ impl ModelStorage { raw_keys: Vec, raw_values: Vec, ) -> Result<(), Error> { - let model_name = - parse_cairo_short_string(&model).map_err(ParseError::ParseCairoShortString)?; - - let model_packed_size = self - .metadata - .read() - .model(&model_name) - .map(|model| model.packed_size) - .ok_or(Error::UnknownModel(model_name.clone()))?; - - match raw_values.len().cmp(&(model_packed_size as usize)) { - Ordering::Greater | Ordering::Less => { - return Err(Error::InvalidModelValuesLen { - model: model_name, - actual_value_len: raw_values.len(), - expected_value_len: model_packed_size as usize, - }); - } - - Ordering::Equal => {} - } - let storage_addresses = self.get_model_storage_addresses(model, &raw_keys)?; self.set_storages_at(storage_addresses.into_iter().zip(raw_values).collect()); self.index_model(model, raw_keys); @@ -174,7 +151,6 @@ mod tests { use starknet::core::utils::cairo_short_string_to_felt; use starknet::macros::felt; - use crate::client::error::Error; use crate::utils::compute_all_storage_addresses; fn create_dummy_metadata() -> WorldMetadata { @@ -199,36 +175,6 @@ mod tests { super::ModelStorage::new(metadata) } - #[test] - fn err_if_set_values_too_many() { - let storage = create_dummy_storage(); - let keys = vec![felt!("0x12345")]; - let values = vec![felt!("1"), felt!("2"), felt!("3"), felt!("4"), felt!("5")]; - let model = cairo_short_string_to_felt("Position").unwrap(); - let result = storage.set_model_storage(model, keys, values); - - assert!(storage.storage.read().is_empty()); - matches!( - result, - Err(Error::InvalidModelValuesLen { actual_value_len: 5, expected_value_len: 4, .. }) - ); - } - - #[test] - fn err_if_set_values_too_few() { - let storage = create_dummy_storage(); - let keys = vec![felt!("0x12345")]; - let values = vec![felt!("1"), felt!("2")]; - let model = cairo_short_string_to_felt("Position").unwrap(); - let result = storage.set_model_storage(model, keys, values); - - assert!(storage.storage.read().is_empty()); - matches!( - result, - Err(Error::InvalidModelValuesLen { actual_value_len: 2, expected_value_len: 4, .. }) - ); - } - #[test] fn set_and_get_model_value() { let storage = create_dummy_storage(); From ed0c67737996d24f3cd326fd360d7aec67a18c9c Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:57:39 -0400 Subject: [PATCH 68/88] refactor(torii-grpc): use Option for felt as keys wildcard (#2119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: use Option for felt as wildcard * reduce code footprint * clippy😡 * fmt🤬 --- .../torii/grpc/src/server/subscriptions/entity.rs | 15 ++++++--------- .../torii/grpc/src/server/subscriptions/event.rs | 15 ++++++--------- .../src/server/subscriptions/event_message.rs | 15 ++++++--------- crates/torii/grpc/src/types/mod.rs | 14 ++++++++++---- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index a62ee8dd69..b93385ad07 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -138,17 +138,14 @@ impl Service { let sub_key = clause.keys.get(idx); match sub_key { - Some(sub_key) => { - if sub_key == &FieldElement::ZERO { - true - } else { - key == sub_key - } - } - // we overflowed the subscriber key pattern + // the key in the subscriber must match the key of the entity + // athis index + Some(Some(sub_key)) => key == sub_key, + // otherwise, if we have no key we should automatically match. + // or.. we overflowed the subscriber key pattern // but we're in VariableLen pattern matching // so we should match all next keys - None => true, + _ => true, } }) { continue; diff --git a/crates/torii/grpc/src/server/subscriptions/event.rs b/crates/torii/grpc/src/server/subscriptions/event.rs index 6a0aa38924..856f2211e6 100644 --- a/crates/torii/grpc/src/server/subscriptions/event.rs +++ b/crates/torii/grpc/src/server/subscriptions/event.rs @@ -104,17 +104,14 @@ impl Service { // if we have a key in the subscriber, it must match the key in the event // unless its empty, which is a wildcard match sub_key { - Some(sub_key) => { - if sub_key == &FieldElement::ZERO { - true - } else { - key == sub_key - } - } - // we overflowed the subscriber key pattern + // the key in the subscriber must match the key of the entity + // athis index + Some(Some(sub_key)) => key == sub_key, + // otherwise, if we have no key we should automatically match. + // or.. we overflowed the subscriber key pattern // but we're in VariableLen pattern matching // so we should match all next keys - None => true, + _ => true, } }) { continue; diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 0b4b490ded..b345710bf0 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -137,17 +137,14 @@ impl Service { let sub_key = clause.keys.get(idx); match sub_key { - Some(sub_key) => { - if sub_key == &FieldElement::ZERO { - true - } else { - key == sub_key - } - } - // we overflowed the subscriber key pattern + // the key in the subscriber must match the key of the entity + // athis index + Some(Some(sub_key)) => key == sub_key, + // otherwise, if we have no key we should automatically match. + // or.. we overflowed the subscriber key pattern // but we're in VariableLen pattern matching // so we should match all next keys - None => true, + _ => true, } }) { continue; diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index cf00ede93f..3840daa1f0 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -43,7 +43,7 @@ pub struct ModelKeysClause { #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct KeysClause { - pub keys: Vec, + pub keys: Vec>, pub pattern_matching: PatternMatching, pub models: Vec, } @@ -184,7 +184,11 @@ impl From for PatternMatching { impl From for proto::types::KeysClause { fn from(value: KeysClause) -> Self { Self { - keys: value.keys.iter().map(|k| k.to_bytes_be().into()).collect(), + keys: value + .keys + .iter() + .map(|k| k.map_or(Vec::new(), |k| k.to_bytes_be().into())) + .collect(), pattern_matching: value.pattern_matching as i32, models: value.models, } @@ -198,8 +202,10 @@ impl TryFrom for KeysClause { let keys = value .keys .iter() - .map(|k| FieldElement::from_byte_slice_be(k)) - .collect::, _>>()?; + .map(|k| { + if k.is_empty() { Ok(None) } else { Ok(Some(FieldElement::from_byte_slice_be(k)?)) } + }) + .collect::>, _>>()?; Ok(Self { keys, pattern_matching: value.pattern_matching().into(), models: value.models }) } From 8f5ee1d525cf22b7db7afc0d1e119e68257a20e5 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:01:16 -0400 Subject: [PATCH 69/88] fix(torii-core): silently retry fetching pending txn until we have it (#2125) * fix(torii-core): silently retry fetching pending txn until we have it * fmt * chore: warn message --- crates/torii/core/src/engine.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 530e24eb87..409c879ef1 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -175,10 +175,11 @@ impl Engine

{ match e.to_string().as_str() { "TransactionHashNotFound" => { // We failed to fetch the transaction, which is because - // the transaction might not have passed the validation stage. - // So we can safely ignore this transaction and not process it, as it - // rejected. - warn!(target: LOG_TARGET, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Ignored failed pending transaction."); + // the transaction might not have been processed fast enough by the + // provider. So we can fail silently and try + // again in the next iteration. + warn!(target: LOG_TARGET, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Retrieving pending transaction receipt."); + return Ok(pending_block_tx); } _ => { error!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction."); From f1348833a9bfcbd505d4121fbf4f900d78421eee Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:48:09 +0200 Subject: [PATCH 70/88] fix unsafe precondition check (#2129) * bump rust to 1.79 * fix clippy * fix clippy * fix ensure wasm * revert rust version --- .github/workflows/ci.yml | 4 +++- crates/dojo-world/src/manifest/mod.rs | 2 +- crates/katana/core/src/service/messaging/ethereum.rs | 2 ++ .../katana/executor/src/implementation/blockifier/mod.rs | 6 ++++-- .../executor/src/implementation/blockifier/utils.rs | 6 ++++-- crates/katana/executor/tests/executor.rs | 6 +++--- crates/katana/primitives/src/genesis/mod.rs | 4 ++-- .../katana/storage/provider/src/providers/fork/state.rs | 4 ++-- crates/sozo/ops/src/migration/migrate.rs | 2 +- crates/sozo/ops/src/migration/mod.rs | 2 ++ crates/torii/core/src/model.rs | 8 ++++---- crates/torii/graphql/src/tests/mod.rs | 1 + crates/torii/libp2p/src/client/events.rs | 1 + crates/torii/libp2p/src/server/mod.rs | 2 +- 14 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b7a4170ab..68de387ca9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 + - name: Install wasm32 target + run: rustup target add wasm32-unknown-unknown - run: cargo build -r --target wasm32-unknown-unknown -p torii-client ensure-windows: @@ -74,7 +76,7 @@ jobs: with: repo-token: ${{ secrets.github_token }} - run: cargo build --target x86_64-pc-windows-msvc --bins - + # This job is used to ensure the built katana image doesn't depend on any # libraries that don't exist in the base docker image we use for distribution ensure-docker: diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index d3906595ab..2ce8178ea3 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -369,7 +369,7 @@ impl DeploymentManifest { // #[async_trait] // impl RemoteLoadable

for DeploymentManifest {} -async fn get_remote_models_and_contracts( +async fn get_remote_models_and_contracts

( world: FieldElement, provider: P, ) -> Result<(Vec>, Vec>), AbstractManifestError> diff --git a/crates/katana/core/src/service/messaging/ethereum.rs b/crates/katana/core/src/service/messaging/ethereum.rs index 40990876dc..90267b8a77 100644 --- a/crates/katana/core/src/service/messaging/ethereum.rs +++ b/crates/katana/core/src/service/messaging/ethereum.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use std::collections::HashMap; use std::str::FromStr; use std::sync::Arc; diff --git a/crates/katana/executor/src/implementation/blockifier/mod.rs b/crates/katana/executor/src/implementation/blockifier/mod.rs index 617624bf0b..94a344aab8 100644 --- a/crates/katana/executor/src/implementation/blockifier/mod.rs +++ b/crates/katana/executor/src/implementation/blockifier/mod.rs @@ -98,8 +98,10 @@ impl<'a> StarknetVMProcessor<'a> { // TODO: should we enforce the gas price to not be 0, // as there's a flag to disable gas uasge instead? - let eth_l1_gas_price = unsafe { NonZeroU128::new_unchecked(header.gas_prices.eth) }; - let strk_l1_gas_price = unsafe { NonZeroU128::new_unchecked(header.gas_prices.strk) }; + let eth_l1_gas_price = + NonZeroU128::new(header.gas_prices.eth).unwrap_or(NonZeroU128::new(1).unwrap()); + let strk_l1_gas_price = + NonZeroU128::new(header.gas_prices.strk).unwrap_or(NonZeroU128::new(1).unwrap()); // TODO: which values is correct for those one? let eth_l1_data_gas_price = eth_l1_gas_price; diff --git a/crates/katana/executor/src/implementation/blockifier/utils.rs b/crates/katana/executor/src/implementation/blockifier/utils.rs index 0298d8426f..6a22e5b9b4 100644 --- a/crates/katana/executor/src/implementation/blockifier/utils.rs +++ b/crates/katana/executor/src/implementation/blockifier/utils.rs @@ -363,8 +363,10 @@ pub fn block_context_from_envs(block_env: &BlockEnv, cfg_env: &CfgEnv) -> BlockC strk_fee_token_address: to_blk_address(cfg_env.fee_token_addresses.strk), }; - let eth_l1_gas_price = unsafe { NonZeroU128::new_unchecked(block_env.l1_gas_prices.eth) }; - let strk_l1_gas_price = unsafe { NonZeroU128::new_unchecked(block_env.l1_gas_prices.strk) }; + let eth_l1_gas_price = + NonZeroU128::new(block_env.l1_gas_prices.eth).unwrap_or(NonZeroU128::new(1).unwrap()); + let strk_l1_gas_price = + NonZeroU128::new(block_env.l1_gas_prices.strk).unwrap_or(NonZeroU128::new(1).unwrap()); let gas_prices = GasPrices { eth_l1_gas_price, diff --git a/crates/katana/executor/tests/executor.rs b/crates/katana/executor/tests/executor.rs index 1573174fc7..6e1bbf46a0 100644 --- a/crates/katana/executor/tests/executor.rs +++ b/crates/katana/executor/tests/executor.rs @@ -305,15 +305,15 @@ fn test_executor_with_valid_blocks_impl( let actual_storage_updates = states.state_updates.storage_updates; assert_eq!(actual_storage_updates.len(), 3, "only 3 contracts whose storage should be updated"); assert!( - actual_storage_updates.get(&DEFAULT_FEE_TOKEN_ADDRESS).is_some(), + actual_storage_updates.contains_key(&DEFAULT_FEE_TOKEN_ADDRESS), "fee token storage must get updated" ); assert!( - actual_storage_updates.get(&(deployed_contract.into())).is_some(), + actual_storage_updates.contains_key(&(deployed_contract.into())), "deployed contract storage must get updated" ); assert!( - actual_storage_updates.get(&new_acc).is_some(), + actual_storage_updates.contains_key(&new_acc), "newly deployed account storage must get updated" ); } diff --git a/crates/katana/primitives/src/genesis/mod.rs b/crates/katana/primitives/src/genesis/mod.rs index d8c46b5170..78e817801d 100644 --- a/crates/katana/primitives/src/genesis/mod.rs +++ b/crates/katana/primitives/src/genesis/mod.rs @@ -530,7 +530,7 @@ mod tests { ); assert!( - actual_state_updates.declared_sierra_classes.get(&fee_token.class_hash).is_none(), + !actual_state_updates.declared_sierra_classes.contains_key(&fee_token.class_hash), "The default fee token class doesnt have a sierra class" ); @@ -553,7 +553,7 @@ mod tests { ); assert!( - actual_state_updates.declared_sierra_classes.get(&ud.class_hash).is_none(), + !actual_state_updates.declared_sierra_classes.contains_key(&ud.class_hash), "The default universal deployer class doesnt have a sierra class" ); diff --git a/crates/katana/storage/provider/src/providers/fork/state.rs b/crates/katana/storage/provider/src/providers/fork/state.rs index 793dc540d2..83e099c28e 100644 --- a/crates/katana/storage/provider/src/providers/fork/state.rs +++ b/crates/katana/storage/provider/src/providers/fork/state.rs @@ -188,7 +188,7 @@ impl StateProvider for ForkedSnapshot { impl ContractClassProvider for ForkedSnapshot { fn sierra_class(&self, hash: ClassHash) -> ProviderResult> { - if self.inner.compiled_class_hashes.get(&hash).is_some() { + if self.inner.compiled_class_hashes.contains_key(&hash) { Ok(self.classes.sierra_classes.read().get(&hash).cloned()) } else { ContractClassProvider::sierra_class(&self.inner.db, hash) @@ -206,7 +206,7 @@ impl ContractClassProvider for ForkedSnapshot { } fn class(&self, hash: ClassHash) -> ProviderResult> { - if self.inner.compiled_class_hashes.get(&hash).is_some() { + if self.inner.compiled_class_hashes.contains_key(&hash) { Ok(self.classes.compiled_classes.read().get(&hash).cloned()) } else { ContractClassProvider::class(&self.inner.db, hash) diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 420c269237..1ab610e24e 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -781,7 +781,7 @@ pub async fn update_manifests_and_abis( }; local_manifest.world.inner.address = Some(world_address); - local_manifest.world.inner.seed = salt.to_owned(); + salt.clone_into(&mut local_manifest.world.inner.seed); // when the migration has not been applied because in `plan` mode or because of an error, // the `migration_output` is empty. diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index 21351004a2..915fb5fa5e 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -172,11 +172,13 @@ where Ok(()) } +#[allow(dead_code)] enum ContractDeploymentOutput { AlreadyDeployed(FieldElement), Output(DeployOutput), } +#[allow(dead_code)] enum ContractUpgradeOutput { Output(UpgradeOutput), } diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index fff8ae6c53..39a28aad14 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -474,7 +474,7 @@ pub fn map_row_to_ty( let option = row.try_get::(&column_name)?; enum_ty.set_option(&option)?; - let path = [path, &name].join("$"); + let path = [path, name].join("$"); for option in &mut enum_ty.options { map_row_to_ty(&path, &option.name, &mut option.ty, row, arrays_rows)?; } @@ -483,21 +483,21 @@ pub fn map_row_to_ty( // struct can be the main entrypoint to our model schema // so we dont format the table name if the path is empty let path = - if path.is_empty() { struct_ty.name.clone() } else { [path, &name].join("$") }; + if path.is_empty() { struct_ty.name.clone() } else { [path, name].join("$") }; for member in &mut struct_ty.children { map_row_to_ty(&path, &member.name, &mut member.ty, row, arrays_rows)?; } } Ty::Tuple(ty) => { - let path = [path, &name].join("$"); + let path = [path, name].join("$"); for (i, member) in ty.iter_mut().enumerate() { map_row_to_ty(&path, &format!("_{}", i), member, row, arrays_rows)?; } } Ty::Array(ty) => { - let path = [path, &name].join("$"); + let path = [path, name].join("$"); // filter by entity id in case we have multiple entities let rows = arrays_rows .get(&path) diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index ddfc8fa182..4a39faae1d 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -180,6 +180,7 @@ pub struct Content { pub socials: Vec, } +#[allow(dead_code)] #[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] pub struct Metadata { diff --git a/crates/torii/libp2p/src/client/events.rs b/crates/torii/libp2p/src/client/events.rs index 120caa3376..d47a2e5330 100644 --- a/crates/torii/libp2p/src/client/events.rs +++ b/crates/torii/libp2p/src/client/events.rs @@ -1,6 +1,7 @@ use gossipsub::Event as GossipsubEvent; use libp2p::{gossipsub, identify, ping}; +#[allow(dead_code)] #[derive(Debug)] pub(crate) enum ClientEvent { Gossipsub(GossipsubEvent), diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index 4a78db033b..83803a55ab 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -601,7 +601,7 @@ pub fn parse_value_to_ty(value: &PrimitiveType, ty: &mut Ty) -> Result<(), Error } }, Ty::ByteArray(s) => { - *s = string.clone(); + s.clone_from(string); } _ => { return Err(Error::InvalidMessageError(format!( From 89b883584fd3ba5c36b66e09428495f39e88f00b Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Thu, 4 Jul 2024 01:36:00 +0800 Subject: [PATCH 71/88] chore: remove `dbg!` macro (#2131) --- crates/dojo-world/src/metadata_test.rs | 2 -- crates/torii/grpc/src/server/tests/entities_test.rs | 2 -- 2 files changed, 4 deletions(-) diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index e564e3a8e4..b8f430072e 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -173,10 +173,8 @@ async fn get_full_dojo_metadata_from_workspace() { let artifacts = get_artifacts_from_manifest(&manifest_dir); - dbg!(&artifacts); for (abi_subdir, name) in artifacts { let resource = dojo_metadata.resources_artifacts.get(&name); - dbg!(&dojo_metadata.resources_artifacts); assert!(resource.is_some(), "bad resource metadata for {}", name); let resource = resource.unwrap(); diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 3e4b5081f1..9c3d2a710d 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -55,8 +55,6 @@ async fn test_entities_queries() { prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); migration.resolve_variable(migration.world_address().unwrap()).unwrap(); - dbg!(&migration); - let sequencer = TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; let provider = Arc::new(JsonRpcClient::new(HttpTransport::new(sequencer.url()))); From e8539d5b199efbd51c89c75da32f6592de5d9262 Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Wed, 3 Jul 2024 18:35:18 -0500 Subject: [PATCH 72/88] Prepare release: v0.7.3 (#2133) --- Cargo.lock | 92 ++++++++++---------- Cargo.toml | 2 +- crates/dojo-core/Scarb.lock | 2 +- crates/dojo-core/Scarb.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- crates/torii/types-test/Scarb.lock | 2 +- crates/torii/types-test/Scarb.toml | 2 +- examples/spawn-and-move/Scarb.lock | 2 +- examples/spawn-and-move/Scarb.toml | 2 +- 9 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1b34f9938..9d12f17185 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1663,7 +1663,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "clap", @@ -4177,7 +4177,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "reqwest 0.12.5", @@ -5046,7 +5046,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "async-trait", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", @@ -5064,15 +5064,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.3-alpha.1" +version = "0.7.3" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.3-alpha.1" +version = "0.7.3" [[package]] name = "dojo-lang" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -5123,7 +5123,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "cairo-lang-language-server", "clap", @@ -5132,7 +5132,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "hyper 0.14.29", @@ -5150,7 +5150,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "assert_fs", @@ -5184,7 +5184,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", "crypto-bigint", @@ -5200,7 +5200,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "assert_fs", @@ -5239,7 +5239,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8358,7 +8358,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-primitives", "anyhow", @@ -8366,7 +8366,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.3-alpha.1", + "common 0.7.3", "console", "dojo-metrics", "katana-core", @@ -8386,7 +8386,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -8399,7 +8399,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "bytes", "katana-primitives", @@ -8407,7 +8407,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "proc-macro2", "quote", @@ -8417,7 +8417,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-contract 0.1.0", "alloy-network 0.1.0", @@ -8464,7 +8464,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8486,7 +8486,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-primitives", "anyhow", @@ -8513,7 +8513,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-primitives", "anyhow", @@ -8537,7 +8537,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-primitives", "anyhow", @@ -8563,7 +8563,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy", "anyhow", @@ -8606,7 +8606,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8617,7 +8617,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-primitives", "anyhow", @@ -8638,7 +8638,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "katana-executor", @@ -8650,7 +8650,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "assert_fs", @@ -8668,7 +8668,7 @@ dependencies = [ [[package]] name = "katana-slot-controller" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "account_sdk", "alloy-primitives", @@ -8684,7 +8684,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "futures", "rayon", @@ -12122,7 +12122,7 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "runner-macro" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "quote", "syn 2.0.68", @@ -12390,7 +12390,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "cairo-proof-parser", @@ -12410,7 +12410,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "async-trait", @@ -12453,7 +12453,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "alloy-primitives", "anyhow", @@ -12625,7 +12625,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "clap", "katana-primitives", @@ -13306,7 +13306,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "account_sdk", "anyhow", @@ -13367,7 +13367,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "assert_fs", @@ -13415,7 +13415,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "starknet", @@ -14713,7 +14713,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "async-trait", @@ -14721,7 +14721,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.3-alpha.1", + "common 0.7.3", "ctrlc", "dojo-metrics", "dojo-types", @@ -14758,7 +14758,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "async-trait", "camino", @@ -14786,7 +14786,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "async-trait", @@ -14824,7 +14824,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "async-graphql", @@ -14864,7 +14864,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "bytes", "camino", @@ -14908,7 +14908,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "anyhow", "async-trait", @@ -14944,7 +14944,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.3-alpha.1" +version = "0.7.3" dependencies = [ "base64 0.21.7", "http 0.2.12", @@ -15246,7 +15246,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.3-alpha.1" +version = "0.7.3" [[package]] name = "u256-literal" diff --git a/Cargo.toml b/Cargo.toml index 1dbe870501..53909fcbcc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.3-alpha.1" +version = "0.7.3" [profile.performance] codegen-units = 1 diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index f6e3d948fe..137f6cc0e0 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.2" +version = "0.7.3" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 98a8f89e3f..96ca4ac712 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -2,7 +2,7 @@ cairo-version = "=2.6.3" description = "The Dojo Core library for autonomous worlds." name = "dojo" -version = "0.7.2" +version = "0.7.3" [dependencies] dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.2" } diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index 9b02af2242..bc5896c2f2 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.3-alpha.1" +version = "0.7.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index eb11adee81..20ffa2fec2 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.2" +version = "0.7.3" dependencies = [ "dojo_plugin", ] diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 301b44469f..686b66e17c 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "2.4.0" name = "types_test" -version = "0.7.2" +version = "0.7.3" [cairo] sierra-replace-ids = true diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index aeef927011..dd1c6d6c47 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -3,7 +3,7 @@ version = 1 [[package]] name = "dojo" -version = "0.7.2" +version = "0.7.3" dependencies = [ "dojo_plugin", ] diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index a122b55aca..784a0233db 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,7 +1,7 @@ [package] cairo-version = "=2.6.3" name = "dojo_examples" -version = "0.7.2" +version = "0.7.3" # Use the prelude with the less imports as possible # from corelib. edition = "2023_10" From b2a4df6c7d8e9da9a07bbe4a356dfd11a2696cfb Mon Sep 17 00:00:00 2001 From: Oche Date: Fri, 5 Jul 2024 16:17:01 +0100 Subject: [PATCH 73/88] feat: sozo init remove git (#2139) * feat: sozo init remove git * refac: remove `.github` folder --- bin/sozo/src/commands/init.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bin/sozo/src/commands/init.rs b/bin/sozo/src/commands/init.rs index 435751ac95..f0e6c8b8c5 100644 --- a/bin/sozo/src/commands/init.rs +++ b/bin/sozo/src/commands/init.rs @@ -15,6 +15,9 @@ pub struct InitArgs { #[arg(help = "Parse a full git url or a url path", default_value = "dojoengine/dojo-starter")] template: String, + + #[arg(long, help = "Initialize a new Git repository")] + git: bool, } impl InitArgs { @@ -58,7 +61,7 @@ impl InitArgs { set_current_dir(&target_dir)?; // Modify the git history. - modify_git_history(&repo_url)?; + modify_git_history(&repo_url, self.git)?; config.ui().print("\n🎉 Successfully created a new ⛩️ Dojo project!"); @@ -83,19 +86,24 @@ fn clone_repo(url: &str, path: &Path, config: &Config) -> Result<()> { Ok(()) } -fn modify_git_history(url: &str) -> Result<()> { +fn modify_git_history(url: &str, init_git: bool) -> Result<()> { trace!("Modifying Git history."); let git_output = Command::new("git").args(["rev-parse", "--short", "HEAD"]).output()?.stdout; let commit_hash = String::from_utf8(git_output)?; trace!(commit_hash = commit_hash.trim()); fs::remove_dir_all(".git")?; + if Path::new(".github").exists() { + fs::remove_dir_all(".github")?; + } - Command::new("git").arg("init").output()?; - Command::new("git").args(["add", "--all"]).output()?; + if init_git { + Command::new("git").arg("init").output()?; + Command::new("git").args(["add", "--all"]).output()?; - let commit_msg = format!("chore: init from {} at {}", url, commit_hash.trim()); - Command::new("git").args(["commit", "-m", &commit_msg]).output()?; + let commit_msg = format!("chore: init from {} at {}", url, commit_hash.trim()); + Command::new("git").args(["commit", "-m", &commit_msg]).output()?; + } trace!("Git history modified."); Ok(()) From ff266dfdbdd24690b7b6fa93a7da3e16b931a90a Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Fri, 5 Jul 2024 22:20:34 +0530 Subject: [PATCH 74/88] fix: override `block_id` method of ConnectedAccount for SozoAccount (#2140) --- bin/sozo/src/commands/options/account/type.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs index 6368fabb71..0a45328600 100644 --- a/bin/sozo/src/commands/options/account/type.rs +++ b/bin/sozo/src/commands/options/account/type.rs @@ -7,7 +7,7 @@ use starknet::accounts::{ RawDeclaration, RawExecution, RawLegacyDeclaration, SingleOwnerAccount, }; use starknet::core::types::contract::legacy::LegacyContractClass; -use starknet::core::types::{FieldElement, FlattenedSierraClass}; +use starknet::core::types::{BlockId, FieldElement, FlattenedSierraClass}; use starknet::providers::Provider; use starknet::signers::LocalWallet; @@ -159,4 +159,12 @@ where Self::Controller(account) => account.provider(), } } + + fn block_id(&self) -> BlockId { + match self { + Self::Standard(account) => account.block_id(), + #[cfg(feature = "controller")] + Self::Controller(account) => account.block_id(), + } + } } From bb3e91a7f1f3301a7653e1611eb7f4a35cec7ca3 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sat, 6 Jul 2024 11:21:02 +0800 Subject: [PATCH 75/88] feat(katana): add better node bindings (#2142) * add katana bindings crate * handle log in json format * remove some args for safety reasons * add more test * add crate desc * improve error handling --- Cargo.lock | 14 + Cargo.toml | 3 +- crates/katana/node-bindings/Cargo.toml | 22 + crates/katana/node-bindings/src/json.rs | 40 ++ crates/katana/node-bindings/src/lib.rs | 655 ++++++++++++++++++++++++ 5 files changed, 733 insertions(+), 1 deletion(-) create mode 100644 crates/katana/node-bindings/Cargo.toml create mode 100644 crates/katana/node-bindings/src/json.rs create mode 100644 crates/katana/node-bindings/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 9d12f17185..545d8f4190 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8511,6 +8511,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "katana-node-bindings" +version = "0.7.3" +dependencies = [ + "serde", + "serde_json", + "starknet", + "tempfile", + "thiserror", + "tokio", + "tracing", + "url", +] + [[package]] name = "katana-primitives" version = "0.7.3" diff --git a/Cargo.toml b/Cargo.toml index 53909fcbcc..a5e69e673c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,8 @@ members = [ "crates/dojo-world/abigen", "crates/katana/controller", "crates/katana/core", - "crates/katana/executor", + "crates/katana/executor", + "crates/katana/node-bindings", "crates/katana/primitives", "crates/katana/rpc/rpc", "crates/katana/rpc/rpc-api", diff --git a/crates/katana/node-bindings/Cargo.toml b/crates/katana/node-bindings/Cargo.toml new file mode 100644 index 0000000000..4fccee0f08 --- /dev/null +++ b/crates/katana/node-bindings/Cargo.toml @@ -0,0 +1,22 @@ +[package] +description = "Utilities for working with the Katana binary" +edition.workspace = true +license-file.workspace = true +license.workspace = true +name = "katana-node-bindings" +repository.workspace = true +version.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +starknet.workspace = true +thiserror.workspace = true +tracing.workspace = true +url.workspace = true + +[dev-dependencies] +tempfile.workspace = true +tokio.workspace = true diff --git a/crates/katana/node-bindings/src/json.rs b/crates/katana/node-bindings/src/json.rs new file mode 100644 index 0000000000..3dec9efcd3 --- /dev/null +++ b/crates/katana/node-bindings/src/json.rs @@ -0,0 +1,40 @@ +//! Utilities for parsing the logs in JSON format. This is when katana is run with `--json-log`. + +use serde::Deserialize; + +#[derive(Deserialize)] +pub struct JsonLogMessage { + pub timestamp: String, + pub level: String, + pub fields: JsonLogFields, + pub target: String, +} + +#[derive(Deserialize)] +pub struct JsonLogFields { + #[serde(deserialize_with = "deserialize_katana_info")] + pub message: KatanaInfo, +} + +fn deserialize_katana_info<'de, D>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, +{ + let s = String::deserialize(deserializer)?; + serde_json::from_str(&s).map_err(serde::de::Error::custom) +} + +#[derive(Deserialize)] +pub struct KatanaInfo { + pub seed: String, + pub address: String, + pub accounts: Vec<(String, AccountInfo)>, +} + +#[derive(Deserialize)] +pub struct AccountInfo { + pub balance: String, + pub class_hash: String, + pub private_key: String, + pub public_key: String, +} diff --git a/crates/katana/node-bindings/src/lib.rs b/crates/katana/node-bindings/src/lib.rs new file mode 100644 index 0000000000..72bd86eef9 --- /dev/null +++ b/crates/katana/node-bindings/src/lib.rs @@ -0,0 +1,655 @@ +// Mostly generated by Claude 3.5 Sonnet based on `alloy`'s `anvil` node binding to adapt it to `katana`'s CLI arguments. + +#![cfg_attr(not(test), warn(unused_crate_dependencies))] + +//! Utilities for launching a Katana instance. + +mod json; + +use std::io::{BufRead, BufReader}; +use std::net::SocketAddr; +use std::path::PathBuf; +use std::process::{Child, Command}; +use std::str::FromStr; +use std::time::{Duration, Instant}; + +use starknet::core::types::{FieldElement, FromStrError}; +use starknet::macros::short_string; +use starknet::signers::SigningKey; +use thiserror::Error; +use tracing::trace; +use url::Url; + +use crate::json::{JsonLogMessage, KatanaInfo}; + +/// How long we will wait for katana to indicate that it is ready. +const KATANA_STARTUP_TIMEOUT_MILLIS: u64 = 10_000; + +/// Genesis accounts created by Katana +#[derive(Debug, Clone)] +pub struct Account { + /// The account contract address + pub address: FieldElement, + /// The private key, if any + pub private_key: Option, +} + +/// A katana CLI instance. Will close the instance when dropped. +/// +/// Construct this using [`Katana`]. +#[derive(Debug)] +pub struct KatanaInstance { + port: u16, + child: Child, + accounts: Vec, + chain_id: FieldElement, +} + +impl KatanaInstance { + /// Returns a reference to the child process. + pub const fn child(&self) -> &Child { + &self.child + } + + /// Returns a mutable reference to the child process. + pub fn child_mut(&mut self) -> &mut Child { + &mut self.child + } + + /// Returns the port of this instance + pub const fn port(&self) -> u16 { + self.port + } + + /// Returns the chain of the katana instance + pub fn chain_id(&self) -> FieldElement { + self.chain_id + } + + /// Returns the list of accounts created by this katana instance + pub fn accounts(&self) -> &[Account] { + &self.accounts + } + + /// Returns the HTTP endpoint of this instance + #[doc(alias = "http_endpoint")] + pub fn endpoint(&self) -> String { + format!("http://localhost:{}", self.port) + } + + /// Returns the HTTP endpoint [`Url`] of this instance + #[doc(alias = "http_endpoint_url")] + pub fn endpoint_url(&self) -> Url { + Url::parse(&self.endpoint()).unwrap() + } +} + +impl Drop for KatanaInstance { + fn drop(&mut self) { + self.child.kill().expect("could not kill katana"); + } +} + +/// Errors that can occur when working with the [`Katana`]. +#[derive(Debug, Error)] +pub enum Error { + /// Spawning the katana process failed. + #[error("could not start katana: {0}")] + SpawnError(std::io::Error), + + /// Timed out waiting for a message from katana's stderr. + #[error("timed out waiting for katana to spawn; is katana installed?")] + Timeout, + + /// Unable to parse felt value from katana's stdout. + #[error("failed to parse felt value from katana's stdout")] + ParseFelt(#[from] FromStrError), + + /// A line could not be read from the katana stderr. + #[error("could not read line from katana stderr: {0}")] + ReadLineError(std::io::Error), + + /// The child katana process's stderr was not captured. + #[error("could not get stderr for katana child process")] + NoStderr, + + #[error("failed to parse instance address: {0}")] + AddrParse(#[from] std::net::AddrParseError), + + /// A line indicating the account address was found but the actual value was not. + #[error("missing account address")] + MissingAccountAddress, + + /// A line indicating the private key was found but the actual value was not. + #[error("missing account private key")] + MissingAccountPrivateKey, + + /// A line indicating the instance address was found but the actual value was not. + #[error("missing account private key")] + MissingSocketAddr, + + #[error("encountered unexpected format: {0}")] + UnexpectedFormat(String), +} + +/// Builder for launching `katana`. +/// +/// # Panics +/// +/// If `spawn` is called without `katana` being available in the user's $PATH +/// +/// # Example +/// +/// ```no_run +/// use katana_node_bindings::Katana; +/// +/// let port = 5050u16; +/// let url = format!("http://localhost:{}", port).to_string(); +/// +/// let katana = Katana::new().port(port).spawn(); +/// +/// drop(katana); // this will kill the instance +/// ``` +#[derive(Clone, Debug, Default)] +#[must_use = "This Builder struct does nothing unless it is `spawn`ed"] +pub struct Katana { + // General options + dev: bool, + no_mining: bool, + json_log: bool, + block_time: Option, + db_dir: Option, + rpc_url: Option, + fork_block_number: Option, + messaging: Option, + + // Metrics options + metrics: Option, + + // Server options + port: Option, + host: Option, + max_connections: Option, + allowed_origins: Option, + + // Starknet options + seed: Option, + accounts: Option, + disable_fee: bool, + disable_validate: bool, + + // Environment options + chain_id: Option, + validate_max_steps: Option, + invoke_max_steps: Option, + eth_gas_price: Option, + strk_gas_price: Option, + genesis: Option, + + // Others + timeout: Option, + program: Option, +} + +impl Katana { + /// Creates an empty Katana builder. + /// The default port is 5050. + /// + /// # Example + /// + /// ``` + /// # use katana_node_bindings::Katana; + /// fn a() { + /// let katana = Katana::default().spawn(); + /// + /// println!("Katana running at `{}`", katana.endpoint()); + /// # } + /// ``` + pub fn new() -> Self { + Self::default() + } + + /// Creates a Katana builder which will execute `katana` at the given path. + /// + /// # Example + /// + /// ``` + /// # use katana_node_bindings::Katana; + /// fn a() { + /// let katana = Katana::at("~/.katana/bin/katana").spawn(); + /// + /// println!("Katana running at `{}`", katana.endpoint()); + /// # } + /// ``` + pub fn at(path: impl Into) -> Self { + Self::new().path(path) + } + + /// Sets the `path` to the `katana` cli + /// + /// By default, it's expected that `katana` is in `$PATH`, see also + /// [`std::process::Command::new()`] + pub fn path>(mut self, path: T) -> Self { + self.program = Some(path.into()); + self + } + + /// Sets the port which will be used when the `katana` instance is launched. + pub fn port>(mut self, port: T) -> Self { + self.port = Some(port.into()); + self + } + + /// Sets the block-time in milliseconds which will be used when the `katana` instance is + /// launched. + pub const fn block_time(mut self, block_time: u64) -> Self { + self.block_time = Some(block_time); + self + } + + /// Sets the database directory path which will be used when the `katana` instance is launched. + pub fn db_dir>(mut self, db_dir: T) -> Self { + self.db_dir = Some(db_dir.into()); + self + } + + /// Sets the RPC URL to fork the network from. + pub fn rpc_url>(mut self, rpc_url: T) -> Self { + self.rpc_url = Some(rpc_url.into()); + self + } + + /// Enables the dev mode. + pub const fn dev(mut self, dev: bool) -> Self { + self.dev = dev; + self + } + + /// Enables JSON logging. + pub const fn json_log(mut self, json_log: bool) -> Self { + self.json_log = json_log; + self + } + + /// Sets the fork block number which will be used when the `katana` instance is launched. + pub const fn fork_block_number(mut self, fork_block_number: u64) -> Self { + self.fork_block_number = Some(fork_block_number); + self + } + + /// Sets the messaging configuration path which will be used when the `katana` instance is + /// launched. + pub fn messaging>(mut self, messaging: T) -> Self { + self.messaging = Some(messaging.into()); + self + } + + /// Enables Prometheus metrics and sets the socket address. + pub fn metrics>(mut self, metrics: T) -> Self { + self.metrics = Some(metrics.into()); + self + } + + /// Sets the host IP address the server will listen on. + pub fn host>(mut self, host: T) -> Self { + self.host = Some(host.into()); + self + } + + /// Sets the maximum number of concurrent connections allowed. + pub const fn max_connections(mut self, max_connections: u64) -> Self { + self.max_connections = Some(max_connections); + self + } + + /// Enables the CORS layer and sets the allowed origins, separated by commas. + pub fn allowed_origins>(mut self, allowed_origins: T) -> Self { + self.allowed_origins = Some(allowed_origins.into()); + self + } + + /// Sets the seed for randomness of accounts to be predeployed. + pub const fn seed(mut self, seed: u64) -> Self { + self.seed = Some(seed); + self + } + + /// Sets the number of pre-funded accounts to generate. + pub fn accounts(mut self, accounts: u16) -> Self { + self.accounts = Some(accounts); + self + } + + /// Enable or disable charging fee when executing transactions. + /// Enabled by default. + pub const fn fee(mut self, enable: bool) -> Self { + self.disable_fee = !enable; + self + } + + /// Enables or disable transaction validation. + /// Enabled by default. + pub const fn validate(mut self, enable: bool) -> Self { + self.disable_validate = !enable; + self + } + + /// Sets the chain ID. + pub const fn chain_id(mut self, id: FieldElement) -> Self { + self.chain_id = Some(id); + self + } + + /// Sets the maximum number of steps available for the account validation logic. + pub const fn validate_max_steps(mut self, validate_max_steps: u64) -> Self { + self.validate_max_steps = Some(validate_max_steps); + self + } + + /// Sets the maximum number of steps available for the account execution logic. + pub const fn invoke_max_steps(mut self, invoke_max_steps: u64) -> Self { + self.invoke_max_steps = Some(invoke_max_steps); + self + } + + /// Sets the L1 ETH gas price (denominated in wei). + pub const fn eth_gas_price(mut self, eth_gas_price: u64) -> Self { + self.eth_gas_price = Some(eth_gas_price); + self + } + + /// Sets the L1 STRK gas price (denominated in fri). + pub const fn strk_gas_price(mut self, strk_gas_price: u64) -> Self { + self.strk_gas_price = Some(strk_gas_price); + self + } + + /// Sets the genesis configuration path. + pub fn genesis>(mut self, genesis: T) -> Self { + self.genesis = Some(genesis.into()); + self + } + + /// Sets the timeout which will be used when the `katana` instance is launched. + pub const fn timeout(mut self, timeout: u64) -> Self { + self.timeout = Some(timeout); + self + } + + /// Disable auto and interval mining, and mine on demand instead via an endpoint. + pub const fn no_mining(mut self, no_mining: bool) -> Self { + self.no_mining = no_mining; + self + } + + /// Consumes the builder and spawns `katana`. + /// + /// # Panics + /// + /// If spawning the instance fails at any point. + #[track_caller] + pub fn spawn(self) -> KatanaInstance { + self.try_spawn().expect("could not spawn katana") + } + + /// Consumes the builder and spawns `katana`. If spawning fails, returns an error. + pub fn try_spawn(self) -> Result { + let mut cmd = self.program.as_ref().map_or_else(|| Command::new("katana"), Command::new); + cmd.stdout(std::process::Stdio::piped()).stderr(std::process::Stdio::inherit()); + + let mut port = self.port.unwrap_or(0); + cmd.arg("--port").arg(port.to_string()); + + if self.no_mining { + cmd.arg("--no-mining"); + } + + if let Some(block_time) = self.block_time { + cmd.arg("-b").arg(block_time.to_string()); + } + + if let Some(db_dir) = self.db_dir { + cmd.arg("--db-dir").arg(db_dir); + } + + if let Some(rpc_url) = self.rpc_url { + cmd.arg("--rpc-url").arg(rpc_url); + } + + if self.dev { + cmd.arg("--dev"); + } + + if self.json_log { + cmd.arg("--json-log"); + } + + if let Some(fork_block_number) = self.fork_block_number { + cmd.arg("--fork-block-number").arg(fork_block_number.to_string()); + } + + if let Some(messaging) = self.messaging { + cmd.arg("--messaging").arg(messaging); + } + + if let Some(metrics) = self.metrics { + cmd.arg("--metrics").arg(metrics); + } + + if let Some(host) = self.host { + cmd.arg("--host").arg(host); + } + + if let Some(max_connections) = self.max_connections { + cmd.arg("--max-connections").arg(max_connections.to_string()); + } + + if let Some(allowed_origins) = self.allowed_origins { + cmd.arg("--allowed-origins").arg(allowed_origins); + } + + if let Some(seed) = self.seed { + cmd.arg("--seed").arg(seed.to_string()); + } + + if let Some(accounts) = self.accounts { + cmd.arg("--accounts").arg(accounts.to_string()); + } + + if self.disable_fee { + cmd.arg("--disable-fee"); + } + + if self.disable_validate { + cmd.arg("--disable-validate"); + } + + if let Some(chain_id) = self.chain_id { + // Referring to katana docs: + // "If the `str` starts with `0x` it is parsed as a hex string, otherwise it is parsed + // as a Cairo short string." + cmd.arg("--chain-id").arg(format!("{chain_id:#x}")); + } + + if let Some(validate_max_steps) = self.validate_max_steps { + cmd.arg("--validate-max-steps").arg(validate_max_steps.to_string()); + } + + let mut child = cmd.spawn().map_err(Error::SpawnError)?; + let stdout = child.stdout.as_mut().ok_or(Error::NoStderr)?; + + let start = Instant::now(); + let mut reader = BufReader::new(stdout); + + let mut accounts = Vec::new(); + // var to store the current account being processed + let mut current_account: Option = None; + + // TODO: the chain id should be fetched from stdout as well but Katana doesn't display the + // chain id atm + let chain_id = self.chain_id.unwrap_or(short_string!("KATANA")); + + loop { + if start + Duration::from_millis(self.timeout.unwrap_or(KATANA_STARTUP_TIMEOUT_MILLIS)) + <= Instant::now() + { + return Err(Error::Timeout); + } + + let mut line = String::new(); + reader.read_line(&mut line).map_err(Error::ReadLineError)?; + trace!(line); + + if self.json_log { + if let Ok(log) = serde_json::from_str::(&line) { + let KatanaInfo { address, accounts: account_infos, .. } = log.fields.message; + + let addr = SocketAddr::from_str(&address)?; + port = addr.port(); + + for (address, info) in account_infos { + let address = FieldElement::from_str(&address)?; + let private_key = FieldElement::from_str(&info.private_key)?; + let key = SigningKey::from_secret_scalar(private_key); + accounts.push(Account { address, private_key: Some(key) }); + } + + break; + } + } else { + const URL_PREFIX: &str = "🚀 JSON-RPC server started:"; + if line.starts_with(URL_PREFIX) { + // <🚀 JSON-RPC server started: http://0.0.0.0:5050> + let line = line.strip_prefix(URL_PREFIX).ok_or(Error::MissingSocketAddr)?; + let addr = line.trim(); + + // parse the actual port + let addr = addr.strip_prefix("http://").unwrap_or(addr); + let addr = SocketAddr::from_str(addr)?; + port = addr.port(); + + // The address is the last thing to be displayed so we can safely break here. + break; + } + + const ACC_ADDRESS_PREFIX: &str = "| Account address |"; + if line.starts_with(ACC_ADDRESS_PREFIX) { + // If there is currently an account being handled, but we've reached the next + // account line, that means the previous address didn't have + // a private key, so we can add it to the accounts list and + // start processing the next account. + if let Some(acc) = current_account.take() { + accounts.push(acc); + } + + let hex = line + .strip_prefix(ACC_ADDRESS_PREFIX) + .ok_or(Error::MissingAccountAddress)? + .trim(); + + let address = FieldElement::from_str(hex)?; + let account = Account { address, private_key: None }; + current_account = Some(account); + } + + const ACC_PK_PREFIX: &str = "| Private key |"; + if line.starts_with(ACC_PK_PREFIX) { + // the private key may or may not be present for a particular account, so we + // have to handle both cases properly + let Some(acc) = current_account.take() else { + let msg = "Account address not found before private key".to_string(); + return Err(Error::UnexpectedFormat(msg)); + }; + + let hex = line + .strip_prefix(ACC_PK_PREFIX) + .ok_or(Error::MissingAccountPrivateKey)? + .trim(); + + let private_key = FieldElement::from_str(hex)?; + let signing_key = SigningKey::from_secret_scalar(private_key); + accounts.push(Account { private_key: Some(signing_key), ..acc }); + } + } + } + + Ok(KatanaInstance { port, child, accounts, chain_id }) + } +} + +#[cfg(test)] +mod tests { + use starknet::providers::jsonrpc::HttpTransport; + use starknet::providers::{JsonRpcClient, Provider}; + + use super::*; + + #[test] + fn can_launch_katana() { + let katana = Katana::new().spawn(); + // assert some default values + assert_eq!(katana.accounts().len(), 10); + assert_eq!(katana.chain_id(), short_string!("KATANA")); + // assert that all accounts have private key + assert!(katana.accounts().iter().all(|a| a.private_key.is_some())); + } + + #[test] + fn can_launch_katana_with_json_log() { + let katana = Katana::new().json_log(true).spawn(); + // Assert default values when using JSON logging + assert_eq!(katana.accounts().len(), 10); + assert_eq!(katana.chain_id(), short_string!("KATANA")); + // assert that all accounts have private key + assert!(katana.accounts().iter().all(|a| a.private_key.is_some())); + } + + #[test] + fn can_launch_katana_with_more_accounts() { + let katana = Katana::new().accounts(20).spawn(); + assert_eq!(katana.accounts().len(), 20); + } + + #[test] + fn assert_block_time_is_natural_number() { + let katana = Katana::new().block_time(12); + assert_eq!(katana.block_time.unwrap().to_string(), "12"); + let _ = katana.spawn(); + } + + #[test] + fn can_launch_katana_with_sub_seconds_block_time() { + let _ = Katana::new().block_time(500).spawn(); + } + + #[test] + fn can_launch_katana_with_specific_port() { + let specific_port = 49999; + let katana = Katana::new().port(specific_port).spawn(); + assert_eq!(katana.port(), specific_port); + } + + #[tokio::test] + async fn assert_custom_chain_id() { + let chain_id = short_string!("SN_GOERLI"); + let katana = Katana::new().chain_id(chain_id).spawn(); + + let provider = JsonRpcClient::new(HttpTransport::new(katana.endpoint_url())); + let actual_chain_id = provider.chain_id().await.unwrap(); + + assert_eq!(chain_id, actual_chain_id); + } + + #[test] + fn can_launch_katana_with_db_dir() { + let temp_dir = tempfile::tempdir().expect("failed to create temp dir"); + let db_path = temp_dir.path().join("test-db"); + assert!(!db_path.exists()); + + let _katana = Katana::new().db_dir(db_path.clone()).spawn(); + + // Check that the db directory is created + assert!(db_path.exists()); + assert!(db_path.is_dir()); + } +} From 8ff31b0cf56d008355833304bd9488b4ca7aad58 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sat, 6 Jul 2024 11:22:19 +0800 Subject: [PATCH 76/88] refactor(katana-runner): use the new bindings (#2143) --- Cargo.lock | 4 +- bin/sozo/tests/register_test.rs | 3 +- crates/katana/runner/Cargo.toml | 4 +- crates/katana/runner/src/lib.rs | 86 ++++++++------------------- crates/katana/runner/src/prefunded.rs | 30 +++++----- crates/katana/runner/src/utils.rs | 11 +--- 6 files changed, 46 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 545d8f4190..3efd806e95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8669,9 +8669,7 @@ dependencies = [ "anyhow", "assert_fs", "chrono", - "katana-core", - "katana-primitives", - "lazy_static", + "katana-node-bindings", "runner-macro", "serde", "serde_json", diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index 8cc161abee..31607e3624 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -39,7 +39,8 @@ async fn reregister_models() { execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); let world_address = &format!("0x{:x}", &migration.world_address().unwrap()); let account_address = &format!("0x{:x}", account.address()); - let private_key = &format!("0x{:x}", sequencer.account_data(0).1.private_key); + let private_key = + &format!("0x{:x}", sequencer.account_data(0).private_key.as_ref().unwrap().secret_scalar()); let rpc_url = &sequencer.url().to_string(); let moves_model = diff --git a/crates/katana/runner/Cargo.toml b/crates/katana/runner/Cargo.toml index e4daf7a28c..284da3e854 100644 --- a/crates/katana/runner/Cargo.toml +++ b/crates/katana/runner/Cargo.toml @@ -9,9 +9,7 @@ version.workspace = true anyhow.workspace = true assert_fs.workspace = true chrono.workspace = true -katana-core.workspace = true -katana-primitives.workspace = true -lazy_static.workspace = true +katana-node-bindings = { path = "../node-bindings" } runner-macro = { path = "./runner-macro" } serde.workspace = true serde_json.workspace = true diff --git a/crates/katana/runner/src/lib.rs b/crates/katana/runner/src/lib.rs index 342379f87a..435e0d5ea0 100644 --- a/crates/katana/runner/src/lib.rs +++ b/crates/katana/runner/src/lib.rs @@ -1,19 +1,17 @@ +#![cfg_attr(not(test), warn(unused_crate_dependencies))] + mod logs; mod prefunded; mod utils; use std::path::PathBuf; -use std::process::{Child, Command, Stdio}; -use std::sync::mpsc::{self}; use std::thread; -use std::time::Duration; use anyhow::{Context, Result}; use assert_fs::TempDir; -use katana_primitives::contract::ContractAddress; -use katana_primitives::genesis::allocation::{DevAllocationsGenerator, DevGenesisAccount}; -use katana_primitives::FieldElement; +use katana_node_bindings::{Katana, KatanaInstance}; pub use runner_macro::{katana_test, runner}; +use starknet::core::types::FieldElement; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use tokio::sync::Mutex; @@ -22,10 +20,8 @@ use utils::find_free_port; #[derive(Debug)] pub struct KatanaRunner { - child: Child, - port: u16, + instance: KatanaInstance, provider: JsonRpcClient, - accounts: Vec<(ContractAddress, DevGenesisAccount)>, log_file_path: PathBuf, contract: Mutex>, } @@ -83,34 +79,30 @@ impl KatanaRunner { /// /// * `config` - The configuration for the katana runner. fn setup_and_start(config: KatanaRunnerConfig) -> Result { - let program = config.program_name.clone().unwrap_or_else(determine_default_program_path); - + let program = config.program_name.unwrap_or_else(determine_default_program_path); let port = config.port.unwrap_or_else(find_free_port); let n_accounts = config.n_accounts; - let mut command = Command::new(program); - command - .args(["-p", &port.to_string()]) - .args(["--json-log"]) - .args(["--max-connections", &format!("{}", 10000)]) - .args(["--accounts", &format!("{}", n_accounts)]); + let mut builder = Katana::new() + .path(program) + .port(port) + .accounts(n_accounts) + .json_log(true) + .max_connections(10000) + .fee(!config.disable_fee); if let Some(block_time_ms) = config.block_time { - command.args(["--block-time", &format!("{}", block_time_ms)]); - } - - if config.disable_fee { - command.args(["--disable-fee"]); + builder = builder.block_time(block_time_ms); } if let Some(messaging_file) = config.messaging { - command.args(["--messaging", messaging_file.as_str()]); + builder = builder.messaging(messaging_file); } - let mut child = - command.stdout(Stdio::piped()).spawn().context("failed to start subprocess")?; + let mut katana = builder.spawn(); - let stdout = child.stdout.take().context("failed to take subprocess stdout")?; + let stdout = + katana.child_mut().stdout.take().context("failed to take subprocess stdout")?; let log_filename = PathBuf::from(format!( "katana-{}.log", @@ -125,30 +117,14 @@ impl KatanaRunner { }; let log_file_path_sent = log_file_path.clone(); - - let (sender, receiver) = mpsc::channel(); thread::spawn(move || { - utils::wait_for_server_started_and_signal(&log_file_path_sent, stdout, sender); + utils::listen_to_stdout(&log_file_path_sent, stdout); }); - receiver - .recv_timeout(Duration::from_secs(5)) - .context("timeout waiting for server to start")?; - - let url = - Url::parse(&format!("http://127.0.0.1:{}/", port)).context("Failed to parse url")?; - let provider = JsonRpcClient::new(HttpTransport::new(url)); - - let mut seed = [0; 32]; - seed[0] = 48; - let accounts = DevAllocationsGenerator::new(n_accounts) - .with_seed(seed) - .generate() - .into_iter() - .collect(); + let provider = JsonRpcClient::new(HttpTransport::new(katana.endpoint_url())); let contract = Mutex::new(Option::None); - Ok(KatanaRunner { child, port, provider, accounts, log_file_path, contract }) + Ok(KatanaRunner { instance: katana, provider, log_file_path, contract }) } pub fn log_file_path(&self) -> &PathBuf { @@ -160,19 +136,18 @@ impl KatanaRunner { } pub fn endpoint(&self) -> String { - format!("http://127.0.0.1:{}/", self.port) + self.instance.endpoint() } pub fn url(&self) -> Url { - Url::parse(&self.endpoint()).context("Failed to parse url").unwrap() + self.instance.endpoint_url() } pub fn owned_provider(&self) -> JsonRpcClient { - let url = Url::parse(&self.endpoint()).context("Failed to parse url").unwrap(); - JsonRpcClient::new(HttpTransport::new(url)) + JsonRpcClient::new(HttpTransport::new(self.url())) } - // A constract needs to be deployed only once for each instance + // A contract needs to be deployed only once for each instance // In proptest runner is static but deployment would happen for each test, unless it is // persisted here. pub async fn set_contract(&self, contract_address: FieldElement) { @@ -185,17 +160,6 @@ impl KatanaRunner { } } -impl Drop for KatanaRunner { - fn drop(&mut self) { - if let Err(e) = self.child.kill() { - eprintln!("Failed to kill katana subprocess: {}", e); - } - if let Err(e) = self.child.wait() { - eprintln!("Failed to wait for katana subprocess: {}", e); - } - } -} - /// Determines the default program path for the katana runner based on the KATANA_RUNNER_BIN /// environment variable. If not set, try to to use katana from the PATH. fn determine_default_program_path() -> String { diff --git a/crates/katana/runner/src/prefunded.rs b/crates/katana/runner/src/prefunded.rs index 2f1d54ecab..033ae50fc6 100644 --- a/crates/katana/runner/src/prefunded.rs +++ b/crates/katana/runner/src/prefunded.rs @@ -1,25 +1,21 @@ -use katana_core::backend::config::Environment; -use katana_primitives::chain::ChainId; -use katana_primitives::contract::ContractAddress; -use katana_primitives::genesis::allocation::DevGenesisAccount; use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount}; use starknet::core::types::{BlockId, BlockTag}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; -use starknet::signers::{LocalWallet, SigningKey}; +use starknet::signers::LocalWallet; use crate::KatanaRunner; impl KatanaRunner { - pub fn accounts_data(&self) -> &[(ContractAddress, DevGenesisAccount)] { - &self.accounts[1..] // The first one is used to deploy the contract + pub fn accounts_data(&self) -> &[katana_node_bindings::Account] { + self.instance.accounts() } pub fn accounts(&self) -> Vec, LocalWallet>> { self.accounts_data().iter().map(|account| self.account_to_single_owned(account)).collect() } - pub fn account_data(&self, index: usize) -> &(ContractAddress, DevGenesisAccount) { + pub fn account_data(&self, index: usize) -> &katana_node_bindings::Account { &self.accounts_data()[index] } @@ -27,25 +23,27 @@ impl KatanaRunner { &self, index: usize, ) -> SingleOwnerAccount, LocalWallet> { - self.account_to_single_owned(&self.accounts[index]) + self.account_to_single_owned(&self.accounts_data()[index]) } fn account_to_single_owned( &self, - account: &(ContractAddress, DevGenesisAccount), + account: &katana_node_bindings::Account, ) -> SingleOwnerAccount, LocalWallet> { - let private_key = SigningKey::from_secret_scalar(account.1.private_key); - let signer = LocalWallet::from_signing_key(private_key); + let signer = if let Some(private_key) = &account.private_key { + LocalWallet::from(private_key.clone()) + } else { + panic!("Account does not have a private key") + }; - let chain_id = Environment::default().chain_id; - debug_assert_eq!(Environment::default().chain_id, ChainId::parse("KATANA").unwrap()); + let chain_id = self.instance.chain_id(); let provider = self.owned_provider(); let mut account = SingleOwnerAccount::new( provider, signer, - account.0.into(), - chain_id.into(), + account.address, + chain_id, ExecutionEncoding::New, ); diff --git a/crates/katana/runner/src/utils.rs b/crates/katana/runner/src/utils.rs index d6072aeb51..2d4037143e 100644 --- a/crates/katana/runner/src/utils.rs +++ b/crates/katana/runner/src/utils.rs @@ -3,28 +3,23 @@ use std::io::{BufRead, BufReader, Write}; use std::net::TcpListener; use std::path::Path; use std::process::ChildStdout; -use std::sync::mpsc::Sender; pub fn find_free_port() -> u16 { TcpListener::bind("127.0.0.1:0").unwrap().local_addr().unwrap().port() // This might need to me mutexed } -pub fn wait_for_server_started_and_signal(path: &Path, stdout: ChildStdout, sender: Sender<()>) { +pub fn listen_to_stdout(log_file: &Path, stdout: ChildStdout) { let reader = BufReader::new(stdout); - if let Some(dir_path) = path.parent() { + if let Some(dir_path) = log_file.parent() { if !dir_path.exists() { fs::create_dir_all(dir_path).unwrap(); } } - let mut log_writer = File::create(path).expect("failed to create log file"); + let mut log_writer = File::create(log_file).expect("failed to create log file"); for line in reader.lines() { let line = line.expect("failed to read line from subprocess stdout"); writeln!(log_writer, "{}", line).expect("failed to write to log file"); - - if line.contains(r#""target":"katana::cli""#) { - sender.send(()).expect("failed to send start signal"); - } } } From 4d333746938f94e594378db697706bd6e4ff1cca Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sat, 6 Jul 2024 11:36:27 +0800 Subject: [PATCH 77/88] breaking: `Felt` type migration + `0.7.1` RPC update (#2126) * init * wip * wip * wip * wip * wip * wip * bump slot * wip * fmt * wip * update cairo-proof-serde and cainome dep * update slot rev to HEAD * conversion unit tests * add more tests * add getBlockWithReceipts endpoint * clippy * update hurl test * patch starknet-types-core * update lockfile * change default chain id for testing * adapt saya serde test to the new felt type * chore: bump cainome to tag instead of rev * examples: add starknet_getBlockWithReceipts * fix: update lock files of tests * ci: migrate some data before running hurls * ci: start katana before migrating * ci: fix typo --------- Co-authored-by: glihm --- .github/workflows/ci.yml | 4 + Cargo.lock | 859 +++++++++++------- Cargo.toml | 25 +- bin/saya/src/args/mod.rs | 8 +- bin/saya/src/args/proof.rs | 2 +- bin/saya/src/args/starknet_account.rs | 2 +- bin/saya/src/tests.rs | 63 +- bin/scheduler/src/main.rs | 2 +- bin/sozo/Cargo.toml | 2 +- bin/sozo/src/commands/account.rs | 6 +- bin/sozo/src/commands/auth.rs | 6 +- bin/sozo/src/commands/call.rs | 4 +- bin/sozo/src/commands/calldata_decoder.rs | 44 +- bin/sozo/src/commands/migrate.rs | 4 +- bin/sozo/src/commands/model.rs | 6 +- .../commands/options/account/controller.rs | 17 +- bin/sozo/src/commands/options/account/mod.rs | 45 +- bin/sozo/src/commands/options/account/type.rs | 114 ++- bin/sozo/src/commands/options/signer.rs | 16 +- bin/sozo/src/commands/options/transaction.rs | 4 +- bin/sozo/src/commands/options/world.rs | 24 +- bin/sozo/src/commands/register.rs | 4 +- bin/torii/src/main.rs | 4 +- crates/benches/src/deployer.rs | 13 +- crates/benches/src/helpers.rs | 22 +- crates/benches/src/lib.rs | 22 +- crates/benches/src/spammer.rs | 20 +- crates/benches/tests/basic.rs | 10 +- crates/benches/tests/character.rs | 19 +- crates/benches/tests/heavy.rs | 20 +- crates/benches/tests/katana_ramp_up.rs | 6 +- crates/benches/tests/primitive.rs | 8 +- crates/dojo-lang/src/compiler.rs | 17 +- .../compiler_cairo/Scarb.lock | 2 +- crates/dojo-test-utils/Cargo.toml | 1 + crates/dojo-test-utils/src/migration.rs | 4 +- crates/dojo-test-utils/src/sequencer.rs | 22 +- crates/dojo-types/Cargo.toml | 1 + crates/dojo-types/src/event.rs | 18 +- crates/dojo-types/src/lib.rs | 6 +- crates/dojo-types/src/packing.rs | 117 ++- crates/dojo-types/src/primitive.rs | 128 ++- crates/dojo-types/src/schema.rs | 34 +- crates/dojo-types/src/storage.rs | 4 +- crates/dojo-world/Cargo.toml | 3 +- .../dojo-world/src/contracts/cairo_utils.rs | 4 +- crates/dojo-world/src/contracts/model.rs | 29 +- crates/dojo-world/src/contracts/world_test.rs | 15 +- .../dojo-world/src/manifest/manifest_test.rs | 4 +- crates/dojo-world/src/manifest/mod.rs | 44 +- crates/dojo-world/src/manifest/types.rs | 40 +- crates/dojo-world/src/migration/class.rs | 8 +- crates/dojo-world/src/migration/contract.rs | 16 +- crates/dojo-world/src/migration/mod.rs | 95 +- crates/dojo-world/src/migration/strategy.rs | 16 +- crates/dojo-world/src/migration/world.rs | 6 +- crates/dojo-world/src/utils.rs | 199 ++-- crates/katana/controller/src/lib.rs | 12 +- crates/katana/core/Cargo.toml | 3 +- crates/katana/core/src/backend/mod.rs | 5 +- crates/katana/core/src/pool.rs | 2 +- .../core/src/service/messaging/starknet.rs | 84 +- crates/katana/core/src/service/mod.rs | 2 +- .../src/implementation/blockifier/error.rs | 12 +- .../src/implementation/blockifier/state.rs | 75 +- .../src/implementation/blockifier/utils.rs | 185 ++-- crates/katana/executor/tests/executor.rs | 2 +- .../executor/tests/fixtures/transaction.rs | 13 +- crates/katana/primitives/Cargo.toml | 3 +- crates/katana/primitives/src/chain.rs | 28 +- .../katana/primitives/src/conversion/rpc.rs | 4 +- .../primitives/src/genesis/allocation.rs | 2 +- .../katana/primitives/src/genesis/constant.rs | 87 +- crates/katana/primitives/src/genesis/json.rs | 6 +- crates/katana/primitives/src/genesis/mod.rs | 16 +- crates/katana/primitives/src/lib.rs | 6 +- .../primitives/src/utils/transaction.rs | 57 +- crates/katana/rpc/rpc-api/src/starknet.rs | 16 +- .../katana/rpc/rpc-types-builder/Cargo.toml | 2 +- .../katana/rpc/rpc-types-builder/src/block.rs | 20 +- .../rpc/rpc-types-builder/src/receipt.rs | 14 +- crates/katana/rpc/rpc-types/Cargo.toml | 1 + crates/katana/rpc/rpc-types/src/block.rs | 128 ++- crates/katana/rpc/rpc-types/src/message.rs | 2 +- crates/katana/rpc/rpc-types/src/receipt.rs | 156 +--- crates/katana/rpc/rpc-types/src/trace.rs | 5 +- .../katana/rpc/rpc-types/src/transaction.rs | 19 +- crates/katana/rpc/rpc/Cargo.toml | 1 + crates/katana/rpc/rpc/src/starknet.rs | 105 ++- crates/katana/rpc/rpc/src/torii.rs | 24 +- crates/katana/rpc/rpc/tests/common/mod.rs | 24 +- crates/katana/rpc/rpc/tests/messaging.rs | 38 +- crates/katana/rpc/rpc/tests/saya.rs | 12 +- crates/katana/rpc/rpc/tests/starknet.rs | 85 +- crates/katana/rpc/rpc/tests/torii.rs | 54 +- crates/katana/storage/codecs/src/lib.rs | 2 +- crates/katana/storage/db/src/codecs/mod.rs | 3 +- .../katana/storage/db/src/models/storage.rs | 3 +- crates/katana/storage/provider/tests/block.rs | 2 +- crates/saya/core/Cargo.toml | 3 +- .../src/data_availability/celestia/mod.rs | 11 +- crates/saya/core/src/data_availability/mod.rs | 11 +- crates/saya/core/src/dojo_os/mod.rs | 16 +- crates/saya/core/src/lib.rs | 3 +- crates/saya/core/src/prover/extract.rs | 9 +- crates/saya/core/src/prover/program_input.rs | 305 ++++--- crates/saya/core/src/prover/state_diff.rs | 6 +- crates/saya/core/src/verifier/mod.rs | 8 +- crates/saya/core/src/verifier/starknet.rs | 10 +- crates/saya/provider/Cargo.toml | 1 + crates/saya/provider/src/error.rs | 4 +- crates/saya/provider/src/provider.rs | 4 +- crates/saya/provider/src/rpc/mod.rs | 9 +- crates/saya/provider/src/rpc/state.rs | 37 +- crates/saya/provider/src/rpc/transaction.rs | 17 +- crates/sozo/ops/Cargo.toml | 3 + crates/sozo/ops/src/account.rs | 77 +- crates/sozo/ops/src/auth.rs | 19 +- crates/sozo/ops/src/call.rs | 4 +- crates/sozo/ops/src/events.rs | 86 +- crates/sozo/ops/src/execute.rs | 6 +- crates/sozo/ops/src/keystore.rs | 4 +- crates/sozo/ops/src/migration/migrate.rs | 40 +- crates/sozo/ops/src/migration/mod.rs | 14 +- crates/sozo/ops/src/migration/utils.rs | 4 +- crates/sozo/ops/src/model.rs | 41 +- crates/sozo/ops/src/register.rs | 8 +- crates/sozo/ops/src/tests/call.rs | 12 +- crates/sozo/ops/src/tests/migration.rs | 7 +- crates/sozo/ops/src/tests/utils.rs | 16 +- crates/sozo/ops/src/utils.rs | 38 +- crates/sozo/signers/src/lib.rs | 4 +- crates/torii/client/Cargo.toml | 1 + crates/torii/client/src/client/mod.rs | 14 +- crates/torii/client/src/client/storage.rs | 38 +- .../torii/client/src/client/subscription.rs | 7 +- crates/torii/client/src/utils.rs | 19 +- crates/torii/core/Cargo.toml | 1 + crates/torii/core/src/engine.rs | 67 +- crates/torii/core/src/error.rs | 4 +- crates/torii/core/src/lib.rs | 10 +- crates/torii/core/src/model.rs | 26 +- .../core/src/processors/event_message.rs | 4 +- .../core/src/processors/metadata_update.rs | 7 +- crates/torii/core/src/processors/mod.rs | 9 +- .../core/src/processors/register_model.rs | 4 +- .../core/src/processors/store_del_record.rs | 4 +- .../core/src/processors/store_set_record.rs | 13 +- .../core/src/processors/store_transaction.rs | 7 +- crates/torii/core/src/query_queue.rs | 4 +- crates/torii/core/src/sql.rs | 34 +- crates/torii/core/src/sql_test.rs | 14 +- crates/torii/core/src/types.rs | 14 +- .../torii/graphql/src/tests/entities_test.rs | 9 +- .../torii/graphql/src/tests/metadata_test.rs | 8 +- crates/torii/graphql/src/tests/mod.rs | 14 +- crates/torii/graphql/src/tests/models_test.rs | 6 +- .../graphql/src/tests/subscription_test.rs | 70 +- crates/torii/grpc/Cargo.toml | 1 + crates/torii/grpc/src/client.rs | 23 +- crates/torii/grpc/src/server/mod.rs | 37 +- .../grpc/src/server/subscriptions/entity.rs | 6 +- .../grpc/src/server/subscriptions/event.rs | 8 +- .../src/server/subscriptions/event_message.rs | 6 +- .../src/server/subscriptions/model_diff.rs | 26 +- .../grpc/src/server/tests/entities_test.rs | 2 +- crates/torii/grpc/src/types/mod.rs | 111 +-- crates/torii/grpc/src/types/schema.rs | 14 +- crates/torii/libp2p/src/server/mod.rs | 35 +- crates/torii/libp2p/src/tests.rs | 18 +- crates/torii/libp2p/src/typed_data.rs | 53 +- crates/torii/libp2p/src/types.rs | 6 +- crates/torii/types-test/Scarb.lock | 2 +- .../starknet_getBlockWithReceipts.hurl | 21 + .../rpc/starknet/starknet_specVersion.hurl | 2 +- examples/spawn-and-move/Scarb.lock | 2 +- 176 files changed, 2766 insertions(+), 2410 deletions(-) create mode 100644 examples/rpc/starknet/starknet_getBlockWithReceipts.hurl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68de387ca9..dcb238f9c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,5 +190,9 @@ jobs: curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/3.0.0/hurl_3.0.0_amd64.deb sudo apt update && sudo apt install ./hurl_3.0.0_amd64.deb chmod +x /tmp/bins/katana + chmod +x /tmp/bins/sozo nohup /tmp/bins/katana --accounts 2 --disable-fee & + - run: | + /tmp/bins/sozo --manifest-path examples/spawn-and-move/Scarb.toml build + /tmp/bins/sozo --manifest-path examples/spawn-and-move/Scarb.toml migrate apply - run: hurl --test examples/rpc/**/*.hurl diff --git a/Cargo.lock b/Cargo.lock index 3efd806e95..a661166da3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,27 +15,28 @@ dependencies = [ [[package]] name = "account_sdk" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/controller?rev=e8276cfffe48b5d09f0598026d13635374204b72#e8276cfffe48b5d09f0598026d13635374204b72" +source = "git+https://github.com/cartridge-gg/controller?branch=bump-starknet#366484fe7f19aa3fffef3929f8a00b753062fbdc" dependencies = [ "anyhow", "async-trait", "base64 0.21.7", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", - "cairo-lang-starknet 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cairo-lang-starknet 2.6.4", "coset", "ecdsa", "futures", "indexmap 2.2.6", "js-sys", "lazy_static", + "num-traits 0.2.19", "p256", "primitive-types", "rand_core", "serde", "serde_json", "sha2 0.10.8", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "thiserror", "tokio", "toml 0.8.14", @@ -144,7 +145,7 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-consensus 0.1.3", "alloy-contract 0.1.3", @@ -188,7 +189,7 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-eips 0.1.3", "alloy-primitives", @@ -219,7 +220,7 @@ dependencies = [ [[package]] name = "alloy-contract" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", @@ -280,7 +281,7 @@ dependencies = [ [[package]] name = "alloy-eips" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -305,7 +306,7 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-primitives", "alloy-serde 0.1.3", @@ -339,7 +340,7 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-primitives", "serde", @@ -368,7 +369,7 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-consensus 0.1.3", "alloy-eips 0.1.3", @@ -387,7 +388,7 @@ dependencies = [ [[package]] name = "alloy-node-bindings" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-genesis 0.1.3", "alloy-primitives", @@ -453,7 +454,7 @@ dependencies = [ [[package]] name = "alloy-provider" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-chains", "alloy-consensus 0.1.3", @@ -486,9 +487,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -497,9 +498,9 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8037e03c7f462a063f28daec9fda285a9a89da003c552f8637a80b9c8fd96241" +checksum = "d83524c1f6162fcb5b0decf775498a125066c86dda6066ed609531b0e912f85a" dependencies = [ "proc-macro2", "quote", @@ -529,7 +530,7 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-json-rpc 0.1.3", "alloy-transport 0.1.3", @@ -567,7 +568,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-primitives", "alloy-serde 0.1.3", @@ -577,7 +578,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-consensus 0.1.3", "alloy-eips 0.1.3", @@ -616,7 +617,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-primitives", "serde", @@ -639,7 +640,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-primitives", "async-trait", @@ -652,7 +653,7 @@ dependencies = [ [[package]] name = "alloy-signer-local" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-consensus 0.1.3", "alloy-network 0.1.3", @@ -757,7 +758,7 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-json-rpc 0.1.3", "base64 0.22.1", @@ -788,7 +789,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.3" -source = "git+https://github.com/alloy-rs/alloy#60cd429bd036c16f1e1f23ec7950689ad9819c76" +source = "git+https://github.com/alloy-rs/alloy#78807cbd0e659873c32d373af963031f71bde8a2" dependencies = [ "alloy-json-rpc 0.1.3", "alloy-transport 0.1.3", @@ -1682,7 +1683,7 @@ dependencies = [ "serde_json", "sozo", "sozo-ops", - "starknet", + "starknet 0.11.0", "tokio", ] @@ -2087,20 +2088,22 @@ checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "cainome" version = "0.2.3" -source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +source = "git+https://github.com/cartridge-gg/cainome?tag=v0.3.0#6c82c5b8e8169a79fe5606f963a3afdf0aa37078" dependencies = [ "anyhow", "async-trait", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", + "cainome-rs-macro 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "camino", "clap", "clap_complete", "convert_case 0.6.0", "serde", "serde_json", - "starknet", + "starknet 0.11.0", + "starknet-types-core", "thiserror", "tracing", "tracing-subscriber", @@ -2110,21 +2113,22 @@ dependencies = [ [[package]] name = "cainome" version = "0.2.3" -source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" +source = "git+https://github.com/cartridge-gg/cainome?rev=e67d925#e67d9259fc562cf743a1a22e5a936e66e073592a" dependencies = [ "anyhow", "async-trait", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", - "cainome-rs-macro", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cainome-rs-macro 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", "camino", "clap", "clap_complete", "convert_case 0.6.0", "serde", "serde_json", - "starknet", + "starknet 0.11.0", + "starknet-types-core", "thiserror", "tracing", "tracing-subscriber", @@ -2134,32 +2138,32 @@ dependencies = [ [[package]] name = "cainome-cairo-serde" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +source = "git+https://github.com/cartridge-gg/cainome?tag=v0.3.0#6c82c5b8e8169a79fe5606f963a3afdf0aa37078" dependencies = [ "serde", - "starknet", + "starknet 0.11.0", "thiserror", ] [[package]] name = "cainome-cairo-serde" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" +source = "git+https://github.com/cartridge-gg/cainome?rev=e67d925#e67d9259fc562cf743a1a22e5a936e66e073592a" dependencies = [ "serde", - "starknet", + "starknet 0.11.0", "thiserror", ] [[package]] name = "cainome-parser" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +source = "git+https://github.com/cartridge-gg/cainome?tag=v0.3.0#6c82c5b8e8169a79fe5606f963a3afdf0aa37078" dependencies = [ "convert_case 0.6.0", "quote", "serde_json", - "starknet", + "starknet 0.11.0", "syn 2.0.68", "thiserror", ] @@ -2167,12 +2171,12 @@ dependencies = [ [[package]] name = "cainome-parser" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" +source = "git+https://github.com/cartridge-gg/cainome?rev=e67d925#e67d9259fc562cf743a1a22e5a936e66e073592a" dependencies = [ "convert_case 0.6.0", "quote", "serde_json", - "starknet", + "starknet 0.11.0", "syn 2.0.68", "thiserror", ] @@ -2180,17 +2184,17 @@ dependencies = [ [[package]] name = "cainome-rs" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f#a84dfe0f54116116f5a3c79642cd4111b1d4a5ac" +source = "git+https://github.com/cartridge-gg/cainome?tag=v0.3.0#6c82c5b8e8169a79fe5606f963a3afdf0aa37078" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=a84dfe0f)", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "camino", "prettyplease 0.2.20", "proc-macro2", "quote", "serde_json", - "starknet", + "starknet 0.11.0", "syn 2.0.68", "thiserror", ] @@ -2198,17 +2202,17 @@ dependencies = [ [[package]] name = "cainome-rs" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" +source = "git+https://github.com/cartridge-gg/cainome?rev=e67d925#e67d9259fc562cf743a1a22e5a936e66e073592a" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", "camino", "prettyplease 0.2.20", "proc-macro2", "quote", "serde_json", - "starknet", + "starknet 0.11.0", "syn 2.0.68", "thiserror", ] @@ -2216,16 +2220,33 @@ dependencies = [ [[package]] name = "cainome-rs-macro" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?rev=ec18eea5#ec18eea55a5c3c563dc502c051a8df3dfab118a9" +source = "git+https://github.com/cartridge-gg/cainome?tag=v0.3.0#6c82c5b8e8169a79fe5606f963a3afdf0aa37078" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "proc-macro2", "quote", "serde_json", - "starknet", + "starknet 0.11.0", + "syn 2.0.68", + "thiserror", +] + +[[package]] +name = "cainome-rs-macro" +version = "0.1.0" +source = "git+https://github.com/cartridge-gg/cainome?rev=e67d925#e67d9259fc562cf743a1a22e5a936e66e073592a" +dependencies = [ + "anyhow", + "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", + "proc-macro2", + "quote", + "serde_json", + "starknet 0.11.0", "syn 2.0.68", "thiserror", ] @@ -2245,10 +2266,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d9c31baeb6b52586b5adc88f01e90f86389d63d94363c562de5c79352e545b" +source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-utils 2.6.4", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2259,9 +2279,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" +source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2271,10 +2291,11 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6296d5748288d9fb97175d31aff9f68ea3f602456923895e512b078e9a2210a0" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2915,7 +2936,7 @@ dependencies = [ "sha2 0.10.8", "smol_str", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.4", + "starknet-types-core", "thiserror", ] @@ -3040,7 +3061,7 @@ dependencies = [ "serde_json", "sha3", "smol_str", - "starknet-types-core 0.1.4", + "starknet-types-core", "thiserror", ] @@ -3227,27 +3248,6 @@ dependencies = [ "smol_str", ] -[[package]] -name = "cairo-lang-sierra-to-casm" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3c3be88c8562fbf93b0803c186e7282f6daad93576c07f61b04a591fde468f" -dependencies = [ - "assert_matches", - "cairo-felt", - "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-ap-change 2.6.4", - "cairo-lang-sierra-gas 2.6.4", - "cairo-lang-sierra-type-size 2.6.4", - "cairo-lang-utils 2.6.4", - "indoc 2.0.5", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.19", - "thiserror", -] - [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.3" @@ -3284,7 +3284,28 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "starknet-types-core 0.1.4", + "starknet-types-core", + "thiserror", +] + +[[package]] +name = "cairo-lang-sierra-to-casm" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ac02c90be2630ae861db6af226090da92741020519768332dd2c07e24d94c75" +dependencies = [ + "assert_matches", + "cairo-felt", + "cairo-lang-casm 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-ap-change 2.6.4", + "cairo-lang-sierra-gas 2.6.4", + "cairo-lang-sierra-type-size 2.6.4", + "cairo-lang-utils 2.6.4", + "indoc 2.0.5", + "itertools 0.11.0", + "num-bigint", + "num-traits 0.2.19", "thiserror", ] @@ -3316,37 +3337,6 @@ dependencies = [ "cairo-lang-utils 2.6.4", ] -[[package]] -name = "cairo-lang-starknet" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9ffa8b3b8c47138c36b1907cebb5047dfc4de29ec10ece5bd6d6853243ec50" -dependencies = [ - "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.4", - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-lowering 2.6.4", - "cairo-lang-plugins 2.6.4", - "cairo-lang-semantic 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-generator 2.6.4", - "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", - "const_format", - "indent", - "indoc 2.0.5", - "itertools 0.11.0", - "once_cell", - "serde", - "serde_json", - "smol_str", - "thiserror", -] - [[package]] name = "cairo-lang-starknet" version = "2.6.3" @@ -3403,32 +3393,38 @@ dependencies = [ "serde", "serde_json", "smol_str", - "starknet-types-core 0.1.4", + "starknet-types-core", "thiserror", ] [[package]] -name = "cairo-lang-starknet-classes" -version = "2.6.3" +name = "cairo-lang-starknet" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c64ae2bb00173e3a88760128bf72de356fa80eb19fa47602479063648b4003" +checksum = "a27921a2bf82d191d28afd570b913341080c8fc25c83bf870dbf1252570b1b41" dependencies = [ + "anyhow", "cairo-felt", - "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-compiler 2.6.4", + "cairo-lang-defs 2.6.4", + "cairo-lang-diagnostics 2.6.4", + "cairo-lang-filesystem 2.6.4", + "cairo-lang-lowering 2.6.4", + "cairo-lang-plugins 2.6.4", + "cairo-lang-semantic 2.6.4", "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-to-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.4", + "cairo-lang-starknet-classes 2.6.4", + "cairo-lang-syntax 2.6.4", "cairo-lang-utils 2.6.4", - "convert_case 0.6.0", + "const_format", + "indent", + "indoc 2.0.5", "itertools 0.11.0", - "num-bigint", - "num-integer", - "num-traits 0.2.19", "once_cell", "serde", "serde_json", - "sha3", "smol_str", - "starknet-crypto 0.6.2", "thiserror", ] @@ -3476,7 +3472,32 @@ dependencies = [ "sha3", "smol_str", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.4", + "starknet-types-core", + "thiserror", +] + +[[package]] +name = "cairo-lang-starknet-classes" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8623b076ef3569e4262da5da270a84658b1ff242fe0c9624fbe432e7a937d101" +dependencies = [ + "cairo-felt", + "cairo-lang-casm 2.6.4", + "cairo-lang-sierra 2.6.4", + "cairo-lang-sierra-to-casm 2.6.4", + "cairo-lang-utils 2.6.4", + "convert_case 0.6.0", + "itertools 0.11.0", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "once_cell", + "serde", + "serde_json", + "sha3", + "smol_str", + "starknet-crypto 0.6.2", "thiserror", ] @@ -3578,7 +3599,7 @@ dependencies = [ "num-bigint", "num-traits 0.2.19", "serde", - "starknet-types-core 0.1.4", + "starknet-types-core", ] [[package]] @@ -3600,7 +3621,7 @@ dependencies = [ "itertools 0.12.1", "num-traits 0.2.19", "rayon", - "starknet-types-core 0.1.4", + "starknet-types-core", ] [[package]] @@ -3665,7 +3686,7 @@ dependencies = [ [[package]] name = "cairo-proof-parser" version = "0.3.0" -source = "git+https://github.com/cartridge-gg/cairo-proof-parser?tag=v0.3.0#1cd7af307609d0f6a602a59d124d5044e56cc7b4" +source = "git+https://github.com/cartridge-gg/cairo-proof-parser?branch=v0.3.0/new-felt#c2b95715c053c2ab81ae605ab30527ecbafa4f03" dependencies = [ "anyhow", "clap", @@ -3674,8 +3695,9 @@ dependencies = [ "regex", "serde", "serde_json", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", + "starknet-types-core", "tokio", "url", ] @@ -3735,7 +3757,7 @@ dependencies = [ "sha2 0.10.8", "sha3", "starknet-crypto 0.6.2", - "starknet-types-core 0.1.4", + "starknet-types-core", "thiserror-no-std", "zip", ] @@ -3789,9 +3811,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.101" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" dependencies = [ "jobserver", "libc", @@ -3977,7 +3999,7 @@ dependencies = [ "num-traits 0.2.19", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4043,9 +4065,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -4063,9 +4085,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -4075,18 +4097,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.6" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbca90c87c2a04da41e95d1856e8bcd22f159bdbfa147314d2ce5218057b0e58" +checksum = "1d598e88f6874d4b888ed40c71efbcbf4076f1dfbae128a08a8c9e45f710605d" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4172,7 +4194,7 @@ dependencies = [ "prefix-hex", "serde", "serde_json", - "serde_with 3.8.1", + "serde_with 3.8.3", ] [[package]] @@ -5049,7 +5071,7 @@ name = "dojo-bindgen" version = "0.7.3" dependencies = [ "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "camino", "chrono", "convert_case 0.6.0", @@ -5058,7 +5080,7 @@ dependencies = [ "scarb", "serde", "serde_json", - "starknet", + "starknet 0.11.0", "thiserror", ] @@ -5113,7 +5135,7 @@ dependencies = [ "serde_json", "serde_with 2.3.3", "smol_str", - "starknet", + "starknet 0.11.0", "test-log", "thiserror", "toml 0.8.14", @@ -5174,7 +5196,8 @@ dependencies = [ "serde_json", "serde_with 2.3.3", "smol_str", - "starknet", + "starknet 0.10.0", + "starknet 0.11.0", "thiserror", "tokio", "toml 0.8.14", @@ -5186,13 +5209,14 @@ dependencies = [ name = "dojo-types" version = "0.7.3" dependencies = [ - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "crypto-bigint", "hex", "itertools 0.12.1", + "num-traits 0.2.19", "serde", "serde_json", - "starknet", + "starknet 0.11.0", "strum 0.25.0", "strum_macros 0.25.3", "thiserror", @@ -5206,7 +5230,7 @@ dependencies = [ "assert_fs", "assert_matches", "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -5220,14 +5244,15 @@ dependencies = [ "http 0.2.12", "ipfs-api-backend-hyper", "katana-runner", + "num-traits 0.2.19", "scarb", "serde", "serde_json", "serde_with 2.3.3", "similar-asserts", "smol_str", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "tempfile", "thiserror", "tokio", @@ -6074,9 +6099,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.2" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69c59d392c7e6c94385b6fd6089d6df0fe945f32b4357687989f3aee253cd7f" +checksum = "d9b8ee65074b2bbb91d9d97c15d172ea75043aefebf9869b5b329149dc76501c" dependencies = [ "bstr 1.9.1", "gix-date", @@ -6433,9 +6458,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.23.3" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f69655c4706db2545f2d78723db30ac15738811de0bc14963135d06666392279" +checksum = "7cb2da346958252cbc8656529f5479830a3bc6046f3d86405c9e77f71dfdf7b2" dependencies = [ "bstr 1.9.1", "gix-actor", @@ -6461,9 +6486,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.2" +version = "0.42.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe2dc4a41191c680c942e6ebd630c8107005983c4679214fdb1007dcf5ae1df" +checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" dependencies = [ "bstr 1.9.1", "gix-actor", @@ -7349,9 +7374,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", @@ -7430,7 +7455,7 @@ checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "rustls 0.23.10", "rustls-pki-types", @@ -7473,7 +7498,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-util", "native-tls", "tokio", @@ -7483,16 +7508,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.3.1", + "hyper 1.4.0", "pin-project-lite", "socket2 0.5.7", "tokio", @@ -7632,12 +7657,12 @@ dependencies = [ [[package]] name = "imara-diff" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" +checksum = "af13c8ceb376860ff0c6a66d83a8cdd4ecd9e464da24621bbffcd02b49619434" dependencies = [ "ahash", - "hashbrown 0.12.3", + "hashbrown 0.14.5", ] [[package]] @@ -8430,8 +8455,6 @@ dependencies = [ "anyhow", "assert_matches", "async-trait", - "cairo-lang-casm 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "cairo-lang-starknet 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "cairo-vm 0.9.2", "convert_case 0.6.0", "derive_more", @@ -8447,13 +8470,14 @@ dependencies = [ "katana-tasks", "lazy_static", "metrics", + "num-traits 0.2.19", "parking_lot 0.12.3", "rand", "reqwest 0.12.5", "serde", "serde_json", "serde_with 2.3.3", - "starknet", + "starknet 0.11.0", "starknet_api", "tempfile", "thiserror", @@ -8478,7 +8502,7 @@ dependencies = [ "roaring", "serde", "serde_json", - "starknet", + "starknet 0.11.0", "starknet_api", "tempfile", "thiserror", @@ -8504,7 +8528,7 @@ dependencies = [ "rstest_reuse", "serde_json", "similar-asserts", - "starknet", + "starknet 0.11.0", "starknet_api", "thiserror", "tokio", @@ -8536,13 +8560,14 @@ dependencies = [ "flate2", "katana-cairo", "lazy_static", + "num-traits 0.2.19", "rand", "serde", "serde_json", "serde_with 2.3.3", "similar-asserts", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "starknet_api", "strum 0.25.0", "strum_macros 0.25.3", @@ -8567,7 +8592,7 @@ dependencies = [ "rstest 0.18.2", "rstest_reuse", "serde_json", - "starknet", + "starknet 0.11.0", "tempfile", "thiserror", "tokio", @@ -8582,7 +8607,7 @@ dependencies = [ "alloy", "anyhow", "assert_matches", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "dojo-metrics", @@ -8603,11 +8628,12 @@ dependencies = [ "katana-runner", "katana-tasks", "metrics", + "num-traits 0.2.19", "rand", "serde", "serde_json", "serde_with 2.3.3", - "starknet", + "starknet 0.11.0", "starknet_api", "tempfile", "thiserror", @@ -8626,7 +8652,7 @@ dependencies = [ "katana-core", "katana-primitives", "katana-rpc-types", - "starknet", + "starknet 0.11.0", ] [[package]] @@ -8642,11 +8668,12 @@ dependencies = [ "katana-executor", "katana-primitives", "katana-provider", + "num-traits 0.2.19", "rstest 0.18.2", "serde", "serde_json", "serde_with 2.3.3", - "starknet", + "starknet 0.11.0", "thiserror", ] @@ -8659,7 +8686,7 @@ dependencies = [ "katana-primitives", "katana-provider", "katana-rpc-types", - "starknet", + "starknet 0.11.0", ] [[package]] @@ -8673,7 +8700,7 @@ dependencies = [ "runner-macro", "serde", "serde_json", - "starknet", + "starknet 0.11.0", "tokio", "url", ] @@ -8690,7 +8717,7 @@ dependencies = [ "katana-primitives", "serde_json", "slot", - "starknet", + "starknet 0.11.0", "tracing", ] @@ -8798,18 +8825,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb5d4f22241504f7c7b8d2c3a7d7835d7c07117f10bff2a7d96a9ef6ef217c3" dependencies = [ - "lambdaworks-math 0.7.0", + "lambdaworks-math", "serde", "sha2 0.10.8", "sha3", ] -[[package]] -name = "lambdaworks-math" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee7dcab3968c71896b8ee4dc829147acc918cffe897af6265b1894527fe3add" - [[package]] name = "lambdaworks-math" version = "0.7.0" @@ -8859,7 +8880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -9506,9 +9527,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ "value-bag", ] @@ -9717,9 +9738,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -10125,9 +10146,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits 0.2.19", @@ -10311,9 +10332,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -10549,7 +10570,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -10638,9 +10659,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -10649,9 +10670,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -10659,9 +10680,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", @@ -10672,9 +10693,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -11310,7 +11331,7 @@ dependencies = [ "reqwest_cookie_store", "serde", "serde_json", - "serde_with 3.8.1", + "serde_with 3.8.3", "thiserror", "tokio", "tracing", @@ -11772,7 +11793,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.3.1", + "hyper 1.4.0", "hyper-rustls 0.27.2", "hyper-tls 0.6.0", "hyper-util", @@ -11875,9 +11896,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.37" +version = "0.8.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +checksum = "a7439be6844e40133eda024efd85bf07f59d0dd2f59b10c00dd6cfb92cc5c741" dependencies = [ "bytemuck", ] @@ -11933,9 +11954,9 @@ dependencies = [ [[package]] name = "roaring" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7699249cc2c7d71939f30868f47e9d7add0bdc030d90ee10bfd16887ff8bb1c8" +checksum = "8f4b84ba6e838ceb47b41de5194a60244fac43d9fe03b71dbe8c5a201081d6d1" dependencies = [ "bytemuck", "byteorder", @@ -12245,7 +12266,7 @@ dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.5", "subtle", "zeroize", ] @@ -12299,9 +12320,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -12412,8 +12433,8 @@ dependencies = [ "katana-rpc-api", "saya-core", "serde_json", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "tokio", "tracing", "tracing-subscriber", @@ -12426,6 +12447,7 @@ version = "0.7.3" dependencies = [ "anyhow", "async-trait", + "bigdecimal 0.4.5", "cairo-felt", "cairo-proof-parser", "cairo-vm 0.9.2", @@ -12453,9 +12475,9 @@ dependencies = [ "serde", "serde_json", "serde_with 2.3.3", - "starknet", - "starknet-crypto 0.6.2", - "starknet-types-core 0.0.9", + "starknet 0.11.0", + "starknet-crypto 0.7.1", + "starknet-types-core", "starknet_api", "thiserror", "tokio", @@ -12482,10 +12504,11 @@ dependencies = [ "katana-rpc-api", "katana-rpc-types", "lazy_static", + "num-traits 0.2.19", "serde", "serde_json", "serde_with 2.3.3", - "starknet", + "starknet 0.11.0", "starknet_api", "thiserror", "tokio", @@ -12872,9 +12895,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.118" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -12952,9 +12975,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.8.1" +version = "3.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" dependencies = [ "base64 0.22.1", "chrono", @@ -12964,7 +12987,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros 3.8.1", + "serde_with_macros 3.8.3", "time", ] @@ -12982,9 +13005,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.8.1" +version = "3.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" dependencies = [ "darling 0.20.9", "proc-macro2", @@ -13204,7 +13227,7 @@ dependencies = [ [[package]] name = "slot" version = "0.8.0" -source = "git+https://github.com/cartridge-gg/slot?rev=1d0c9f7#1d0c9f79122202bb448279f68c97092413e72cd3" +source = "git+https://github.com/cartridge-gg/slot?rev=4c1165d#4c1165d8308495f8de57a8ac52362ce8322e545b" dependencies = [ "anyhow", "axum", @@ -13215,7 +13238,7 @@ dependencies = [ "serde", "serde_json", "serde_with 2.3.3", - "starknet", + "starknet 0.11.0", "tempfile", "thiserror", "tokio", @@ -13325,7 +13348,7 @@ dependencies = [ "assert_fs", "async-trait", "bigdecimal 0.4.5", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -13367,8 +13390,8 @@ dependencies = [ "smol_str", "snapbox", "sozo-ops", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "thiserror", "tokio", "tracing", @@ -13384,7 +13407,8 @@ dependencies = [ "anyhow", "assert_fs", "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "bigdecimal 0.4.5", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -13408,6 +13432,8 @@ dependencies = [ "futures", "ipfs-api-backend-hyper", "katana-runner", + "num-bigint", + "num-traits 0.2.19", "rpassword", "scarb", "scarb-ui", @@ -13416,8 +13442,8 @@ dependencies = [ "serde_json", "serde_with 2.3.3", "smol_str", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "thiserror", "tokio", "toml 0.8.14", @@ -13430,7 +13456,7 @@ name = "sozo-signers" version = "0.7.3" dependencies = [ "anyhow", - "starknet", + "starknet 0.11.0", ] [[package]] @@ -13697,14 +13723,29 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20b9a7b7bfd87287af85854f7458b8170ba6aa59c39113436532b7ff3d2fcbd8" dependencies = [ - "starknet-accounts", - "starknet-contract", - "starknet-core", + "starknet-accounts 0.9.0", + "starknet-contract 0.9.0", + "starknet-core 0.10.0", "starknet-crypto 0.6.2", "starknet-ff", - "starknet-macros", - "starknet-providers", - "starknet-signers", + "starknet-macros 0.1.7", + "starknet-providers 0.10.0", + "starknet-signers 0.8.0", +] + +[[package]] +name = "starknet" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e633a772f59214c296d5037c95c36b72792c9360323818da2b625c7b4ec4b49" +dependencies = [ + "starknet-accounts 0.10.0", + "starknet-contract 0.10.0", + "starknet-core 0.11.1", + "starknet-crypto 0.7.1", + "starknet-macros 0.2.0", + "starknet-providers 0.11.0", + "starknet-signers 0.9.0", ] [[package]] @@ -13715,9 +13756,24 @@ checksum = "2095d7584608ae1707bd1cf2889368ab3734d9f54e4fcef4765cba1f3b3f7618" dependencies = [ "async-trait", "auto_impl", - "starknet-core", - "starknet-providers", - "starknet-signers", + "starknet-core 0.10.0", + "starknet-providers 0.10.0", + "starknet-signers 0.8.0", + "thiserror", +] + +[[package]] +name = "starknet-accounts" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee8a6b588a22c7e79f5d8d4e33413387db63a8beb98be8610138541794cc0a5" +dependencies = [ + "async-trait", + "auto_impl", + "starknet-core 0.11.1", + "starknet-crypto 0.7.1", + "starknet-providers 0.11.0", + "starknet-signers 0.9.0", "thiserror", ] @@ -13730,9 +13786,24 @@ dependencies = [ "serde", "serde_json", "serde_with 2.3.3", - "starknet-accounts", - "starknet-core", - "starknet-providers", + "starknet-accounts 0.9.0", + "starknet-core 0.10.0", + "starknet-providers 0.10.0", + "thiserror", +] + +[[package]] +name = "starknet-contract" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5f91344f1e0b81873b6dc235c50ae4d084c6ea4dd4a1e3e27ad895803adb610" +dependencies = [ + "serde", + "serde_json", + "serde_with 2.3.3", + "starknet-accounts 0.10.0", + "starknet-core 0.11.1", + "starknet-providers 0.11.0", "thiserror", ] @@ -13754,6 +13825,24 @@ dependencies = [ "starknet-ff", ] +[[package]] +name = "starknet-core" +version = "0.11.1" +source = "git+https://github.com/kariy/starknet-rs?branch=dojo-patch#a8ed922690258ca218c80154007aa446ad03929c" +dependencies = [ + "base64 0.21.7", + "crypto-bigint", + "flate2", + "hex", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with 2.3.3", + "sha3", + "starknet-crypto 0.7.0", + "starknet-types-core", +] + [[package]] name = "starknet-crypto" version = "0.5.2" @@ -13768,7 +13857,7 @@ dependencies = [ "num-traits 0.2.19", "rfc6979", "sha2 0.10.8", - "starknet-crypto-codegen", + "starknet-crypto-codegen 0.3.3", "starknet-curve 0.3.0", "starknet-ff", "zeroize", @@ -13788,12 +13877,51 @@ dependencies = [ "num-traits 0.2.19", "rfc6979", "sha2 0.10.8", - "starknet-crypto-codegen", + "starknet-crypto-codegen 0.3.3", "starknet-curve 0.4.2", "starknet-ff", "zeroize", ] +[[package]] +name = "starknet-crypto" +version = "0.7.0" +source = "git+https://github.com/kariy/starknet-rs?branch=dojo-patch#a8ed922690258ca218c80154007aa446ad03929c" +dependencies = [ + "crypto-bigint", + "hex", + "hmac", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "rfc6979", + "sha2 0.10.8", + "starknet-crypto-codegen 0.4.0 (git+https://github.com/kariy/starknet-rs?branch=dojo-patch)", + "starknet-curve 0.5.0 (git+https://github.com/kariy/starknet-rs?branch=dojo-patch)", + "starknet-types-core", + "zeroize", +] + +[[package]] +name = "starknet-crypto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2a821ad8d98c6c3e4d0e5097f3fe6e2ed120ada9d32be87cd1330c7923a2f0" +dependencies = [ + "crypto-bigint", + "hex", + "hmac", + "num-bigint", + "num-integer", + "num-traits 0.2.19", + "rfc6979", + "sha2 0.10.8", + "starknet-crypto-codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-curve 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-types-core", + "zeroize", +] + [[package]] name = "starknet-crypto-codegen" version = "0.3.3" @@ -13805,6 +13933,27 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "starknet-crypto-codegen" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e179dedc3fa6da064e56811d3e05d446aa2f7459e4eb0e3e49378a337235437" +dependencies = [ + "starknet-curve 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-types-core", + "syn 2.0.68", +] + +[[package]] +name = "starknet-crypto-codegen" +version = "0.4.0" +source = "git+https://github.com/kariy/starknet-rs?branch=dojo-patch#a8ed922690258ca218c80154007aa446ad03929c" +dependencies = [ + "starknet-curve 0.5.0 (git+https://github.com/kariy/starknet-rs?branch=dojo-patch)", + "starknet-types-core", + "syn 2.0.68", +] + [[package]] name = "starknet-curve" version = "0.3.0" @@ -13823,6 +13972,23 @@ dependencies = [ "starknet-ff", ] +[[package]] +name = "starknet-curve" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56935b306dcf0b8f14bb2a1257164b8478bb8be4801dfae0923f5b266d1b457c" +dependencies = [ + "starknet-types-core", +] + +[[package]] +name = "starknet-curve" +version = "0.5.0" +source = "git+https://github.com/kariy/starknet-rs?branch=dojo-patch#a8ed922690258ca218c80154007aa446ad03929c" +dependencies = [ + "starknet-types-core", +] + [[package]] name = "starknet-ff" version = "0.3.7" @@ -13844,7 +14010,17 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95d549d3078bdbe775d0deaa8ddb57a19942989ce7c1f2dfd60beeb322bb4945" dependencies = [ - "starknet-core", + "starknet-core 0.10.0", + "syn 2.0.68", +] + +[[package]] +name = "starknet-macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fe4f8d615329410578cbedcdbaa4a36c7f28f68c3f3ac56006cfbdaeaa2b41" +dependencies = [ + "starknet-core 0.11.1", "syn 2.0.68", ] @@ -13863,7 +14039,28 @@ dependencies = [ "serde", "serde_json", "serde_with 2.3.3", - "starknet-core", + "starknet-core 0.10.0", + "thiserror", + "url", +] + +[[package]] +name = "starknet-providers" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c85e0a0f4563ae95dfeae14ea0f0c70610efc0ec2462505c64eff5765e7b97" +dependencies = [ + "async-trait", + "auto_impl", + "ethereum-types", + "flate2", + "getrandom", + "log", + "reqwest 0.11.27", + "serde", + "serde_json", + "serde_with 2.3.3", + "starknet-core 0.11.1", "thiserror", "url", ] @@ -13879,34 +14076,35 @@ dependencies = [ "crypto-bigint", "eth-keystore", "rand", - "starknet-core", + "starknet-core 0.10.0", "starknet-crypto 0.6.2", "thiserror", ] [[package]] -name = "starknet-types-core" -version = "0.0.9" +name = "starknet-signers" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d53160556d1f23425100f42b3230df747ea05763efee685a2cd939dfb640701" +checksum = "c17da2139119dbe3aacf1d5d4338798a5c489d17f424916ceb9d2efd83554f87" dependencies = [ - "bitvec", - "lambdaworks-math 0.5.0", - "lazy_static", - "num-bigint", - "num-integer", - "num-traits 0.2.19", - "serde", + "async-trait", + "auto_impl", + "crypto-bigint", + "eth-keystore", + "getrandom", + "rand", + "starknet-core 0.11.1", + "starknet-crypto 0.7.1", + "thiserror", ] [[package]] name = "starknet-types-core" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65799574816ba83cb04b21a3cb16f791b9882687cd9093415fd1b3821dbac29d" +version = "0.1.5" +source = "git+https://github.com/dojoengine/types-rs?rev=289e2f0#289e2f0bfd5f01a98e7273ff7ce8902a23b5f9d5" dependencies = [ "lambdaworks-crypto", - "lambdaworks-math 0.7.0", + "lambdaworks-math", "lazy_static", "num-bigint", "num-integer", @@ -13920,7 +14118,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "365ec5c0662466f299762bd012012da30e9a28319000cfade372b8787111f202" dependencies = [ - "cairo-lang-starknet-classes 2.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-starknet-classes 2.6.4", "derive_more", "hex", "indexmap 2.2.6", @@ -14750,8 +14948,8 @@ dependencies = [ "serde", "serde_json", "sqlx", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "tokio", "tokio-stream", "tokio-util", @@ -14780,13 +14978,14 @@ dependencies = [ "futures", "futures-util", "libp2p-gossipsub 0.46.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.19", "parking_lot 0.12.3", "prost 0.11.9", "prost 0.12.6", "serde", "serde_json", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "thiserror", "tokio", "tonic 0.10.2", @@ -14803,7 +15002,7 @@ dependencies = [ "anyhow", "async-trait", "base64 0.21.7", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "camino", "chrono", "crypto-bigint", @@ -14816,6 +15015,7 @@ dependencies = [ "katana-runner", "lazy_static", "log", + "num-traits 0.2.19", "once_cell", "reqwest 0.12.5", "scarb", @@ -14825,8 +15025,8 @@ dependencies = [ "slab", "sozo-ops", "sqlx", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "thiserror", "tokio", "tokio-stream", @@ -14859,8 +15059,8 @@ dependencies = [ "serial_test", "sozo-ops", "sqlx", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "strum 0.25.0", "strum_macros 0.25.3", "thiserror", @@ -14888,6 +15088,7 @@ dependencies = [ "futures-util", "hex", "hyper 0.14.29", + "num-traits 0.2.19", "parking_lot 0.12.3", "prost 0.11.9", "prost 0.12.6", @@ -14898,8 +15099,8 @@ dependencies = [ "serde_json", "sozo-ops", "sqlx", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "strum 0.25.0", "strum_macros 0.25.3", "thiserror", @@ -14924,7 +15125,7 @@ version = "0.7.3" dependencies = [ "anyhow", "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=ec18eea5)", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "chrono", "crypto-bigint", "dojo-test-utils", @@ -14940,8 +15141,8 @@ dependencies = [ "serde", "serde_json", "sqlx", - "starknet", - "starknet-crypto 0.6.2", + "starknet 0.11.0", + "starknet-crypto 0.7.1", "tempfile", "thiserror", "tokio", @@ -16093,7 +16294,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -16111,7 +16312,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -16138,7 +16339,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -16173,18 +16374,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -16201,9 +16402,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -16219,9 +16420,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -16237,15 +16438,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -16261,9 +16462,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -16279,9 +16480,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -16297,9 +16498,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -16315,9 +16516,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -16456,9 +16657,9 @@ checksum = "9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852" [[package]] name = "xxhash-rust" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" +checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb" [[package]] name = "yamux" @@ -16508,18 +16709,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index a5e69e673c..a63f5e5799 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,7 +57,7 @@ inherits = "release" lto = "fat" [workspace.dependencies] -cainome = { git = "https://github.com/cartridge-gg/cainome", rev = "ec18eea5", features = [ "abigen-rs" ] } +cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.3.0", features = [ "abigen-rs" ] } common = { path = "crates/common" } # metrics @@ -113,6 +113,7 @@ assert_matches = "1.5.0" async-trait = "0.1.77" auto_impl = "1.2.0" base64 = "0.21.2" +bigdecimal = "0.4.1" bytes = "1.6" cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } @@ -136,7 +137,7 @@ cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-proof-parser = { git = "https://github.com/cartridge-gg/cairo-proof-parser", tag = "v0.3.0" } +cairo-proof-parser = { git = "https://github.com/cartridge-gg/cairo-proof-parser", branch = "v0.3.0/new-felt" } cairo-vm = "0.9.2" camino = { version = "1.1.2", features = [ "serde1" ] } chrono = { version = "0.4.24", features = [ "serde" ] } @@ -180,8 +181,13 @@ serde_with = "2.3" similar-asserts = "1.5.0" smol_str = { version = "0.2.0", features = [ "serde" ] } sqlx = { version = "0.7.2", features = [ "chrono", "macros", "regexp", "runtime-async-std", "runtime-tokio", "sqlite", "uuid" ] } -starknet = "0.10.0" -starknet-crypto = "0.6.2" +starknet = "0.11.0" +starknet-crypto = "0.7.0" +# `starknet-rs` is using `starknet-types-core` 0.1.3, but we need >=0.1.4 because +# we need this . So we put strict +# requirement here to prevent from being downgraded. +# We can remove this requirement once `starknet-rs` is using >=0.1.4 +starknet-types-core = "~0.1.4" starknet_api = "0.11.0" strum = "0.25" strum_macros = "0.25" @@ -219,8 +225,8 @@ alloy-sol-types = { version = "0.7.6", default-features = false } criterion = "0.5.1" # Controller integration -account_sdk = { git = "https://github.com/cartridge-gg/controller", rev = "e8276cfffe48b5d09f0598026d13635374204b72" } -slot = { git = "https://github.com/cartridge-gg/slot", rev = "1d0c9f7" } +account_sdk = { git = "https://github.com/cartridge-gg/controller", branch = "bump-starknet" } +slot = { git = "https://github.com/cartridge-gg/slot", rev = "4c1165d" } [patch.crates-io] cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" } @@ -233,3 +239,10 @@ alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372 alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "4655f8e4372ecc0b056e83abbc60c3912902ee64" } + +# Remove this patch once the following PR is merged: +# +# To enable std feature on `starknet-types-core`. +# To re-export the entire `felt` module from `starknet-types-core`. +starknet-core = { git = "https://github.com/kariy/starknet-rs", branch = "dojo-patch" } +starknet-types-core = { git = "https://github.com/dojoengine/types-rs", rev = "289e2f0" } diff --git a/bin/saya/src/args/mod.rs b/bin/saya/src/args/mod.rs index b16fce3cdc..2e14cdb297 100644 --- a/bin/saya/src/args/mod.rs +++ b/bin/saya/src/args/mod.rs @@ -161,7 +161,7 @@ impl TryFrom for SayaConfig { #[cfg(test)] mod tests { - use katana_primitives::FieldElement; + use katana_primitives::felt::FieldElement; use super::*; use crate::args::data_availability::CelestiaOptions; @@ -226,12 +226,12 @@ mod tests { let expected = StarknetAccountData { starknet_url: Url::parse("http://localhost:5030").unwrap(), - chain_id: FieldElement::from_hex_be("0x534e5f5345504f4c4941").unwrap(), - signer_address: FieldElement::from_hex_be( + chain_id: FieldElement::from_hex("0x534e5f5345504f4c4941").unwrap(), + signer_address: FieldElement::from_hex( "0x3aa0a12c62a46a200b1a1211e8cd09b520164104e76d79648ca459cf05db94", ) .unwrap(), - signer_key: FieldElement::from_hex_be( + signer_key: FieldElement::from_hex( "0x6b41bfa82e791a8b4e6b3ee058cb25b89714e4a23bd9a1ad6e6ba0bbc0b145b", ) .unwrap(), diff --git a/bin/saya/src/args/proof.rs b/bin/saya/src/args/proof.rs index 23375d1dc2..41afd9d6ee 100644 --- a/bin/saya/src/args/proof.rs +++ b/bin/saya/src/args/proof.rs @@ -1,5 +1,5 @@ use clap::Args; -use katana_primitives::FieldElement; +use katana_primitives::felt::FieldElement; use url::Url; #[derive(Debug, Args, Clone)] diff --git a/bin/saya/src/args/starknet_account.rs b/bin/saya/src/args/starknet_account.rs index 45d772ce08..ce03441e7f 100644 --- a/bin/saya/src/args/starknet_account.rs +++ b/bin/saya/src/args/starknet_account.rs @@ -1,7 +1,7 @@ //! Data availability options. use clap::Args; -use katana_primitives::FieldElement; +use katana_primitives::felt::FieldElement; use url::Url; #[derive(Debug, Args, Clone)] diff --git a/bin/saya/src/tests.rs b/bin/saya/src/tests.rs index fbb9b4b727..b32fa3f66f 100644 --- a/bin/saya/src/tests.rs +++ b/bin/saya/src/tests.rs @@ -12,7 +12,7 @@ use saya_core::prover::{ ProverIdentifier, ProvingState, Scheduler, }; use saya_core::ProverAccessKey; -use starknet_crypto::FieldElement; +use starknet_crypto::Felt; use tokio::time::sleep; fn prover_identifier() -> ProverIdentifier { @@ -37,69 +37,64 @@ where #[tokio::test] async fn test_program_input_from_program_output() -> anyhow::Result<()> { let mut input = ProgramInput { - prev_state_root: FieldElement::from_str("101").unwrap(), + prev_state_root: Felt::from_str("101").unwrap(), block_number: 102, - block_hash: FieldElement::from_str("103").unwrap(), - config_hash: FieldElement::from_str("104").unwrap(), + block_hash: Felt::from_str("103").unwrap(), + config_hash: Felt::from_str("104").unwrap(), message_to_starknet_segment: vec![ MessageToStarknet { - from_address: ContractAddress::from(FieldElement::from_str("105").unwrap()), - to_address: ContractAddress::from(FieldElement::from_str("106").unwrap()), - payload: vec![FieldElement::from_str("107").unwrap()], + from_address: ContractAddress::from(Felt::from_str("105").unwrap()), + to_address: ContractAddress::from(Felt::from_str("106").unwrap()), + payload: vec![Felt::from_str("107").unwrap()], }, MessageToStarknet { - from_address: ContractAddress::from(FieldElement::from_str("105").unwrap()), - to_address: ContractAddress::from(FieldElement::from_str("106").unwrap()), - payload: vec![FieldElement::from_str("107").unwrap()], + from_address: ContractAddress::from(Felt::from_str("105").unwrap()), + to_address: ContractAddress::from(Felt::from_str("106").unwrap()), + payload: vec![Felt::from_str("107").unwrap()], }, ], message_to_appchain_segment: vec![ MessageToAppchain { - from_address: ContractAddress::from(FieldElement::from_str("108").unwrap()), - to_address: ContractAddress::from(FieldElement::from_str("109").unwrap()), - nonce: FieldElement::from_str("110").unwrap(), - selector: FieldElement::from_str("111").unwrap(), - payload: vec![FieldElement::from_str("112").unwrap()], + from_address: ContractAddress::from(Felt::from_str("108").unwrap()), + to_address: ContractAddress::from(Felt::from_str("109").unwrap()), + nonce: Felt::from_str("110").unwrap(), + selector: Felt::from_str("111").unwrap(), + payload: vec![Felt::from_str("112").unwrap()], }, MessageToAppchain { - from_address: ContractAddress::from(FieldElement::from_str("108").unwrap()), - to_address: ContractAddress::from(FieldElement::from_str("109").unwrap()), - nonce: FieldElement::from_str("110").unwrap(), - selector: FieldElement::from_str("111").unwrap(), - payload: vec![FieldElement::from_str("112").unwrap()], + from_address: ContractAddress::from(Felt::from_str("108").unwrap()), + to_address: ContractAddress::from(Felt::from_str("109").unwrap()), + nonce: Felt::from_str("110").unwrap(), + selector: Felt::from_str("111").unwrap(), + payload: vec![Felt::from_str("112").unwrap()], }, ], state_updates: StateUpdates { nonce_updates: { let mut map = std::collections::HashMap::new(); map.insert( - ContractAddress::from(FieldElement::from_str("1111").unwrap()), - FieldElement::from_str("22222").unwrap(), + ContractAddress::from(Felt::from_str("1111").unwrap()), + Felt::from_str("22222").unwrap(), ); map }, storage_updates: vec![( - ContractAddress::from(FieldElement::from_str("333")?), - vec![(FieldElement::from_str("4444")?, FieldElement::from_str("555")?)] - .into_iter() - .collect(), + ContractAddress::from(Felt::from_str("333")?), + vec![(Felt::from_str("4444")?, Felt::from_str("555")?)].into_iter().collect(), )] .into_iter() .collect(), contract_updates: { let mut map = std::collections::HashMap::new(); map.insert( - ContractAddress::from(FieldElement::from_str("66666").unwrap()), - FieldElement::from_str("7777").unwrap(), + ContractAddress::from(Felt::from_str("66666").unwrap()), + Felt::from_str("7777").unwrap(), ); map }, declared_classes: { let mut map = std::collections::HashMap::new(); - map.insert( - FieldElement::from_str("88888").unwrap(), - FieldElement::from_str("99999").unwrap(), - ); + map.insert(Felt::from_str("88888").unwrap(), Felt::from_str("99999").unwrap()); map }, }, @@ -256,7 +251,7 @@ async fn test_combine_proofs() { .map(|s| serde_json::from_str::(s).unwrap()) .collect::>(); - let world = FieldElement::from_dec_str("333").unwrap(); + let world = Felt::from_dec_str("333").unwrap(); for input in &mut inputs { input.fill_da(world) } @@ -286,7 +281,7 @@ async fn test_combine_proofs() { #[ignore] #[tokio::test] async fn test_4_combine_proofs() -> anyhow::Result<()> { - let world = FieldElement::from_dec_str("42")?; + let world = Felt::from_dec_str("42")?; let input_1 = r#"{ "prev_state_root": "101", diff --git a/bin/scheduler/src/main.rs b/bin/scheduler/src/main.rs index 275b4036ed..b94ace2f71 100644 --- a/bin/scheduler/src/main.rs +++ b/bin/scheduler/src/main.rs @@ -2,7 +2,7 @@ use std::fs; use std::sync::Arc; use clap::Parser; -use katana_primitives::FieldElement; +use katana_primitives::felt::FieldElement; use saya_core::prover::{HttpProverParams, ProgramInput, ProverIdentifier, Scheduler}; use saya_core::ProverAccessKey; use serde::{Deserialize, Serialize}; diff --git a/bin/sozo/Cargo.toml b/bin/sozo/Cargo.toml index 64fb08de3c..6d7b3c651a 100644 --- a/bin/sozo/Cargo.toml +++ b/bin/sozo/Cargo.toml @@ -11,7 +11,7 @@ slot = { workspace = true, optional = true } anyhow.workspace = true async-trait.workspace = true -bigdecimal = "0.4.1" +bigdecimal.workspace = true cairo-lang-compiler.workspace = true cairo-lang-defs.workspace = true cairo-lang-filesystem.workspace = true diff --git a/bin/sozo/src/commands/account.rs b/bin/sozo/src/commands/account.rs index 63b3206960..806e07e264 100644 --- a/bin/sozo/src/commands/account.rs +++ b/bin/sozo/src/commands/account.rs @@ -4,8 +4,8 @@ use anyhow::Result; use clap::{Args, Subcommand}; use scarb::core::Config; use sozo_ops::account; +use starknet::core::types::Felt; use starknet::signers::LocalWallet; -use starknet_crypto::FieldElement; use tracing::trace; use super::options::signer::SignerOptions; @@ -53,7 +53,7 @@ pub enum AccountCommand { estimate_only: bool, #[clap(long, help = "Provide transaction nonce manually")] - nonce: Option, + nonce: Option, #[clap( long, @@ -82,7 +82,7 @@ pub enum AccountCommand { output: PathBuf, #[clap(help = "Contract address")] - address: FieldElement, + address: Felt, }, } diff --git a/bin/sozo/src/commands/auth.rs b/bin/sozo/src/commands/auth.rs index 01e3c6189d..554f7fe945 100644 --- a/bin/sozo/src/commands/auth.rs +++ b/bin/sozo/src/commands/auth.rs @@ -188,7 +188,7 @@ mod tests { use std::str::FromStr; use dojo_world::contracts::cairo_utils; - use starknet_crypto::FieldElement; + use starknet::core::types::Felt; use super::*; @@ -196,7 +196,7 @@ mod tests { fn test_owner_resource_from_str() { // Test valid input let input = "contract:path::to::contract,0x1234"; - let expected_owner = FieldElement::from_hex_be("0x1234").unwrap(); + let expected_owner = Felt::from_hex("0x1234").unwrap(); let expected_resource = auth::ResourceType::Contract("path::to::contract".to_string()); let expected = auth::OwnerResource { owner: expected_owner, resource: expected_resource }; let result = auth::OwnerResource::from_str(input).unwrap(); @@ -204,7 +204,7 @@ mod tests { // Test valid input with model let input = "model:model_name,0x1234"; - let expected_owner = FieldElement::from_hex_be("0x1234").unwrap(); + let expected_owner = Felt::from_hex("0x1234").unwrap(); let expected_model = cairo_utils::str_to_felt("model_name").unwrap(); let expected_resource = auth::ResourceType::Model(expected_model); let expected = auth::OwnerResource { owner: expected_owner, resource: expected_resource }; diff --git a/bin/sozo/src/commands/call.rs b/bin/sozo/src/commands/call.rs index dd7c944cec..e4caf0b554 100644 --- a/bin/sozo/src/commands/call.rs +++ b/bin/sozo/src/commands/call.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clap::Args; use scarb::core::Config; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use tracing::trace; use super::options::starknet::StarknetOptions; @@ -21,7 +21,7 @@ pub struct CallArgs { #[arg(value_delimiter = ',')] #[arg(help = "The calldata to be passed to the entrypoint. Comma separated values e.g., \ 0x12345,0x69420.")] - pub calldata: Vec, + pub calldata: Vec, #[arg(short, long)] #[arg(help = "The block ID (could be a hash, a number, 'pending' or 'latest')")] diff --git a/bin/sozo/src/commands/calldata_decoder.rs b/bin/sozo/src/commands/calldata_decoder.rs index 86a5b095f2..082f50d7cd 100644 --- a/bin/sozo/src/commands/calldata_decoder.rs +++ b/bin/sozo/src/commands/calldata_decoder.rs @@ -1,7 +1,7 @@ use anyhow::{self, Result}; use cainome::cairo_serde::{ByteArray, CairoSerde}; use num_bigint::BigUint; -use starknet::core::types::{FieldElement, FromStrError}; +use starknet::core::types::{Felt, FromStrError}; use starknet::core::utils::cairo_short_string_to_felt; /// An error that occurs while decoding calldata. @@ -26,16 +26,16 @@ pub type DecoderResult = Result; const ITEM_DELIMITER: char = ','; const ITEM_PREFIX_DELIMITER: char = ':'; -/// A trait for decoding calldata into a vector of FieldElements. +/// A trait for decoding calldata into a vector of Felts. trait CalldataDecoder { - fn decode(&self, input: &str) -> DecoderResult>; + fn decode(&self, input: &str) -> DecoderResult>; } -/// Decodes a u256 string into a [`FieldElement`]s array representing +/// Decodes a u256 string into a [`Felt`]s array representing /// a u256 value split into two 128-bit words. struct U256CalldataDecoder; impl CalldataDecoder for U256CalldataDecoder { - fn decode(&self, input: &str) -> DecoderResult> { + fn decode(&self, input: &str) -> DecoderResult> { let bigint = if let Some(hex_str) = input.strip_prefix("0x") { let unsigned_bytes = if hex_str.len() % 2 == 0 { hex::decode(hex_str)? @@ -68,46 +68,46 @@ impl CalldataDecoder for U256CalldataDecoder { let low = &bigint % &u128_max_plus_1; // Unwrapping is safe as these are never out of range - let high = FieldElement::from_byte_slice_be(&high.to_bytes_be()).unwrap(); - let low = FieldElement::from_byte_slice_be(&low.to_bytes_be()).unwrap(); + let high = Felt::from_bytes_be_slice(&high.to_bytes_be()); + let low = Felt::from_bytes_be_slice(&low.to_bytes_be()); Ok(vec![low, high]) } } -/// Decodes a string (ByteArray) into a [`FieldElement`]s array representing +/// Decodes a string (ByteArray) into a [`Felt`]s array representing /// a serialized Cairo ByteArray. struct StrCalldataDecoder; impl CalldataDecoder for StrCalldataDecoder { - fn decode(&self, input: &str) -> DecoderResult> { + fn decode(&self, input: &str) -> DecoderResult> { let ba = ByteArray::from_string(input)?; Ok(ByteArray::cairo_serialize(&ba)) } } -/// Decodes a cairo short string into a [`FieldElement`]. +/// Decodes a cairo short string into a [`Felt`]. struct ShortStrCalldataDecoder; impl CalldataDecoder for ShortStrCalldataDecoder { - fn decode(&self, input: &str) -> DecoderResult> { + fn decode(&self, input: &str) -> DecoderResult> { Ok(vec![cairo_short_string_to_felt(input)?]) } } -/// Decodes a string into a [`FieldElement`], either from hexadecimal or decimal string. +/// Decodes a string into a [`Felt`], either from hexadecimal or decimal string. struct DefaultCalldataDecoder; impl CalldataDecoder for DefaultCalldataDecoder { - fn decode(&self, input: &str) -> DecoderResult> { + fn decode(&self, input: &str) -> DecoderResult> { let felt = if let Some(hex_str) = input.strip_prefix("0x") { - FieldElement::from_hex_be(hex_str)? + Felt::from_hex(hex_str)? } else { - FieldElement::from_dec_str(input)? + Felt::from_dec_str(input)? }; Ok(vec![felt]) } } -/// Decodes a string of calldata items into a vector of FieldElements. +/// Decodes a string of calldata items into a vector of Felts. /// /// # Arguments: /// @@ -115,7 +115,7 @@ impl CalldataDecoder for DefaultCalldataDecoder { /// prefixes to indicate the type of the item. /// /// # Returns -/// A vector of [`FieldElement`]s. +/// A vector of [`Felt`]s. /// /// # Example /// @@ -123,7 +123,7 @@ impl CalldataDecoder for DefaultCalldataDecoder { /// let input = "u256:0x1,str:hello,64"; /// let result = decode_calldata(input).unwrap(); /// ``` -pub fn decode_calldata(input: &str) -> DecoderResult> { +pub fn decode_calldata(input: &str) -> DecoderResult> { let items = input.split(ITEM_DELIMITER); let mut calldata = vec![]; @@ -134,15 +134,15 @@ pub fn decode_calldata(input: &str) -> DecoderResult> { Ok(calldata) } -/// Decodes a single item of calldata into a vector of FieldElements. +/// Decodes a single item of calldata into a vector of Felts. /// /// # Arguments /// /// * `item` - The item to decode. /// /// # Returns -/// A vector of [`FieldElement`]s. -fn decode_inner(item: &str) -> DecoderResult> { +/// A vector of [`Felt`]s. +fn decode_inner(item: &str) -> DecoderResult> { let item = item.trim(); let felts = if let Some((prefix, value)) = item.split_once(ITEM_PREFIX_DELIMITER) { @@ -168,7 +168,7 @@ mod tests { #[test] fn test_u256_decoder_hex() { let input = "u256:0x1"; - let expected = vec![FieldElement::ONE, FieldElement::ZERO]; + let expected = vec![Felt::ONE, Felt::ZERO]; let result = decode_calldata(input).unwrap(); assert_eq!(result, expected); } diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index 4ab758ed9e..c4dfc43fb5 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -7,7 +7,7 @@ use katana_rpc_api::starknet::RPC_SPEC_VERSION; use scarb::core::{Config, Workspace}; use sozo_ops::migration; use starknet::accounts::{Account, ConnectedAccount}; -use starknet::core::types::{BlockId, BlockTag, FieldElement, StarknetError}; +use starknet::core::types::{BlockId, BlockTag, Felt, StarknetError}; use starknet::core::utils::parse_cairo_short_string; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider, ProviderError}; @@ -156,7 +156,7 @@ pub async fn setup_env<'a>( world: WorldOptions, name: &str, env: Option<&'a Environment>, -) -> Result<(Option, SozoAccount>, String)> { +) -> Result<(Option, SozoAccount>, String)> { trace!("Setting up environment."); let ui = ws.config().ui(); diff --git a/bin/sozo/src/commands/model.rs b/bin/sozo/src/commands/model.rs index c14297034a..d004cf7f13 100644 --- a/bin/sozo/src/commands/model.rs +++ b/bin/sozo/src/commands/model.rs @@ -2,7 +2,7 @@ use anyhow::Result; use clap::{Args, Subcommand}; use scarb::core::Config; use sozo_ops::model; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use tracing::trace; use super::options::starknet::StarknetOptions; @@ -52,7 +52,7 @@ hashes, called 'hash' in the following documentation. fixed layout key = parent_key struct layout field key = hash(parent_key, field_selector) tuple layout item key = hash(parent_key, item_index) - enum layout + enum layout variant key = parent_key data key = hash(parent_key, variant_index) array layout @@ -96,7 +96,7 @@ hashes, called 'hash' in the following documentation. #[arg(value_name = "KEYS")] #[arg(value_delimiter = ',')] #[arg(help = "Comma seperated values e.g., 0x12345,0x69420,...")] - keys: Vec, + keys: Vec, #[command(flatten)] world: WorldOptions, diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs index f110a9b7f3..3cdd75fad2 100644 --- a/bin/sozo/src/commands/options/account/controller.rs +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -9,7 +9,7 @@ use dojo_world::migration::strategy::generate_salt; use scarb::core::Config; use slot::session::Policy; use starknet::core::types::contract::{AbiEntry, StateMutability}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::{cairo_short_string_to_felt, get_contract_address}; use starknet::macros::short_string; use starknet::providers::Provider; @@ -121,7 +121,7 @@ where /// project's base manifest ( `/manifests//base` ) and convert them into policies. fn collect_policies( world_addr_or_name: WorldAddressOrName, - user_address: FieldElement, + user_address: Felt, config: &Config, ) -> Result> { let root_dir = config.root(); @@ -140,7 +140,7 @@ fn get_project_base_manifest(root_dir: &Utf8Path, profile: &str) -> Result Result> { @@ -182,7 +182,7 @@ fn collect_policies_from_base_manifest( fn policies_from_abis( policies: &mut Vec, contract_name: &str, - contract_address: FieldElement, + contract_address: Felt, entries: &[AbiEntry], ) { for entry in entries { @@ -205,10 +205,7 @@ fn policies_from_abis( } } -fn get_dojo_contract_address( - world_address: FieldElement, - manifest: &Manifest, -) -> FieldElement { +fn get_dojo_contract_address(world_address: Felt, manifest: &Manifest) -> Felt { if let Some(address) = manifest.inner.address { address } else { @@ -220,7 +217,7 @@ fn get_dojo_contract_address( fn get_dojo_world_address( world_address: WorldAddressOrName, manifest: &BaseManifest, -) -> Result { +) -> Result { match world_address { WorldAddressOrName::Address(addr) => Ok(addr), WorldAddressOrName::Name(name) => { @@ -230,7 +227,7 @@ fn get_dojo_world_address( salt, manifest.world.inner.original_class_hash, &[manifest.base.inner.original_class_hash], - FieldElement::ZERO, + Felt::ZERO, ); Ok(address) } diff --git a/bin/sozo/src/commands/options/account/mod.rs b/bin/sozo/src/commands/options/account/mod.rs index 8a33772848..0e68b02a3c 100644 --- a/bin/sozo/src/commands/options/account/mod.rs +++ b/bin/sozo/src/commands/options/account/mod.rs @@ -5,7 +5,7 @@ use clap::Args; use dojo_world::metadata::Environment; use scarb::core::Config; use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount}; -use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::providers::Provider; use starknet::signers::LocalWallet; use tracing::trace; @@ -28,7 +28,7 @@ pub use r#type::*; /// Else if it's an address, it will be used directly. #[derive(Debug)] pub enum WorldAddressOrName { - Address(FieldElement), + Address(Felt), Name(String), } @@ -42,7 +42,7 @@ pub enum WorldAddressOrName { pub struct AccountOptions { #[arg(long, env = DOJO_ACCOUNT_ADDRESS_ENV_VAR)] #[arg(global = true)] - pub account_address: Option, + pub account_address: Option, #[arg(global = true)] #[arg(long = "slot.controller")] @@ -132,13 +132,13 @@ impl AccountOptions { Ok(account) } - pub fn account_address(&self, env_metadata: Option<&Environment>) -> Result { + pub fn account_address(&self, env_metadata: Option<&Environment>) -> Result { if let Some(address) = self.account_address { trace!(?address, "Account address found."); Ok(address) } else if let Some(address) = env_metadata.and_then(|env| env.account_address()) { trace!(address, "Account address found in environment metadata."); - Ok(FieldElement::from_str(address)?) + Ok(Felt::from_str(address)?) } else { Err(anyhow!( "Could not find account address. Please specify it with --account-address or in \ @@ -152,7 +152,7 @@ impl AccountOptions { mod tests { use clap::Parser; use starknet::accounts::{Call, ExecutionEncoder}; - use starknet_crypto::FieldElement; + use starknet_crypto::Felt; use super::{AccountOptions, DOJO_ACCOUNT_ADDRESS_ENV_VAR}; @@ -167,16 +167,13 @@ mod tests { std::env::set_var(DOJO_ACCOUNT_ADDRESS_ENV_VAR, "0x0"); let cmd = Command::parse_from([""]); - assert_eq!(cmd.account.account_address, Some(FieldElement::from_hex_be("0x0").unwrap())); + assert_eq!(cmd.account.account_address, Some(Felt::from_hex("0x0").unwrap())); } #[test] fn account_address_from_args() { let cmd = Command::parse_from(["sozo", "--account-address", "0x0"]); - assert_eq!( - cmd.account.account_address(None).unwrap(), - FieldElement::from_hex_be("0x0").unwrap() - ); + assert_eq!(cmd.account.account_address(None).unwrap(), Felt::from_hex("0x0").unwrap()); } #[test] @@ -189,7 +186,7 @@ mod tests { let cmd = Command::parse_from([""]); assert_eq!( cmd.account.account_address(Some(&env_metadata)).unwrap(), - FieldElement::from_hex_be("0x0").unwrap() + Felt::from_hex("0x0").unwrap() ); } @@ -203,7 +200,7 @@ mod tests { let cmd = Command::parse_from(["sozo", "--account-address", "0x1"]); assert_eq!( cmd.account.account_address(Some(&env_metadata)).unwrap(), - FieldElement::from_hex_be("0x1").unwrap() + Felt::from_hex("0x1").unwrap() ); } @@ -224,12 +221,9 @@ mod tests { "0x1", ]); let dummy_call = vec![Call { - to: FieldElement::from_hex_be("0x0").unwrap(), - selector: FieldElement::from_hex_be("0x1").unwrap(), - calldata: vec![ - FieldElement::from_hex_be("0x2").unwrap(), - FieldElement::from_hex_be("0x3").unwrap(), - ], + to: Felt::from_hex("0x0").unwrap(), + selector: Felt::from_hex("0x1").unwrap(), + calldata: vec![Felt::from_hex("0x2").unwrap(), Felt::from_hex("0x3").unwrap()], }]; // HACK: SingleOwnerAccount doesn't expose a way to check `encoding` type used in struct, so @@ -237,19 +231,16 @@ mod tests { let account = cmd.account.std_account(runner.provider(), None).await.unwrap(); let result = account.encode_calls(&dummy_call); // 0x0 is the data offset. - assert!(*result.get(3).unwrap() == FieldElement::from_hex_be("0x0").unwrap()); + assert!(*result.get(3).unwrap() == Felt::from_hex("0x0").unwrap()); } #[katana_runner::katana_test(2, true)] async fn without_legacy_flag_works_as_expected() { let cmd = Command::parse_from(["sozo", "--account-address", "0x0", "--private-key", "0x1"]); let dummy_call = vec![Call { - to: FieldElement::from_hex_be("0x0").unwrap(), - selector: FieldElement::from_hex_be("0x1").unwrap(), - calldata: vec![ - FieldElement::from_hex_be("0xf2").unwrap(), - FieldElement::from_hex_be("0xf3").unwrap(), - ], + to: Felt::from_hex("0x0").unwrap(), + selector: Felt::from_hex("0x1").unwrap(), + calldata: vec![Felt::from_hex("0xf2").unwrap(), Felt::from_hex("0xf3").unwrap()], }]; // HACK: SingleOwnerAccount doesn't expose a way to check `encoding` type used in struct, so @@ -257,6 +248,6 @@ mod tests { let account = cmd.account.std_account(runner.provider(), None).await.unwrap(); let result = account.encode_calls(&dummy_call); // 0x2 is the Calldata len. - assert!(*result.get(3).unwrap() == FieldElement::from_hex_be("0x2").unwrap()); + assert!(*result.get(3).unwrap() == Felt::from_hex("0x2").unwrap()); } } diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs index 0a45328600..a0fda6fbc0 100644 --- a/bin/sozo/src/commands/options/account/type.rs +++ b/bin/sozo/src/commands/options/account/type.rs @@ -1,15 +1,15 @@ use std::sync::Arc; use async_trait::async_trait; -use starknet::accounts::single_owner::SignError; use starknet::accounts::{ - Account, Call, ConnectedAccount, Declaration, Execution, ExecutionEncoder, LegacyDeclaration, - RawDeclaration, RawExecution, RawLegacyDeclaration, SingleOwnerAccount, + single_owner, Account, Call, ConnectedAccount, DeclarationV2, DeclarationV3, ExecutionEncoder, + ExecutionV1, ExecutionV3, LegacyDeclaration, RawDeclarationV2, RawDeclarationV3, + RawExecutionV1, RawExecutionV3, RawLegacyDeclaration, SingleOwnerAccount, }; use starknet::core::types::contract::legacy::LegacyContractClass; -use starknet::core::types::{BlockId, FieldElement, FlattenedSierraClass}; +use starknet::core::types::{BlockId, Felt, FlattenedSierraClass}; use starknet::providers::Provider; -use starknet::signers::LocalWallet; +use starknet::signers::{local_wallet, LocalWallet}; #[cfg(feature = "controller")] use super::controller::ControllerSessionAccount; @@ -17,7 +17,7 @@ use super::controller::ControllerSessionAccount; #[derive(Debug, thiserror::Error)] pub enum SozoAccountSignError { #[error(transparent)] - Standard(#[from] SignError), + Standard(#[from] single_owner::SignError), #[cfg(feature = "controller")] #[error(transparent)] @@ -51,7 +51,7 @@ where { type SignError = SozoAccountSignError; - fn address(&self) -> FieldElement { + fn address(&self) -> Felt { match self { Self::Standard(account) => account.address(), #[cfg(feature = "controller")] @@ -59,7 +59,7 @@ where } } - fn chain_id(&self) -> FieldElement { + fn chain_id(&self) -> Felt { match self { Self::Standard(account) => account.chain_id(), #[cfg(feature = "controller")] @@ -67,47 +67,71 @@ where } } + fn declare_legacy( + &self, + contract_class: Arc, + ) -> LegacyDeclaration<'_, Self> { + LegacyDeclaration::new(contract_class, self) + } + fn declare( &self, contract_class: Arc, - compiled_class_hash: FieldElement, - ) -> Declaration<'_, Self> { - Declaration::new(contract_class, compiled_class_hash, self) + compiled_class_hash: Felt, + ) -> DeclarationV2<'_, Self> { + DeclarationV2::new(contract_class, compiled_class_hash, self) } - fn declare_legacy( + fn declare_v2( &self, - contract_class: Arc, - ) -> LegacyDeclaration<'_, Self> { - LegacyDeclaration::new(contract_class, self) + contract_class: Arc, + compiled_class_hash: Felt, + ) -> DeclarationV2<'_, Self> { + DeclarationV2::new(contract_class, compiled_class_hash, self) + } + + fn declare_v3( + &self, + contract_class: Arc, + compiled_class_hash: Felt, + ) -> DeclarationV3<'_, Self> { + DeclarationV3::new(contract_class, compiled_class_hash, self) } - fn execute(&self, calls: Vec) -> Execution<'_, Self> { - Execution::new(calls, self) + fn execute(&self, calls: Vec) -> ExecutionV1<'_, Self> { + ExecutionV1::new(calls, self) } - async fn sign_execution( + fn execute_v1(&self, calls: Vec) -> ExecutionV1<'_, Self> { + ExecutionV1::new(calls, self) + } + + fn execute_v3(&self, calls: Vec) -> ExecutionV3<'_, Self> { + ExecutionV3::new(calls, self) + } + + async fn sign_execution_v1( &self, - execution: &RawExecution, + execution: &RawExecutionV1, query_only: bool, - ) -> Result, Self::SignError> { + ) -> Result, Self::SignError> { let result = match self { - Self::Standard(account) => account.sign_execution(execution, query_only).await?, + Self::Standard(account) => account.sign_execution_v1(execution, query_only).await?, #[cfg(feature = "controller")] - Self::Controller(account) => account.sign_execution(execution, query_only).await?, + Self::Controller(account) => account.sign_execution_v1(execution, query_only).await?, }; Ok(result) } - async fn sign_declaration( + async fn sign_execution_v3( &self, - declaration: &RawDeclaration, + execution: &RawExecutionV3, query_only: bool, - ) -> Result, Self::SignError> { + ) -> Result, Self::SignError> { let result = match self { - Self::Standard(account) => account.sign_declaration(declaration, query_only).await?, + Self::Standard(account) => account.sign_execution_v3(execution, query_only).await?, #[cfg(feature = "controller")] - Self::Controller(account) => account.sign_declaration(declaration, query_only).await?, + Self::Controller(account) => account.sign_execution_v3(execution, query_only).await?, }; Ok(result) } @@ -116,7 +140,7 @@ where &self, declaration: &RawLegacyDeclaration, query_only: bool, - ) -> Result, Self::SignError> { + ) -> Result, Self::SignError> { match self { Self::Standard(account) => { let result = account.sign_legacy_declaration(declaration, query_only).await?; @@ -129,6 +153,38 @@ where } } } + + async fn sign_declaration_v2( + &self, + declaration: &RawDeclarationV2, + query_only: bool, + ) -> Result, Self::SignError> { + let result = match self { + Self::Standard(account) => account.sign_declaration_v2(declaration, query_only).await?, + + #[cfg(feature = "controller")] + Self::Controller(account) => { + account.sign_declaration_v2(declaration, query_only).await? + } + }; + Ok(result) + } + + async fn sign_declaration_v3( + &self, + declaration: &RawDeclarationV3, + query_only: bool, + ) -> Result, Self::SignError> { + let result = match self { + Self::Standard(account) => account.sign_declaration_v3(declaration, query_only).await?, + + #[cfg(feature = "controller")] + Self::Controller(account) => { + account.sign_declaration_v3(declaration, query_only).await? + } + }; + Ok(result) + } } impl

ExecutionEncoder for SozoAccount

@@ -136,7 +192,7 @@ where P: Provider, P: Send + Sync, { - fn encode_calls(&self, calls: &[Call]) -> Vec { + fn encode_calls(&self, calls: &[Call]) -> Vec { match self { Self::Standard(account) => account.encode_calls(calls), #[cfg(feature = "controller")] diff --git a/bin/sozo/src/commands/options/signer.rs b/bin/sozo/src/commands/options/signer.rs index 04b59b913b..8f3e6492c2 100644 --- a/bin/sozo/src/commands/options/signer.rs +++ b/bin/sozo/src/commands/options/signer.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use anyhow::{anyhow, Result}; use clap::Args; use dojo_world::metadata::Environment; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::signers::{LocalWallet, SigningKey}; use tracing::trace; @@ -46,7 +46,7 @@ impl SignerOptions { if let Some(private_key) = self.private_key(env_metadata) { trace!(private_key, "Signing using private key."); return Ok(LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_str(&private_key)?, + Felt::from_str(&private_key)?, ))); } @@ -102,7 +102,7 @@ mod tests { use clap::Parser; use starknet::signers::{LocalWallet, Signer, SigningKey}; - use starknet_crypto::FieldElement; + use starknet_crypto::Felt; use super::{SignerOptions, DOJO_KEYSTORE_PASSWORD_ENV_VAR, DOJO_PRIVATE_KEY_ENV_VAR}; @@ -135,7 +135,7 @@ mod tests { let cmd = Command::parse_from(["sozo", "--private-key", private_key]); let result_wallet = cmd.signer.signer(None, true).unwrap(); let expected_wallet = LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_str(private_key).unwrap(), + Felt::from_str(private_key).unwrap(), )); let result_public_key = result_wallet.get_public_key().await.unwrap(); @@ -154,7 +154,7 @@ mod tests { let cmd = Command::parse_from(["sozo"]); let result_wallet = cmd.signer.signer(Some(&env_metadata), true).unwrap(); let expected_wallet = LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_str(private_key).unwrap(), + Felt::from_str(private_key).unwrap(), )); let result_public_key = result_wallet.get_public_key().await.unwrap(); @@ -177,7 +177,7 @@ mod tests { ]); let result_wallet = cmd.signer.signer(None, true).unwrap(); let expected_wallet = LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_str(private_key).unwrap(), + Felt::from_str(private_key).unwrap(), )); let result_public_key = result_wallet.get_public_key().await.unwrap(); @@ -199,7 +199,7 @@ mod tests { let cmd = Command::parse_from(["sozo", "--password", keystore_password]); let result_wallet = cmd.signer.signer(Some(&env_metadata), true).unwrap(); let expected_wallet = LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_str(private_key).unwrap(), + Felt::from_str(private_key).unwrap(), )); let result_public_key = result_wallet.get_public_key().await.unwrap(); @@ -221,7 +221,7 @@ mod tests { let cmd = Command::parse_from(["sozo", "--keystore", keystore_path]); let result_wallet = cmd.signer.signer(Some(&env_metadata), true).unwrap(); let expected_wallet = LocalWallet::from_signing_key(SigningKey::from_secret_scalar( - FieldElement::from_str(private_key).unwrap(), + Felt::from_str(private_key).unwrap(), )); let result_public_key = result_wallet.get_public_key().await.unwrap(); diff --git a/bin/sozo/src/commands/options/transaction.rs b/bin/sozo/src/commands/options/transaction.rs index f3fb1d9534..bca724fd39 100644 --- a/bin/sozo/src/commands/options/transaction.rs +++ b/bin/sozo/src/commands/options/transaction.rs @@ -1,7 +1,7 @@ use anyhow::{bail, Result}; use clap::Args; use dojo_world::migration::{TxnAction, TxnConfig}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use tracing::trace; #[derive(Debug, Args, Default)] @@ -20,7 +20,7 @@ pub struct TransactionOptions { #[arg(help = "Maximum raw value to be used for fees, in Wei.")] #[arg(conflicts_with = "fee_estimate_multiplier")] #[arg(global = true)] - pub max_fee_raw: Option, + pub max_fee_raw: Option, #[arg(long)] #[arg(help = "Wait until the transaction is accepted by the sequencer, returning the status \ diff --git a/bin/sozo/src/commands/options/world.rs b/bin/sozo/src/commands/options/world.rs index 88f1bbd5f2..0d75ee653c 100644 --- a/bin/sozo/src/commands/options/world.rs +++ b/bin/sozo/src/commands/options/world.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use anyhow::{anyhow, Result}; use clap::Args; use dojo_world::metadata::Environment; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use tracing::trace; use super::DOJO_WORLD_ADDRESS_ENV_VAR; @@ -14,17 +14,17 @@ pub struct WorldOptions { #[arg(help = "The address of the World contract.")] #[arg(long = "world", env = DOJO_WORLD_ADDRESS_ENV_VAR)] #[arg(global = true)] - pub world_address: Option, + pub world_address: Option, } impl WorldOptions { - pub fn address(&self, env_metadata: Option<&Environment>) -> Result { + pub fn address(&self, env_metadata: Option<&Environment>) -> Result { if let Some(world_address) = self.world_address { trace!(?world_address, "Loaded world_address."); Ok(world_address) } else if let Some(world_address) = env_metadata.and_then(|env| env.world_address()) { trace!(world_address, "Loaded world_address from env metadata."); - Ok(FieldElement::from_str(world_address)?) + Ok(Felt::from_str(world_address)?) } else { Err(anyhow!( "Could not find World address. Please specify it with --world, environment \ @@ -38,7 +38,7 @@ impl WorldOptions { mod tests { use clap::Parser; - use starknet_crypto::FieldElement; + use starknet_crypto::Felt; use super::{WorldOptions, DOJO_WORLD_ADDRESS_ENV_VAR}; @@ -53,13 +53,13 @@ mod tests { std::env::set_var(DOJO_WORLD_ADDRESS_ENV_VAR, "0x0"); let cmd = Command::parse_from([""]); - assert_eq!(cmd.inner.world_address, Some(FieldElement::from_hex_be("0x0").unwrap())); + assert_eq!(cmd.inner.world_address, Some(Felt::from_hex("0x0").unwrap())); } #[test] fn world_address_from_args() { let cmd = Command::parse_from(["sozo", "--world", "0x0"]); - assert_eq!(cmd.inner.address(None).unwrap(), FieldElement::from_hex_be("0x0").unwrap()); + assert_eq!(cmd.inner.address(None).unwrap(), Felt::from_hex("0x0").unwrap()); } #[test] @@ -70,10 +70,7 @@ mod tests { }; let cmd = Command::parse_from([""]); - assert_eq!( - cmd.inner.address(Some(&env_metadata)).unwrap(), - FieldElement::from_hex_be("0x0").unwrap() - ); + assert_eq!(cmd.inner.address(Some(&env_metadata)).unwrap(), Felt::from_hex("0x0").unwrap()); } #[test] @@ -84,10 +81,7 @@ mod tests { }; let cmd = Command::parse_from(["sozo", "--world", "0x1"]); - assert_eq!( - cmd.inner.address(Some(&env_metadata)).unwrap(), - FieldElement::from_hex_be("0x1").unwrap() - ); + assert_eq!(cmd.inner.address(Some(&env_metadata)).unwrap(), Felt::from_hex("0x1").unwrap()); } #[test] diff --git a/bin/sozo/src/commands/register.rs b/bin/sozo/src/commands/register.rs index f69fac41d2..0f019643bb 100644 --- a/bin/sozo/src/commands/register.rs +++ b/bin/sozo/src/commands/register.rs @@ -4,7 +4,7 @@ use dojo_world::contracts::WorldContractReader; use scarb::core::Config; use sozo_ops::register; use starknet::accounts::ConnectedAccount; -use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use tracing::trace; use super::options::account::AccountOptions; @@ -27,7 +27,7 @@ pub enum RegisterCommand { #[arg(required = true)] #[arg(value_name = "CLASS_HASH")] #[arg(help = "The class hash of the models to register.")] - models: Vec, + models: Vec, #[command(flatten)] world: WorldOptions, diff --git a/bin/torii/src/main.rs b/bin/torii/src/main.rs index d3c85d63d7..2346771da7 100644 --- a/bin/torii/src/main.rs +++ b/bin/torii/src/main.rs @@ -20,7 +20,7 @@ use dojo_metrics::{metrics_process, prometheus_exporter}; use dojo_world::contracts::world::WorldContractReader; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use sqlx::SqlitePool; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use tokio::sync::broadcast; @@ -49,7 +49,7 @@ pub(crate) const LOG_TARGET: &str = "torii::cli"; struct Args { /// The world to index #[arg(short, long = "world", env = "DOJO_WORLD_ADDRESS")] - world_address: FieldElement, + world_address: Felt, /// The sequencer rpc endpoint to index. #[arg(long, value_name = "URL", default_value = ":5050", value_parser = parse_url)] diff --git a/crates/benches/src/deployer.rs b/crates/benches/src/deployer.rs index 2a3aa0e08c..9dcf7e961e 100644 --- a/crates/benches/src/deployer.rs +++ b/crates/benches/src/deployer.rs @@ -12,12 +12,12 @@ use scarb::compiler::CompilerRepository; use scarb::core::Config; use sozo::args::SozoArgs; use sozo::commands::Commands; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use tokio::process::Command; use crate::{CONTRACT, CONTRACT_RELATIVE_TO_TESTS, RUNTIME}; -pub async fn deploy(runner: &KatanaRunner) -> Result { +pub async fn deploy(runner: &KatanaRunner) -> Result { if let Some(contract) = runner.contract().await { return Ok(contract); } @@ -37,15 +37,12 @@ pub async fn deploy(runner: &KatanaRunner) -> Result { Ok(address) } -pub fn deploy_sync(runner: &KatanaRunner) -> Result { +pub fn deploy_sync(runner: &KatanaRunner) -> Result { let _rt = RUNTIME.enter(); block_on(async move { deploy(runner).await }) } -async fn deploy_contract( - runner: &KatanaRunner, - manifest_and_script: (&str, &str), -) -> Result { +async fn deploy_contract(runner: &KatanaRunner, manifest_and_script: (&str, &str)) -> Result { let args = SozoArgs::parse_from([ "sozo", "migrate", @@ -72,7 +69,7 @@ async fn deploy_contract( Ok(constract_address) } -async fn prepare_migration_args(args: SozoArgs) -> Result { +async fn prepare_migration_args(args: SozoArgs) -> Result { // Preparing config, as in https://github.com/dojoengine/dojo/blob/25fbb7fc973cff4ce1273625c4664545d9b088e9/bin/sozo/src/main.rs#L28-L29 let mut compilers = CompilerRepository::std(); let cairo_plugins = CairoPluginRepository::default(); diff --git a/crates/benches/src/helpers.rs b/crates/benches/src/helpers.rs index 24ed166dae..29ffd444a1 100644 --- a/crates/benches/src/helpers.rs +++ b/crates/benches/src/helpers.rs @@ -3,7 +3,7 @@ use std::io::Write; use anyhow::{Context, Result}; use starknet::accounts::{Account, Call, ConnectedAccount, SingleOwnerAccount}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; @@ -12,12 +12,12 @@ use tokio::sync::OnceCell; pub type OwnerAccount = SingleOwnerAccount, LocalWallet>; #[derive(Clone)] -pub struct BenchCall(pub &'static str, pub Vec); +pub struct BenchCall(pub &'static str, pub Vec); // Because no calls are actually executed in the benchmark, we can use the same nonce for all of // them -pub async fn cached_nonce(account: &OwnerAccount) -> FieldElement { - static NONCE: OnceCell = OnceCell::const_new(); +pub async fn cached_nonce(account: &OwnerAccount) -> Felt { + static NONCE: OnceCell = OnceCell::const_new(); *NONCE.get_or_init(|| async { account.get_nonce().await.unwrap() }).await } @@ -34,7 +34,7 @@ pub fn log(name: &str, gas: u64, calldata: &str) { file.flush().unwrap(); } -pub fn parse_calls(calls: Vec, to: FieldElement) -> Vec { +pub fn parse_calls(calls: Vec, to: Felt) -> Vec { calls .into_iter() .map(|BenchCall(name, calldata)| Call { @@ -45,9 +45,9 @@ pub fn parse_calls(calls: Vec, to: FieldElement) -> Vec { .collect() } -pub async fn estimate_calls(account: &OwnerAccount, calls: Vec) -> Result { +pub async fn estimate_calls(account: &OwnerAccount, calls: Vec) -> Result { let fee = account - .execute(calls) + .execute_v1(calls) .nonce(cached_nonce(account).await) .estimate_fee() .await @@ -56,12 +56,8 @@ pub async fn estimate_calls(account: &OwnerAccount, calls: Vec) -> Result< Ok(fee.gas_consumed) } -pub async fn execute_calls( - account: OwnerAccount, - calls: Vec, - nonce: FieldElement, -) -> Result<()> { - account.execute(calls).nonce(nonce).send().await.context("Failed to execute").unwrap(); +pub async fn execute_calls(account: OwnerAccount, calls: Vec, nonce: Felt) -> Result<()> { + account.execute_v1(calls).nonce(nonce).send().await.context("Failed to execute").unwrap(); Ok(()) } diff --git a/crates/benches/src/lib.rs b/crates/benches/src/lib.rs index e7597cafac..7471444fde 100644 --- a/crates/benches/src/lib.rs +++ b/crates/benches/src/lib.rs @@ -10,7 +10,7 @@ use futures::future; pub use helpers::*; pub use katana_runner::runner; use lazy_static::lazy_static; -pub use starknet::core::types::FieldElement; +pub use starknet::core::types::Felt; use tokio::runtime::Runtime; pub const ENOUGH_GAS: &str = "0x100000000000000000"; @@ -25,8 +25,8 @@ lazy_static! { pub fn estimate_gas_last( account: &OwnerAccount, calls: Vec, - contract: FieldElement, -) -> Result { + contract: Felt, +) -> Result { let mut calls = parse_calls(calls, contract); let all = calls.clone(); calls.pop().expect("Empty calls vector"); // remove last call @@ -39,11 +39,7 @@ pub fn estimate_gas_last( }) } -pub fn estimate_gas( - account: &OwnerAccount, - call: BenchCall, - contract: FieldElement, -) -> Result { +pub fn estimate_gas(account: &OwnerAccount, call: BenchCall, contract: Felt) -> Result { let calls = parse_calls(vec![call], contract); let _rt = RUNTIME.enter(); block_on(async move { estimate_calls(account, calls).await }) @@ -52,8 +48,8 @@ pub fn estimate_gas( pub fn estimate_gas_multiple( account: &OwnerAccount, calls: Vec, - contract: FieldElement, -) -> Result { + contract: Felt, +) -> Result { let calls = parse_calls(calls, contract); let _rt = RUNTIME.enter(); block_on(async move { estimate_calls(account, calls).await }) @@ -62,8 +58,8 @@ pub fn estimate_gas_multiple( pub async fn estimate_gas_async( account: &OwnerAccount, calls: Vec, - contract: FieldElement, -) -> Result { + contract: Felt, +) -> Result { let calls = parse_calls(calls, contract); estimate_calls(account, calls).await } @@ -96,7 +92,7 @@ mod tests { let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("spawn", vec![]), - BenchCall("move", vec![FieldElement::from_hex_be(&c).unwrap()]) + BenchCall("move", vec![Felt::from_hex_be(&c).unwrap()]) ], contract_address).unwrap(); log("bench_move", fee, &c); diff --git a/crates/benches/src/spammer.rs b/crates/benches/src/spammer.rs index 752c32aae0..541a20ae82 100644 --- a/crates/benches/src/spammer.rs +++ b/crates/benches/src/spammer.rs @@ -3,7 +3,7 @@ use std::time::Duration; use futures::future::join_all; use katana_runner::KatanaRunner; use starknet::accounts::{Account, SingleOwnerAccount}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use starknet::signers::LocalWallet; @@ -15,24 +15,24 @@ use crate::{parse_calls, BenchCall, ENOUGH_GAS}; async fn spam_no_stats( runner: &KatanaRunner, accounts: &[SingleOwnerAccount, LocalWallet>], - contract_address: FieldElement, + contract_address: Felt, calldata: Vec, wait_time: Duration, -) -> FieldElement { - let max_fee = FieldElement::from_hex_be(ENOUGH_GAS).unwrap(); - let mut nonce = FieldElement::ONE; +) -> Felt { + let max_fee = Felt::from_hex(ENOUGH_GAS).unwrap(); + let mut nonce = Felt::ONE; for call in parse_calls(calldata, contract_address) { let transactions = accounts .iter() - .map(|account| account.execute(vec![call.clone()]).nonce(nonce).max_fee(max_fee)) + .map(|account| account.execute_v1(vec![call.clone()]).nonce(nonce).max_fee(max_fee)) .collect::>(); join_all(transactions.iter().map(|t| t.send())).await; sleep(wait_time).await; runner.blocks_until_empty().await; - nonce += FieldElement::ONE; + nonce += Felt::ONE; } nonce @@ -40,12 +40,12 @@ async fn spam_no_stats( pub async fn spam_katana( runner: KatanaRunner, - contract_address: FieldElement, + contract_address: Felt, mut calldata: Vec, additional_sleep: u64, sequential: bool, ) -> BenchSummary { - let max_fee = FieldElement::from_hex_be(ENOUGH_GAS).unwrap(); + let max_fee = Felt::from_hex(ENOUGH_GAS).unwrap(); let transaction_sum_before: u32 = runner.block_sizes().await.iter().sum(); let steps_before = runner.steps().await; @@ -78,7 +78,7 @@ pub async fn spam_katana( let final_transactions = accounts .iter() .map(|account| { - let move_call = account.execute(calls.clone()).nonce(nonce).max_fee(max_fee); + let move_call = account.execute_v1(calls.clone()).nonce(nonce).max_fee(max_fee); move_call }) .collect::>(); diff --git a/crates/benches/tests/basic.rs b/crates/benches/tests/basic.rs index a2d8d8e25e..6f86fdafe9 100644 --- a/crates/benches/tests/basic.rs +++ b/crates/benches/tests/basic.rs @@ -4,7 +4,7 @@ mod imports { pub use hex::ToHex; pub use katana_runner::runner; pub use proptest::prelude::*; - pub use starknet::core::types::FieldElement; + pub use starknet::core::types::Felt; } #[cfg(not(feature = "skip-gas-benchmarks"))] @@ -17,7 +17,7 @@ proptest! { runner!(bench_basic_emit); let contract_address = deploy_sync(runner).unwrap(); - let s_hex = FieldElement::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); + let s_hex = Felt::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); let fee = estimate_gas( &runner.account(1), @@ -32,7 +32,7 @@ proptest! { runner!(bench_basic_set); let contract_address = deploy_sync(runner).unwrap(); - let s_hex = FieldElement::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); + let s_hex = Felt::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); let fee = estimate_gas(&runner.account(1), BenchCall("bench_basic_set", vec![s_hex]), contract_address @@ -46,7 +46,7 @@ proptest! { runner!(bench_basic_double_set); let contract_address = deploy_sync(runner).unwrap(); - let s_hex = FieldElement::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); + let s_hex = Felt::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); let fee = estimate_gas(&runner.account(1), BenchCall("bench_basic_double_set", vec![s_hex]), contract_address @@ -60,7 +60,7 @@ proptest! { runner!(bench_basic_get); let contract_address = deploy_sync(runner).unwrap(); - let s_hex = FieldElement::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); + let s_hex = Felt::from_hex_be(&format!("0x{}", s.as_bytes().encode_hex::())).unwrap(); let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("bench_basic_set", vec![s_hex]), BenchCall("bench_basic_get", vec![]) diff --git a/crates/benches/tests/character.rs b/crates/benches/tests/character.rs index 01c5b98270..b5004c1832 100644 --- a/crates/benches/tests/character.rs +++ b/crates/benches/tests/character.rs @@ -1,7 +1,6 @@ #[cfg(not(feature = "skip-gas-benchmarks"))] pub use benches::{ - deploy, deploy_sync, estimate_gas, estimate_gas_last, log, runner, BenchCall, FieldElement, - CONTRACT, + deploy, deploy_sync, estimate_gas, estimate_gas_last, log, runner, BenchCall, Felt, CONTRACT, }; #[cfg(not(feature = "skip-gas-benchmarks"))] pub use proptest::prelude::*; @@ -30,7 +29,7 @@ proptest! { let points = s.chars() .map(|c| c.to_digit(10).unwrap()) - .map(FieldElement::from) + .map(Felt::from) .collect(); let fee = estimate_gas(&runner.account(1), @@ -45,7 +44,7 @@ proptest! { runner!(bench_complex_update_minimal); let contract_address = deploy_sync(runner).unwrap(); - let calldata = FieldElement::from(s.parse::().unwrap()); + let calldata = Felt::from(s.parse::().unwrap()); let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("bench_complex_set_default", vec![]), BenchCall("bench_complex_update_minimal", vec![calldata]) @@ -59,7 +58,7 @@ proptest! { runner!(bench_complex_update_minimal_nested); let contract_address = deploy_sync(runner).unwrap(); - let calldata = FieldElement::from(w as u32); + let calldata = Felt::from(w as u32); let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("bench_complex_set_default", vec![]), BenchCall("bench_complex_update_minimal_nested", vec![calldata]) @@ -75,7 +74,7 @@ proptest! { let calldata = s.chars() .map(|c| c.to_digit(10).unwrap()) - .map(FieldElement::from) + .map(Felt::from) .collect(); let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("bench_complex_set_with_smaller", calldata), @@ -90,7 +89,7 @@ proptest! { runner!(bench_complex_get_minimal); let contract_address = deploy_sync(runner).unwrap(); - let calldata = FieldElement::from(s.parse::().unwrap()); + let calldata = Felt::from(s.parse::().unwrap()); let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("bench_complex_set_default", vec![]), BenchCall("bench_complex_update_minimal", vec![calldata]), @@ -107,11 +106,11 @@ proptest! { let abilities = s.chars() .map(|c| c.to_digit(10).unwrap()) - .map(FieldElement::from) + .map(Felt::from) .collect(); - let ability = FieldElement::from(a as u32); - let threshold = FieldElement::from(t as u32); + let ability = Felt::from(a as u32); + let threshold = Felt::from(t as u32); let fee = estimate_gas_last(&runner.account(1), vec![ BenchCall("bench_complex_set_with_smaller", abilities), diff --git a/crates/benches/tests/heavy.rs b/crates/benches/tests/heavy.rs index 45c49aace6..22e14899a3 100644 --- a/crates/benches/tests/heavy.rs +++ b/crates/benches/tests/heavy.rs @@ -2,12 +2,12 @@ mod katana_benchmarks { use benches::spammer::spam_katana; use benches::{deploy, BenchCall}; - use starknet::core::types::FieldElement; + use starknet::core::types::Felt; #[katana_runner::katana_test(1, true, "../../target/release/katana")] async fn katana_heavy_prime_single() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -25,7 +25,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(100, true, "../../target/release/katana")] async fn katana_heavy_prime_100() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -43,7 +43,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(1000, true, "../../target/release/katana")] async fn katana_heavy_prime_1000_a() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -61,7 +61,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(1000, true, "../../target/release/katana")] async fn katana_heavy_prime_1000_b() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -79,7 +79,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(1000, true, "../../target/release/katana")] async fn katana_heavy_prime_1000_c() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -97,7 +97,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(2000, true, "../../target/release/katana")] async fn katana_heavy_prime_2000_a() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -115,7 +115,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(2000, true, "../../target/release/katana")] async fn katana_heavy_prime_2000_b() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -133,7 +133,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(2000, true, "../../target/release/katana")] async fn katana_heavy_prime_2000_c() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(2111u64 * 2111u64).to_string()).unwrap(); let result = spam_katana( runner, @@ -151,7 +151,7 @@ mod katana_benchmarks { #[katana_runner::katana_test(2000, true, "../../target/release/katana")] async fn katana_heavy_multicall_2000() { let contract_address = deploy(&runner).await.unwrap(); - let arg = FieldElement::from_dec_str(&(109u64 * 109u64).to_string()).unwrap(); + let arg = Felt::from_dec_str(&(109u64 * 109u64).to_string()).unwrap(); let calls = (0..23).map(|_| BenchCall("is_prime", vec![arg])).collect(); let result = spam_katana(runner, contract_address, calls, 120000, true).await; diff --git a/crates/benches/tests/katana_ramp_up.rs b/crates/benches/tests/katana_ramp_up.rs index 852733f710..c92b32d9b1 100644 --- a/crates/benches/tests/katana_ramp_up.rs +++ b/crates/benches/tests/katana_ramp_up.rs @@ -5,11 +5,11 @@ mod katana_benchmarks { use benches::summary::BenchSummary; use benches::{deploy, BenchCall}; use katana_runner::KatanaRunner; - use starknet::core::types::FieldElement; + use starknet::core::types::Felt; - async fn run(runner: KatanaRunner, contract_address: FieldElement) -> BenchSummary { + async fn run(runner: KatanaRunner, contract_address: Felt) -> BenchSummary { let spawn = BenchCall("spawn", vec![]); - let calldata_move = BenchCall("move", vec![FieldElement::from_hex_be("0x3").unwrap()]); + let calldata_move = BenchCall("move", vec![Felt::from_hex_be("0x3").unwrap()]); spam_katana(runner, contract_address, vec![spawn, calldata_move], 0, true).await } diff --git a/crates/benches/tests/primitive.rs b/crates/benches/tests/primitive.rs index 4c5e65e545..cbe85425a4 100644 --- a/crates/benches/tests/primitive.rs +++ b/crates/benches/tests/primitive.rs @@ -1,5 +1,5 @@ #[cfg(not(feature = "skip-gas-benchmarks"))] -use benches::{deploy_sync, estimate_gas, log, runner, BenchCall, FieldElement}; +use benches::{deploy_sync, estimate_gas, log, runner, BenchCall, Felt}; #[cfg(not(feature = "skip-gas-benchmarks"))] use proptest::prelude::*; @@ -13,7 +13,7 @@ proptest! { let args = s.chars().map(|c| { let c = String::from(c); let hex = format!("0x{}", c); - FieldElement::from_hex_be(&hex).unwrap() + Felt::from_hex_be(&hex).unwrap() }).collect::>(); let fee = estimate_gas(&runner.account(1), @@ -29,7 +29,7 @@ proptest! { let contract_address = deploy_sync(runner).unwrap(); let s = format!("{}", s); - let s_hex = FieldElement::from_dec_str(&s).unwrap(); + let s_hex = Felt::from_dec_str(&s).unwrap(); let fee = estimate_gas(&runner.account(1), BenchCall("bench_primitive_iter", vec![s_hex]), contract_address @@ -46,7 +46,7 @@ proptest! { let a = format!("{}", a); let b = format!("{}", b); let c = format!("{}", c); - let args = vec![a.clone(), b.clone(), c.clone()].into_iter().map(|d| FieldElement::from_dec_str(&d).unwrap()).collect::>(); + let args = vec![a.clone(), b.clone(), c.clone()].into_iter().map(|d| Felt::from_dec_str(&d).unwrap()).collect::>(); let fee = estimate_gas(&runner.account(1), BenchCall("bench_primitive_hash", args), contract_address diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index e21edfe2bb..a0eac5529b 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -32,7 +32,7 @@ use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use smol_str::SmolStr; use starknet::core::types::contract::SierraClass; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use tracing::{debug, trace, trace_span}; use crate::inline_macros::utils::{SYSTEM_READS, SYSTEM_WRITES}; @@ -112,8 +112,7 @@ impl Compiler for DojoCompiler { }; // (contract name, class hash) - let mut compiled_classes: HashMap)> = - HashMap::new(); + let mut compiled_classes: HashMap)> = HashMap::new(); for (decl, class) in zip(contracts, classes) { let contract_full_path = decl.module_id().full_path(db.upcast_mut()); @@ -154,7 +153,7 @@ impl Compiler for DojoCompiler { } } -fn compute_class_hash_of_contract_class(class: &ContractClass) -> Result { +fn compute_class_hash_of_contract_class(class: &ContractClass) -> Result { let class_str = serde_json::to_string(&class)?; let sierra_class = serde_json::from_str::(&class_str) .map_err(|e| anyhow!("error parsing Sierra class: {e}"))?; @@ -228,7 +227,7 @@ fn update_manifest( db: &RootDatabase, ws: &Workspace<'_>, crate_ids: &[CrateId], - compiled_artifacts: HashMap)>, + compiled_artifacts: HashMap)>, external_contracts: Option>, ) -> anyhow::Result<()> { let profile_name = @@ -240,9 +239,9 @@ fn update_manifest( let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); fn get_compiled_artifact_from_map<'a>( - artifacts: &'a HashMap)>, + artifacts: &'a HashMap)>, artifact_name: &str, - ) -> anyhow::Result<&'a (FieldElement, Option)> { + ) -> anyhow::Result<&'a (Felt, Option)> { artifacts.get(artifact_name).context(format!( "Contract `{artifact_name}` not found. Did you include `dojo` as a dependency?", )) @@ -357,7 +356,7 @@ fn get_dojo_model_artifacts( db: &RootDatabase, aux_data: &DojoAuxData, module_id: ModuleId, - compiled_classes: &HashMap)>, + compiled_classes: &HashMap)>, ) -> anyhow::Result, Option)>> { let mut models = HashMap::with_capacity(aux_data.models.len()); @@ -425,7 +424,7 @@ fn get_dojo_contract_artifacts( db: &RootDatabase, module_id: &ModuleId, aux_data: &StarkNetContractAuxData, - compiled_classes: &HashMap)>, + compiled_classes: &HashMap)>, ) -> anyhow::Result, Option)>> { let contract_name = &aux_data.contract_name; diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock index 815d300273..aaf6fd8731 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo" -version = "0.7.2" +version = "0.7.3" dependencies = [ "dojo_plugin", ] diff --git a/crates/dojo-test-utils/Cargo.toml b/crates/dojo-test-utils/Cargo.toml index 7df12f7709..2986b743b8 100644 --- a/crates/dojo-test-utils/Cargo.toml +++ b/crates/dojo-test-utils/Cargo.toml @@ -22,6 +22,7 @@ katana-executor = { workspace = true, features = [ "blockifier" ] } katana-primitives = { path = "../katana/primitives" } katana-rpc = { path = "../katana/rpc/rpc" } katana-rpc-api = { path = "../katana/rpc/rpc-api" } +katana-starknet = { package = "starknet", version = "=0.10.0" } scarb-ui.workspace = true scarb.workspace = true serde.workspace = true diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index d0ecc91126..c57f4f75b3 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -3,7 +3,7 @@ use camino::Utf8PathBuf; use dojo_world::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; use dojo_world::migration::strategy::{prepare_for_migration, MigrationStrategy}; use dojo_world::migration::world::WorldDiff; -use katana_primitives::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::cairo_short_string_to_felt; use starknet::macros::felt; @@ -43,7 +43,7 @@ pub fn prepare_migration( pub fn prepare_migration_with_world_and_seed( manifest_dir: Utf8PathBuf, target_dir: Utf8PathBuf, - world_address: Option, + world_address: Option, seed: &str, ) -> Result { // In testing, profile name is always dev. diff --git a/crates/dojo-test-utils/src/sequencer.rs b/crates/dojo-test-utils/src/sequencer.rs index 086d4dc26b..0e2307d5fe 100644 --- a/crates/dojo-test-utils/src/sequencer.rs +++ b/crates/dojo-test-utils/src/sequencer.rs @@ -15,15 +15,15 @@ use katana_rpc::{spawn, NodeHandle}; use katana_rpc_api::ApiKind; use starknet::accounts::{ExecutionEncoding, SingleOwnerAccount}; use starknet::core::chain_id; -use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use starknet::signers::{LocalWallet, SigningKey}; use url::Url; pub struct TestAccount { - pub private_key: FieldElement, - pub account_address: FieldElement, + pub private_key: Felt, + pub account_address: Felt, } #[allow(unused)] @@ -85,8 +85,8 @@ impl TestSequencer { let account = sequencer.backend.config.genesis.accounts().next().unwrap(); let account = TestAccount { - private_key: account.1.private_key().unwrap(), - account_address: (*account.0).into(), + private_key: Felt::from_bytes_be(&account.1.private_key().unwrap().to_bytes_be()), + account_address: Felt::from_bytes_be(&account.0.to_bytes_be()), }; TestSequencer { sequencer, account, handle, url } @@ -97,11 +97,11 @@ impl TestSequencer { JsonRpcClient::new(HttpTransport::new(self.url.clone())), LocalWallet::from_signing_key(SigningKey::from_secret_scalar(self.account.private_key)), self.account.account_address, - chain_id::TESTNET, + chain_id::SEPOLIA, ExecutionEncoding::New, ); - account.set_block_id(BlockId::Tag(BlockTag::Pending)); + account.set_block_id(starknet::core::types::BlockId::Tag(BlockTag::Pending)); account } @@ -117,14 +117,14 @@ impl TestSequencer { let accounts: Vec<_> = self.sequencer.backend.config.genesis.accounts().collect::<_>(); let account = accounts[index]; - let private_key = account.1.private_key().unwrap(); - let address: FieldElement = (*(account.0)).into(); + let private_key = Felt::from_bytes_be(&account.1.private_key().unwrap().to_bytes_be()); + let address: Felt = Felt::from_bytes_be(&account.0.to_bytes_be()); let mut account = SingleOwnerAccount::new( JsonRpcClient::new(HttpTransport::new(self.url.clone())), LocalWallet::from_signing_key(SigningKey::from_secret_scalar(private_key)), address, - chain_id::TESTNET, + chain_id::SEPOLIA, ExecutionEncoding::New, ); @@ -149,7 +149,7 @@ impl TestSequencer { pub fn get_default_test_starknet_config() -> StarknetConfig { StarknetConfig { disable_fee: true, - env: Environment { chain_id: ChainId::GOERLI, ..Default::default() }, + env: Environment { chain_id: ChainId::SEPOLIA, ..Default::default() }, ..Default::default() } } diff --git a/crates/dojo-types/Cargo.toml b/crates/dojo-types/Cargo.toml index 4603f32e83..4ee140db0f 100644 --- a/crates/dojo-types/Cargo.toml +++ b/crates/dojo-types/Cargo.toml @@ -9,6 +9,7 @@ version.workspace = true crypto-bigint.workspace = true hex.workspace = true itertools.workspace = true +num-traits.workspace = true serde.workspace = true starknet.workspace = true strum.workspace = true diff --git a/crates/dojo-types/src/event.rs b/crates/dojo-types/src/event.rs index 38319ff684..9693676840 100644 --- a/crates/dojo-types/src/event.rs +++ b/crates/dojo-types/src/event.rs @@ -1,31 +1,31 @@ -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; /// The event emitted when a World is spawned. #[derive(Clone, Debug)] pub struct WorldSpawned { - pub address: FieldElement, - pub caller: FieldElement, + pub address: Felt, + pub caller: Felt, } /// The event emitted when a model is registered to a World. #[derive(Clone, Debug)] pub struct ModelRegistered { pub name: String, - pub class_hash: FieldElement, + pub class_hash: Felt, } /// The event emmitted when a model value of an entity is set. #[derive(Clone, Debug)] pub struct StoreSetRecord { - pub table_id: FieldElement, - pub keys: Vec, + pub table_id: Felt, + pub keys: Vec, pub offset: u8, - pub value: Vec, + pub value: Vec, } /// The event emmitted when a model is deleted from an entity. #[derive(Clone, Debug)] pub struct StoreDelRecord { - pub table_id: FieldElement, - pub keys: Vec, + pub table_id: Felt, + pub keys: Vec, } diff --git a/crates/dojo-types/src/lib.rs b/crates/dojo-types/src/lib.rs index bb73984aa1..31b65f3332 100644 --- a/crates/dojo-types/src/lib.rs +++ b/crates/dojo-types/src/lib.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use schema::ModelMetadata; use serde::Serialize; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; pub mod event; pub mod packing; @@ -14,8 +14,8 @@ pub mod system; /// Represents the metadata of a World #[derive(Debug, Clone, Serialize, Default)] pub struct WorldMetadata { - pub world_address: FieldElement, - pub world_class_hash: FieldElement, + pub world_address: Felt, + pub world_class_hash: Felt, pub models: HashMap, } diff --git a/crates/dojo-types/src/packing.rs b/crates/dojo-types/src/packing.rs index c231107dcc..6817bb5447 100644 --- a/crates/dojo-types/src/packing.rs +++ b/crates/dojo-types/src/packing.rs @@ -1,21 +1,23 @@ +use std::any::type_name; use std::str::FromStr; use crypto_bigint::U256; -use starknet::core::types::{FieldElement, FromStrError, ValueOutOfRangeError}; +use num_traits::ToPrimitive; +use starknet::core::types::{Felt, FromStrError}; use starknet::core::utils::{ cairo_short_string_to_felt, parse_cairo_short_string, CairoShortStringToFeltError, ParseCairoShortStringError, }; -use crate::primitive::Primitive; +use crate::primitive::{Primitive, PrimitiveError}; use crate::schema::{self, EnumOption, Ty}; #[derive(Debug, thiserror::Error)] pub enum ParseError { #[error("Invalid schema: {0}")] InvalidSchema(String), - #[error("Error when parsing felt: {0}")] - ValueOutOfRange(#[from] ValueOutOfRangeError), + #[error("Value out of range")] + Primitive(#[from] PrimitiveError), #[error("Error when parsing felt: {0}")] FromStr(#[from] FromStrError), #[error(transparent)] @@ -40,6 +42,8 @@ pub enum PackingError { Parse(#[from] ParseError), #[error("Error when unpacking entity")] UnpackingEntityError, + #[error(transparent)] + Primitive(#[from] PrimitiveError), } /// Unpacks a vector of packed values according to a given layout. @@ -51,28 +55,29 @@ pub enum PackingError { /// /// # Returns /// -/// * `Result, PackingError>` - A Result containing a vector of unpacked -/// FieldElement values if successful, or an error if unsuccessful. -pub fn unpack( - mut packed: Vec, - layout: Vec, -) -> Result, PackingError> { +/// * `Result, PackingError>` - A Result containing a vector of unpacked Felt values if +/// successful, or an error if unsuccessful. +pub fn unpack(mut packed: Vec, layout: Vec) -> Result, PackingError> { packed.reverse(); let mut unpacked = vec![]; - let mut unpacking: U256 = - packed.pop().ok_or(PackingError::UnpackingEntityError)?.as_ref().into(); + let felt = packed.pop().ok_or(PackingError::UnpackingEntityError)?; + let mut unpacking = U256::from_be_slice(&felt.to_bytes_be()); let mut offset = 0; - // Iterate over the layout. for size in layout { - let size: u8 = size.try_into().map_err(ParseError::ValueOutOfRange)?; + let size: u8 = size.to_u8().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: size, + })?; + let size: usize = size.into(); let remaining_bits = 251 - offset; // If there are less remaining bits than the size, move to the next felt for unpacking. if remaining_bits < size { - unpacking = packed.pop().ok_or(PackingError::UnpackingEntityError)?.as_ref().into(); + let felt = packed.pop().ok_or(PackingError::UnpackingEntityError)?; + unpacking = U256::from_be_slice(&felt.to_bytes_be()); offset = 0; } @@ -82,8 +87,7 @@ pub fn unpack( } let result = mask & (unpacking >> offset); - let result_fe = - FieldElement::from_hex_be(&result.to_string()).map_err(ParseError::FromStr)?; + let result_fe = Felt::from_hex(&result.to_string()).map_err(ParseError::FromStr)?; unpacked.push(result_fe); // Update unpacking to be the shifted value after extracting the result. @@ -94,7 +98,7 @@ pub fn unpack( } /// Parse a raw schema of a model into a Cairo type, [Ty] -pub fn parse_ty(data: &[FieldElement]) -> Result { +pub fn parse_ty(data: &[Felt]) -> Result { if data.is_empty() { return Err(ParseError::invalid_schema_with_msg( "The function parse_ty expects at least one felt to know the member type variant, \ @@ -102,7 +106,11 @@ pub fn parse_ty(data: &[FieldElement]) -> Result { )); } - let member_type: u8 = data[0].try_into()?; + let member_type: u8 = data[0].to_u8().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[0], + })?; + match member_type { 0 => parse_simple(&data[1..]), 1 => parse_struct(&data[1..]), @@ -117,7 +125,7 @@ pub fn parse_ty(data: &[FieldElement]) -> Result { } } -fn parse_simple(data: &[FieldElement]) -> Result { +fn parse_simple(data: &[Felt]) -> Result { let ty = parse_cairo_short_string(&data[0])?; let primitive = match Primitive::from_str(&ty) { Ok(primitive) => primitive, @@ -132,7 +140,7 @@ fn parse_simple(data: &[FieldElement]) -> Result { Ok(Ty::Primitive(primitive)) } -fn parse_struct(data: &[FieldElement]) -> Result { +fn parse_struct(data: &[Felt]) -> Result { // A struct has at least 3 elements: name, attrs len, and children len. if data.len() < 3 { return Err(ParseError::invalid_schema_with_msg(&format!( @@ -144,12 +152,18 @@ fn parse_struct(data: &[FieldElement]) -> Result { let name = parse_cairo_short_string(&data[0])?; - let attrs_len: u32 = data[1].try_into()?; + let attrs_len: u32 = data[1].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[1], + })?; let attrs_slice_start = 2; let attrs_slice_end = attrs_slice_start + attrs_len as usize; let _attrs = &data[attrs_slice_start..attrs_slice_end]; - let children_len: u32 = data[attrs_slice_end].try_into()?; + let children_len: u32 = data[attrs_slice_end].to_u32().ok_or_else(|| { + PrimitiveError::ValueOutOfRange { r#type: type_name::(), value: data[attrs_slice_end] } + })?; + let children_len = children_len as usize; let mut children = vec![]; @@ -157,7 +171,10 @@ fn parse_struct(data: &[FieldElement]) -> Result { for i in 0..children_len { let start = i + offset; - let len: u32 = data[start].try_into()?; + let len: u32 = data[start].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[start], + })?; let slice_start = start + 1; let slice_end = slice_start + len as usize; children.push(parse_member(&data[slice_start..slice_end])?); @@ -167,7 +184,7 @@ fn parse_struct(data: &[FieldElement]) -> Result { Ok(Ty::Struct(schema::Struct { name, children })) } -fn parse_member(data: &[FieldElement]) -> Result { +fn parse_member(data: &[Felt]) -> Result { if data.len() < 3 { return Err(ParseError::invalid_schema_with_msg(&format!( "The function parse_member expects at least three felts: name, attributes len, and \ @@ -178,7 +195,10 @@ fn parse_member(data: &[FieldElement]) -> Result { let name = parse_cairo_short_string(&data[0])?; - let attributes_len: u32 = data[1].try_into()?; + let attributes_len: u32 = data[1].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[1], + })?; let slice_start = 2; let slice_end = slice_start + attributes_len as usize; let attributes = &data[slice_start..slice_end]; @@ -189,7 +209,7 @@ fn parse_member(data: &[FieldElement]) -> Result { Ok(schema::Member { name, ty, key }) } -fn parse_enum(data: &[FieldElement]) -> Result { +fn parse_enum(data: &[Felt]) -> Result { if data.len() < 3 { return Err(ParseError::invalid_schema_with_msg(&format!( "The function parse_enum expects at least three felts: name, attributes len, and \ @@ -200,12 +220,17 @@ fn parse_enum(data: &[FieldElement]) -> Result { let name = parse_cairo_short_string(&data[0])?; - let attrs_len: u32 = data[1].try_into()?; + let attrs_len: u32 = data[1].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[1], + })?; let attrs_slice_start = 2; let attrs_slice_end = attrs_slice_start + attrs_len as usize; let _attrs = &data[attrs_slice_start..attrs_slice_end]; - let values_len: u32 = data[attrs_slice_end].try_into()?; + let values_len: u32 = data[attrs_slice_end].to_u32().ok_or_else(|| { + PrimitiveError::ValueOutOfRange { r#type: type_name::(), value: data[attrs_slice_end] } + })?; let values_len = values_len as usize; let mut values = vec![]; @@ -215,7 +240,10 @@ fn parse_enum(data: &[FieldElement]) -> Result { let start = i + offset; let name = parse_cairo_short_string(&data[start])?; let slice_start = start + 2; - let len: u32 = data[start + 3].try_into()?; + let len: u32 = data[start + 3].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[start + 3], + })?; let len = len + 1; // Account for Ty enum index let slice_end = slice_start + len as usize; @@ -226,13 +254,16 @@ fn parse_enum(data: &[FieldElement]) -> Result { Ok(Ty::Enum(schema::Enum { name, option: None, options: values })) } -fn parse_tuple(data: &[FieldElement]) -> Result { +fn parse_tuple(data: &[Felt]) -> Result { if data.is_empty() { // The unit type is defined as an empty tuple. return Ok(Ty::Tuple(vec![])); } - let children_len: u32 = data[0].try_into()?; + let children_len: u32 = data[0].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[0], + })?; let children_len = children_len as usize; let mut children = vec![]; @@ -240,7 +271,10 @@ fn parse_tuple(data: &[FieldElement]) -> Result { for i in 0..children_len { let start = i + offset; - let len: u32 = data[start].try_into()?; + let len: u32 = data[start].to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: data[start], + })?; let slice_start = start + 1; let slice_end = slice_start + len as usize; children.push(parse_ty(&data[slice_start..slice_end])?); @@ -250,7 +284,7 @@ fn parse_tuple(data: &[FieldElement]) -> Result { Ok(Ty::Tuple(children)) } -fn parse_array(data: &[FieldElement]) -> Result { +fn parse_array(data: &[Felt]) -> Result { if data.is_empty() || data.len() != 2 { return Err(ParseError::invalid_schema_with_msg( "The function parse_array expects exactly one felt to know the item type, empty input \ @@ -273,14 +307,14 @@ fn parse_byte_array() -> Result { #[cfg(test)] mod tests { - use starknet::core::types::FieldElement; + use starknet::core::types::Felt; use starknet::core::utils::cairo_short_string_to_felt; use super::*; #[test] fn parse_simple_with_invalid_value() { - let data = [FieldElement::default()]; + let data = [Felt::default()]; assert!(parse_simple(&data).is_err()); } @@ -297,17 +331,14 @@ mod tests { assert!(parse_struct(&data).is_err()); // Only with attr len. - let data = [cairo_short_string_to_felt("bad_struct").unwrap(), FieldElement::default()]; + let data = [cairo_short_string_to_felt("bad_struct").unwrap(), Felt::default()]; assert!(parse_struct(&data).is_err()); } #[test] fn parse_struct_empty() { - let data = [ - cairo_short_string_to_felt("empty_struct").unwrap(), - FieldElement::default(), - FieldElement::default(), - ]; + let data = + [cairo_short_string_to_felt("empty_struct").unwrap(), Felt::default(), Felt::default()]; assert_eq!( parse_struct(&data).unwrap(), @@ -317,7 +348,7 @@ mod tests { #[test] fn parse_array_with_invalid_value() { - let data = [FieldElement::default()]; + let data = [Felt::default()]; assert!(parse_array(&data).is_err()); } } diff --git a/crates/dojo-types/src/primitive.rs b/crates/dojo-types/src/primitive.rs index b3cd87477d..6192c107e3 100644 --- a/crates/dojo-types/src/primitive.rs +++ b/crates/dojo-types/src/primitive.rs @@ -1,6 +1,9 @@ +use std::any::type_name; + use crypto_bigint::{Encoding, U256}; +use num_traits::ToPrimitive; use serde::{Deserialize, Serialize}; -use starknet::core::types::{FieldElement, ValueOutOfRangeError}; +use starknet::core::types::Felt; use strum::IntoEnumIterator; use strum_macros::{AsRefStr, Display, EnumIter, EnumString}; @@ -30,11 +33,11 @@ pub enum Primitive { U256(Option), USize(Option), Bool(Option), - Felt252(Option), + Felt252(Option), #[strum(serialize = "ClassHash")] - ClassHash(Option), + ClassHash(Option), #[strum(serialize = "ContractAddress")] - ContractAddress(Option), + ContractAddress(Option), } #[derive(Debug, thiserror::Error)] @@ -47,8 +50,8 @@ pub enum PrimitiveError { UnsupportedType, #[error("Set value type mismatch")] TypeMismatch, - #[error(transparent)] - ValueOutOfRange(#[from] ValueOutOfRangeError), + #[error("Felt value ({value:#x}) out of range for {r#type}")] + ValueOutOfRange { value: Felt, r#type: &'static str }, #[error(transparent)] CairoSerde(#[from] cainome::cairo_serde::Error), #[error(transparent)] @@ -101,9 +104,9 @@ impl Primitive { as_primitive!(as_u256, U256, U256); as_primitive!(as_bool, Bool, bool); as_primitive!(as_usize, USize, u32); - as_primitive!(as_felt252, Felt252, FieldElement); - as_primitive!(as_class_hash, ClassHash, FieldElement); - as_primitive!(as_contract_address, ContractAddress, FieldElement); + as_primitive!(as_felt252, Felt252, Felt); + as_primitive!(as_class_hash, ClassHash, Felt); + as_primitive!(as_contract_address, ContractAddress, Felt); set_primitive!(set_u8, U8, u8); set_primitive!(set_u16, U16, u16); @@ -113,9 +116,9 @@ impl Primitive { set_primitive!(set_u256, U256, U256); set_primitive!(set_bool, Bool, bool); set_primitive!(set_usize, USize, u32); - set_primitive!(set_felt252, Felt252, FieldElement); - set_primitive!(set_class_hash, ClassHash, FieldElement); - set_primitive!(set_contract_address, ContractAddress, FieldElement); + set_primitive!(set_felt252, Felt252, Felt); + set_primitive!(set_class_hash, ClassHash, Felt); + set_primitive!(set_contract_address, ContractAddress, Felt); pub fn to_numeric(&self) -> usize { match self { @@ -189,41 +192,65 @@ impl Primitive { } } - pub fn deserialize(&mut self, felts: &mut Vec) -> Result<(), PrimitiveError> { + pub fn deserialize(&mut self, felts: &mut Vec) -> Result<(), PrimitiveError> { if felts.is_empty() { return Err(PrimitiveError::MissingFieldElement); } match self { Primitive::U8(ref mut value) => { - *value = Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); - Ok(()) + let felt = felts.remove(0); + *value = Some(felt.to_u8().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: felt, + })?); } + Primitive::U16(ref mut value) => { - *value = Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); - Ok(()) + let felt = felts.remove(0); + *value = Some(felt.to_u16().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: felt, + })?); } + Primitive::U32(ref mut value) => { - *value = Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); - Ok(()) + let felt = felts.remove(0); + *value = Some(felt.to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: felt, + })?); } + Primitive::U64(ref mut value) => { - *value = Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); - Ok(()) + let felt = felts.remove(0); + *value = Some(felt.to_u64().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: felt, + })?); } + Primitive::USize(ref mut value) => { - *value = Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); - Ok(()) + let felt = felts.remove(0); + *value = Some(felt.to_u32().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: felt, + })?); } + Primitive::Bool(ref mut value) => { let raw = felts.remove(0); - *value = Some(raw == FieldElement::ONE); - Ok(()) + *value = Some(raw == Felt::ONE); } + Primitive::U128(ref mut value) => { - *value = Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); - Ok(()) + let felt = felts.remove(0); + *value = Some(felt.to_u128().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value: felt, + })?); } + Primitive::U256(ref mut value) => { if felts.len() < 2 { return Err(PrimitiveError::NotEnoughFieldElements); @@ -236,45 +263,46 @@ impl Primitive { bytes[16..].copy_from_slice(&value0_bytes[16..]); bytes[..16].copy_from_slice(&value1_bytes[16..]); *value = Some(U256::from_be_bytes(bytes)); - Ok(()) } + Primitive::ContractAddress(ref mut value) => { *value = Some(felts.remove(0)); - Ok(()) } + Primitive::ClassHash(ref mut value) => { *value = Some(felts.remove(0)); - Ok(()) } + Primitive::Felt252(ref mut value) => { *value = Some(felts.remove(0)); - Ok(()) } } + + Ok(()) } - pub fn serialize(&self) -> Result, PrimitiveError> { + pub fn serialize(&self) -> Result, PrimitiveError> { match self { Primitive::U8(value) => value - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::U16(value) => value - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::U32(value) => value - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::U64(value) => value - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::USize(value) => value - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::Bool(value) => value - .map(|v| Ok(vec![if v { FieldElement::ONE } else { FieldElement::ZERO }])) + .map(|v| Ok(vec![if v { Felt::ONE } else { Felt::ZERO }])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::U128(value) => value - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), Primitive::U256(value) => value .map(|v| { @@ -285,8 +313,8 @@ impl Primitive { let mut value1_array = [0u8; 32]; value0_array[16..].copy_from_slice(value0_slice); value1_array[16..].copy_from_slice(value1_slice); - let value0 = FieldElement::from_bytes_be(&value0_array).unwrap(); - let value1 = FieldElement::from_bytes_be(&value1_array).unwrap(); + let value0 = Felt::from_bytes_be(&value0_array); + let value1 = Felt::from_bytes_be(&value1_array); Ok(vec![value0, value1]) }) .unwrap_or(Err(PrimitiveError::MissingFieldElement)), @@ -308,7 +336,7 @@ mod tests { use std::str::FromStr; use crypto_bigint::U256; - use starknet::core::types::FieldElement; + use starknet::core::types::Felt; use super::Primitive; @@ -327,8 +355,8 @@ mod tests { assert_eq!( serialized, vec![ - FieldElement::from_str("0xccccccccccccccccdddddddddddddddd").unwrap(), - FieldElement::from_str("0xaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb").unwrap() + Felt::from_str("0xccccccccccccccccdddddddddddddddd").unwrap(), + Felt::from_str("0xaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbb").unwrap() ] ); assert_eq!(deserialized, primitive) @@ -361,13 +389,13 @@ mod tests { primitive.set_bool(Some(true)).unwrap(); assert_eq!(primitive.as_bool(), Some(true)); let mut primitive = Primitive::Felt252(None); - primitive.set_felt252(Some(FieldElement::from(1u128))).unwrap(); - assert_eq!(primitive.as_felt252(), Some(FieldElement::from(1u128))); + primitive.set_felt252(Some(Felt::from(1u128))).unwrap(); + assert_eq!(primitive.as_felt252(), Some(Felt::from(1u128))); let mut primitive = Primitive::ClassHash(None); - primitive.set_class_hash(Some(FieldElement::from(1u128))).unwrap(); - assert_eq!(primitive.as_class_hash(), Some(FieldElement::from(1u128))); + primitive.set_class_hash(Some(Felt::from(1u128))).unwrap(); + assert_eq!(primitive.as_class_hash(), Some(Felt::from(1u128))); let mut primitive = Primitive::ContractAddress(None); - primitive.set_contract_address(Some(FieldElement::from(1u128))).unwrap(); - assert_eq!(primitive.as_contract_address(), Some(FieldElement::from(1u128))); + primitive.set_contract_address(Some(Felt::from(1u128))).unwrap(); + assert_eq!(primitive.as_contract_address(), Some(Felt::from(1u128))); } } diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs index fa4f2819e7..162ce295c1 100644 --- a/crates/dojo-types/src/schema.rs +++ b/crates/dojo-types/src/schema.rs @@ -1,7 +1,10 @@ +use std::any::type_name; + use cainome::cairo_serde::{ByteArray, CairoSerde}; use itertools::Itertools; +use num_traits::ToPrimitive; use serde::{Deserialize, Serialize}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use strum_macros::AsRefStr; use crate::primitive::{Primitive, PrimitiveError}; @@ -16,7 +19,7 @@ pub struct Member { } impl Member { - pub fn serialize(&self) -> Result, PrimitiveError> { + pub fn serialize(&self) -> Result, PrimitiveError> { self.ty.serialize() } } @@ -27,9 +30,9 @@ pub struct ModelMetadata { pub name: String, pub packed_size: u32, pub unpacked_size: u32, - pub class_hash: FieldElement, - pub contract_address: FieldElement, - pub layout: Vec, + pub class_hash: Felt, + pub contract_address: Felt, + pub layout: Vec, } /// Represents all possible types in Cairo @@ -113,10 +116,10 @@ impl Ty { } } - pub fn serialize(&self) -> Result, PrimitiveError> { + pub fn serialize(&self) -> Result, PrimitiveError> { let mut felts = vec![]; - fn serialize_inner(ty: &Ty, felts: &mut Vec) -> Result<(), PrimitiveError> { + fn serialize_inner(ty: &Ty, felts: &mut Vec) -> Result<(), PrimitiveError> { match ty { Ty::Primitive(c) => { felts.extend(c.serialize()?); @@ -129,7 +132,7 @@ impl Ty { Ty::Enum(e) => { let option = e .option - .map(|v| Ok(vec![FieldElement::from(v)])) + .map(|v| Ok(vec![Felt::from(v)])) .unwrap_or(Err(PrimitiveError::MissingFieldElement))?; felts.extend(option); @@ -165,7 +168,7 @@ impl Ty { Ok(felts) } - pub fn deserialize(&mut self, felts: &mut Vec) -> Result<(), PrimitiveError> { + pub fn deserialize(&mut self, felts: &mut Vec) -> Result<(), PrimitiveError> { match self { Ty::Primitive(c) => { c.deserialize(felts)?; @@ -176,8 +179,11 @@ impl Ty { } } Ty::Enum(e) => { - e.option = - Some(felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?); + let value = felts.remove(0); + e.option = Some(value.to_u8().ok_or_else(|| PrimitiveError::ValueOutOfRange { + r#type: type_name::(), + value, + })?); match &e.options[e.option.unwrap() as usize].ty { // Skip deserializing the enum option if it has no type - unit type @@ -193,8 +199,10 @@ impl Ty { } } Ty::Array(items_ty) => { - let arr_len: u32 = - felts.remove(0).try_into().map_err(PrimitiveError::ValueOutOfRange)?; + let value = felts.remove(0); + let arr_len: u32 = value.to_u32().ok_or_else(|| { + PrimitiveError::ValueOutOfRange { r#type: type_name::(), value } + })?; let item_ty = items_ty.pop().unwrap(); for _ in 0..arr_len { diff --git a/crates/dojo-types/src/storage.rs b/crates/dojo-types/src/storage.rs index 037d8a85fa..8ae4c2820a 100644 --- a/crates/dojo-types/src/storage.rs +++ b/crates/dojo-types/src/storage.rs @@ -1,7 +1,7 @@ -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; #[derive(Clone, Debug)] pub struct Query { pub address_domain: u32, - pub keys: Vec, + pub keys: Vec, } diff --git a/crates/dojo-world/Cargo.toml b/crates/dojo-world/Cargo.toml index 8504077caa..3c440ef24d 100644 --- a/crates/dojo-world/Cargo.toml +++ b/crates/dojo-world/Cargo.toml @@ -16,6 +16,7 @@ cairo-lang-starknet.workspace = true camino.workspace = true convert_case.workspace = true futures.workspace = true +num-traits = { workspace = true, optional = true } serde.workspace = true serde_json.workspace = true serde_with.workspace = true @@ -46,7 +47,7 @@ tempfile.workspace = true tokio.workspace = true [features] -contracts = [ "dep:dojo-types", "dep:http" ] +contracts = [ "dep:dojo-types", "dep:http", "dep:num-traits" ] manifest = [ "contracts", "dep:dojo-types", "dep:url" ] metadata = [ "dep:ipfs-api-backend-hyper", "dep:scarb", "dep:url" ] migration = [ "dep:tokio" ] diff --git a/crates/dojo-world/src/contracts/cairo_utils.rs b/crates/dojo-world/src/contracts/cairo_utils.rs index 3a67953299..d1afd89750 100644 --- a/crates/dojo-world/src/contracts/cairo_utils.rs +++ b/crates/dojo-world/src/contracts/cairo_utils.rs @@ -1,9 +1,9 @@ use anyhow::{anyhow, Result}; use http::uri::Uri; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::cairo_short_string_to_felt; -pub fn str_to_felt(string: &str) -> Result { +pub fn str_to_felt(string: &str) -> Result { cairo_short_string_to_felt(string).map_err(|e| { anyhow!(format!("Failed to convert string `{}` to cairo short string: {}", string, e)) }) diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs index 13bb96ea14..902bf4c558 100644 --- a/crates/dojo-world/src/contracts/model.rs +++ b/crates/dojo-world/src/contracts/model.rs @@ -6,7 +6,7 @@ use cainome::cairo_serde::{CairoSerde as _, ContractAddress, Error as CainomeErr use dojo_types::packing::{PackingError, ParseError}; use dojo_types::primitive::{Primitive, PrimitiveError}; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::{ cairo_short_string_to_felt, get_selector_from_name, parse_cairo_short_string, CairoShortStringToFeltError, NonAsciiNameError, ParseCairoShortStringError, @@ -55,9 +55,9 @@ pub trait ModelReader { // TODO: kept for compatibility but should be removed // because it returns the model name hash and not the model name itself. fn name(&self) -> String; - fn selector(&self) -> FieldElement; - fn class_hash(&self) -> FieldElement; - fn contract_address(&self) -> FieldElement; + fn selector(&self) -> Felt; + fn class_hash(&self) -> Felt; + fn contract_address(&self) -> Felt; async fn schema(&self) -> Result; async fn packed_size(&self) -> Result; async fn unpacked_size(&self) -> Result; @@ -66,11 +66,11 @@ pub trait ModelReader { pub struct ModelRPCReader<'a, P: Provider + Sync + Send> { /// The name of the model - name: FieldElement, + name: Felt, /// The class hash of the model - class_hash: FieldElement, + class_hash: Felt, /// The contract address of the model - contract_address: FieldElement, + contract_address: Felt, /// Contract reader of the World that the model is registered to. world_reader: &'a WorldContractReader

, /// Contract reader of the model. @@ -92,7 +92,7 @@ where // World Cairo contract won't raise an error in case of unknown/unregistered // model so raise an error here in case of zero address. - if contract_address == ContractAddress(FieldElement::ZERO) { + if contract_address == ContractAddress(Felt::ZERO) { return Err(ModelError::ModelNotFound); } @@ -107,10 +107,7 @@ where }) } - pub async fn entity_storage( - &self, - keys: &[FieldElement], - ) -> Result, ModelError> { + pub async fn entity_storage(&self, keys: &[Felt]) -> Result, ModelError> { // As the dojo::database::introspect::Layout type has been pasted // in both `model` and `world` ABI by abigen, the compiler sees both types // as different even if they are strictly identical. @@ -122,7 +119,7 @@ where Ok(self.world_reader.entity(&self.selector(), &keys.to_vec(), &layout).call().await?) } - pub async fn entity(&self, keys: &[FieldElement]) -> Result { + pub async fn entity(&self, keys: &[Felt]) -> Result { let mut schema = self.schema().await?; let values = self.entity_storage(keys).await?; @@ -144,15 +141,15 @@ where self.name.to_string() } - fn selector(&self) -> FieldElement { + fn selector(&self) -> Felt { self.name } - fn class_hash(&self) -> FieldElement { + fn class_hash(&self) -> Felt { self.class_hash } - fn contract_address(&self) -> FieldElement { + fn contract_address(&self) -> Felt { self.contract_address } diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index 5680d52c45..91ee527423 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -4,7 +4,7 @@ use camino::Utf8PathBuf; use dojo_test_utils::compiler; use katana_runner::KatanaRunner; use starknet::accounts::{Account, ConnectedAccount}; -use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use super::{WorldContract, WorldContractReader}; use crate::manifest::{BaseManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR}; @@ -49,7 +49,7 @@ pub async fn deploy_world( manifest_dir: &Utf8PathBuf, target_dir: &Utf8PathBuf, skip_migration: Option>, -) -> FieldElement { +) -> Felt { // Dev profile is used by default for testing: let profile_name = "dev"; @@ -74,13 +74,8 @@ pub async fn deploy_world( let account = sequencer.account(0); - let mut strategy = prepare_for_migration( - None, - FieldElement::from_hex_be("0x12345").unwrap(), - target_dir, - world, - ) - .unwrap(); + let mut strategy = + prepare_for_migration(None, Felt::from_hex("0x12345").unwrap(), target_dir, world).unwrap(); strategy.resolve_variable(strategy.world_address().unwrap()).unwrap(); let base_class_hash = @@ -118,7 +113,7 @@ pub async fn deploy_world( .map(|o| world.register_model_getcall(&o.class_hash.into())) .collect::>(); - let _ = account.execute(calls).send().await.unwrap(); + let _ = account.execute_v1(calls).send().await.unwrap(); // wait for the tx to be mined tokio::time::sleep(Duration::from_millis(250)).await; diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index b4894c453c..67b541796f 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -9,7 +9,7 @@ use serde_json::json; use smol_str::SmolStr; use starknet::accounts::ConnectedAccount; use starknet::core::types::contract::AbiEntry; -use starknet::core::types::{EmittedEvent, FieldElement}; +use starknet::core::types::{EmittedEvent, Felt}; use starknet::macros::{felt, selector}; use starknet::providers::jsonrpc::{JsonRpcClient, JsonRpcMethod}; @@ -41,7 +41,7 @@ async fn manifest_from_remote_throw_error_on_not_deployed() { ); let rpc = JsonRpcClient::new(mock_transport); - let err = DeploymentManifest::load_from_remote(rpc, FieldElement::ONE).await.unwrap_err(); + let err = DeploymentManifest::load_from_remote(rpc, Felt::ONE).await.unwrap_err(); match err { AbstractManifestError::RemoteWorldNotFound => { diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 2ce8178ea3..1aa721bd6c 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -7,7 +7,7 @@ use camino::Utf8PathBuf; use serde::de::DeserializeOwned; use smol_str::SmolStr; use starknet::core::types::{ - BlockId, BlockTag, EmittedEvent, EventFilter, FieldElement, FunctionCall, StarknetError, + BlockId, BlockTag, EmittedEvent, EventFilter, Felt, FunctionCall, StarknetError, }; use starknet::core::utils::{ parse_cairo_short_string, starknet_keccak, CairoShortStringToFeltError, @@ -259,7 +259,7 @@ impl DeploymentManifest { self.contracts.iter_mut().for_each(|contract| { let previous_contract = previous.contracts.iter().find(|c| c.name == contract.name); if let Some(previous_contract) = previous_contract { - if previous_contract.inner.base_class_hash != FieldElement::ZERO { + if previous_contract.inner.base_class_hash != Felt::ZERO { contract.inner.base_class_hash = previous_contract.inner.base_class_hash; } } @@ -310,7 +310,7 @@ impl DeploymentManifest { /// * `world_address` - The address of the remote World contract. pub async fn load_from_remote

( provider: P, - world_address: FieldElement, + world_address: Felt, ) -> Result where P: Provider + Send + Sync, @@ -370,7 +370,7 @@ impl DeploymentManifest { // impl RemoteLoadable

for DeploymentManifest {} async fn get_remote_models_and_contracts

( - world: FieldElement, + world: Felt, provider: P, ) -> Result<(Vec>, Vec>), AbstractManifestError> where @@ -441,8 +441,8 @@ where async fn get_events( provider: P, - world: FieldElement, - keys: Vec>, + world: Felt, + keys: Vec>, ) -> Result, ProviderError> { const DEFAULT_CHUNK_SIZE: u64 = 100; @@ -471,11 +471,9 @@ fn parse_contracts_events( deployed: Vec, upgraded: Vec, ) -> Vec> { - fn retain_only_latest_upgrade_events( - events: Vec, - ) -> HashMap { + fn retain_only_latest_upgrade_events(events: Vec) -> HashMap { // addr -> (block_num, class_hash) - let mut upgrades: HashMap = HashMap::new(); + let mut upgrades: HashMap = HashMap::new(); events.into_iter().for_each(|event| { let mut data = event.data.into_iter(); @@ -531,7 +529,7 @@ fn parse_contracts_events( } fn parse_models_events(events: Vec) -> Vec> { - let mut models: HashMap = HashMap::with_capacity(events.len()); + let mut models: HashMap = HashMap::with_capacity(events.len()); for e in events { let model_event = match e.try_into() { @@ -650,15 +648,15 @@ impl ManifestMethods for DojoContract { self.abi = abi; } - fn class_hash(&self) -> &FieldElement { + fn class_hash(&self) -> &Felt { self.class_hash.as_ref() } - fn set_class_hash(&mut self, class_hash: FieldElement) { + fn set_class_hash(&mut self, class_hash: Felt) { self.class_hash = class_hash; } - fn original_class_hash(&self) -> &FieldElement { + fn original_class_hash(&self) -> &Felt { self.original_class_hash.as_ref() } @@ -689,15 +687,15 @@ impl ManifestMethods for DojoModel { self.abi = abi; } - fn class_hash(&self) -> &FieldElement { + fn class_hash(&self) -> &Felt { self.class_hash.as_ref() } - fn set_class_hash(&mut self, class_hash: FieldElement) { + fn set_class_hash(&mut self, class_hash: Felt) { self.class_hash = class_hash; } - fn original_class_hash(&self) -> &FieldElement { + fn original_class_hash(&self) -> &Felt { self.original_class_hash.as_ref() } @@ -719,15 +717,15 @@ impl ManifestMethods for WorldContract { self.abi = abi; } - fn class_hash(&self) -> &FieldElement { + fn class_hash(&self) -> &Felt { self.class_hash.as_ref() } - fn set_class_hash(&mut self, class_hash: FieldElement) { + fn set_class_hash(&mut self, class_hash: Felt) { self.class_hash = class_hash; } - fn original_class_hash(&self) -> &FieldElement { + fn original_class_hash(&self) -> &Felt { self.original_class_hash.as_ref() } @@ -749,15 +747,15 @@ impl ManifestMethods for Class { self.abi = abi; } - fn class_hash(&self) -> &FieldElement { + fn class_hash(&self) -> &Felt { self.class_hash.as_ref() } - fn set_class_hash(&mut self, class_hash: FieldElement) { + fn set_class_hash(&mut self, class_hash: Felt) { self.class_hash = class_hash; } - fn original_class_hash(&self) -> &FieldElement { + fn original_class_hash(&self) -> &Felt { self.original_class_hash.as_ref() } diff --git a/crates/dojo-world/src/manifest/types.rs b/crates/dojo-world/src/manifest/types.rs index 5eb3e67d0c..b576c6e557 100644 --- a/crates/dojo-world/src/manifest/types.rs +++ b/crates/dojo-world/src/manifest/types.rs @@ -6,7 +6,7 @@ use serde_with::serde_as; use smol_str::SmolStr; use starknet::core::serde::unsigned_field_element::UfeHex; use starknet::core::types::contract::AbiEntry; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use crate::manifest::AbstractManifestError; @@ -61,9 +61,9 @@ pub trait ManifestMethods { type OverlayType; fn abi(&self) -> Option<&AbiFormat>; fn set_abi(&mut self, abi: Option); - fn class_hash(&self) -> &FieldElement; - fn set_class_hash(&mut self, class_hash: FieldElement); - fn original_class_hash(&self) -> &FieldElement; + fn class_hash(&self) -> &Felt; + fn set_class_hash(&mut self, class_hash: Felt); + fn original_class_hash(&self) -> &Felt; /// This method is called when during compilation base manifest file already exists. /// Manifest generated during compilation won't contains properties manually updated by users @@ -86,14 +86,14 @@ where #[serde(tag = "kind")] pub struct DojoContract { #[serde_as(as = "Option")] - pub address: Option, + pub address: Option, #[serde_as(as = "UfeHex")] - pub class_hash: FieldElement, + pub class_hash: Felt, #[serde_as(as = "UfeHex")] - pub original_class_hash: FieldElement, + pub original_class_hash: Felt, // base class hash used to deploy the contract #[serde_as(as = "UfeHex")] - pub base_class_hash: FieldElement, + pub base_class_hash: Felt, pub abi: Option, #[serde(default)] pub reads: Vec, @@ -113,9 +113,9 @@ pub struct DojoContract { pub struct DojoModel { pub members: Vec, #[serde_as(as = "UfeHex")] - pub class_hash: FieldElement, + pub class_hash: Felt, #[serde_as(as = "UfeHex")] - pub original_class_hash: FieldElement, + pub original_class_hash: Felt, pub abi: Option, } @@ -125,14 +125,14 @@ pub struct DojoModel { #[serde(tag = "kind")] pub struct WorldContract { #[serde_as(as = "UfeHex")] - pub class_hash: FieldElement, + pub class_hash: Felt, #[serde_as(as = "UfeHex")] - pub original_class_hash: FieldElement, + pub original_class_hash: Felt, pub abi: Option, #[serde_as(as = "Option")] - pub address: Option, + pub address: Option, #[serde_as(as = "Option")] - pub transaction_hash: Option, + pub transaction_hash: Option, pub block_number: Option, pub seed: String, pub metadata: Option, @@ -144,9 +144,9 @@ pub struct WorldContract { #[serde(tag = "kind")] pub struct Class { #[serde_as(as = "UfeHex")] - pub class_hash: FieldElement, + pub class_hash: Felt, #[serde_as(as = "UfeHex")] - pub original_class_hash: FieldElement, + pub original_class_hash: Felt, pub abi: Option, } @@ -155,7 +155,7 @@ pub struct Class { #[cfg_attr(test, derive(PartialEq))] pub struct OverlayDojoContract { pub name: SmolStr, - pub original_class_hash: Option, + pub original_class_hash: Option, pub reads: Option>, pub writes: Option>, pub init_calldata: Option>, @@ -166,7 +166,7 @@ pub struct OverlayDojoContract { #[cfg_attr(test, derive(PartialEq))] pub struct OverlayDojoModel { pub name: SmolStr, - pub original_class_hash: Option, + pub original_class_hash: Option, } #[serde_as] @@ -174,7 +174,7 @@ pub struct OverlayDojoModel { #[cfg_attr(test, derive(PartialEq))] pub struct OverlayContract { pub name: SmolStr, - pub original_class_hash: Option, + pub original_class_hash: Option, } #[serde_as] @@ -182,7 +182,7 @@ pub struct OverlayContract { #[cfg_attr(test, derive(PartialEq))] pub struct OverlayClass { pub name: SmolStr, - pub original_class_hash: Option, + pub original_class_hash: Option, } // Types used by manifest diff --git a/crates/dojo-world/src/migration/class.rs b/crates/dojo-world/src/migration/class.rs index e5b29f16d9..a342e6eb01 100644 --- a/crates/dojo-world/src/migration/class.rs +++ b/crates/dojo-world/src/migration/class.rs @@ -2,7 +2,7 @@ use std::fmt::Display; use std::path::PathBuf; use async_trait::async_trait; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use super::{Declarable, MigrationType, StateDiff}; @@ -10,9 +10,9 @@ use super::{Declarable, MigrationType, StateDiff}; #[derive(Debug, Default, Clone)] pub struct ClassDiff { pub name: String, - pub local_class_hash: FieldElement, - pub original_class_hash: FieldElement, - pub remote_class_hash: Option, + pub local_class_hash: Felt, + pub original_class_hash: Felt, + pub remote_class_hash: Option, } impl StateDiff for ClassDiff { diff --git a/crates/dojo-world/src/migration/contract.rs b/crates/dojo-world/src/migration/contract.rs index 59e6c929f9..6a0bb9ce35 100644 --- a/crates/dojo-world/src/migration/contract.rs +++ b/crates/dojo-world/src/migration/contract.rs @@ -2,7 +2,7 @@ use std::fmt::Display; use std::path::PathBuf; use async_trait::async_trait; -use starknet::core::types::{DeclareTransactionResult, FieldElement}; +use starknet::core::types::{DeclareTransactionResult, Felt}; use super::{Declarable, Deployable, MigrationType, StateDiff, Upgradable}; @@ -12,10 +12,10 @@ pub type DeclareOutput = DeclareTransactionResult; #[derive(Debug, Default, Clone)] pub struct ContractDiff { pub name: String, - pub local_class_hash: FieldElement, - pub original_class_hash: FieldElement, - pub base_class_hash: FieldElement, - pub remote_class_hash: Option, + pub local_class_hash: Felt, + pub original_class_hash: Felt, + pub base_class_hash: Felt, + pub remote_class_hash: Option, pub init_calldata: Vec, } @@ -47,10 +47,10 @@ impl Display for ContractDiff { // Represents a contract that needs to be migrated to the remote state #[derive(Debug, Default, Clone)] pub struct ContractMigration { - pub salt: FieldElement, + pub salt: Felt, pub diff: ContractDiff, pub artifact_path: PathBuf, - pub contract_address: FieldElement, + pub contract_address: Felt, } impl ContractMigration { @@ -75,7 +75,7 @@ impl Declarable for ContractMigration { #[async_trait] impl Deployable for ContractMigration { - fn salt(&self) -> FieldElement { + fn salt(&self) -> Felt { self.salt } } diff --git a/crates/dojo-world/src/migration/mod.rs b/crates/dojo-world/src/migration/mod.rs index 203b5d91de..e67dbafc32 100644 --- a/crates/dojo-world/src/migration/mod.rs +++ b/crates/dojo-world/src/migration/mod.rs @@ -10,8 +10,8 @@ use cairo_lang_starknet_classes::contract_class::ContractClass; use starknet::accounts::{Account, AccountError, Call, ConnectedAccount}; use starknet::core::types::contract::{CompiledClass, SierraClass}; use starknet::core::types::{ - BlockId, BlockTag, DeclareTransactionResult, FieldElement, FlattenedSierraClass, - InvokeTransactionResult, MaybePendingTransactionReceipt, StarknetError, TransactionReceipt, + BlockId, BlockTag, DeclareTransactionResult, Felt, FlattenedSierraClass, + InvokeTransactionResult, ReceiptBlock, StarknetError, TransactionReceiptWithBlockInfo, }; use starknet::core::utils::{get_contract_address, CairoShortStringToFeltError}; use starknet::macros::{felt, selector}; @@ -29,27 +29,27 @@ pub type DeclareOutput = DeclareTransactionResult; #[derive(Clone, Debug)] pub struct DeployOutput { - pub transaction_hash: FieldElement, + pub transaction_hash: Felt, pub block_number: Option, - pub contract_address: FieldElement, + pub contract_address: Felt, pub declare: Option, // base class hash at time of deployment - pub base_class_hash: FieldElement, + pub base_class_hash: Felt, pub was_upgraded: bool, pub name: Option, } #[derive(Clone, Debug)] pub struct UpgradeOutput { - pub transaction_hash: FieldElement, + pub transaction_hash: Felt, pub block_number: Option, - pub contract_address: FieldElement, + pub contract_address: Felt, pub declare: Option, } #[derive(Debug)] pub struct RegisterOutput { - pub transaction_hash: FieldElement, + pub transaction_hash: Felt, pub declare_output: Vec, pub registered_model_names: Vec, } @@ -61,7 +61,7 @@ pub enum MigrationError { #[error("Class already declared.")] ClassAlreadyDeclared, #[error("Contract already deployed.")] - ContractAlreadyDeployed(FieldElement), + ContractAlreadyDeployed(Felt), #[error(transparent)] Migrator(#[from] AccountError), #[error(transparent)] @@ -100,7 +100,7 @@ pub struct TxnConfig { pub fee_estimate_multiplier: Option, pub wait: bool, pub receipt: bool, - pub max_fee_raw: Option, + pub max_fee_raw: Option, } #[derive(Debug, Copy, Clone)] @@ -108,7 +108,7 @@ pub enum TxnAction { Send { wait: bool, receipt: bool, - max_fee_raw: Option, + max_fee_raw: Option, /// The multiplier for how much the actual transaction max fee should be relative to the /// estimated fee. If `None` is provided, the multiplier is set to `1.1`. fee_estimate_multiplier: Option, @@ -149,7 +149,7 @@ pub trait Declarable { } let DeclareTransactionResult { transaction_hash, class_hash } = account - .declare(Arc::new(flattened_class), casm_class_hash) + .declare_v2(Arc::new(flattened_class), casm_class_hash) .send_with_cfg(txn_config) .await .map_err(MigrationError::Migrator)?; @@ -169,9 +169,9 @@ pub trait Declarable { pub trait Deployable: Declarable + Sync { async fn deploy_dojo_contract( &self, - world_address: FieldElement, - class_hash: FieldElement, - base_class_hash: FieldElement, + world_address: Felt, + class_hash: Felt, + base_class_hash: Felt, account: A, txn_config: &TxnConfig, calldata: &[String], @@ -207,14 +207,13 @@ pub trait Deployable: Declarable + Sync { } Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => { - let init_calldata: Vec = calldata + let init_calldata: Vec = calldata .iter() - .map(|s| FieldElement::from_str(s)) + .map(|s| Felt::from_str(s)) .collect::, _>>() .map_err(|_| MigrationError::BadInitCalldata)?; - let mut calldata = - vec![self.salt(), class_hash, FieldElement::from(calldata.len())]; + let mut calldata = vec![self.salt(), class_hash, Felt::from(calldata.len())]; calldata.extend(init_calldata); Call { calldata, selector: selector!("deploy_contract"), to: world_address } } @@ -227,7 +226,7 @@ pub trait Deployable: Declarable + Sync { }; let InvokeTransactionResult { transaction_hash } = account - .execute(vec![call]) + .execute_v1(vec![call]) .send_with_cfg(txn_config) .await .map_err(MigrationError::Migrator)?; @@ -248,8 +247,8 @@ pub trait Deployable: Declarable + Sync { async fn deploy( &self, - class_hash: FieldElement, - constructor_calldata: Vec, + class_hash: Felt, + constructor_calldata: Vec, account: A, txn_config: &TxnConfig, ) -> Result::SignError>> @@ -265,21 +264,17 @@ pub trait Deployable: Declarable + Sync { let calldata = [ vec![ - class_hash, // class hash - self.salt(), // salt - FieldElement::ZERO, // unique - FieldElement::from(constructor_calldata.len()), // constructor calldata len + class_hash, // class hash + self.salt(), // salt + Felt::ZERO, // unique + Felt::from(constructor_calldata.len()), // constructor calldata len ], constructor_calldata.clone(), ] .concat(); - let contract_address = get_contract_address( - self.salt(), - class_hash, - &constructor_calldata, - FieldElement::ZERO, - ); + let contract_address = + get_contract_address(self.salt(), class_hash, &constructor_calldata, Felt::ZERO); match account .provider() @@ -291,7 +286,7 @@ pub trait Deployable: Declarable + Sync { Err(e) => return Err(MigrationError::Provider(e)), } - let txn = account.execute(vec![Call { + let txn = account.execute_v1(vec![Call { calldata, // devnet UDC address selector: selector!("deployContract"), @@ -309,13 +304,13 @@ pub trait Deployable: Declarable + Sync { block_number, contract_address, declare, - base_class_hash: FieldElement::default(), + base_class_hash: Felt::default(), was_upgraded: false, name: None, }) } - fn salt(&self) -> FieldElement; + fn salt(&self) -> Felt; } #[cfg_attr(not(target_arch = "wasm32"), async_trait)] @@ -323,9 +318,9 @@ pub trait Deployable: Declarable + Sync { pub trait Upgradable: Deployable + Declarable + Sync { async fn upgrade_world( &self, - class_hash: FieldElement, - original_class_hash: FieldElement, - original_base_class_hash: FieldElement, + class_hash: Felt, + original_class_hash: Felt, + original_base_class_hash: Felt, account: A, txn_config: &TxnConfig, ) -> Result::SignError>> @@ -344,7 +339,7 @@ pub trait Upgradable: Deployable + Declarable + Sync { self.salt(), original_class_hash, &original_constructor_calldata, - FieldElement::ZERO, + Felt::ZERO, ); match account @@ -359,7 +354,11 @@ pub trait Upgradable: Deployable + Declarable + Sync { let calldata = vec![class_hash]; let InvokeTransactionResult { transaction_hash } = account - .execute(vec![Call { calldata, selector: selector!("upgrade"), to: contract_address }]) + .execute_v1(vec![Call { + calldata, + selector: selector!("upgrade"), + to: contract_address, + }]) .send_with_cfg(txn_config) .await .map_err(MigrationError::Migrator)?; @@ -373,7 +372,7 @@ pub trait Upgradable: Deployable + Declarable + Sync { fn prepare_contract_declaration_params( artifact_path: &PathBuf, -) -> Result<(FlattenedSierraClass, FieldElement)> { +) -> Result<(FlattenedSierraClass, Felt)> { let flattened_class = read_class(artifact_path)? .flatten() .map_err(|e| anyhow!("error flattening the contract class: {e}"))?; @@ -389,7 +388,7 @@ pub fn read_class(artifact_path: &PathBuf) -> Result { Ok(contract_artifact) } -fn get_compiled_class_hash(artifact_path: &PathBuf) -> Result { +fn get_compiled_class_hash(artifact_path: &PathBuf) -> Result { let file = File::open(artifact_path)?; let casm_contract_class: ContractClass = serde_json::from_reader(file)?; let casm_contract = @@ -399,13 +398,9 @@ fn get_compiled_class_hash(artifact_path: &PathBuf) -> Result { Ok(compiled_class.class_hash()?) } -fn get_block_number_from_receipt(receipt: MaybePendingTransactionReceipt) -> Option { - match receipt { - MaybePendingTransactionReceipt::Receipt(receipt) => match receipt { - TransactionReceipt::Deploy(r) => Some(r.block_number), - TransactionReceipt::Invoke(r) => Some(r.block_number), - _ => None, - }, - MaybePendingTransactionReceipt::PendingReceipt(_receipt) => None, +fn get_block_number_from_receipt(receipt: TransactionReceiptWithBlockInfo) -> Option { + match receipt.block { + ReceiptBlock::Pending => None, + ReceiptBlock::Block { block_number, .. } => Some(block_number), } } diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index 258b34ea68..f0e79d8867 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use anyhow::{anyhow, bail, Context, Result}; use camino::Utf8PathBuf; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::{cairo_short_string_to_felt, get_contract_address}; use starknet_crypto::{poseidon_hash_many, poseidon_hash_single}; @@ -20,7 +20,7 @@ pub enum MigrationMetadata { #[derive(Debug, Clone)] pub struct MigrationStrategy { - pub world_address: Option, + pub world_address: Option, pub world: Option, pub base: Option, pub contracts: Vec, @@ -35,7 +35,7 @@ pub struct MigrationItemsInfo { } impl MigrationStrategy { - pub fn world_address(&self) -> Result { + pub fn world_address(&self) -> Result { match &self.world { Some(c) => Ok(c.contract_address), None => self.world_address.ok_or(anyhow!("World address not found")), @@ -66,7 +66,7 @@ impl MigrationStrategy { MigrationItemsInfo { new, update } } - pub fn resolve_variable(&mut self, world_address: FieldElement) -> Result<()> { + pub fn resolve_variable(&mut self, world_address: Felt) -> Result<()> { for contract in self.contracts.iter_mut() { for field in contract.diff.init_calldata.iter_mut() { if let Some(dependency) = field.strip_prefix("$contract_address:") { @@ -101,8 +101,8 @@ impl MigrationStrategy { /// construct migration strategy /// evaluate which contracts/classes need to be declared/deployed pub fn prepare_for_migration( - world_address: Option, - seed: FieldElement, + world_address: Option, + seed: Felt, target_dir: &Utf8PathBuf, diff: WorldDiff, ) -> Result { @@ -152,7 +152,7 @@ pub fn prepare_for_migration( salt, diff.world.original_class_hash, &[base.as_ref().unwrap().diff.original_class_hash], - FieldElement::ZERO, + Felt::ZERO, ); if let Some(world_address) = world_address { @@ -264,7 +264,7 @@ fn find_artifact_path<'a>( .with_context(|| anyhow!("missing contract artifact for `{}` contract", contract_name)) } -pub fn generate_salt(value: &str) -> FieldElement { +pub fn generate_salt(value: &str) -> Felt { poseidon_hash_many( &value .chars() diff --git a/crates/dojo-world/src/migration/world.rs b/crates/dojo-world/src/migration/world.rs index 27adf6c69a..a19a7084a4 100644 --- a/crates/dojo-world/src/migration/world.rs +++ b/crates/dojo-world/src/migration/world.rs @@ -4,7 +4,7 @@ use std::str::FromStr; use anyhow::{bail, Result}; use convert_case::{Case, Casing}; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use topological_sort::TopologicalSort; use super::class::ClassDiff; @@ -60,7 +60,7 @@ impl WorldDiff { .map(|contract| { let base_class_hash = { let class_hash = contract.inner.base_class_hash; - if class_hash != FieldElement::ZERO { + if class_hash != Felt::ZERO { class_hash } else { *local.base.inner.class_hash() @@ -129,7 +129,7 @@ impl WorldDiff { ts.add_dependency(dependency, curr_name); } else { // verify its a field element - match FieldElement::from_str(field) { + match Felt::from_str(field) { Ok(_) => continue, Err(e) => bail!(format!( "Expected init_calldata element to be a special variable (i.e. \ diff --git a/crates/dojo-world/src/utils.rs b/crates/dojo-world/src/utils.rs index 25e478bce0..16c7d59a64 100644 --- a/crates/dojo-world/src/utils.rs +++ b/crates/dojo-world/src/utils.rs @@ -5,13 +5,13 @@ use std::time::Duration; use futures::FutureExt; use starknet::accounts::{ - AccountDeployment, AccountError, AccountFactory, AccountFactoryError, ConnectedAccount, - Declaration, Execution, + AccountDeploymentV1, AccountError, AccountFactory, AccountFactoryError, ConnectedAccount, + DeclarationV2, ExecutionV1, }; use starknet::core::types::{ - DeclareTransactionResult, DeployAccountTransactionResult, ExecutionResult, FieldElement, - InvokeTransactionResult, MaybePendingTransactionReceipt, PendingTransactionReceipt, - StarknetError, TransactionFinalityStatus, TransactionReceipt, TransactionStatus, + DeclareTransactionResult, DeployAccountTransactionResult, ExecutionResult, Felt, + InvokeTransactionResult, ReceiptBlock, StarknetError, TransactionFinalityStatus, + TransactionReceipt, TransactionReceiptWithBlockInfo, TransactionStatus, }; use starknet::providers::{Provider, ProviderError}; use tokio::time::{Instant, Interval}; @@ -19,7 +19,7 @@ use tokio::time::{Instant, Interval}; use crate::migration::TxnConfig; type GetTxStatusResult = Result; -type GetTxReceiptResult = Result; +type GetTxReceiptResult = Result; type GetTxStatusFuture<'a> = Pin + Send + 'a>>; type GetTxReceiptFuture<'a> = Pin + Send + 'a>>; @@ -54,13 +54,13 @@ pub enum TransactionWaitingError { /// /// let provider = JsonRpcClient::new(HttpTransport::new(Url::parse("http://localhost:5000").unwrap())); /// -/// let tx_hash = FieldElement::from(0xbadbeefu64); +/// let tx_hash = Felt::from(0xbadbeefu64); /// let receipt = TransactionWaiter::new(tx_hash, &provider).with_tx_status(TransactionFinalityStatus::AcceptedOnL2).await.unwrap(); /// ``` #[must_use = "TransactionWaiter does nothing unless polled"] pub struct TransactionWaiter<'a, P: Provider> { /// The hash of the transaction to wait for. - tx_hash: FieldElement, + tx_hash: Felt, /// The transaction finality status to wait for. /// /// If not set, then it will wait until it is `ACCEPTED_ON_L2` whether it is reverted or not. @@ -97,7 +97,7 @@ where /// Interval for use with 3rd party provider without burning the API rate limit. const DEFAULT_INTERVAL: Duration = Duration::from_millis(2500); - pub fn new(tx: FieldElement, provider: &'a P) -> Self { + pub fn new(tx: Felt, provider: &'a P) -> Self { Self { provider, tx_hash: tx, @@ -130,12 +130,12 @@ where // Helper function to evaluate if the transaction receipt should be accepted yet or not, based // on the waiter's parameters. Used in the `Future` impl. fn evaluate_receipt_from_params( - receipt: MaybePendingTransactionReceipt, + receipt: TransactionReceiptWithBlockInfo, expected_finality_status: Option, must_succeed: bool, - ) -> Option> { - match &receipt { - MaybePendingTransactionReceipt::PendingReceipt(r) => { + ) -> Option> { + match &receipt.block { + ReceiptBlock::Pending => { // pending receipt doesn't include finality status, so we cant check it. if expected_finality_status.is_some() { return None; @@ -145,7 +145,7 @@ where return Some(Ok(receipt)); } - match execution_status_from_pending_receipt(r) { + match execution_status_from_receipt(&receipt.receipt) { ExecutionResult::Succeeded => Some(Ok(receipt)), ExecutionResult::Reverted { reason } => { Some(Err(TransactionWaitingError::TransactionReverted(reason.clone()))) @@ -153,9 +153,9 @@ where } } - MaybePendingTransactionReceipt::Receipt(r) => { + ReceiptBlock::Block { .. } => { if let Some(expected_status) = expected_finality_status { - match finality_status_from_receipt(r) { + match finality_status_from_receipt(&receipt.receipt) { TransactionFinalityStatus::AcceptedOnL2 if expected_status == TransactionFinalityStatus::AcceptedOnL1 => { @@ -167,7 +167,7 @@ where return Some(Ok(receipt)); } - match execution_status_from_receipt(r) { + match execution_status_from_receipt(&receipt.receipt) { ExecutionResult::Succeeded => Some(Ok(receipt)), ExecutionResult::Reverted { reason } => Some(Err( TransactionWaitingError::TransactionReverted(reason.clone()), @@ -187,7 +187,7 @@ impl<'a, P> Future for TransactionWaiter<'a, P> where P: Provider + Send, { - type Output = Result; + type Output = Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.get_mut(); @@ -255,9 +255,9 @@ where return Poll::Ready(Err(TransactionWaitingError::Provider(e))); } - Ok(receipt) => { + Ok(res) => { if let Some(res) = Self::evaluate_receipt_from_params( - receipt, + res, this.tx_finality_status, this.must_succeed, ) { @@ -281,19 +281,7 @@ where } #[inline] -pub fn execution_status_from_maybe_pending_receipt( - receipt: &MaybePendingTransactionReceipt, -) -> &ExecutionResult { - match &receipt { - MaybePendingTransactionReceipt::PendingReceipt(r) => { - execution_status_from_pending_receipt(r) - } - MaybePendingTransactionReceipt::Receipt(r) => execution_status_from_receipt(r), - } -} - -#[inline] -fn execution_status_from_receipt(receipt: &TransactionReceipt) -> &ExecutionResult { +pub fn execution_status_from_receipt(receipt: &TransactionReceipt) -> &ExecutionResult { match receipt { TransactionReceipt::Invoke(receipt) => &receipt.execution_result, TransactionReceipt::Deploy(receipt) => &receipt.execution_result, @@ -303,16 +291,6 @@ fn execution_status_from_receipt(receipt: &TransactionReceipt) -> &ExecutionResu } } -#[inline] -fn execution_status_from_pending_receipt(receipt: &PendingTransactionReceipt) -> &ExecutionResult { - match receipt { - PendingTransactionReceipt::Invoke(receipt) => &receipt.execution_result, - PendingTransactionReceipt::Declare(receipt) => &receipt.execution_result, - PendingTransactionReceipt::L1Handler(receipt) => &receipt.execution_result, - PendingTransactionReceipt::DeployAccount(receipt) => &receipt.execution_result, - } -} - #[inline] fn finality_status_from_receipt(receipt: &TransactionReceipt) -> TransactionFinalityStatus { match receipt { @@ -324,17 +302,6 @@ fn finality_status_from_receipt(receipt: &TransactionReceipt) -> TransactionFina } } -#[inline] -pub fn block_number_from_receipt(receipt: &TransactionReceipt) -> u64 { - match receipt { - TransactionReceipt::Invoke(tx) => tx.block_number, - TransactionReceipt::L1Handler(tx) => tx.block_number, - TransactionReceipt::Declare(tx) => tx.block_number, - TransactionReceipt::Deploy(tx) => tx.block_number, - TransactionReceipt::DeployAccount(tx) => tx.block_number, - } -} - /// Helper trait to abstract away setting `TxnConfig` configurations before sending a transaction /// Implemented by types from `starknet-accounts` like `Execution`, `Declaration`, etc... #[allow(async_fn_in_trait)] @@ -349,7 +316,7 @@ pub trait TransactionExt { async fn send_with_cfg(self, txn_config: &TxnConfig) -> Result; } -impl TransactionExt for Execution<'_, T> +impl TransactionExt for ExecutionV1<'_, T> where T: ConnectedAccount + Sync, { @@ -372,7 +339,7 @@ where } } -impl TransactionExt for Declaration<'_, T> +impl TransactionExt for DeclarationV2<'_, T> where T: ConnectedAccount + Sync, { @@ -395,7 +362,7 @@ where } } -impl TransactionExt for AccountDeployment<'_, T> +impl TransactionExt for AccountDeploymentV1<'_, T> where T: AccountFactory + Sync, { @@ -425,9 +392,9 @@ mod tests { get_default_test_starknet_config, SequencerConfig, TestSequencer, }; use starknet::core::types::{ - ExecutionResources, ExecutionResult, FeePayment, FieldElement, InvokeTransactionReceipt, - MaybePendingTransactionReceipt, PendingInvokeTransactionReceipt, PendingTransactionReceipt, - PriceUnit, TransactionFinalityStatus, TransactionReceipt, + ComputationResources, DataAvailabilityResources, DataResources, ExecutionResources, + ExecutionResult, FeePayment, Felt, InvokeTransactionReceipt, PriceUnit, ReceiptBlock, + TransactionFinalityStatus, TransactionReceipt, TransactionReceiptWithBlockInfo, }; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; @@ -443,44 +410,58 @@ mod tests { } const EXECUTION_RESOURCES: ExecutionResources = ExecutionResources { - steps: 0, - memory_holes: None, - ec_op_builtin_applications: Some(0), - ecdsa_builtin_applications: Some(0), - keccak_builtin_applications: Some(0), - bitwise_builtin_applications: Some(0), - pedersen_builtin_applications: Some(0), - poseidon_builtin_applications: Some(0), - range_check_builtin_applications: Some(0), - segment_arena_builtin: Some(0), + computation_resources: ComputationResources { + steps: 0, + memory_holes: None, + ec_op_builtin_applications: Some(0), + ecdsa_builtin_applications: Some(0), + keccak_builtin_applications: Some(0), + bitwise_builtin_applications: Some(0), + pedersen_builtin_applications: Some(0), + poseidon_builtin_applications: Some(0), + range_check_builtin_applications: Some(0), + segment_arena_builtin: Some(0), + }, + data_resources: DataResources { + data_availability: DataAvailabilityResources { l1_gas: 0, l1_data_gas: 0 }, + }, }; fn mock_receipt( finality_status: TransactionFinalityStatus, execution_result: ExecutionResult, - ) -> TransactionReceipt { - TransactionReceipt::Invoke(InvokeTransactionReceipt { + ) -> TransactionReceiptWithBlockInfo { + let receipt = TransactionReceipt::Invoke(InvokeTransactionReceipt { finality_status, execution_result, events: Default::default(), actual_fee: FeePayment { amount: Default::default(), unit: PriceUnit::Wei }, - block_hash: Default::default(), - block_number: Default::default(), messages_sent: Default::default(), transaction_hash: Default::default(), execution_resources: EXECUTION_RESOURCES, - }) + }); + + TransactionReceiptWithBlockInfo { + receipt, + block: ReceiptBlock::Block { + block_hash: Default::default(), + block_number: Default::default(), + }, + } } - fn mock_pending_receipt(execution_result: ExecutionResult) -> PendingTransactionReceipt { - PendingTransactionReceipt::Invoke(PendingInvokeTransactionReceipt { + fn mock_pending_receipt(execution_result: ExecutionResult) -> TransactionReceiptWithBlockInfo { + let receipt = TransactionReceipt::Invoke(InvokeTransactionReceipt { execution_result, events: Default::default(), + finality_status: TransactionFinalityStatus::AcceptedOnL2, actual_fee: FeePayment { amount: Default::default(), unit: PriceUnit::Wei }, messages_sent: Default::default(), transaction_hash: Default::default(), execution_resources: EXECUTION_RESOURCES, - }) + }); + + TransactionReceiptWithBlockInfo { receipt, block: ReceiptBlock::Pending } } #[tokio::test] @@ -488,7 +469,7 @@ mod tests { let (_sequencer, provider) = create_test_sequencer().await; assert_matches!( - TransactionWaiter::new(FieldElement::from_hex_be("0x1234").unwrap(), &provider) + TransactionWaiter::new(Felt::from_hex("0x1234").unwrap(), &provider) .with_timeout(Duration::from_secs(1)) .await, Err(super::TransactionWaitingError::Timeout) @@ -497,10 +478,8 @@ mod tests { #[test] fn wait_for_no_finality_status() { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL2, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL2, ExecutionResult::Succeeded); assert_eq!( TransactionWaiter::>::evaluate_receipt_from_params( @@ -532,10 +511,8 @@ mod tests { #[test] fn wait_for_finality_status_with_no_succeed() { { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL2, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL2, ExecutionResult::Succeeded); assert_eval_receipt!( (receipt.clone(), Some(TransactionFinalityStatus::AcceptedOnL2)), @@ -544,10 +521,8 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL2, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL2, ExecutionResult::Succeeded); assert!( TransactionWaiter::>::evaluate_receipt_from_params( @@ -560,10 +535,8 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL1, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL1, ExecutionResult::Succeeded); assert_eval_receipt!( (receipt.clone(), Some(TransactionFinalityStatus::AcceptedOnL2)), @@ -572,10 +545,8 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL1, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL1, ExecutionResult::Succeeded); assert_eval_receipt!( (receipt.clone(), Some(TransactionFinalityStatus::AcceptedOnL1)), @@ -587,10 +558,8 @@ mod tests { #[test] fn wait_for_finality_status_with_must_succeed() { { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL2, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL2, ExecutionResult::Succeeded); assert_eq!( TransactionWaiter::>::evaluate_receipt_from_params( @@ -605,10 +574,8 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( - TransactionFinalityStatus::AcceptedOnL1, - ExecutionResult::Succeeded, - )); + let receipt = + mock_receipt(TransactionFinalityStatus::AcceptedOnL1, ExecutionResult::Succeeded); assert_eq!( TransactionWaiter::>::evaluate_receipt_from_params( @@ -623,10 +590,10 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::Receipt(mock_receipt( + let receipt = mock_receipt( TransactionFinalityStatus::AcceptedOnL1, ExecutionResult::Reverted { reason: Default::default() }, - )); + ); let err = TransactionWaiter::>::evaluate_receipt_from_params( @@ -644,9 +611,7 @@ mod tests { #[test] fn wait_for_pending_tx() { { - let receipt = MaybePendingTransactionReceipt::PendingReceipt(mock_pending_receipt( - ExecutionResult::Succeeded, - )); + let receipt = mock_pending_receipt(ExecutionResult::Succeeded); assert!( TransactionWaiter::>::evaluate_receipt_from_params( @@ -659,9 +624,8 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::PendingReceipt(mock_pending_receipt( - ExecutionResult::Reverted { reason: Default::default() }, - )); + let receipt = + mock_pending_receipt(ExecutionResult::Reverted { reason: Default::default() }); assert_eq!( TransactionWaiter::>::evaluate_receipt_from_params( @@ -676,9 +640,8 @@ mod tests { } { - let receipt = MaybePendingTransactionReceipt::PendingReceipt(mock_pending_receipt( - ExecutionResult::Reverted { reason: Default::default() }, - )); + let receipt = + mock_pending_receipt(ExecutionResult::Reverted { reason: Default::default() }); let err = TransactionWaiter::>::evaluate_receipt_from_params( diff --git a/crates/katana/controller/src/lib.rs b/crates/katana/controller/src/lib.rs index ec4716d891..bb5ddded59 100644 --- a/crates/katana/controller/src/lib.rs +++ b/crates/katana/controller/src/lib.rs @@ -50,7 +50,11 @@ fn add_controller_account_inner(genesis: &mut Genesis, user: slot::account::Acco storage: Some(get_contract_storage(credential_id, public_key, SignerType::Webauthn)?), }; - (ContractAddress::from(user.contract_address), GenesisAllocation::Contract(account)) + let address = ContractAddress::from(FieldElement::from_bytes_be( + &user.contract_address.to_bytes_be(), + )); + + (address, GenesisAllocation::Contract(account)) }; genesis.extend_allocations([(address, contract)]); @@ -102,7 +106,11 @@ pub mod json { )?), }; - (ContractAddress::from(user.account.contract_address), account) + let address = ContractAddress::from(FieldElement::from_bytes_be( + &user.account.contract_address.to_bytes_be(), + )); + + (address, account) }; genesis.contracts.insert(address, contract); diff --git a/crates/katana/core/Cargo.toml b/crates/katana/core/Cargo.toml index f3bb707825..7497cd7441 100644 --- a/crates/katana/core/Cargo.toml +++ b/crates/katana/core/Cargo.toml @@ -15,8 +15,6 @@ katana-tasks.workspace = true anyhow.workspace = true async-trait.workspace = true -cairo-lang-casm = "=2.6.3" -cairo-lang-starknet = "=2.6.3" cairo-vm.workspace = true convert_case.workspace = true derive_more.workspace = true @@ -26,6 +24,7 @@ futures.workspace = true k256 = { version = "0.13", default-features = false, features = [ "ecdsa", "std" ] } lazy_static.workspace = true metrics.workspace = true +num-traits.workspace = true parking_lot.workspace = true rand = { workspace = true, features = [ "small_rng" ] } reqwest.workspace = true diff --git a/crates/katana/core/src/backend/mod.rs b/crates/katana/core/src/backend/mod.rs index 209b58a2dc..b1a73c08ae 100644 --- a/crates/katana/core/src/backend/mod.rs +++ b/crates/katana/core/src/backend/mod.rs @@ -11,6 +11,7 @@ use katana_primitives::FieldElement; use katana_provider::providers::fork::ForkedProvider; use katana_provider::providers::in_memory::InMemoryProvider; use katana_provider::traits::block::{BlockHashProvider, BlockWriter}; +use num_traits::ToPrimitive; use parking_lot::RwLock; use starknet::core::types::{BlockId, BlockStatus, MaybePendingBlockWithTxHashes}; use starknet::core::utils::parse_cairo_short_string; @@ -73,9 +74,9 @@ impl Backend { config.genesis.timestamp = block.timestamp; config.genesis.sequencer_address = block.sequencer_address.into(); config.genesis.gas_prices.eth = - block.l1_gas_price.price_in_wei.try_into().expect("should fit in u128"); + block.l1_gas_price.price_in_wei.to_u128().expect("should fit in u128"); config.genesis.gas_prices.strk = - block.l1_gas_price.price_in_fri.try_into().expect("should fit in u128"); + block.l1_gas_price.price_in_fri.to_u128().expect("should fit in u128"); trace!( target: LOG_TARGET, diff --git a/crates/katana/core/src/pool.rs b/crates/katana/core/src/pool.rs index 8214e91657..c8c423cd70 100644 --- a/crates/katana/core/src/pool.rs +++ b/crates/katana/core/src/pool.rs @@ -2,8 +2,8 @@ use futures::channel::mpsc::{channel, Receiver, Sender}; use katana_primitives::transaction::ExecutableTxWithHash; +use katana_primitives::FieldElement; use parking_lot::RwLock; -use starknet::core::types::FieldElement; use tracing::{info, warn}; pub(crate) const LOG_TARGET: &str = "txpool"; diff --git a/crates/katana/core/src/service/messaging/starknet.rs b/crates/katana/core/src/service/messaging/starknet.rs index 6f85fe550a..fc5d9083ce 100644 --- a/crates/katana/core/src/service/messaging/starknet.rs +++ b/crates/katana/core/src/service/messaging/starknet.rs @@ -8,7 +8,7 @@ use katana_primitives::receipt::MessageToL1; use katana_primitives::transaction::L1HandlerTx; use katana_primitives::utils::transaction::compute_l2_to_l1_message_hash; use starknet::accounts::{Account, Call, ExecutionEncoding, SingleOwnerAccount}; -use starknet::core::types::{BlockId, BlockTag, EmittedEvent, EventFilter, FieldElement}; +use starknet::core::types::{BlockId, BlockTag, EmittedEvent, EventFilter, Felt}; use starknet::core::utils::starknet_keccak; use starknet::macros::{felt, selector}; use starknet::providers::jsonrpc::HttpTransport; @@ -24,17 +24,17 @@ use super::{Error, MessagingConfig, Messenger, MessengerResult, LOG_TARGET}; /// In the case of execution -> the felt 'EXE' will be passed. /// And for normal messages, the felt 'MSG' is used. /// Those values are very not likely a valid account address on starknet. -const MSG_MAGIC: FieldElement = felt!("0x4d5347"); -const EXE_MAGIC: FieldElement = felt!("0x455845"); +const MSG_MAGIC: Felt = felt!("0x4d5347"); +const EXE_MAGIC: Felt = felt!("0x455845"); -pub const HASH_EXEC: FieldElement = felt!("0xee"); +pub const HASH_EXEC: Felt = felt!("0xee"); pub struct StarknetMessaging { - chain_id: FieldElement, + chain_id: Felt, provider: AnyProvider, wallet: LocalWallet, - sender_account_address: FieldElement, - messaging_contract_address: FieldElement, + sender_account_address: Felt, + messaging_contract_address: Felt, } impl StarknetMessaging { @@ -43,13 +43,13 @@ impl StarknetMessaging { Url::parse(&config.rpc_url)?, ))); - let private_key = FieldElement::from_hex_be(&config.private_key)?; + let private_key = Felt::from_hex(&config.private_key)?; let key = SigningKey::from_secret_scalar(private_key); let wallet = LocalWallet::from_signing_key(key); let chain_id = provider.chain_id().await?; - let sender_account_address = FieldElement::from_hex_be(&config.sender_address)?; - let messaging_contract_address = FieldElement::from_hex_be(&config.contract_address)?; + let sender_account_address = Felt::from_hex(&config.sender_address)?; + let messaging_contract_address = Felt::from_hex(&config.contract_address)?; Ok(StarknetMessaging { wallet, @@ -107,7 +107,7 @@ impl StarknetMessaging { } /// Sends an invoke TX on starknet. - async fn send_invoke_tx(&self, calls: Vec) -> Result { + async fn send_invoke_tx(&self, calls: Vec) -> Result { let signer = Arc::new(&self.wallet); let mut account = SingleOwnerAccount::new( @@ -121,19 +121,19 @@ impl StarknetMessaging { account.set_block_id(BlockId::Tag(BlockTag::Pending)); // TODO: we need to have maximum fee configurable. - let execution = account.execute(calls).fee_estimate_multiplier(10f64); - let estimated_fee = (execution.estimate_fee().await?.overall_fee) * 10u64.into(); + let execution = account.execute_v1(calls).fee_estimate_multiplier(10f64); + let estimated_fee = (execution.estimate_fee().await?.overall_fee) * Felt::from(10u128); let tx = execution.max_fee(estimated_fee).send().await?; Ok(tx.transaction_hash) } /// Sends messages hashes to settlement layer by sending a transaction. - async fn send_hashes(&self, mut hashes: Vec) -> MessengerResult { + async fn send_hashes(&self, mut hashes: Vec) -> MessengerResult { hashes.retain(|&x| x != HASH_EXEC); if hashes.is_empty() { - return Ok(FieldElement::ZERO); + return Ok(Felt::ZERO); } let mut calldata = hashes; @@ -160,7 +160,7 @@ impl StarknetMessaging { #[async_trait] impl Messenger for StarknetMessaging { - type MessageHash = FieldElement; + type MessageHash = Felt; type MessageTransaction = L1HandlerTx; async fn gather_messages( @@ -250,8 +250,8 @@ impl Messenger for StarknetMessaging { /// /// Messages can also be labelled as EXE, which in this case generate a `Call` /// additionally to the hash. -fn parse_messages(messages: &[MessageToL1]) -> MessengerResult<(Vec, Vec)> { - let mut hashes: Vec = vec![]; +fn parse_messages(messages: &[MessageToL1]) -> MessengerResult<(Vec, Vec)> { + let mut hashes: Vec = vec![]; let mut calls: Vec = vec![]; for m in messages { @@ -295,7 +295,7 @@ fn parse_messages(messages: &[MessageToL1]) -> MessengerResult<(Vec = vec![]; buf.extend(m.from_address.to_bytes_be()); buf.extend(to_address.to_bytes_be()); - buf.extend(FieldElement::from(payload.len()).to_bytes_be()); + buf.extend(Felt::from(payload.len()).to_bytes_be()); for p in payload { buf.extend(p.to_bytes_be()); } @@ -347,7 +347,7 @@ fn l1_handler_tx_from_event(event: &EmittedEvent, chain_id: ChainId) -> Result for ExecutionError { fn from(error: TransactionExecutionError) -> Self { match error { TransactionExecutionError::DeclareTransactionError { class_hash } => { - Self::ClassAlreadyDeclared(class_hash.0.into()) + Self::ClassAlreadyDeclared(to_felt(class_hash.0)) } TransactionExecutionError::ValidateTransactionError(e) => { Self::TransactionValidationFailed(Box::new(Self::from(e))) @@ -50,7 +50,7 @@ impl From for ExecutionError { fn from(error: PreExecutionError) -> Self { match error { PreExecutionError::EntryPointNotFound(selector) => { - Self::EntryPointNotFound(selector.0.into()) + Self::EntryPointNotFound(to_felt(selector.0)) } PreExecutionError::UninitializedStorageAddress(address) => { Self::ContractNotDeployed(to_address(address)) @@ -69,8 +69,8 @@ impl From for ExecutionError { incoming_tx_nonce, .. } => Self::InvalidNonce { - actual: incoming_tx_nonce.0.into(), - expected: account_nonce.0.into(), + actual: to_felt(incoming_tx_nonce.0), + expected: to_felt(account_nonce.0), }, TransactionPreValidationError::TransactionFeeError(e) => Self::from(e), TransactionPreValidationError::StateError(e) => Self::from(e), @@ -96,7 +96,7 @@ impl From for ExecutionError { impl From for ExecutionError { fn from(error: StateError) -> Self { match error { - StateError::UndeclaredClassHash(hash) => Self::UndeclaredClass(hash.0.into()), + StateError::UndeclaredClassHash(hash) => Self::UndeclaredClass(to_felt(hash.0)), e => Self::Other(e.to_string()), } } diff --git a/crates/katana/executor/src/implementation/blockifier/state.rs b/crates/katana/executor/src/implementation/blockifier/state.rs index c6d7f27572..49d4b17462 100644 --- a/crates/katana/executor/src/implementation/blockifier/state.rs +++ b/crates/katana/executor/src/implementation/blockifier/state.rs @@ -11,12 +11,10 @@ use katana_provider::traits::contract::ContractClassProvider; use katana_provider::traits::state::StateProvider; use katana_provider::ProviderResult; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; -use starknet_api::core::{ClassHash, CompiledClassHash, Nonce, PatriciaKey}; -use starknet_api::hash::StarkHash; -use starknet_api::patricia_key; +use starknet_api::core::{ClassHash, CompiledClassHash, Nonce}; use starknet_api::state::StorageKey; -use super::utils::{self}; +use super::utils::{self, to_felt, to_stark_felt}; use super::CACHE_SIZE; use crate::StateProviderDb; @@ -32,7 +30,7 @@ impl<'a> StateReader for StateProviderDb<'a> { ) -> StateResult { self.0 .class_hash_of_contract(utils::to_address(contract_address)) - .map(|v| ClassHash(v.unwrap_or_default().into())) + .map(|v| ClassHash(to_stark_felt(v.unwrap_or_default()))) .map_err(|e| StateError::StateReadError(e.to_string())) } @@ -42,10 +40,10 @@ impl<'a> StateReader for StateProviderDb<'a> { ) -> StateResult { if let Some(hash) = self .0 - .compiled_class_hash_of_class_hash(class_hash.0.into()) + .compiled_class_hash_of_class_hash(to_felt(class_hash.0)) .map_err(|e| StateError::StateReadError(e.to_string()))? { - Ok(CompiledClassHash(hash.into())) + Ok(CompiledClassHash(to_stark_felt(hash))) } else { Err(StateError::UndeclaredClassHash(class_hash)) } @@ -57,7 +55,7 @@ impl<'a> StateReader for StateProviderDb<'a> { ) -> StateResult { if let Some(class) = self .0 - .class(class_hash.0.into()) + .class(to_felt(class_hash.0)) .map_err(|e| StateError::StateReadError(e.to_string()))? { let class = @@ -75,7 +73,7 @@ impl<'a> StateReader for StateProviderDb<'a> { ) -> StateResult { self.0 .nonce(utils::to_address(contract_address)) - .map(|n| Nonce(n.unwrap_or_default().into())) + .map(|n| Nonce(to_stark_felt(n.unwrap_or_default()))) .map_err(|e| StateError::StateReadError(e.to_string())) } @@ -85,8 +83,8 @@ impl<'a> StateReader for StateProviderDb<'a> { key: starknet_api::state::StorageKey, ) -> StateResult { self.0 - .storage(utils::to_address(contract_address), (*key.0.key()).into()) - .map(|v| v.unwrap_or_default().into()) + .storage(utils::to_address(contract_address), to_felt(*key.0.key())) + .map(|v| to_stark_felt(v.unwrap_or_default())) .map_err(|e| StateError::StateReadError(e.to_string())) } } @@ -142,10 +140,11 @@ impl ContractClassProvider for CachedState { &self, hash: katana_primitives::class::ClassHash, ) -> ProviderResult> { - let Ok(hash) = self.write().inner.get_compiled_class_hash(ClassHash(hash.into())) else { + let Ok(hash) = self.write().inner.get_compiled_class_hash(ClassHash(to_stark_felt(hash))) + else { return Ok(None); }; - Ok(Some(hash.0.into())) + Ok(Some(to_felt(hash.0))) } fn sierra_class( @@ -170,7 +169,7 @@ impl StateProvider for CachedState { return Ok(None); }; - let hash = hash.0.into(); + let hash = to_felt(hash.0); if hash == FieldElement::ZERO { Ok(None) } else { Ok(Some(hash)) } } @@ -184,7 +183,7 @@ impl StateProvider for CachedState { } match self.0.write().inner.get_nonce_at(utils::to_blk_address(address)) { - Ok(nonce) => Ok(Some(nonce.0.into())), + Ok(nonce) => Ok(Some(to_felt(nonce.0))), Err(e) => Err(ProviderError::Other(e.to_string())), } } @@ -200,10 +199,14 @@ impl StateProvider for CachedState { } let address = utils::to_blk_address(address); - let key = StorageKey(patricia_key!(storage_key)); + let key = StorageKey( + to_stark_felt(storage_key) + .try_into() + .expect("storage key is not a valid field element"), + ); match self.write().inner.get_storage_at(address, key) { - Ok(value) => Ok(Some(value.into())), + Ok(value) => Ok(Some(to_felt(value))), Err(e) => Err(ProviderError::Other(e.to_string())), } } @@ -260,6 +263,9 @@ mod tests { use katana_provider::traits::contract::ContractClassWriter; use katana_provider::traits::state::{StateFactoryProvider, StateProvider, StateWriter}; use starknet::macros::felt; + use starknet_api::core::PatriciaKey; + use starknet_api::hash::StarkHash; + use starknet_api::patricia_key; use super::{CachedState, *}; use crate::StateProviderDb; @@ -308,17 +314,19 @@ mod tests { let api_address = utils::to_blk_address(address); let actual_class_hash = cached_state.get_class_hash_at(api_address)?; let actual_nonce = cached_state.get_nonce_at(api_address)?; - let actual_storage_value = - cached_state.get_storage_at(api_address, StorageKey(patricia_key!(storage_key)))?; + let actual_storage_value = cached_state.get_storage_at( + api_address, + StorageKey(patricia_key!(utils::to_stark_felt(storage_key))), + )?; let actual_compiled_hash = cached_state.get_compiled_class_hash(actual_class_hash)?; let actual_class = cached_state.get_compiled_contract_class(actual_class_hash)?; - let actual_legacy_class = - cached_state.get_compiled_contract_class(ClassHash(legacy_class_hash.into()))?; + let actual_legacy_class = cached_state + .get_compiled_contract_class(ClassHash(to_stark_felt(legacy_class_hash)))?; - assert_eq!(actual_nonce.0, felt!("0x7").into()); - assert_eq!(actual_storage_value, felt!("0x2").into()); - assert_eq!(actual_class_hash.0, felt!("0x123").into()); - assert_eq!(actual_compiled_hash.0, felt!("0x456").into()); + assert_eq!(actual_nonce.0, to_stark_felt(felt!("0x7"))); + assert_eq!(actual_storage_value, to_stark_felt(felt!("0x2"))); + assert_eq!(actual_class_hash.0, to_stark_felt(felt!("0x123"))); + assert_eq!(actual_compiled_hash.0, to_stark_felt(felt!("0x456"))); assert_eq!( actual_class, utils::to_class(DEFAULT_OZ_ACCOUNT_CONTRACT_CASM.clone()).unwrap().contract_class() @@ -378,16 +386,17 @@ mod tests { let blk_state = &mut lock.inner; let address = utils::to_blk_address(new_address); - let storage_key = StorageKey(patricia_key!(new_storage_key)); - let storage_value = new_storage_value.into(); - let class_hash = ClassHash(new_class_hash.into()); + let storage_key = StorageKey(patricia_key!(utils::to_stark_felt(new_storage_key))); + let storage_value = utils::to_stark_felt(new_storage_value); + let class_hash = ClassHash(utils::to_stark_felt(new_class_hash)); let class = utils::to_class(new_compiled_sierra_class.clone()).unwrap().contract_class(); - let compiled_hash = CompiledClassHash(new_compiled_hash.into()); - let legacy_class_hash = ClassHash(new_legacy_class_hash.into()); + let compiled_hash = CompiledClassHash(utils::to_stark_felt(new_compiled_hash)); + let legacy_class_hash = ClassHash(utils::to_stark_felt(new_legacy_class_hash)); let legacy_class = utils::to_class(DEFAULT_LEGACY_UDC_CASM.clone()).unwrap().contract_class(); - let legacy_compiled_hash = CompiledClassHash(new_legacy_compiled_hash.into()); + let legacy_compiled_hash = + CompiledClassHash(utils::to_stark_felt(new_legacy_compiled_hash)); blk_state.increment_nonce(address)?; blk_state.set_class_hash_at(address, legacy_class_hash)?; @@ -488,8 +497,8 @@ mod tests { let mut cached_state = CachedState::new(StateProviderDb(sp)); let api_address = utils::to_blk_address(address); - let api_storage_key = StorageKey(patricia_key!(storage_key)); - let api_class_hash = ClassHash(class_hash.into()); + let api_storage_key = StorageKey(patricia_key!(utils::to_stark_felt(storage_key))); + let api_class_hash = ClassHash(utils::to_stark_felt(class_hash)); let actual_nonce = cached_state.get_nonce_at(api_address).expect("should return default value"); diff --git a/crates/katana/executor/src/implementation/blockifier/utils.rs b/crates/katana/executor/src/implementation/blockifier/utils.rs index 6a22e5b9b4..9a07699b15 100644 --- a/crates/katana/executor/src/implementation/blockifier/utils.rs +++ b/crates/katana/executor/src/implementation/blockifier/utils.rs @@ -40,13 +40,10 @@ use katana_provider::traits::contract::ContractClassProvider; use starknet::core::types::PriceUnit; use starknet::core::utils::parse_cairo_short_string; use starknet_api::block::{BlockNumber, BlockTimestamp}; -use starknet_api::core::{ - self, ChainId, ClassHash, CompiledClassHash, ContractAddress, Nonce, PatriciaKey, -}; +use starknet_api::core::{self, ChainId, ClassHash, CompiledClassHash, ContractAddress, Nonce}; use starknet_api::data_availability::DataAvailabilityMode; use starknet_api::deprecated_contract_class::EntryPointType; -use starknet_api::hash::StarkHash; -use starknet_api::patricia_key; +use starknet_api::hash::StarkFelt; use starknet_api::transaction::{ AccountDeploymentData, Calldata, ContractAddressSalt, DeclareTransaction as ApiDeclareTransaction, DeclareTransactionV0V1, DeclareTransactionV2, @@ -138,8 +135,8 @@ pub fn call( let call = CallEntryPoint { initial_gas: initial_gas as u64, storage_address: to_blk_address(request.contract_address), - entry_point_selector: core::EntryPointSelector(request.entry_point_selector.into()), - calldata: Calldata(Arc::new(request.calldata.into_iter().map(|f| f.into()).collect())), + entry_point_selector: core::EntryPointSelector(to_stark_felt(request.entry_point_selector)), + calldata: Calldata(Arc::new(request.calldata.into_iter().map(to_stark_felt).collect())), ..Default::default() }; @@ -169,7 +166,7 @@ pub fn call( )?; let retdata = res.execution.retdata.0; - let retdata = retdata.into_iter().map(|f| f.into()).collect::>(); + let retdata = retdata.into_iter().map(to_felt).collect::>(); Ok(retdata) } @@ -179,36 +176,36 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { match tx.transaction { ExecutableTx::Invoke(tx) => match tx { InvokeTx::V1(tx) => { - let calldata = tx.calldata.into_iter().map(|f| f.into()).collect(); - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); + let calldata = tx.calldata.into_iter().map(to_stark_felt).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); Transaction::AccountTransaction(AccountTransaction::Invoke(InvokeTransaction { tx: ApiInvokeTransaction::V1(starknet_api::transaction::InvokeTransactionV1 { max_fee: Fee(tx.max_fee), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), sender_address: to_blk_address(tx.sender_address), signature: TransactionSignature(signature), calldata: Calldata(Arc::new(calldata)), }), - tx_hash: TransactionHash(hash.into()), + tx_hash: TransactionHash(to_stark_felt(hash)), only_query: false, })) } InvokeTx::V3(tx) => { - let calldata = tx.calldata.into_iter().map(|f| f.into()).collect(); - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); + let calldata = tx.calldata.into_iter().map(to_stark_felt).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); - let paymaster_data = tx.paymaster_data.into_iter().map(|f| f.into()).collect(); + let paymaster_data = tx.paymaster_data.into_iter().map(to_stark_felt).collect(); let account_deploy_data = - tx.account_deployment_data.into_iter().map(|f| f.into()).collect(); + tx.account_deployment_data.into_iter().map(to_stark_felt).collect(); let fee_data_availability_mode = to_api_da_mode(tx.fee_data_availability_mode); let nonce_data_availability_mode = to_api_da_mode(tx.nonce_data_availability_mode); Transaction::AccountTransaction(AccountTransaction::Invoke(InvokeTransaction { tx: ApiInvokeTransaction::V3(starknet_api::transaction::InvokeTransactionV3 { tip: Tip(tx.tip), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), sender_address: to_blk_address(tx.sender_address), signature: TransactionSignature(signature), calldata: Calldata(Arc::new(calldata)), @@ -218,7 +215,7 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { nonce_data_availability_mode, resource_bounds: to_api_resource_bounds(tx.resource_bounds), }), - tx_hash: TransactionHash(hash.into()), + tx_hash: TransactionHash(to_stark_felt(hash)), only_query: false, })) } @@ -226,33 +223,33 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { ExecutableTx::DeployAccount(tx) => match tx { DeployAccountTx::V1(tx) => { - let calldata = tx.constructor_calldata.into_iter().map(|f| f.into()).collect(); - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); - let salt = ContractAddressSalt(tx.contract_address_salt.into()); + let calldata = tx.constructor_calldata.into_iter().map(to_stark_felt).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); + let salt = ContractAddressSalt(to_stark_felt(tx.contract_address_salt)); Transaction::AccountTransaction(AccountTransaction::DeployAccount( DeployAccountTransaction { contract_address: to_blk_address(tx.contract_address), tx: ApiDeployAccountTransaction::V1(DeployAccountTransactionV1 { max_fee: Fee(tx.max_fee), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), signature: TransactionSignature(signature), - class_hash: ClassHash(tx.class_hash.into()), + class_hash: ClassHash(to_stark_felt(tx.class_hash)), constructor_calldata: Calldata(Arc::new(calldata)), contract_address_salt: salt, }), - tx_hash: TransactionHash(hash.into()), + tx_hash: TransactionHash(to_stark_felt(hash)), only_query: false, }, )) } DeployAccountTx::V3(tx) => { - let calldata = tx.constructor_calldata.into_iter().map(|f| f.into()).collect(); - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); - let salt = ContractAddressSalt(tx.contract_address_salt.into()); + let calldata = tx.constructor_calldata.into_iter().map(to_stark_felt).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); + let salt = ContractAddressSalt(to_stark_felt(tx.contract_address_salt)); - let paymaster_data = tx.paymaster_data.into_iter().map(|f| f.into()).collect(); + let paymaster_data = tx.paymaster_data.into_iter().map(to_stark_felt).collect(); let fee_data_availability_mode = to_api_da_mode(tx.fee_data_availability_mode); let nonce_data_availability_mode = to_api_da_mode(tx.nonce_data_availability_mode); @@ -261,9 +258,9 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { contract_address: to_blk_address(tx.contract_address), tx: ApiDeployAccountTransaction::V3(DeployAccountTransactionV3 { tip: Tip(tx.tip), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), signature: TransactionSignature(signature), - class_hash: ClassHash(tx.class_hash.into()), + class_hash: ClassHash(to_stark_felt(tx.class_hash)), constructor_calldata: Calldata(Arc::new(calldata)), contract_address_salt: salt, paymaster_data: PaymasterData(paymaster_data), @@ -271,7 +268,7 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { nonce_data_availability_mode, resource_bounds: to_api_resource_bounds(tx.resource_bounds), }), - tx_hash: TransactionHash(hash.into()), + tx_hash: TransactionHash(to_stark_felt(hash)), only_query: false, }, )) @@ -283,48 +280,52 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { let tx = match tx.transaction { DeclareTx::V1(tx) => { - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); ApiDeclareTransaction::V1(DeclareTransactionV0V1 { max_fee: Fee(tx.max_fee), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), sender_address: to_blk_address(tx.sender_address), signature: TransactionSignature(signature), - class_hash: ClassHash(tx.class_hash.into()), + class_hash: ClassHash(to_stark_felt(tx.class_hash)), }) } DeclareTx::V2(tx) => { - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); ApiDeclareTransaction::V2(DeclareTransactionV2 { max_fee: Fee(tx.max_fee), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), sender_address: to_blk_address(tx.sender_address), signature: TransactionSignature(signature), - class_hash: ClassHash(tx.class_hash.into()), - compiled_class_hash: CompiledClassHash(tx.compiled_class_hash.into()), + class_hash: ClassHash(to_stark_felt(tx.class_hash)), + compiled_class_hash: CompiledClassHash(to_stark_felt( + tx.compiled_class_hash, + )), }) } DeclareTx::V3(tx) => { - let signature = tx.signature.into_iter().map(|f| f.into()).collect(); + let signature = tx.signature.into_iter().map(to_stark_felt).collect(); - let paymaster_data = tx.paymaster_data.into_iter().map(|f| f.into()).collect(); + let paymaster_data = tx.paymaster_data.into_iter().map(to_stark_felt).collect(); let fee_data_availability_mode = to_api_da_mode(tx.fee_data_availability_mode); let nonce_data_availability_mode = to_api_da_mode(tx.nonce_data_availability_mode); let account_deploy_data = - tx.account_deployment_data.into_iter().map(|f| f.into()).collect(); + tx.account_deployment_data.into_iter().map(to_stark_felt).collect(); ApiDeclareTransaction::V3(DeclareTransactionV3 { tip: Tip(tx.tip), - nonce: Nonce(tx.nonce.into()), + nonce: Nonce(to_stark_felt(tx.nonce)), sender_address: to_blk_address(tx.sender_address), signature: TransactionSignature(signature), - class_hash: ClassHash(tx.class_hash.into()), + class_hash: ClassHash(to_stark_felt(tx.class_hash)), account_deployment_data: AccountDeploymentData(account_deploy_data), - compiled_class_hash: CompiledClassHash(tx.compiled_class_hash.into()), + compiled_class_hash: CompiledClassHash(to_stark_felt( + tx.compiled_class_hash, + )), paymaster_data: PaymasterData(paymaster_data), fee_data_availability_mode, nonce_data_availability_mode, @@ -333,24 +334,26 @@ fn to_executor_tx(tx: ExecutableTxWithHash) -> Transaction { } }; - let hash = TransactionHash(hash.into()); + let hash = TransactionHash(to_stark_felt(hash)); let class = to_class(contract_class).unwrap(); let tx = DeclareTransaction::new(tx, hash, class).expect("class mismatch"); Transaction::AccountTransaction(AccountTransaction::Declare(tx)) } ExecutableTx::L1Handler(tx) => { - let calldata = tx.calldata.into_iter().map(|f| f.into()).collect(); + let calldata = tx.calldata.into_iter().map(to_stark_felt).collect(); Transaction::L1HandlerTransaction(L1HandlerTransaction { paid_fee_on_l1: Fee(tx.paid_fee_on_l1), tx: starknet_api::transaction::L1HandlerTransaction { - nonce: core::Nonce(tx.nonce.into()), + nonce: core::Nonce(to_stark_felt(tx.nonce)), calldata: Calldata(Arc::new(calldata)), version: TransactionVersion(1u128.into()), contract_address: to_blk_address(tx.contract_address), - entry_point_selector: core::EntryPointSelector(tx.entry_point_selector.into()), + entry_point_selector: core::EntryPointSelector(to_stark_felt( + tx.entry_point_selector, + )), }, - tx_hash: TransactionHash(hash.into()), + tx_hash: TransactionHash(to_stark_felt(hash)), }) } } @@ -410,7 +413,7 @@ pub(super) fn state_update_from_cached_state( > = HashMap::new(); for (class_hash, _) in &state_diff.class_hash_to_compiled_class_hash { - let hash = class_hash.0.into(); + let hash = to_felt(class_hash.0); let class = state.class(hash).unwrap().expect("must exist if declared"); if let CompiledClass::Class(_) = class { @@ -425,7 +428,7 @@ pub(super) fn state_update_from_cached_state( state_diff .address_to_nonce .into_iter() - .map(|(key, value)| (to_address(key), value.0.into())) + .map(|(key, value)| (to_address(key), to_felt(value.0))) .collect::( .map(|(addr, entries)| { let entries = entries .into_iter() - .map(|(k, v)| ((*k.0.key()).into(), v.into())) + .map(|(k, v)| (to_felt(*k.0.key()), to_felt(v))) .collect::>(); + katana_primitives::contract::StorageKey, + katana_primitives::contract::StorageValue, + >>(); (to_address(addr), entries) }) @@ -451,7 +454,7 @@ pub(super) fn state_update_from_cached_state( state_diff .address_to_class_hash .into_iter() - .map(|(key, value)| (to_address(key), value.0.into())) + .map(|(key, value)| (to_address(key), to_felt(value.0))) .collect::( state_diff .class_hash_to_compiled_class_hash .into_iter() - .map(|(key, value)| (key.0.into(), value.0.into())) + .map(|(key, value)| (to_felt(key.0), to_felt(value.0))) .collect:: FeeType { } pub fn to_blk_address(address: katana_primitives::contract::ContractAddress) -> ContractAddress { - ContractAddress(patricia_key!(address.0)) + to_stark_felt(address.0).try_into().expect("valid address") } pub fn to_address(address: ContractAddress) -> katana_primitives::contract::ContractAddress { - katana_primitives::contract::ContractAddress((*address.0.key()).into()) + katana_primitives::contract::ContractAddress(to_felt(*address.0.key())) } pub fn to_blk_chain_id(chain_id: katana_primitives::chain::ChainId) -> ChainId { @@ -558,7 +561,7 @@ fn starknet_api_ethaddr_to_felt(value: starknet_api::core::EthAddress) -> FieldE // Padding H160 with zeros to 32 bytes (big endian) bytes[12..32].copy_from_slice(value.0.as_bytes()); let stark_felt = starknet_api::hash::StarkFelt::new(bytes).expect("valid slice for stark felt"); - stark_felt.into() + to_felt(stark_felt) } pub fn to_exec_info(exec_info: TransactionExecutionInfo) -> TxExecInfo { @@ -581,10 +584,10 @@ fn to_call_info(call: CallInfo) -> trace::CallInfo { let contract_address = to_address(call.call.storage_address); let caller_address = to_address(call.call.caller_address); let code_address = call.call.code_address.map(to_address); - let class_hash = call.call.class_hash.map(|a| a.0.into()); - let entry_point_selector = call.call.entry_point_selector.0.into(); - let calldata = call.call.calldata.0.iter().map(|f| (*f).into()).collect(); - let retdata = call.execution.retdata.0.into_iter().map(|f| f.into()).collect(); + let class_hash = call.call.class_hash.map(|a| to_felt(a.0)); + let entry_point_selector = to_felt(call.call.entry_point_selector.0); + let calldata = call.call.calldata.0.iter().map(|f| to_felt(*f)).collect(); + let retdata = call.execution.retdata.0.into_iter().map(to_felt).collect(); let builtin_counter = call.resources.builtin_instance_counter; let execution_resources = trace::ExecutionResources { @@ -610,8 +613,8 @@ fn to_call_info(call: CallInfo) -> trace::CallInfo { EntryPointType::Constructor => trace::EntryPointType::Constructor, }; - let storage_read_values = call.storage_read_values.into_iter().map(|f| f.into()).collect(); - let storg_keys = call.accessed_storage_keys.into_iter().map(|k| (*k.0.key()).into()).collect(); + let storage_read_values = call.storage_read_values.into_iter().map(to_felt).collect(); + let storg_keys = call.accessed_storage_keys.into_iter().map(|k| to_felt(*k.0.key())).collect(); let inner_calls = call.inner_calls.into_iter().map(to_call_info).collect(); trace::CallInfo { @@ -638,8 +641,8 @@ fn to_call_info(call: CallInfo) -> trace::CallInfo { fn to_ordered_event(e: OrderedEvent) -> event::OrderedEvent { event::OrderedEvent { order: e.order as u64, - keys: e.event.keys.into_iter().map(|f| f.0.into()).collect(), - data: e.event.data.0.into_iter().map(FieldElement::from).collect(), + keys: e.event.keys.iter().map(|f| to_felt(f.0)).collect(), + data: e.event.data.0.into_iter().map(to_felt).collect(), } } @@ -649,10 +652,18 @@ fn to_l2_l1_messages( ) -> message::OrderedL2ToL1Message { let order = m.order as u64; let to_address = starknet_api_ethaddr_to_felt(m.message.to_address); - let payload = m.message.payload.0.into_iter().map(FieldElement::from).collect(); + let payload = m.message.payload.0.into_iter().map(to_felt).collect(); message::OrderedL2ToL1Message { order, from_address, to_address, payload } } +pub fn to_stark_felt(value: FieldElement) -> StarkFelt { + StarkFelt::new(value.to_bytes_be()).expect("can convert from field element") +} + +pub fn to_felt(value: StarkFelt) -> FieldElement { + FieldElement::from_bytes_be_slice(value.bytes()) +} + #[cfg(test)] mod tests { @@ -660,12 +671,36 @@ mod tests { use katana_cairo::cairo_vm::vm::runners::cairo_runner::ExecutionResources; use katana_primitives::chain::{ChainId, NamedChainId}; + use katana_primitives::felt::FieldElement; use starknet_api::core::EntryPointSelector; use starknet_api::hash::StarkFelt; use starknet_api::stark_felt; use starknet_api::transaction::{EventContent, EventData, EventKey}; use super::*; + use crate::implementation::blockifier::utils; + + #[test] + fn test_to_stark_felt() { + let field_element = FieldElement::from_hex("0x1234567890abcdef").unwrap(); + let stark_felt = to_stark_felt(field_element); + assert_eq!(stark_felt, StarkFelt::try_from("0x1234567890abcdef").unwrap()); + } + + #[test] + fn test_to_felt() { + let stark_felt = StarkFelt::try_from("0xabcdef1234567890").unwrap(); + let field_element = to_felt(stark_felt); + assert_eq!(field_element, FieldElement::from_hex("0xabcdef1234567890").unwrap()); + } + + #[test] + fn test_roundtrip_felt_conversion() { + let original_felt = FieldElement::from_hex("0x123456789abcdef0").unwrap(); + let stark_felt = to_stark_felt(original_felt); + let roundtrip_felt = to_felt(stark_felt); + assert_eq!(original_felt, roundtrip_felt); + } #[test] fn convert_chain_id() { @@ -748,12 +783,12 @@ mod tests { let expected_contract_address = to_address(call.call.storage_address); let expected_caller_address = to_address(call.call.caller_address); let expected_code_address = call.call.code_address.map(to_address); - let expected_class_hash = call.call.class_hash.map(|a| a.0.into()); - let expected_entry_point_selector = call.call.entry_point_selector.0.into(); + let expected_class_hash = call.call.class_hash.map(|c| to_felt(c.0)); + let expected_entry_point_selector = to_felt(call.call.entry_point_selector.0); let expected_calldata: Vec = - call.call.calldata.0.iter().map(|f| (*f).into()).collect(); + call.call.calldata.0.iter().map(|f| to_felt(*f)).collect(); let expected_retdata: Vec = - call.execution.retdata.0.iter().map(|f| (*f).into()).collect(); + call.execution.retdata.0.iter().map(|f| to_felt(*f)).collect(); let builtin_counter = call.resources.builtin_instance_counter.clone(); let expected_execution_resources = trace::ExecutionResources { @@ -784,9 +819,9 @@ mod tests { }; let expected_storage_read_values: Vec = - call.storage_read_values.iter().map(|f| (*f).into()).collect(); + call.storage_read_values.iter().map(|v| utils::to_felt(*v)).collect(); let expected_storage_keys: HashSet = - call.accessed_storage_keys.iter().map(|k| (*k.0.key()).into()).collect(); + call.accessed_storage_keys.iter().map(|k| utils::to_felt(*k.0.key())).collect(); let expected_inner_calls: Vec<_> = call.inner_calls.clone().into_iter().map(to_call_info).collect(); diff --git a/crates/katana/executor/tests/executor.rs b/crates/katana/executor/tests/executor.rs index 6e1bbf46a0..a0de300f90 100644 --- a/crates/katana/executor/tests/executor.rs +++ b/crates/katana/executor/tests/executor.rs @@ -223,7 +223,7 @@ fn test_executor_with_valid_blocks_impl( let actual_storage_value_4_1 = state_provider .storage( deployed_contract.into(), - get_storage_var_address("ERC20_total_supply", &[]).unwrap() + 1u8.into(), + get_storage_var_address("ERC20_total_supply", &[]).unwrap() + FieldElement::ONE, ) .unwrap(); let actual_storage_value_5 = state_provider diff --git a/crates/katana/executor/tests/fixtures/transaction.rs b/crates/katana/executor/tests/fixtures/transaction.rs index 450df62e16..f804cca858 100644 --- a/crates/katana/executor/tests/fixtures/transaction.rs +++ b/crates/katana/executor/tests/fixtures/transaction.rs @@ -44,7 +44,7 @@ pub fn invoke_executable_tx( calldata: vec![felt!("0x1"), felt!("0x99"), felt!("0x0")], }]; - let tx = account.execute(calls).nonce(nonce).max_fee(max_fee).prepared().unwrap(); + let tx = account.execute_v1(calls).nonce(nonce).max_fee(max_fee).prepared().unwrap(); let mut broadcasted_tx = tokio::runtime::Builder::new_current_thread() .enable_all() @@ -54,14 +54,13 @@ pub fn invoke_executable_tx( .unwrap(); if !signed { - match broadcasted_tx { - BroadcastedInvokeTransaction::V1(ref mut tx) => tx.signature = vec![], - BroadcastedInvokeTransaction::V3(ref mut tx) => tx.signature = vec![], - } + broadcasted_tx.signature = vec![] } - let tx = katana_rpc_types::transaction::BroadcastedInvokeTx(broadcasted_tx) - .into_tx_with_chain_id(chain_id); + let tx = katana_rpc_types::transaction::BroadcastedInvokeTx(BroadcastedInvokeTransaction::V1( + broadcasted_tx, + )) + .into_tx_with_chain_id(chain_id); ExecutableTxWithHash::new(tx.into()) } diff --git a/crates/katana/primitives/Cargo.toml b/crates/katana/primitives/Cargo.toml index 6a4e1ed8c3..880ea906db 100644 --- a/crates/katana/primitives/Cargo.toml +++ b/crates/katana/primitives/Cargo.toml @@ -11,11 +11,12 @@ anyhow.workspace = true base64.workspace = true derive_more.workspace = true lazy_static.workspace = true +num-traits.workspace = true rand = { workspace = true, features = [ "small_rng" ] } serde.workspace = true serde_json.workspace = true serde_with.workspace = true -starknet-crypto = "0.6.1" +starknet-crypto.workspace = true starknet.workspace = true strum.workspace = true strum_macros.workspace = true diff --git a/crates/katana/primitives/src/chain.rs b/crates/katana/primitives/src/chain.rs index ec1c2d6f77..ecce9bd794 100644 --- a/crates/katana/primitives/src/chain.rs +++ b/crates/katana/primitives/src/chain.rs @@ -1,5 +1,8 @@ -use starknet::core::types::{FieldElement, FromStrError}; use starknet::core::utils::{cairo_short_string_to_felt, CairoShortStringToFeltError}; +use starknet::macros::short_string; + +use crate::felt::FromStrError; +use crate::FieldElement; /// Known chain ids that has been assigned a name. #[derive(Debug, Clone, Copy, PartialEq, Eq, strum_macros::Display)] @@ -12,28 +15,13 @@ pub enum NamedChainId { impl NamedChainId { /// `SN_MAIN` in ASCII - pub const SN_MAIN: FieldElement = FieldElement::from_mont([ - 0xf596341657d6d657, - 0xffffffffffffffff, - 0xffffffffffffffff, - 0x6f9757bd5443bc6, - ]); + pub const SN_MAIN: FieldElement = short_string!("SN_MAIN"); /// `SN_GOERLI` in ASCII - pub const SN_GOERLI: FieldElement = FieldElement::from_mont([ - 0x3417161755cc97b2, - 0xfffffffffffff596, - 0xffffffffffffffff, - 0x588778cb29612d1, - ]); + pub const SN_GOERLI: FieldElement = short_string!("SN_GOERLI"); /// `SN_SEPOLIA` in ASCII - pub const SN_SEPOLIA: FieldElement = FieldElement::from_mont([ - 0x159755f62c97a933, - 0xfffffffffff59634, - 0xffffffffffffffff, - 0x70cb558f6123c62, - ]); + pub const SN_SEPOLIA: FieldElement = short_string!("SN_SEPOLIA"); /// Returns the id of the chain. It is the ASCII representation of a predefined string /// constants. @@ -108,7 +96,7 @@ impl ChainId { /// Cairo short string. pub fn parse(s: &str) -> Result { let id = if s.starts_with("0x") { - FieldElement::from_hex_be(s)? + FieldElement::from_hex(s)? } else { cairo_short_string_to_felt(s)? }; diff --git a/crates/katana/primitives/src/conversion/rpc.rs b/crates/katana/primitives/src/conversion/rpc.rs index 25ec978a31..a21a47e7c2 100644 --- a/crates/katana/primitives/src/conversion/rpc.rs +++ b/crates/katana/primitives/src/conversion/rpc.rs @@ -47,7 +47,7 @@ pub fn legacy_inner_to_rpc_class( .iter() .map(|e| LegacyContractEntryPoint { offset: e.offset.0 as u64, - selector: FieldElement::from(e.selector.0), + selector: FieldElement::from_bytes_be_slice(e.selector.0.bytes()), }) .collect::>()) } @@ -149,7 +149,7 @@ pub fn flattened_sierra_to_compiled_class( let sierra = SierraProgram { program, entry_points_by_type }; let casm = CasmContractClass::from_contract_class(class, true, usize::MAX)?; - let compiled_hash = FieldElement::from_bytes_be(&casm.compiled_class_hash().to_be_bytes())?; + let compiled_hash = FieldElement::from_bytes_be(&casm.compiled_class_hash().to_be_bytes()); let class = crate::class::CompiledClass::Class(SierraCompiledClass { casm, sierra }); Ok((class_hash, compiled_hash, class)) diff --git a/crates/katana/primitives/src/genesis/allocation.rs b/crates/katana/primitives/src/genesis/allocation.rs index 5ae6f11cba..c267fee0fe 100644 --- a/crates/katana/primitives/src/genesis/allocation.rs +++ b/crates/katana/primitives/src/genesis/allocation.rs @@ -269,7 +269,7 @@ impl DevAllocationsGenerator { private_key_bytes[0] %= 0x8; seed = private_key_bytes; - let private_key = FieldElement::from_bytes_be(&private_key_bytes).unwrap(); + let private_key = FieldElement::from_bytes_be(&private_key_bytes); DevGenesisAccount::new_with_balance(private_key, self.class_hash, self.balance) }) .collect() diff --git a/crates/katana/primitives/src/genesis/constant.rs b/crates/katana/primitives/src/genesis/constant.rs index affd6890ce..273e9ec365 100644 --- a/crates/katana/primitives/src/genesis/constant.rs +++ b/crates/katana/primitives/src/genesis/constant.rs @@ -9,83 +9,51 @@ use crate::FieldElement; /// The default universal deployer contract address. /// Corresponds to 0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf -pub const DEFAULT_UDC_ADDRESS: ContractAddress = ContractAddress(FieldElement::from_mont([ - 15144800532519055890, - 15685625669053253235, - 9333317513348225193, - 121672436446604875, -])); +pub const DEFAULT_UDC_ADDRESS: ContractAddress = + ContractAddress(felt!("0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf")); /// The default fee token contract address. /// Corresponds to 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 -pub const DEFAULT_FEE_TOKEN_ADDRESS: ContractAddress = ContractAddress(FieldElement::from_mont([ - 4380532846569209554, - 17839402928228694863, - 17240401758547432026, - 418961398025637529, -])); +pub const DEFAULT_FEE_TOKEN_ADDRESS: ContractAddress = + ContractAddress(felt!("0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7")); /// The standard storage address for `public key` in OpenZeppelin account contract. /// Corresponds to keccak("Account_public_key") == /// 0x1379ac0624b939ceb9dede92211d7db5ee174fe28be72245b0a1a2abd81c98f -pub const OZ_ACCOUNT_CONTRACT_PUBKEY_STORAGE_SLOT: StorageKey = FieldElement::from_mont([ - 1846274790623946671, - 4425861538928837650, - 5862944509338977095, - 333410775162302292, -]); +pub const OZ_ACCOUNT_CONTRACT_PUBKEY_STORAGE_SLOT: StorageKey = + felt!("0x1379ac0624b939ceb9dede92211d7db5ee174fe28be72245b0a1a2abd81c98f"); /// The standard storage address for `ERC20_name` in ERC20 contract. /// Corresponds to keccak("ERC20_name") == /// 0x0341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1 -pub const ERC20_NAME_STORAGE_SLOT: StorageKey = FieldElement::from_mont([ - 14245373332046594057, - 5531369627875559154, - 7076950148258849527, - 42006782206471821, -]); +pub const ERC20_NAME_STORAGE_SLOT: StorageKey = + felt!("0x0341c1bdfd89f69748aa00b5742b03adbffd79b8e80cab5c50d91cd8c2a79be1"); /// The standard storage address for `ERC20_symbol` in ERC20 contract. /// Corresponds to keccak("ERC20_symbol") == /// 0x00b6ce5410fca59d078ee9b2a4371a9d684c530d697c64fbef0ae6d5e8f0ac72 -pub const ERC20_SYMBOL_STORAGE_SLOT: StorageKey = FieldElement::from_mont([ - 3529993699915368059, - 8508842680170426599, - 11308853324722862885, - 140787116910459578, -]); +pub const ERC20_SYMBOL_STORAGE_SLOT: StorageKey = + felt!("0x00b6ce5410fca59d078ee9b2a4371a9d684c530d697c64fbef0ae6d5e8f0ac72"); /// The standard storage address for `ERC20_decimals` in ERC20 contract. /// Corresponds to keccak("ERC20_decimals") == /// 0x01f0d4aa99431d246bac9b8e48c33e888245b15e9678f64f9bdfc8823dc8f979 -pub const ERC20_DECIMAL_STORAGE_SLOT: StorageKey = FieldElement::from_mont([ - 1858031281331058897, - 9678267618682904527, - 9433316002840757017, - 17823060228645335, -]); +pub const ERC20_DECIMAL_STORAGE_SLOT: StorageKey = + felt!("0x01f0d4aa99431d246bac9b8e48c33e888245b15e9678f64f9bdfc8823dc8f979"); /// The standard storage address for `ERC20_total_supply` in ERC20 contract. /// Corresponds to keccak("ERC20_total_supply") == /// 0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a -pub const ERC20_TOTAL_SUPPLY_STORAGE_SLOT: StorageKey = FieldElement::from_mont([ - 700008926920971440, - 9682182591019764224, - 8184857487847920423, - 218835885563775175, -]); +pub const ERC20_TOTAL_SUPPLY_STORAGE_SLOT: StorageKey = + felt!("0x110e2f729c9c2b988559994a3daccd838cf52faf88e18101373e67dd061455a"); /// The default fee token balance for dev accounts at genesis. pub const DEFAULT_PREFUNDED_ACCOUNT_BALANCE: u128 = 10 * u128::pow(10, 21); /// The class hash of DEFAULT_LEGACY_ERC20_CONTRACT_CASM. /// Corresponds to 0x02a8846878b6ad1f54f6ba46f5f40e11cee755c677f130b2c4b60566c9003f1f -pub const DEFAULT_LEGACY_ERC20_CONTRACT_CLASS_HASH: ClassHash = FieldElement::from_mont([ - 5063404709606896214, - 17264546324508274858, - 2617848339092803640, - 396742056646423680, -]); +pub const DEFAULT_LEGACY_ERC20_CONTRACT_CLASS_HASH: ClassHash = + felt!("0x02a8846878b6ad1f54f6ba46f5f40e11cee755c677f130b2c4b60566c9003f1f"); /// The compiled class hash of DEFAULT_LEGACY_ERC20_CONTRACT_CASM. pub const DEFAULT_LEGACY_ERC20_CONTRACT_COMPILED_CLASS_HASH: CompiledClassHash = @@ -93,34 +61,21 @@ pub const DEFAULT_LEGACY_ERC20_CONTRACT_COMPILED_CLASS_HASH: CompiledClassHash = /// The class hash of DEFAULT_LEGACY_UDC_CASM. /// Corresponds to 0x07b3e05f48f0c69e4a65ce5e076a66271a527aff2c34ce1083ec6e1526997a69 -pub const DEFAULT_LEGACY_UDC_CLASS_HASH: ClassHash = FieldElement::from_mont([ - 13364470047046544565, - 11148922744554181574, - 8853940111481564631, - 179653587345909319, -]); +pub const DEFAULT_LEGACY_UDC_CLASS_HASH: ClassHash = + felt!("0x07b3e05f48f0c69e4a65ce5e076a66271a527aff2c34ce1083ec6e1526997a69"); /// The compiled class hash of DEFAULT_LEGACY_UDC_CASM. pub const DEFAULT_LEGACY_UDC_COMPILED_CLASS_HASH: CompiledClassHash = DEFAULT_LEGACY_UDC_CLASS_HASH; /// The class hash of DEFAULT_OZ_ACCOUNT_CONTRACT. /// Corresponds to 0x05400e90f7e0ae78bd02c77cd75527280470e2fe19c54970dd79dc37a9d3645c -pub const DEFAULT_OZ_ACCOUNT_CONTRACT_CLASS_HASH: ClassHash = FieldElement::from_mont([ - 8460675502047588988, - 17729791148444280953, - 7171298771336181387, - 292243705759714441, -]); +pub const DEFAULT_OZ_ACCOUNT_CONTRACT_CLASS_HASH: ClassHash = + felt!("0x05400e90f7e0ae78bd02c77cd75527280470e2fe19c54970dd79dc37a9d3645c"); /// The compiled class hash of DEFAULT_OZ_ACCOUNT_CONTRACT. /// Corresponds to 0x016c6081eb34ad1e0c5513234ed0c025b3c7f305902d291bad534cd6474c85bc pub const DEFAULT_OZ_ACCOUNT_CONTRACT_COMPILED_CLASS_HASH: CompiledClassHash = - FieldElement::from_mont([ - 18006730038010879891, - 12016093095874787527, - 4539661479059859683, - 190499602541245794, - ]); + felt!("0x016c6081eb34ad1e0c5513234ed0c025b3c7f305902d291bad534cd6474c85bc"); pub const CONTROLLER_ACCOUNT_CONTRACT_CLASS_HASH: ClassHash = felt!("0xCC"); diff --git a/crates/katana/primitives/src/genesis/json.rs b/crates/katana/primitives/src/genesis/json.rs index d1fa24bfd6..eef85a0d7a 100644 --- a/crates/katana/primitives/src/genesis/json.rs +++ b/crates/katana/primitives/src/genesis/json.rs @@ -20,7 +20,6 @@ use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; use starknet::core::types::contract::legacy::LegacyContractClass; use starknet::core::types::contract::{ComputeClassHashError, JsonError}; -use starknet::core::types::FromByteArrayError; use super::allocation::{ DevGenesisAccount, GenesisAccount, GenesisAccountAlloc, GenesisContractAlloc, @@ -210,9 +209,6 @@ pub enum GenesisJsonError { #[error(transparent)] ComputeClassHash(#[from] ComputeClassHashError), - #[error(transparent)] - ConversionError(#[from] FromByteArrayError), - #[error(transparent)] SierraCompilation(#[from] StarknetSierraCompilationError), @@ -363,7 +359,7 @@ impl TryFrom for Genesis { ( class_hash, - FieldElement::from_bytes_be(&compiled_hash)?, + FieldElement::from_bytes_be(&compiled_hash), Some(Arc::new(sierra.flatten()?)), Arc::new(CompiledClass::Class(class)), ) diff --git a/crates/katana/primitives/src/genesis/mod.rs b/crates/katana/primitives/src/genesis/mod.rs index 78e817801d..d65ad481d7 100644 --- a/crates/katana/primitives/src/genesis/mod.rs +++ b/crates/katana/primitives/src/genesis/mod.rs @@ -204,7 +204,7 @@ impl Genesis { // the storage address of low u128 of the balance let low_bal_storage_var = bal_base_storage_var; // the storage address of high u128 of the balance - let high_bal_storage_var = bal_base_storage_var + 1u8.into(); + let high_bal_storage_var = bal_base_storage_var + FieldElement::ONE; fee_token_storage.insert(low_bal_storage_var, low); fee_token_storage.insert(high_bal_storage_var, high); @@ -222,7 +222,8 @@ impl Genesis { fee_token_storage.insert(ERC20_SYMBOL_STORAGE_SLOT, symbol); fee_token_storage.insert(ERC20_DECIMAL_STORAGE_SLOT, decimals); fee_token_storage.insert(ERC20_TOTAL_SUPPLY_STORAGE_SLOT, total_supply_low); - fee_token_storage.insert(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + 1u8.into(), total_supply_high); + fee_token_storage + .insert(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + FieldElement::ONE, total_supply_high); states .state_updates @@ -449,7 +450,8 @@ mod tests { fee_token_storage.insert(ERC20_SYMBOL_STORAGE_SLOT, symbol); fee_token_storage.insert(ERC20_DECIMAL_STORAGE_SLOT, decimals); fee_token_storage.insert(ERC20_TOTAL_SUPPLY_STORAGE_SLOT, total_supply_low); - fee_token_storage.insert(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + 1u8.into(), total_supply_high); + fee_token_storage + .insert(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + FieldElement::ONE, total_supply_high); for (address, alloc) in &allocations { if let Some(balance) = alloc.balance() { @@ -461,7 +463,7 @@ mod tests { // the storage address of low u128 of the balance let low_bal_storage_var = bal_base_storage_var; // the storage address of high u128 of the balance - let high_bal_storage_var = bal_base_storage_var + 1u8.into(); + let high_bal_storage_var = bal_base_storage_var + FieldElement::ONE; fee_token_storage.insert(low_bal_storage_var, low); fee_token_storage.insert(high_bal_storage_var, high); @@ -698,7 +700,7 @@ mod tests { Some(&total_supply_low) ); assert_eq!( - fee_token_storage.get(&(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + 1u8.into())), + fee_token_storage.get(&(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + FieldElement::ONE)), Some(&total_supply_high) ); @@ -720,7 +722,7 @@ mod tests { // the storage address of low u128 of the balance let low_bal_storage_var = bal_base_storage_var; // the storage address of high u128 of the balance - let high_bal_storage_var = bal_base_storage_var + 1u8.into(); + let high_bal_storage_var = bal_base_storage_var + FieldElement::ONE; assert_eq!(fee_token_storage.get(&low_bal_storage_var), Some(&low)); assert_eq!(fee_token_storage.get(&high_bal_storage_var), Some(&high)); @@ -740,7 +742,7 @@ mod tests { "total supply must be calculated from allocations balances correctly" ); assert_eq!( - fee_token_storage.get(&(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + 1u8.into())), + fee_token_storage.get(&(ERC20_TOTAL_SUPPLY_STORAGE_SLOT + FieldElement::ONE)), Some(&actual_total_supply_high), "total supply must be calculated from allocations balances correctly" ); diff --git a/crates/katana/primitives/src/lib.rs b/crates/katana/primitives/src/lib.rs index de95663047..7accc01ceb 100644 --- a/crates/katana/primitives/src/lib.rs +++ b/crates/katana/primitives/src/lib.rs @@ -17,4 +17,8 @@ pub mod conversion; pub mod state; pub mod utils; -pub type FieldElement = starknet::core::types::FieldElement; +pub use felt::FieldElement; + +pub mod felt { + pub use starknet::core::types::{Felt as FieldElement, FromStrError}; +} diff --git a/crates/katana/primitives/src/utils/transaction.rs b/crates/katana/primitives/src/utils/transaction.rs index 0157c3a15c..94cc1b3458 100644 --- a/crates/katana/primitives/src/utils/transaction.rs +++ b/crates/katana/primitives/src/utils/transaction.rs @@ -6,43 +6,39 @@ use starknet_crypto::poseidon_hash_many; use crate::FieldElement; /// 2^ 128 -const QUERY_VERSION_OFFSET: FieldElement = FieldElement::from_mont([ - 18446744073700081665, - 17407, - 18446744073709551584, - 576460752142434320, -]); +const QUERY_VERSION_OFFSET: FieldElement = + FieldElement::from_raw([576460752142434320, 18446744073709551584, 17407, 18446744073700081665]); /// Cairo string for "invoke" -const PREFIX_INVOKE: FieldElement = FieldElement::from_mont([ - 18443034532770911073, +const PREFIX_INVOKE: FieldElement = FieldElement::from_raw([ + 513398556346534256, 18446744073709551615, 18446744073709551615, - 513398556346534256, + 18443034532770911073, ]); /// Cairo string for "declare" -const PREFIX_DECLARE: FieldElement = FieldElement::from_mont([ - 17542456862011667323, +const PREFIX_DECLARE: FieldElement = FieldElement::from_raw([ + 191557713328401194, 18446744073709551615, 18446744073709551615, - 191557713328401194, + 17542456862011667323, ]); /// Cairo string for "deploy_account" -const PREFIX_DEPLOY_ACCOUNT: FieldElement = FieldElement::from_mont([ - 3350261884043292318, - 18443211694809419988, - 18446744073709551615, +const PREFIX_DEPLOY_ACCOUNT: FieldElement = FieldElement::from_raw([ 461298303000467581, + 18446744073709551615, + 18443211694809419988, + 3350261884043292318, ]); /// Cairo string for "l1_handler" -const PREFIX_L1_HANDLER: FieldElement = FieldElement::from_mont([ - 1365666230910873368, - 18446744073708665300, - 18446744073709551615, +const PREFIX_L1_HANDLER: FieldElement = FieldElement::from_raw([ 157895833347907735, + 18446744073709551615, + 18446744073708665300, + 1365666230910873368, ]); /// Compute the hash of a V1 DeployAccount transaction. @@ -306,7 +302,7 @@ fn encode_gas_bound(name: &[u8], bound: &ResourceBounds) -> FieldElement { max_amount.copy_from_slice(&bound.max_amount.to_be_bytes()); max_price.copy_from_slice(&bound.max_price_per_unit.to_be_bytes()); - FieldElement::from_bytes_be(&buffer).expect("Packed resource should fit into felt") + FieldElement::from_bytes_be(&buffer) } fn hash_fee_fields( @@ -332,11 +328,26 @@ fn encode_da_mode( #[cfg(test)] mod tests { + use num_traits::ToPrimitive; use starknet::core::chain_id; - use starknet::macros::felt; + use starknet::macros::{felt, short_string}; use super::*; + #[test] + fn test_query_version_offset() { + // 2^ 128 + assert_eq!(QUERY_VERSION_OFFSET, FieldElement::TWO.pow(128u8)); + } + + #[test] + fn test_prefix_constants() { + assert_eq!(PREFIX_INVOKE, short_string!("invoke")); + assert_eq!(PREFIX_DECLARE, short_string!("declare")); + assert_eq!(PREFIX_DEPLOY_ACCOUNT, short_string!("deploy_account")); + assert_eq!(PREFIX_L1_HANDLER, short_string!("l1_handler")); + } + #[test] fn test_compute_deploy_account_v1_tx_hash() { // Starknet mainnet tx hash: https://voyager.online/tx/0x3d013d17c20a5db05d5c2e06c948a4e0bf5ea5b851b15137316533ec4788b6b @@ -363,7 +374,7 @@ mod tests { &constructor_calldata, class_hash, salt, - max_fee.try_into().unwrap(), + max_fee.to_u128().unwrap(), chain_id, nonce, false, diff --git a/crates/katana/rpc/rpc-api/src/starknet.rs b/crates/katana/rpc/rpc-api/src/starknet.rs index 9158fa1724..2f496462ce 100644 --- a/crates/katana/rpc/rpc-api/src/starknet.rs +++ b/crates/katana/rpc/rpc-api/src/starknet.rs @@ -4,11 +4,12 @@ use katana_primitives::block::{BlockIdOrTag, BlockNumber}; use katana_primitives::transaction::TxHash; use katana_primitives::FieldElement; use katana_rpc_types::block::{ - BlockHashAndNumber, BlockTxCount, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, + BlockHashAndNumber, BlockTxCount, MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, + MaybePendingBlockWithTxs, }; use katana_rpc_types::event::{EventFilterWithPage, EventsPage}; use katana_rpc_types::message::MsgFromL1; -use katana_rpc_types::receipt::MaybePendingTxReceipt; +use katana_rpc_types::receipt::TxReceiptWithBlockInfo; use katana_rpc_types::state_update::StateUpdate; use katana_rpc_types::transaction::{ BroadcastedDeclareTx, BroadcastedDeployAccountTx, BroadcastedInvokeTx, BroadcastedTx, @@ -21,7 +22,7 @@ use katana_rpc_types::{ use starknet::core::types::{SimulatedTransaction, TransactionStatus}; /// The currently supported version of the Starknet JSON-RPC specification. -pub const RPC_SPEC_VERSION: &str = "0.6.0"; +pub const RPC_SPEC_VERSION: &str = "0.7.1"; /// Starknet JSON-RPC APIs: #[cfg_attr(not(feature = "client"), rpc(server, namespace = "starknet"))] @@ -44,6 +45,13 @@ pub trait StarknetApi { #[method(name = "getBlockWithTxs")] async fn block_with_txs(&self, block_id: BlockIdOrTag) -> RpcResult; + /// Get block information with full transactions and receipts given the block id. + #[method(name = "getBlockWithReceipts")] + async fn block_with_receipts( + &self, + block_id: BlockIdOrTag, + ) -> RpcResult; + /// Get the information about the result of executing the requested block. #[method(name = "getStateUpdate")] async fn state_update(&self, block_id: BlockIdOrTag) -> RpcResult; @@ -79,7 +87,7 @@ pub trait StarknetApi { async fn transaction_receipt( &self, transaction_hash: TxHash, - ) -> RpcResult; + ) -> RpcResult; /// Get the contract class definition in the given block associated with the given hash. #[method(name = "getClass")] diff --git a/crates/katana/rpc/rpc-types-builder/Cargo.toml b/crates/katana/rpc/rpc-types-builder/Cargo.toml index d53783e828..8caf945948 100644 --- a/crates/katana/rpc/rpc-types-builder/Cargo.toml +++ b/crates/katana/rpc/rpc-types-builder/Cargo.toml @@ -11,6 +11,6 @@ katana-executor.workspace = true katana-primitives.workspace = true katana-provider.workspace = true katana-rpc-types.workspace = true +starknet.workspace = true anyhow.workspace = true -starknet.workspace = true diff --git a/crates/katana/rpc/rpc-types-builder/src/block.rs b/crates/katana/rpc/rpc-types-builder/src/block.rs index cd16a71f94..537da569d0 100644 --- a/crates/katana/rpc/rpc-types-builder/src/block.rs +++ b/crates/katana/rpc/rpc-types-builder/src/block.rs @@ -1,7 +1,8 @@ use katana_primitives::block::BlockHashOrNumber; use katana_provider::traits::block::{BlockHashProvider, BlockProvider, BlockStatusProvider}; +use katana_provider::traits::transaction::ReceiptProvider; use katana_provider::ProviderResult; -use katana_rpc_types::block::{BlockWithTxHashes, BlockWithTxs}; +use katana_rpc_types::block::{BlockWithReceipts, BlockWithTxHashes, BlockWithTxs}; /// A builder for building RPC block types. pub struct BlockBuilder

{ @@ -17,7 +18,7 @@ impl

BlockBuilder

{ impl

BlockBuilder

where - P: BlockProvider + BlockHashProvider, + P: BlockProvider + BlockHashProvider + ReceiptProvider, { pub fn build(self) -> ProviderResult> { let Some(hash) = BlockHashProvider::block_hash_by_id(&self.provider, self.block_id)? else { @@ -44,4 +45,19 @@ where Ok(Some(BlockWithTxHashes::new(hash, block, finality_status))) } + + pub fn build_with_receipts(self) -> ProviderResult> { + let Some(block) = BlockProvider::block(&self.provider, self.block_id)? else { + return Ok(None); + }; + + let finality_status = BlockStatusProvider::block_status(&self.provider, self.block_id)? + .expect("should exist if block exists"); + let receipts = ReceiptProvider::receipts_by_block(&self.provider, self.block_id)? + .expect("should exist if block exists"); + + let receipts_with_txs = block.body.into_iter().zip(receipts); + + Ok(Some(BlockWithReceipts::new(block.header, finality_status, receipts_with_txs))) + } } diff --git a/crates/katana/rpc/rpc-types-builder/src/receipt.rs b/crates/katana/rpc/rpc-types-builder/src/receipt.rs index 36dac22825..d46e85c389 100644 --- a/crates/katana/rpc/rpc-types-builder/src/receipt.rs +++ b/crates/katana/rpc/rpc-types-builder/src/receipt.rs @@ -2,7 +2,7 @@ use katana_primitives::transaction::TxHash; use katana_provider::traits::transaction::{ ReceiptProvider, TransactionProvider, TransactionStatusProvider, }; -use katana_rpc_types::receipt::TxReceipt; +use katana_rpc_types::receipt::{ReceiptBlock, TxReceiptWithBlockInfo}; /// A builder for building RPC transaction receipt types. pub struct ReceiptBuilder

{ @@ -20,11 +20,10 @@ impl

ReceiptBuilder

where P: TransactionProvider + TransactionStatusProvider + ReceiptProvider, { - pub fn build(&self) -> anyhow::Result> { + pub fn build(&self) -> anyhow::Result> { let receipt = ReceiptProvider::receipt_by_hash(&self.provider, self.transaction_hash)?; let Some(receipt) = receipt else { return Ok(None) }; - let transaction_hash = self.transaction_hash; let (block_number, block_hash) = TransactionProvider::transaction_block_num_and_hash( &self.provider, self.transaction_hash, @@ -35,10 +34,11 @@ where TransactionStatusProvider::transaction_status(&self.provider, self.transaction_hash)? .expect("must exist"); - Ok(Some(TxReceipt::new( - transaction_hash, - block_number, - block_hash, + let block = ReceiptBlock::Block { block_hash, block_number }; + + Ok(Some(TxReceiptWithBlockInfo::new( + block, + self.transaction_hash, finality_status, receipt, ))) diff --git a/crates/katana/rpc/rpc-types/Cargo.toml b/crates/katana/rpc/rpc-types/Cargo.toml index bc351aa0fc..d792d682ef 100644 --- a/crates/katana/rpc/rpc-types/Cargo.toml +++ b/crates/katana/rpc/rpc-types/Cargo.toml @@ -16,6 +16,7 @@ anyhow.workspace = true derive_more.workspace = true futures.workspace = true jsonrpsee = { workspace = true, features = [ "server" ] } +num-traits.workspace = true serde.workspace = true serde_json.workspace = true serde_with.workspace = true diff --git a/crates/katana/rpc/rpc-types/src/block.rs b/crates/katana/rpc/rpc-types/src/block.rs index 0e274906aa..a9c24e642b 100644 --- a/crates/katana/rpc/rpc-types/src/block.rs +++ b/crates/katana/rpc/rpc-types/src/block.rs @@ -1,7 +1,15 @@ -use katana_primitives::block::{Block, BlockHash, BlockNumber, FinalityStatus, PartialHeader}; +use katana_primitives::block::{ + Block, BlockHash, BlockNumber, FinalityStatus, Header, PartialHeader, +}; +use katana_primitives::receipt::Receipt; use katana_primitives::transaction::{TxHash, TxWithHash}; use serde::{Deserialize, Serialize}; -use starknet::core::types::{BlockStatus, ResourcePrice}; +use starknet::core::types::{ + BlockStatus, L1DataAvailabilityMode, ResourcePrice, TransactionWithReceipt, +}; + +use crate::receipt::TxReceipt; +use crate::transaction::Tx; pub type BlockTxCount = u64; @@ -33,6 +41,12 @@ impl BlockWithTxs { FinalityStatus::AcceptedOnL1 => BlockStatus::AcceptedOnL1, FinalityStatus::AcceptedOnL2 => BlockStatus::AcceptedOnL2, }, + + l1_da_mode: L1DataAvailabilityMode::Calldata, + l1_data_gas_price: ResourcePrice { + price_in_fri: Default::default(), + price_in_wei: Default::default(), + }, }) } } @@ -58,6 +72,12 @@ impl PendingBlockWithTxs { parent_hash: header.parent_hash, starknet_version: header.version.to_string(), sequencer_address: header.sequencer_address.into(), + + l1_da_mode: L1DataAvailabilityMode::Calldata, + l1_data_gas_price: ResourcePrice { + price_in_fri: Default::default(), + price_in_wei: Default::default(), + }, }) } } @@ -98,6 +118,12 @@ impl BlockWithTxHashes { FinalityStatus::AcceptedOnL1 => BlockStatus::AcceptedOnL1, FinalityStatus::AcceptedOnL2 => BlockStatus::AcceptedOnL2, }, + + l1_da_mode: L1DataAvailabilityMode::Calldata, + l1_data_gas_price: ResourcePrice { + price_in_fri: Default::default(), + price_in_wei: Default::default(), + }, }) } } @@ -120,6 +146,12 @@ impl PendingBlockWithTxHashes { parent_hash: header.parent_hash, starknet_version: header.version.to_string(), sequencer_address: header.sequencer_address.into(), + + l1_da_mode: L1DataAvailabilityMode::Calldata, + l1_data_gas_price: ResourcePrice { + price_in_fri: Default::default(), + price_in_wei: Default::default(), + }, }) } } @@ -146,3 +178,95 @@ impl From<(BlockHash, BlockNumber)> for BlockHashAndNumber { Self::new(hash, number) } } + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(transparent)] +pub struct BlockWithReceipts(starknet::core::types::BlockWithReceipts); + +impl BlockWithReceipts { + pub fn new( + header: Header, + finality_status: FinalityStatus, + receipts: impl Iterator, + ) -> Self { + let l1_gas_price = ResourcePrice { + price_in_wei: header.gas_prices.eth.into(), + price_in_fri: header.gas_prices.strk.into(), + }; + + let transactions = receipts + .map(|(tx_with_hash, receipt)| { + let receipt = TxReceipt::new(tx_with_hash.hash, finality_status, receipt).0; + let transaction = Tx::from(tx_with_hash).0; + TransactionWithReceipt { transaction, receipt } + }) + .collect(); + + Self(starknet::core::types::BlockWithReceipts { + status: match finality_status { + FinalityStatus::AcceptedOnL1 => BlockStatus::AcceptedOnL1, + FinalityStatus::AcceptedOnL2 => BlockStatus::AcceptedOnL2, + }, + block_hash: header.parent_hash, + parent_hash: header.parent_hash, + block_number: header.number, + new_root: header.state_root, + timestamp: header.timestamp, + sequencer_address: header.sequencer_address.into(), + l1_gas_price, + l1_data_gas_price: ResourcePrice { + price_in_fri: Default::default(), + price_in_wei: Default::default(), + }, + l1_da_mode: L1DataAvailabilityMode::Calldata, + starknet_version: header.version.to_string(), + transactions, + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(transparent)] +pub struct PendingBlockWithReceipts(starknet::core::types::PendingBlockWithReceipts); + +impl PendingBlockWithReceipts { + pub fn new( + header: PartialHeader, + receipts: impl Iterator, + ) -> Self { + let l1_gas_price = ResourcePrice { + price_in_wei: header.gas_prices.eth.into(), + price_in_fri: header.gas_prices.strk.into(), + }; + + let transactions = receipts + .map(|(tx_with_hash, receipt)| { + let receipt = + TxReceipt::new(tx_with_hash.hash, FinalityStatus::AcceptedOnL2, receipt).0; + let transaction = Tx::from(tx_with_hash).0; + TransactionWithReceipt { transaction, receipt } + }) + .collect(); + + Self(starknet::core::types::PendingBlockWithReceipts { + transactions, + l1_gas_price, + timestamp: header.timestamp, + sequencer_address: header.sequencer_address.into(), + parent_hash: header.parent_hash, + l1_da_mode: L1DataAvailabilityMode::Calldata, + l1_data_gas_price: ResourcePrice { + price_in_fri: Default::default(), + price_in_wei: Default::default(), + }, + starknet_version: header.version.to_string(), + }) + } +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum MaybePendingBlockWithReceipts { + Pending(PendingBlockWithReceipts), + Block(BlockWithReceipts), +} diff --git a/crates/katana/rpc/rpc-types/src/message.rs b/crates/katana/rpc/rpc-types/src/message.rs index 3ffa26566b..5014796104 100644 --- a/crates/katana/rpc/rpc-types/src/message.rs +++ b/crates/katana/rpc/rpc-types/src/message.rs @@ -16,7 +16,7 @@ impl MsgFromL1 { let message_hash = compute_l2_to_l1_message_hash( // This conversion will never fail bcs `from_address` is 20 bytes and the it will only // fail if the slice is > 32 bytes - FieldElement::from_byte_slice_be(self.0.from_address.as_bytes()).unwrap(), + FieldElement::from_bytes_be_slice(self.0.from_address.as_bytes()), self.0.to_address, &self.0.payload, ); diff --git a/crates/katana/rpc/rpc-types/src/receipt.rs b/crates/katana/rpc/rpc-types/src/receipt.rs index 6dd4ad5ecd..970f7f40fb 100644 --- a/crates/katana/rpc/rpc-types/src/receipt.rs +++ b/crates/katana/rpc/rpc-types/src/receipt.rs @@ -1,25 +1,23 @@ -use katana_primitives::block::{BlockHash, BlockNumber, FinalityStatus}; +use katana_primitives::block::FinalityStatus; use katana_primitives::fee::TxFeeInfo; use katana_primitives::receipt::{MessageToL1, Receipt, TxExecutionResources}; use katana_primitives::transaction::TxHash; use serde::{Deserialize, Serialize}; +pub use starknet::core::types::ReceiptBlock; use starknet::core::types::{ - DeclareTransactionReceipt, DeployAccountTransactionReceipt, ExecutionResult, FeePayment, - Hash256, InvokeTransactionReceipt, L1HandlerTransactionReceipt, - PendingDeclareTransactionReceipt, PendingDeployAccountTransactionReceipt, - PendingInvokeTransactionReceipt, PendingL1HandlerTransactionReceipt, PendingTransactionReceipt, - TransactionFinalityStatus, TransactionReceipt, + ComputationResources, DataAvailabilityResources, DataResources, DeclareTransactionReceipt, + DeployAccountTransactionReceipt, ExecutionResult, FeePayment, Hash256, + InvokeTransactionReceipt, L1HandlerTransactionReceipt, TransactionFinalityStatus, + TransactionReceipt, TransactionReceiptWithBlockInfo, }; #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(transparent)] -pub struct TxReceipt(starknet::core::types::TransactionReceipt); +pub struct TxReceipt(pub(crate) starknet::core::types::TransactionReceipt); impl TxReceipt { pub fn new( transaction_hash: TxHash, - block_number: BlockNumber, - block_hash: BlockHash, finality_status: FinalityStatus, receipt: Receipt, ) -> Self { @@ -36,8 +34,6 @@ impl TxReceipt { TransactionReceipt::Invoke(InvokeTransactionReceipt { events, - block_hash, - block_number, messages_sent, finality_status, transaction_hash, @@ -58,8 +54,6 @@ impl TxReceipt { TransactionReceipt::Declare(DeclareTransactionReceipt { events, - block_hash, - block_number, messages_sent, finality_status, transaction_hash, @@ -80,8 +74,6 @@ impl TxReceipt { TransactionReceipt::L1Handler(L1HandlerTransactionReceipt { events, - block_hash, - block_number, messages_sent, finality_status, transaction_hash, @@ -103,8 +95,6 @@ impl TxReceipt { TransactionReceipt::DeployAccount(DeployAccountTransactionReceipt { events, - block_hash, - block_number, messages_sent, finality_status, transaction_hash, @@ -126,104 +116,17 @@ impl TxReceipt { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(transparent)] -pub struct PendingTxReceipt(starknet::core::types::PendingTransactionReceipt); +pub struct TxReceiptWithBlockInfo(starknet::core::types::TransactionReceiptWithBlockInfo); -impl PendingTxReceipt { - pub fn new(transaction_hash: TxHash, receipt: Receipt) -> Self { - let receipt = match receipt { - Receipt::Invoke(rct) => { - let messages_sent = - rct.messages_sent.into_iter().map(|e| MsgToL1::from(e).0).collect(); - let events = rct.events.into_iter().map(|e| Event::from(e).0).collect(); - - PendingTransactionReceipt::Invoke(PendingInvokeTransactionReceipt { - transaction_hash, - events, - messages_sent, - actual_fee: to_rpc_fee(rct.fee), - execution_resources: ExecutionResources::from(rct.execution_resources).0, - execution_result: if let Some(reason) = rct.revert_error { - ExecutionResult::Reverted { reason } - } else { - ExecutionResult::Succeeded - }, - }) - } - - Receipt::Declare(rct) => { - let messages_sent = - rct.messages_sent.into_iter().map(|e| MsgToL1::from(e).0).collect(); - let events = rct.events.into_iter().map(|e| Event::from(e).0).collect(); - - PendingTransactionReceipt::Declare(PendingDeclareTransactionReceipt { - events, - transaction_hash, - messages_sent, - actual_fee: to_rpc_fee(rct.fee), - execution_resources: ExecutionResources::from(rct.execution_resources).0, - execution_result: if let Some(reason) = rct.revert_error { - ExecutionResult::Reverted { reason } - } else { - ExecutionResult::Succeeded - }, - }) - } - - Receipt::L1Handler(rct) => { - let messages_sent = - rct.messages_sent.into_iter().map(|e| MsgToL1::from(e).0).collect(); - let events = rct.events.into_iter().map(|e| Event::from(e).0).collect(); - - PendingTransactionReceipt::L1Handler(PendingL1HandlerTransactionReceipt { - transaction_hash, - events, - messages_sent, - actual_fee: to_rpc_fee(rct.fee), - execution_resources: ExecutionResources::from(rct.execution_resources).0, - message_hash: Hash256::from_bytes(rct.message_hash.0), - execution_result: if let Some(reason) = rct.revert_error { - ExecutionResult::Reverted { reason } - } else { - ExecutionResult::Succeeded - }, - }) - } - - Receipt::DeployAccount(rct) => { - let messages_sent = - rct.messages_sent.into_iter().map(|e| MsgToL1::from(e).0).collect(); - let events = rct.events.into_iter().map(|e| Event::from(e).0).collect(); - - PendingTransactionReceipt::DeployAccount(PendingDeployAccountTransactionReceipt { - transaction_hash, - events, - messages_sent, - actual_fee: to_rpc_fee(rct.fee), - contract_address: rct.contract_address.into(), - execution_resources: ExecutionResources::from(rct.execution_resources).0, - execution_result: if let Some(reason) = rct.revert_error { - ExecutionResult::Reverted { reason } - } else { - ExecutionResult::Succeeded - }, - }) - } - }; - - Self(receipt) - } -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum MaybePendingTxReceipt { - Receipt(TxReceipt), - Pending(PendingTxReceipt), -} - -impl From for TxReceipt { - fn from(receipt: starknet::core::types::TransactionReceipt) -> Self { - Self(receipt) +impl TxReceiptWithBlockInfo { + pub fn new( + block: ReceiptBlock, + transaction_hash: TxHash, + finality_status: FinalityStatus, + receipt: Receipt, + ) -> Self { + let receipt = TxReceipt::new(transaction_hash, finality_status, receipt).0; + Self(TransactionReceiptWithBlockInfo { receipt, block }) } } @@ -256,16 +159,21 @@ struct ExecutionResources(starknet::core::types::ExecutionResources); impl From for ExecutionResources { fn from(value: TxExecutionResources) -> Self { ExecutionResources(starknet::core::types::ExecutionResources { - steps: value.steps, - memory_holes: value.memory_holes, - ec_op_builtin_applications: value.ec_op_builtin, - ecdsa_builtin_applications: value.ecdsa_builtin, - keccak_builtin_applications: value.keccak_builtin, - bitwise_builtin_applications: value.bitwise_builtin, - pedersen_builtin_applications: value.pedersen_builtin, - poseidon_builtin_applications: value.poseidon_builtin, - range_check_builtin_applications: value.range_check_builtin, - segment_arena_builtin: value.segment_arena_builtin, + computation_resources: ComputationResources { + steps: value.steps, + memory_holes: value.memory_holes, + ec_op_builtin_applications: value.ec_op_builtin, + ecdsa_builtin_applications: value.ecdsa_builtin, + keccak_builtin_applications: value.keccak_builtin, + bitwise_builtin_applications: value.bitwise_builtin, + pedersen_builtin_applications: value.pedersen_builtin, + poseidon_builtin_applications: value.poseidon_builtin, + range_check_builtin_applications: value.range_check_builtin, + segment_arena_builtin: value.segment_arena_builtin, + }, + data_resources: DataResources { + data_availability: DataAvailabilityResources { l1_data_gas: 0, l1_gas: 0 }, + }, }) } } diff --git a/crates/katana/rpc/rpc-types/src/trace.rs b/crates/katana/rpc/rpc-types/src/trace.rs index 971d1b46a0..938ca9485a 100644 --- a/crates/katana/rpc/rpc-types/src/trace.rs +++ b/crates/katana/rpc/rpc-types/src/trace.rs @@ -2,7 +2,7 @@ use katana_primitives::trace::{CallInfo, TxExecInfo}; use katana_primitives::transaction::TxHash; use serde::{Deserialize, Serialize}; use starknet::core::types::{ - CallType, EntryPointType, ExecutionResources, OrderedEvent, OrderedMessage, + CallType, ComputationResources, EntryPointType, OrderedEvent, OrderedMessage, }; pub struct FunctionInvocation(pub starknet::core::types::FunctionInvocation); @@ -41,10 +41,9 @@ impl From for FunctionInvocation { let vm_resources = info.execution_resources; let get_vm_resource = |name: &str| vm_resources.builtin_instance_counter.get(name).copied(); - // TODO: replace execution resources type in primitive CallInfo with an already defined // `TxExecutionResources` - let execution_resources = ExecutionResources { + let execution_resources = ComputationResources { steps: vm_resources.n_steps, memory_holes: Some(vm_resources.n_memory_holes), range_check_builtin_applications: get_vm_resource("range_check_builtin"), diff --git a/crates/katana/rpc/rpc-types/src/transaction.rs b/crates/katana/rpc/rpc-types/src/transaction.rs index 231326474d..83116798f7 100644 --- a/crates/katana/rpc/rpc-types/src/transaction.rs +++ b/crates/katana/rpc/rpc-types/src/transaction.rs @@ -14,6 +14,7 @@ use katana_primitives::transaction::{ DeployAccountTxV1, DeployAccountTxV3, InvokeTx, InvokeTxV1, InvokeTxV3, TxHash, TxWithHash, }; use katana_primitives::FieldElement; +use num_traits::ToPrimitive; use serde::{Deserialize, Serialize}; use starknet::core::types::{ BroadcastedDeclareTransaction, BroadcastedDeployAccountTransaction, @@ -22,7 +23,7 @@ use starknet::core::types::{ }; use starknet::core::utils::get_contract_address; -use crate::receipt::MaybePendingTxReceipt; +use crate::receipt::TxReceiptWithBlockInfo; pub const CHUNK_SIZE_DEFAULT: u64 = 100; @@ -46,7 +47,7 @@ impl BroadcastedInvokeTx { calldata: tx.calldata, signature: tx.signature, sender_address: tx.sender_address.into(), - max_fee: tx.max_fee.try_into().expect("max_fee is too big"), + max_fee: tx.max_fee.to_u128().expect("max_fee is too big"), }), BroadcastedInvokeTransaction::V3(tx) => InvokeTx::V3(InvokeTxV3 { @@ -107,7 +108,7 @@ impl BroadcastedDeclareTx { nonce: tx.nonce, signature: tx.signature, sender_address: tx.sender_address.into(), - max_fee: tx.max_fee.try_into().expect("max fee is too large"), + max_fee: tx.max_fee.to_u128().expect("max fee is too large"), }), }) } @@ -127,7 +128,7 @@ impl BroadcastedDeclareTx { signature: tx.signature, sender_address: tx.sender_address.into(), compiled_class_hash: tx.compiled_class_hash, - max_fee: tx.max_fee.try_into().expect("max fee is too large"), + max_fee: tx.max_fee.to_u128().expect("max fee is too large"), }), }) } @@ -198,7 +199,7 @@ impl BroadcastedDeployAccountTx { contract_address: contract_address.into(), constructor_calldata: tx.constructor_calldata, contract_address_salt: tx.contract_address_salt, - max_fee: tx.max_fee.try_into().expect("max_fee is too big"), + max_fee: tx.max_fee.to_u128().expect("max_fee is too big"), }) } @@ -340,7 +341,7 @@ impl From for Tx { calldata: tx.calldata, contract_address: tx.contract_address.into(), entry_point_selector: tx.entry_point_selector, - nonce: tx.nonce.try_into().expect("nonce should fit in u64"), + nonce: tx.nonce.to_u64().expect("nonce should fit in u64"), version: tx.version, }, ), @@ -430,7 +431,7 @@ impl From for InvokeTx { signature: tx.signature, chain_id: ChainId::default(), sender_address: tx.sender_address.into(), - max_fee: tx.max_fee.try_into().expect("max_fee is too big"), + max_fee: tx.max_fee.to_u128().expect("max_fee is too big"), }), BroadcastedInvokeTransaction::V3(tx) => InvokeTx::V3(InvokeTxV3 { @@ -469,7 +470,7 @@ impl From for DeployAccountTx { contract_address: contract_address.into(), constructor_calldata: tx.constructor_calldata, contract_address_salt: tx.contract_address_salt, - max_fee: tx.max_fee.try_into().expect("max_fee is too big"), + max_fee: tx.max_fee.to_u128().expect("max_fee is too big"), }) } @@ -515,6 +516,6 @@ impl Default for TransactionsPageCursor { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct TransactionsPage { - pub transactions: Vec<(TxWithHash, MaybePendingTxReceipt)>, + pub transactions: Vec<(TxWithHash, TxReceiptWithBlockInfo)>, pub cursor: TransactionsPageCursor, } diff --git a/crates/katana/rpc/rpc/Cargo.toml b/crates/katana/rpc/rpc/Cargo.toml index 21bd70a416..a5d5cbaf42 100644 --- a/crates/katana/rpc/rpc/Cargo.toml +++ b/crates/katana/rpc/rpc/Cargo.toml @@ -47,6 +47,7 @@ dojo-world.workspace = true jsonrpsee = { workspace = true, features = [ "client" ] } katana-rpc-api = { workspace = true, features = [ "client" ] } katana-runner.workspace = true +num-traits.workspace = true url.workspace = true alloy = { git = "https://github.com/alloy-rs/alloy", features = [ "contract", diff --git a/crates/katana/rpc/rpc/src/starknet.rs b/crates/katana/rpc/rpc/src/starknet.rs index 603dcff366..f1e616ee58 100644 --- a/crates/katana/rpc/rpc/src/starknet.rs +++ b/crates/katana/rpc/rpc/src/starknet.rs @@ -16,13 +16,14 @@ use katana_provider::traits::transaction::{ }; use katana_rpc_api::starknet::StarknetApiServer; use katana_rpc_types::block::{ - BlockHashAndNumber, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, - PendingBlockWithTxHashes, PendingBlockWithTxs, + BlockHashAndNumber, MaybePendingBlockWithReceipts, MaybePendingBlockWithTxHashes, + MaybePendingBlockWithTxs, PendingBlockWithReceipts, PendingBlockWithTxHashes, + PendingBlockWithTxs, }; use katana_rpc_types::error::starknet::StarknetApiError; use katana_rpc_types::event::{EventFilterWithPage, EventsPage}; use katana_rpc_types::message::MsgFromL1; -use katana_rpc_types::receipt::{MaybePendingTxReceipt, PendingTxReceipt}; +use katana_rpc_types::receipt::{ReceiptBlock, TxReceiptWithBlockInfo}; use katana_rpc_types::state_update::StateUpdate; use katana_rpc_types::trace::FunctionInvocation; use katana_rpc_types::transaction::{ @@ -36,7 +37,8 @@ use katana_rpc_types::{ use katana_rpc_types_builder::ReceiptBuilder; use katana_tasks::{BlockingTaskPool, TokioTaskSpawner}; use starknet::core::types::{ - BlockTag, DeclareTransactionTrace, DeployAccountTransactionTrace, ExecuteInvocation, + BlockTag, ComputationResources, DataAvailabilityResources, DataResources, + DeclareTransactionTrace, DeployAccountTransactionTrace, ExecuteInvocation, ExecutionResources, InvokeTransactionTrace, L1HandlerTransactionTrace, RevertedInvocation, SimulatedTransaction, TransactionExecutionStatus, TransactionStatus, TransactionTrace, }; @@ -107,6 +109,8 @@ impl StarknetApi { gas_consumed: fee.gas_consumed.into(), overall_fee: fee.overall_fee.into(), unit: fee.unit, + data_gas_price: Default::default(), + data_gas_consumed: Default::default(), }), Err(err) => { @@ -347,6 +351,62 @@ impl StarknetApiServer for StarknetApi { .await } + async fn block_with_receipts( + &self, + block_id: BlockIdOrTag, + ) -> RpcResult { + self.on_io_blocking_task(move |this| { + let provider = this.inner.sequencer.backend.blockchain.provider(); + + if BlockIdOrTag::Tag(BlockTag::Pending) == block_id { + if let Some(executor) = this.inner.sequencer.pending_executor() { + let block_env = executor.read().block_env(); + let latest_hash = provider.latest_hash().map_err(StarknetApiError::from)?; + + let gas_prices = block_env.l1_gas_prices.clone(); + + let header = PartialHeader { + number: block_env.number, + gas_prices, + parent_hash: latest_hash, + version: CURRENT_STARKNET_VERSION, + timestamp: block_env.timestamp, + sequencer_address: block_env.sequencer_address, + }; + + let receipts = executor + .read() + .transactions() + .iter() + .filter_map(|(tx, result)| match result { + ExecutionResult::Success { receipt, .. } => { + Some((tx.clone(), receipt.clone())) + } + ExecutionResult::Failed { .. } => None, + }) + .collect::>(); + + return Ok(MaybePendingBlockWithReceipts::Pending( + PendingBlockWithReceipts::new(header, receipts.into_iter()), + )); + } + } + + let block_num = BlockIdReader::convert_block_id(provider, block_id) + .map_err(|e| StarknetApiError::UnexpectedError { reason: e.to_string() })? + .map(BlockHashOrNumber::Num) + .ok_or(StarknetApiError::BlockNotFound)?; + + let block = katana_rpc_types_builder::BlockBuilder::new(block_num, provider) + .build_with_receipts() + .map_err(|e| StarknetApiError::UnexpectedError { reason: e.to_string() })? + .ok_or(Error::from(StarknetApiError::BlockNotFound))?; + + Ok(MaybePendingBlockWithReceipts::Block(block)) + }) + .await + } + async fn state_update(&self, block_id: BlockIdOrTag) -> RpcResult { self.on_io_blocking_task(move |this| { let provider = this.inner.sequencer.backend.blockchain.provider(); @@ -375,7 +435,7 @@ impl StarknetApiServer for StarknetApi { async fn transaction_receipt( &self, transaction_hash: FieldElement, - ) -> RpcResult { + ) -> RpcResult { self.on_io_blocking_task(move |this| { let provider = this.inner.sequencer.backend.blockchain.provider(); let receipt = ReceiptBuilder::new(transaction_hash, provider) @@ -383,7 +443,7 @@ impl StarknetApiServer for StarknetApi { .map_err(|e| StarknetApiError::UnexpectedError { reason: e.to_string() })?; match receipt { - Some(receipt) => Ok(MaybePendingTxReceipt::Receipt(receipt)), + Some(receipt) => Ok(receipt), None => { let executor = this.inner.sequencer.pending_executor(); @@ -404,10 +464,12 @@ impl StarknetApiServer for StarknetApi { }) .ok_or(Error::from(StarknetApiError::TxnHashNotFound))?; - Ok(MaybePendingTxReceipt::Pending(PendingTxReceipt::new( + Ok(TxReceiptWithBlockInfo::new( + ReceiptBlock::Pending, transaction_hash, + FinalityStatus::AcceptedOnL2, pending_receipt, - ))) + )) } } }) @@ -841,6 +903,27 @@ impl StarknetApiServer for StarknetApi { // TODO: compute the state diff let state_diff = None; + let execution_resources = ExecutionResources { + computation_resources: ComputationResources { + steps: 0, + memory_holes: None, + segment_arena_builtin: None, + ecdsa_builtin_applications: None, + ec_op_builtin_applications: None, + keccak_builtin_applications: None, + bitwise_builtin_applications: None, + pedersen_builtin_applications: None, + poseidon_builtin_applications: None, + range_check_builtin_applications: None, + }, + data_resources: DataResources { + data_availability: DataAvailabilityResources { + l1_gas: 0, + l1_data_gas: 0, + }, + }, + }; + let transaction_trace = match receipt { Receipt::Invoke(_) => { TransactionTrace::Invoke(InvokeTransactionTrace { @@ -857,6 +940,7 @@ impl StarknetApiServer for StarknetApi { .expect("should exist if not reverted"), ) }, + execution_resources: execution_resources.clone(), }) } @@ -865,6 +949,7 @@ impl StarknetApiServer for StarknetApi { fee_transfer_invocation, validate_invocation, state_diff, + execution_resources: execution_resources.clone(), }) } @@ -875,6 +960,7 @@ impl StarknetApiServer for StarknetApi { state_diff, constructor_invocation: execute_invocation .expect("should exist bcs tx succeed"), + execution_resources: execution_resources.clone(), }) } @@ -883,6 +969,7 @@ impl StarknetApiServer for StarknetApi { state_diff, function_invocation: execute_invocation .expect("should exist bcs tx succeed"), + execution_resources, }) } }; @@ -895,6 +982,8 @@ impl StarknetApiServer for StarknetApi { gas_price: fee.gas_price.into(), overall_fee: fee.overall_fee.into(), gas_consumed: fee.gas_consumed.into(), + data_gas_price: Default::default(), + data_gas_consumed: Default::default(), }, }) } diff --git a/crates/katana/rpc/rpc/src/torii.rs b/crates/katana/rpc/rpc/src/torii.rs index d80baf35b6..ec2b8ff821 100644 --- a/crates/katana/rpc/rpc/src/torii.rs +++ b/crates/katana/rpc/rpc/src/torii.rs @@ -5,11 +5,11 @@ use jsonrpsee::core::{async_trait, RpcResult}; use katana_core::sequencer::KatanaSequencer; use katana_core::service::block_producer::BlockProducerMode; use katana_executor::ExecutorFactory; -use katana_primitives::block::BlockHashOrNumber; +use katana_primitives::block::{BlockHashOrNumber, FinalityStatus}; use katana_provider::traits::transaction::TransactionProvider; use katana_rpc_api::torii::ToriiApiServer; use katana_rpc_types::error::torii::ToriiApiError; -use katana_rpc_types::receipt::{MaybePendingTxReceipt, PendingTxReceipt}; +use katana_rpc_types::receipt::{ReceiptBlock, TxReceiptWithBlockInfo}; use katana_rpc_types::transaction::{TransactionsPage, TransactionsPageCursor}; use katana_rpc_types_builder::ReceiptBuilder; use katana_tasks::TokioTaskSpawner; @@ -83,7 +83,7 @@ impl ToriiApiServer for ToriiApi { .build() .expect("Receipt should exist for tx") .expect("Receipt should exist for tx"); - (tx, MaybePendingTxReceipt::Receipt(receipt)) + (tx, receipt) }) .collect::>(); @@ -114,10 +114,12 @@ impl ToriiApiServer for ToriiApi { res.receipt().map(|rct| { ( tx.clone(), - MaybePendingTxReceipt::Pending(PendingTxReceipt::new( + TxReceiptWithBlockInfo::new( + ReceiptBlock::Pending, tx.hash, + FinalityStatus::AcceptedOnL2, rct.clone(), - )), + ), ) }) }) @@ -152,10 +154,12 @@ impl ToriiApiServer for ToriiApi { res.receipt().map(|rct| { ( tx.clone(), - MaybePendingTxReceipt::Pending(PendingTxReceipt::new( + TxReceiptWithBlockInfo::new( + ReceiptBlock::Pending, tx.hash, + FinalityStatus::AcceptedOnL2, rct.clone(), - )), + ), ) }) }) @@ -201,10 +205,12 @@ impl ToriiApiServer for ToriiApi { .map(|tx_outcome| { ( tx_outcome.tx.clone(), - MaybePendingTxReceipt::Pending(PendingTxReceipt::new( + TxReceiptWithBlockInfo::new( + ReceiptBlock::Pending, tx_outcome.tx.hash, + FinalityStatus::AcceptedOnL2, tx_outcome.receipt, - )), + ), ) }) .collect::>(); diff --git a/crates/katana/rpc/rpc/tests/common/mod.rs b/crates/katana/rpc/rpc/tests/common/mod.rs index 853e4091cf..e0aa36bdb2 100644 --- a/crates/katana/rpc/rpc/tests/common/mod.rs +++ b/crates/katana/rpc/rpc/tests/common/mod.rs @@ -7,12 +7,12 @@ use cairo_lang_starknet_classes::contract_class::ContractClass; use katana_primitives::conversion::rpc::CompiledClass; use starknet::accounts::Call; use starknet::core::types::contract::SierraClass; -use starknet::core::types::{FieldElement, FlattenedSierraClass}; +use starknet::core::types::{Felt, FlattenedSierraClass}; use starknet::core::utils::get_selector_from_name; pub fn prepare_contract_declaration_params( artifact_path: &PathBuf, -) -> Result<(FlattenedSierraClass, FieldElement)> { +) -> Result<(FlattenedSierraClass, Felt)> { let flattened_class = get_flattened_class(artifact_path) .map_err(|e| anyhow!("error flattening the contract class: {e}"))?; let compiled_class_hash = get_compiled_class_hash(artifact_path) @@ -26,7 +26,7 @@ fn get_flattened_class(artifact_path: &PathBuf) -> Result Ok(contract_artifact.flatten()?) } -fn get_compiled_class_hash(artifact_path: &PathBuf) -> Result { +fn get_compiled_class_hash(artifact_path: &PathBuf) -> Result { let file = File::open(artifact_path)?; let casm_contract_class: ContractClass = serde_json::from_reader(file)?; let casm_contract = @@ -40,15 +40,15 @@ fn get_compiled_class_hash(artifact_path: &PathBuf) -> Result { // TODO: not sure why this function is not seen as used // as prepare_contract_declaration_params is. #[allow(dead_code)] -pub fn build_deploy_cairo1_contract_call(class_hash: FieldElement, salt: FieldElement) -> Call { - let constructor_calldata = vec![FieldElement::from(1_u32), FieldElement::from(2_u32)]; +pub fn build_deploy_cairo1_contract_call(class_hash: Felt, salt: Felt) -> Call { + let constructor_calldata = vec![Felt::from(1_u32), Felt::from(2_u32)]; let calldata = [ vec![ - class_hash, // class hash - salt, // salt - FieldElement::ZERO, // unique - FieldElement::from(constructor_calldata.len()), // constructor calldata len + class_hash, // class hash + salt, // salt + Felt::ZERO, // unique + Felt::from(constructor_calldata.len()), // constructor calldata len ], constructor_calldata.clone(), ] @@ -57,10 +57,8 @@ pub fn build_deploy_cairo1_contract_call(class_hash: FieldElement, salt: FieldEl Call { calldata, // devnet UDC address - to: FieldElement::from_hex_be( - "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", - ) - .unwrap(), + to: Felt::from_hex("0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf") + .unwrap(), selector: get_selector_from_name("deployContract").unwrap(), } } diff --git a/crates/katana/rpc/rpc/tests/messaging.rs b/crates/katana/rpc/rpc/tests/messaging.rs index a2dffb8538..7156d56fc2 100644 --- a/crates/katana/rpc/rpc/tests/messaging.rs +++ b/crates/katana/rpc/rpc/tests/messaging.rs @@ -11,14 +11,15 @@ use dojo_world::utils::TransactionWaiter; use katana_primitives::utils::transaction::{ compute_l1_handler_tx_hash, compute_l1_to_l2_message_hash, compute_l2_to_l1_message_hash, }; +use katana_rpc_types::receipt::ReceiptBlock; use katana_runner::{KatanaRunner, KatanaRunnerConfig}; use rand::Rng; use serde_json::json; use starknet::accounts::{Account, ConnectedAccount}; use starknet::contract::ContractFactory; use starknet::core::types::{ - BlockId, BlockTag, ContractClass, FieldElement, Hash256, MaybePendingTransactionReceipt, - Transaction, TransactionFinalityStatus, TransactionReceipt, + BlockId, BlockTag, ContractClass, Felt, Hash256, Transaction, TransactionFinalityStatus, + TransactionReceipt, }; use starknet::core::utils::get_contract_address; use starknet::macros::selector; @@ -94,7 +95,7 @@ async fn test_messaging() { // Declare the contract let class_hash = contract.class_hash(); - let res = katana_account.declare(contract.into(), compiled_hash).send().await.unwrap(); + let res = katana_account.declare_v2(contract.into(), compiled_hash).send().await.unwrap(); // The waiter already checks that the transaction is accepted and succeeded on L2. TransactionWaiter::new(res.transaction_hash, katana_account.provider()) @@ -109,11 +110,11 @@ async fn test_messaging() { assert_eq!(class.class_hash(), class_hash, "invalid declared class"); // just to make sure the rpc returns the correct class // Compute the contract address - let address = get_contract_address(FieldElement::ZERO, class_hash, &[], FieldElement::ZERO); + let address = get_contract_address(Felt::ZERO, class_hash, &[], Felt::ZERO); // Deploy the contract using UDC let res = ContractFactory::new(class_hash, &katana_account) - .deploy(Vec::new(), FieldElement::ZERO, false) + .deploy_v1(Vec::new(), Felt::ZERO, false) .send() .await .expect("Unable to deploy contract"); @@ -173,12 +174,12 @@ async fn test_messaging() { // In an l1_handler transaction, the first element of the calldata is always the Ethereum // address of the sender (msg.sender). - let mut l1_tx_calldata = vec![FieldElement::from_byte_slice_be(sender.as_slice()).unwrap()]; - l1_tx_calldata.extend(calldata.iter().map(|x| FieldElement::from(*x))); + let mut l1_tx_calldata = vec![Felt::from_bytes_be_slice(sender.as_slice())]; + l1_tx_calldata.extend(calldata.iter().map(|x| Felt::from(*x))); // Compute transaction hash let tx_hash = compute_l1_handler_tx_hash( - FieldElement::ZERO, + Felt::ZERO, recipient, selector, &l1_tx_calldata, @@ -203,15 +204,15 @@ async fn test_messaging() { assert_eq!(tx.calldata, l1_tx_calldata); // fetch the receipt - let receipt = katana_account + let receipt_res = katana_account .provider() .get_transaction_receipt(tx.transaction_hash) .await .expect("failed to get receipt"); - match receipt { - MaybePendingTransactionReceipt::Receipt(receipt) => { - let TransactionReceipt::L1Handler(receipt) = receipt else { + match receipt_res.block { + ReceiptBlock::Block { .. } => { + let TransactionReceipt::L1Handler(receipt) = receipt_res.receipt else { panic!("invalid receipt type"); }; @@ -219,7 +220,7 @@ async fn test_messaging() { sender.as_slice().try_into().unwrap(), recipient, selector, - &calldata.iter().map(|x| FieldElement::from(*x)).collect::>(), + &calldata.iter().map(|x| Felt::from(*x)).collect::>(), nonce.to::(), ); @@ -243,13 +244,13 @@ async fn test_messaging() { { // The L1 contract address to send the message to let l1_contract_address = l1_test_contract.address(); - let l1_contract_address = FieldElement::from_str(&l1_contract_address.to_string()).unwrap(); + let l1_contract_address = Felt::from_str(&l1_contract_address.to_string()).unwrap(); let l2_contract = CairoMessagingContract::new(l2_test_contract, &katana_account); // Send message to L1 let res = l2_contract - .send_message_value(&EthAddress::from(l1_contract_address), &FieldElement::TWO) + .send_message_value(&EthAddress::from(l1_contract_address), &Felt::TWO) .send() .await .expect("Call to send_message_value failed"); @@ -266,11 +267,8 @@ async fn test_messaging() { // registered. If the message is registered, calling `l2ToL1Messages` of the L1 core // contract with the message hash should return a non-zero value. - let l2_l1_msg_hash = compute_l2_to_l1_message_hash( - l2_test_contract, - l1_contract_address, - &[FieldElement::TWO], - ); + let l2_l1_msg_hash = + compute_l2_to_l1_message_hash(l2_test_contract, l1_contract_address, &[Felt::TWO]); let msg_fee = core_contract .l2ToL1Messages(l2_l1_msg_hash) diff --git a/crates/katana/rpc/rpc/tests/saya.rs b/crates/katana/rpc/rpc/tests/saya.rs index ad821d524b..7b8b260d6b 100644 --- a/crates/katana/rpc/rpc/tests/saya.rs +++ b/crates/katana/rpc/rpc/tests/saya.rs @@ -9,10 +9,10 @@ use katana_primitives::block::{BlockIdOrTag, BlockTag}; use katana_rpc_api::dev::DevApiClient; use katana_rpc_api::saya::SayaApiClient; use starknet::accounts::{Account, ConnectedAccount}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::macros::felt; -const ENOUGH_GAS: FieldElement = felt!("0x100000000000000000"); +const ENOUGH_GAS: Felt = felt!("0x100000000000000000"); mod common; @@ -33,7 +33,7 @@ async fn fetch_traces_from_block() { common::prepare_contract_declaration_params(&path).unwrap(); let contract = Arc::new(contract); - let res = account.declare(contract.clone(), compiled_class_hash).send().await.unwrap(); + let res = account.declare_v2(contract.clone(), compiled_class_hash).send().await.unwrap(); // wait for the tx to be mined TransactionWaiter::new(res.transaction_hash, account.provider()) .with_interval(200) @@ -47,7 +47,7 @@ async fn fetch_traces_from_block() { let call = common::build_deploy_cairo1_contract_call(res.class_hash, (i + 2_u32).into()); let res = account - .execute(vec![call]) + .execute_v1(vec![call]) .max_fee(ENOUGH_GAS) .send() .await @@ -102,7 +102,7 @@ async fn fetch_traces_from_pending_block() { common::prepare_contract_declaration_params(&path).unwrap(); let contract = Arc::new(contract); - let res = account.declare(contract.clone(), compiled_class_hash).send().await.unwrap(); + let res = account.declare_v2(contract.clone(), compiled_class_hash).send().await.unwrap(); // wait for the tx to be mined TransactionWaiter::new(res.transaction_hash, account.provider()) .with_interval(200) @@ -118,7 +118,7 @@ async fn fetch_traces_from_pending_block() { // we set the nonce manually so that we can send the tx rapidly without waiting for the // previous tx to be mined first. let res = account - .execute(vec![call]) + .execute_v1(vec![call]) .max_fee(ENOUGH_GAS) .send() .await diff --git a/crates/katana/rpc/rpc/tests/starknet.rs b/crates/katana/rpc/rpc/tests/starknet.rs index ec0bf3a57f..d9aae51aaa 100644 --- a/crates/katana/rpc/rpc/tests/starknet.rs +++ b/crates/katana/rpc/rpc/tests/starknet.rs @@ -5,11 +5,12 @@ use std::time::Duration; use dojo_test_utils::sequencer::{get_default_test_starknet_config, TestSequencer}; use katana_core::sequencer::SequencerConfig; +use katana_rpc_types::receipt::ReceiptBlock; use starknet::accounts::{Account, Call, ConnectedAccount}; use starknet::core::types::contract::legacy::LegacyContractClass; use starknet::core::types::{ - BlockId, BlockTag, DeclareTransactionReceipt, FieldElement, MaybePendingTransactionReceipt, - TransactionFinalityStatus, TransactionReceipt, + BlockId, BlockTag, DeclareTransactionReceipt, Felt, TransactionFinalityStatus, + TransactionReceipt, }; use starknet::core::utils::{get_contract_address, get_selector_from_name}; use starknet::providers::Provider; @@ -29,52 +30,51 @@ async fn test_send_declare_and_deploy_contract() { common::prepare_contract_declaration_params(&path).unwrap(); let class_hash = contract.class_hash(); - let res = account.declare(Arc::new(contract), compiled_class_hash).send().await.unwrap(); + let res = account.declare_v2(Arc::new(contract), compiled_class_hash).send().await.unwrap(); // wait for the tx to be mined tokio::time::sleep(Duration::from_millis(WAIT_TX_DELAY_MILLIS)).await; let receipt = account.provider().get_transaction_receipt(res.transaction_hash).await.unwrap(); - match receipt { - MaybePendingTransactionReceipt::Receipt(TransactionReceipt::Declare( - DeclareTransactionReceipt { finality_status, .. }, - )) => { + match receipt.block { + ReceiptBlock::Block { .. } => { + let TransactionReceipt::Declare(DeclareTransactionReceipt { finality_status, .. }) = + receipt.receipt + else { + panic!("invalid tx receipt") + }; + assert_eq!(finality_status, TransactionFinalityStatus::AcceptedOnL2); } + _ => panic!("invalid tx receipt"), } assert!(account.provider().get_class(BlockId::Tag(BlockTag::Latest), class_hash).await.is_ok()); - let constructor_calldata = vec![FieldElement::from(1_u32), FieldElement::from(2_u32)]; + let constructor_calldata = vec![Felt::from(1_u32), Felt::from(2_u32)]; let calldata = [ vec![ - res.class_hash, // class hash - FieldElement::ZERO, // salt - FieldElement::ZERO, // unique - FieldElement::from(constructor_calldata.len()), // constructor calldata len + res.class_hash, // class hash + Felt::ZERO, // salt + Felt::ZERO, // unique + Felt::from(constructor_calldata.len()), // constructor calldata len ], constructor_calldata.clone(), ] .concat(); - let contract_address = get_contract_address( - FieldElement::ZERO, - res.class_hash, - &constructor_calldata, - FieldElement::ZERO, - ); + let contract_address = + get_contract_address(Felt::ZERO, res.class_hash, &constructor_calldata, Felt::ZERO); account - .execute(vec![Call { + .execute_v1(vec![Call { calldata, // devnet UDC address - to: FieldElement::from_hex_be( - "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", - ) - .unwrap(), + to: Felt::from_hex("0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf") + .unwrap(), selector: get_selector_from_name("deployContract").unwrap(), }]) .send() @@ -115,45 +115,44 @@ async fn test_send_declare_and_deploy_legacy_contract() { let receipt = account.provider().get_transaction_receipt(res.transaction_hash).await.unwrap(); - match receipt { - MaybePendingTransactionReceipt::Receipt(TransactionReceipt::Declare( - DeclareTransactionReceipt { finality_status, .. }, - )) => { + match receipt.block { + ReceiptBlock::Block { .. } => { + let TransactionReceipt::Declare(DeclareTransactionReceipt { finality_status, .. }) = + receipt.receipt + else { + panic!("invalid tx receipt") + }; + assert_eq!(finality_status, TransactionFinalityStatus::AcceptedOnL2); } + _ => panic!("invalid tx receipt"), } assert!(account.provider().get_class(BlockId::Tag(BlockTag::Latest), class_hash).await.is_ok()); - let constructor_calldata = vec![FieldElement::ONE]; + let constructor_calldata = vec![Felt::ONE]; let calldata = [ vec![ - res.class_hash, // class hash - FieldElement::ZERO, // salt - FieldElement::ZERO, // unique - FieldElement::from(constructor_calldata.len()), // constructor calldata len + res.class_hash, // class hash + Felt::ZERO, // salt + Felt::ZERO, // unique + Felt::from(constructor_calldata.len()), // constructor calldata len ], constructor_calldata.clone(), ] .concat(); - let contract_address = get_contract_address( - FieldElement::ZERO, - res.class_hash, - &constructor_calldata.clone(), - FieldElement::ZERO, - ); + let contract_address = + get_contract_address(Felt::ZERO, res.class_hash, &constructor_calldata.clone(), Felt::ZERO); account - .execute(vec![Call { + .execute_v1(vec![Call { calldata, // devnet UDC address - to: FieldElement::from_hex_be( - "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", - ) - .unwrap(), + to: Felt::from_hex("0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf") + .unwrap(), selector: get_selector_from_name("deployContract").unwrap(), }]) .send() diff --git a/crates/katana/rpc/rpc/tests/torii.rs b/crates/katana/rpc/rpc/tests/torii.rs index 64f57da019..abd552e347 100644 --- a/crates/katana/rpc/rpc/tests/torii.rs +++ b/crates/katana/rpc/rpc/tests/torii.rs @@ -11,7 +11,7 @@ use katana_rpc_api::starknet::StarknetApiClient; use katana_rpc_api::torii::ToriiApiClient; use katana_rpc_types::transaction::{TransactionsPage, TransactionsPageCursor}; use starknet::accounts::{Account, Call, ConnectedAccount}; -use starknet::core::types::{FieldElement, TransactionStatus}; +use starknet::core::types::{Felt, TransactionStatus}; use starknet::core::utils::get_selector_from_name; use tokio::time::sleep; @@ -46,7 +46,8 @@ async fn test_get_transactions() { assert_eq!(response.cursor.block_number, 1); assert_eq!(response.cursor.transaction_index, 0); - let declare_res = account.declare(contract.clone(), compiled_class_hash).send().await.unwrap(); + let declare_res = + account.declare_v2(contract.clone(), compiled_class_hash).send().await.unwrap(); // Should return successfully with single pending txn. let response: TransactionsPage = client.get_transactions(response.cursor).await.unwrap(); @@ -67,8 +68,8 @@ async fn test_get_transactions() { // Should block on cursor at end of page and return on new txn let long_poll_future = client.get_transactions(response.cursor); - let deploy_call = build_deploy_contract_call(declare_res.class_hash, FieldElement::ZERO); - let deploy_txn = account.execute(vec![deploy_call]); + let deploy_call = build_deploy_contract_call(declare_res.class_hash, Felt::ZERO); + let deploy_txn = account.execute_v1(vec![deploy_call]); let deploy_txn_future = deploy_txn.send(); tokio::select! { @@ -87,8 +88,8 @@ async fn test_get_transactions() { // Create block 2. let _: () = client.generate_block().await.unwrap(); - let deploy_call = build_deploy_contract_call(declare_res.class_hash, FieldElement::ONE); - let deploy_txn = account.execute(vec![deploy_call]); + let deploy_call = build_deploy_contract_call(declare_res.class_hash, Felt::ONE); + let deploy_txn = account.execute_v1(vec![deploy_call]); let deploy_txn_future = deploy_txn.send().await.unwrap(); TransactionWaiter::new(deploy_txn_future.transaction_hash, &account.provider()).await.unwrap(); @@ -111,23 +112,23 @@ async fn test_get_transactions() { // Create block 3. let _: () = client.generate_block().await.unwrap(); - let max_fee = FieldElement::from_hex_be(ENOUGH_GAS).unwrap(); - let mut nonce = FieldElement::THREE; - let mut last_tx_hash = FieldElement::ZERO; + let max_fee = Felt::from_hex(ENOUGH_GAS).unwrap(); + let mut nonce = Felt::THREE; + let mut last_tx_hash = Felt::ZERO; // Test only returns first 100 txns from pending block for i in 0..101 { let deploy_call = build_deploy_contract_call(declare_res.class_hash, (i + 2_u32).into()); - let deploy_txn = account.execute(vec![deploy_call]).nonce(nonce).max_fee(max_fee); + let deploy_txn = account.execute_v1(vec![deploy_call]).nonce(nonce).max_fee(max_fee); let res = deploy_txn.send().await.unwrap(); - nonce += FieldElement::ONE; + nonce += Felt::ONE; if i == 100 { last_tx_hash = res.transaction_hash; } } - assert!(last_tx_hash != FieldElement::ZERO); + assert!(last_tx_hash != Felt::ZERO); // Poll the statux of the last tx sent. let max_retry = 10; @@ -195,7 +196,8 @@ async fn test_get_transactions_with_instant_mining() { // Should return successfully when no transactions have been mined. let cursor = TransactionsPageCursor { block_number: 0, transaction_index: 0, chunk_size: 100 }; - let declare_res = account.declare(contract.clone(), compiled_class_hash).send().await.unwrap(); + let declare_res = + account.declare_v2(contract.clone(), compiled_class_hash).send().await.unwrap(); sleep(Duration::from_millis(1000)).await; @@ -208,8 +210,8 @@ async fn test_get_transactions_with_instant_mining() { // Should block on cursor at end of page and return on new txn let long_poll_future = client.get_transactions(response.cursor); - let deploy_call = build_deploy_contract_call(declare_res.class_hash, FieldElement::ZERO); - let deploy_txn = account.execute(vec![deploy_call]); + let deploy_call = build_deploy_contract_call(declare_res.class_hash, Felt::ZERO); + let deploy_txn = account.execute_v1(vec![deploy_call]); let deploy_txn_future = deploy_txn.send(); tokio::select! { @@ -225,8 +227,8 @@ async fn test_get_transactions_with_instant_mining() { } } - let deploy_call = build_deploy_contract_call(declare_res.class_hash, FieldElement::ONE); - let deploy_txn = account.execute(vec![deploy_call]); + let deploy_call = build_deploy_contract_call(declare_res.class_hash, Felt::ONE); + let deploy_txn = account.execute_v1(vec![deploy_call]); let deploy_txn_future = deploy_txn.send().await.unwrap(); // Should properly increment to new pending block @@ -247,15 +249,15 @@ async fn test_get_transactions_with_instant_mining() { sequencer.stop().expect("failed to stop sequencer"); } -fn build_deploy_contract_call(class_hash: FieldElement, salt: FieldElement) -> Call { - let constructor_calldata = vec![FieldElement::from(1_u32), FieldElement::from(2_u32)]; +fn build_deploy_contract_call(class_hash: Felt, salt: Felt) -> Call { + let constructor_calldata = vec![Felt::from(1_u32), Felt::from(2_u32)]; let calldata = [ vec![ - class_hash, // class hash - salt, // salt - FieldElement::ZERO, // unique - FieldElement::from(constructor_calldata.len()), // constructor calldata len + class_hash, // class hash + salt, // salt + Felt::ZERO, // unique + Felt::from(constructor_calldata.len()), // constructor calldata len ], constructor_calldata.clone(), ] @@ -264,10 +266,8 @@ fn build_deploy_contract_call(class_hash: FieldElement, salt: FieldElement) -> C Call { calldata, // devnet UDC address - to: FieldElement::from_hex_be( - "0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf", - ) - .unwrap(), + to: Felt::from_hex("0x41a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf") + .unwrap(), selector: get_selector_from_name("deployContract").unwrap(), } } diff --git a/crates/katana/storage/codecs/src/lib.rs b/crates/katana/storage/codecs/src/lib.rs index 9e0c2e2043..ff18972ec0 100644 --- a/crates/katana/storage/codecs/src/lib.rs +++ b/crates/katana/storage/codecs/src/lib.rs @@ -63,7 +63,7 @@ macro_rules! impl_compact_felt { if len > 0 { let mut arr = [0u8; 32]; arr[32 - len..].copy_from_slice(&buf[..len]); - (FieldElement::from_bytes_be(&arr).unwrap().into(), &buf[len..]) + (FieldElement::from_bytes_be(&arr).into(), &buf[len..]) } else { (FieldElement::ZERO.into(), buf) } diff --git a/crates/katana/storage/db/src/codecs/mod.rs b/crates/katana/storage/db/src/codecs/mod.rs index c45a2a93f5..9c57ec7034 100644 --- a/crates/katana/storage/db/src/codecs/mod.rs +++ b/crates/katana/storage/db/src/codecs/mod.rs @@ -62,8 +62,7 @@ macro_rules! impl_encode_and_decode_for_felts { impl Decode for $ty { fn decode>(bytes: B) -> Result { - let felt = FieldElement::from_byte_slice_be(bytes.as_ref()); - Ok(felt.map_err(|e| CodecError::Decode(e.to_string()))?.into()) + Ok(FieldElement::from_bytes_be_slice(bytes.as_ref()).into()) } } )* diff --git a/crates/katana/storage/db/src/models/storage.rs b/crates/katana/storage/db/src/models/storage.rs index 5412b22b1f..b6264a481f 100644 --- a/crates/katana/storage/db/src/models/storage.rs +++ b/crates/katana/storage/db/src/models/storage.rs @@ -27,8 +27,7 @@ impl Compress for StorageEntry { impl Decompress for StorageEntry { fn decompress>(bytes: B) -> Result { let bytes = bytes.as_ref(); - let key = StorageKey::from_byte_slice_be(&bytes[0..32]) - .map_err(|e| CodecError::Decompress(e.to_string()))?; + let key = StorageKey::from_bytes_be_slice(&bytes[0..32]); let value = StorageValue::decompress(&bytes[32..])?; Ok(Self { key, value }) } diff --git a/crates/katana/storage/provider/tests/block.rs b/crates/katana/storage/provider/tests/block.rs index 2378ee3968..a5ea696017 100644 --- a/crates/katana/storage/provider/tests/block.rs +++ b/crates/katana/storage/provider/tests/block.rs @@ -27,7 +27,7 @@ use fixtures::{ db_provider, fork_provider, fork_provider_with_spawned_fork_network, in_memory_provider, mock_state_updates, provider_with_states, }; -use starknet::core::types::FieldElement; +use katana_primitives::FieldElement; #[apply(insert_block_cases)] fn insert_block_with_in_memory_provider( diff --git a/crates/saya/core/Cargo.toml b/crates/saya/core/Cargo.toml index bb319cbc3a..051b8f3c9d 100644 --- a/crates/saya/core/Cargo.toml +++ b/crates/saya/core/Cargo.toml @@ -16,6 +16,7 @@ saya-provider.workspace = true anyhow.workspace = true async-trait.workspace = true +bigdecimal.workspace = true cairo-proof-parser.workspace = true cairo-vm.workspace = true convert_case.workspace = true @@ -31,7 +32,7 @@ serde.workspace = true serde_json.workspace = true serde_with.workspace = true starknet-crypto.workspace = true -starknet-types-core = { version = "0.0.9", default-features = false, features = [ "curve", "num-traits", "serde" ] } +starknet-types-core = { version = "0.1.4", default-features = false, features = [ "curve", "num-traits", "serde" ] } starknet.workspace = true starknet_api.workspace = true thiserror.workspace = true diff --git a/crates/saya/core/src/data_availability/celestia/mod.rs b/crates/saya/core/src/data_availability/celestia/mod.rs index 7e85dd1567..51372e7910 100644 --- a/crates/saya/core/src/data_availability/celestia/mod.rs +++ b/crates/saya/core/src/data_availability/celestia/mod.rs @@ -7,7 +7,7 @@ use celestia_types::blob::GasPrice; use celestia_types::nmt::Namespace; use celestia_types::Blob; use serde::{Deserialize, Serialize}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use url::Url; use crate::data_availability::error::{DataAvailabilityResult, Error}; @@ -54,10 +54,7 @@ impl DataAvailabilityClient for CelestiaClient { self.mode } - async fn publish_state_diff_felts( - &self, - state_diff: &[FieldElement], - ) -> DataAvailabilityResult { + async fn publish_state_diff_felts(&self, state_diff: &[Felt]) -> DataAvailabilityResult { let bytes: Vec = state_diff.iter().flat_map(|fe| fe.to_bytes_be().to_vec()).collect(); let blob = Blob::new(self.namespace, bytes)?; @@ -72,8 +69,8 @@ impl DataAvailabilityClient for CelestiaClient { async fn publish_state_diff_and_proof_felts( &self, - state_diff: &[FieldElement], - state_diff_proof: &[FieldElement], + state_diff: &[Felt], + state_diff_proof: &[Felt], ) -> DataAvailabilityResult { let bytes: Vec = state_diff.iter().flat_map(|fe| fe.to_bytes_be().to_vec()).collect(); let blob = Blob::new(self.namespace, bytes)?; diff --git a/crates/saya/core/src/data_availability/mod.rs b/crates/saya/core/src/data_availability/mod.rs index d5ae1d410b..fbf8deba8c 100644 --- a/crates/saya/core/src/data_availability/mod.rs +++ b/crates/saya/core/src/data_availability/mod.rs @@ -7,7 +7,7 @@ use std::fmt::Display; use async_trait::async_trait; use serde::{Deserialize, Serialize}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; pub mod celestia; @@ -57,10 +57,7 @@ pub trait DataAvailabilityClient { /// * `state_diff` - An array of felt representing the data to be published on the DA layer. We /// use felt as all fields inside the state diff can be expressed as a felt. Nonce and updates /// count are limited to 64 bits anyway. - async fn publish_state_diff_felts( - &self, - state_diff: &[FieldElement], - ) -> DataAvailabilityResult; + async fn publish_state_diff_felts(&self, state_diff: &[Felt]) -> DataAvailabilityResult; /// Publishes both data and transition proof on the DA layer atomically. /// Returns the block height in which the state diff was included. @@ -73,8 +70,8 @@ pub trait DataAvailabilityClient { /// * `state_diff_proof` - The serialized transition proof corresponding to the `state_diff`. async fn publish_state_diff_and_proof_felts( &self, - state_diff: &[FieldElement], - state_diff_proof: &[FieldElement], + state_diff: &[Felt], + state_diff_proof: &[Felt], ) -> DataAvailabilityResult; } diff --git a/crates/saya/core/src/dojo_os/mod.rs b/crates/saya/core/src/dojo_os/mod.rs index 74d387539c..2318fc9656 100644 --- a/crates/saya/core/src/dojo_os/mod.rs +++ b/crates/saya/core/src/dojo_os/mod.rs @@ -17,7 +17,7 @@ use itertools::chain; use once_cell::sync::OnceCell; use starknet::accounts::{Account, Call, ConnectedAccount, ExecutionEncoding, SingleOwnerAccount}; use starknet::core::types::{ - BlockId, BlockTag, FieldElement, TransactionExecutionStatus, TransactionStatus, + BlockId, BlockTag, Felt, TransactionExecutionStatus, TransactionStatus, }; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; @@ -55,15 +55,15 @@ pub fn get_starknet_account( } pub async fn starknet_apply_diffs( - world: FieldElement, - new_state: Vec, - program_output: Vec, - program_hash: FieldElement, - nonce: FieldElement, + world: Felt, + new_state: Vec, + program_output: Vec, + program_hash: Felt, + nonce: Felt, starknet_account: StarknetAccountData, ) -> anyhow::Result { let calldata = chain![ - vec![FieldElement::from(new_state.len() as u64 / 2)].into_iter(), + vec![Felt::from(new_state.len() as u64 / 2)].into_iter(), new_state.clone().into_iter(), program_output.into_iter(), vec![program_hash], @@ -74,7 +74,7 @@ pub async fn starknet_apply_diffs( let account = account.lock().await; let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; let tx = account - .execute(vec![Call { + .execute_v1(vec![Call { to: world, selector: get_selector_from_name("upgrade_state").expect("invalid selector"), calldata, diff --git a/crates/saya/core/src/lib.rs b/crates/saya/core/src/lib.rs index fa982c5eb4..030b2bd6ca 100644 --- a/crates/saya/core/src/lib.rs +++ b/crates/saya/core/src/lib.rs @@ -20,6 +20,7 @@ use saya_provider::Provider as SayaProvider; use serde::{Deserialize, Serialize}; use starknet::core::utils::cairo_short_string_to_felt; use starknet_crypto::poseidon_hash_many; +use starknet_types_core::felt::Felt; use tokio::fs::File; use tokio::io::AsyncWriteExt; use tracing::{error, info, trace}; @@ -388,7 +389,7 @@ impl Saya { world_da, program_output, program_hash, - nonce_after + 1u64.into(), + nonce_after + Felt::ONE, self.config.starknet_account.clone(), ) .await?; diff --git a/crates/saya/core/src/prover/extract.rs b/crates/saya/core/src/prover/extract.rs index 7ae3cf7bdd..7a760183f5 100644 --- a/crates/saya/core/src/prover/extract.rs +++ b/crates/saya/core/src/prover/extract.rs @@ -1,4 +1,5 @@ use anyhow::anyhow; +use bigdecimal::BigDecimal; use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; use katana_primitives::FieldElement; @@ -15,7 +16,7 @@ pub fn program_input_from_program_output( let block_number = serde_json::from_str(&output[2].to_string()).unwrap(); let block_hash = output[3]; let config_hash = output[4]; - let mut decimal = output[6].clone().to_big_decimal(0); // Convert with no decimal places + let mut decimal: BigDecimal = output[6].clone().to_bigint().into(); // Convert with no decimal places let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; let message_to_starknet_segment = match num { @@ -24,7 +25,7 @@ pub fn program_input_from_program_output( }; let index = 7 + num as usize; - decimal = output[index].clone().to_big_decimal(0); + decimal = output[index].clone().to_bigint().into(); let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; let message_to_appchain_segment = match num { 0..=4 => Default::default(), @@ -59,7 +60,7 @@ fn get_message_to_starknet_segment( } let from_address = ContractAddress::from(output[index]); let to_address = ContractAddress::from(output[index + 1]); - let decimal = output[index + 2].to_big_decimal(0); + let decimal: BigDecimal = output[index + 2].to_bigint().into(); let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; let payload = output[index + 3..index + 3 + num as usize].to_vec(); message_to_starknet_segment.push(MessageToStarknet { from_address, to_address, payload }); @@ -81,7 +82,7 @@ fn get_message_to_appchain_segment( let to_address = ContractAddress::from(output[index + 1]); let nonce = output[index + 2]; let selector = output[index + 3]; - let decimal = output[index + 4].to_big_decimal(0); + let decimal: BigDecimal = output[index + 4].to_bigint().into(); let num = decimal.to_u64().ok_or_else(|| anyhow!("Conversion to u64 failed"))?; let payload = output[index + 5..index + 5 + num as usize].to_vec(); diff --git a/crates/saya/core/src/prover/program_input.rs b/crates/saya/core/src/prover/program_input.rs index 146f9ce111..74fdb233ab 100644 --- a/crates/saya/core/src/prover/program_input.rs +++ b/crates/saya/core/src/prover/program_input.rs @@ -1,6 +1,7 @@ use std::str::FromStr; use anyhow::bail; +use bigdecimal::BigDecimal; use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; use katana_primitives::trace::{CallInfo, EntryPointType}; @@ -8,16 +9,16 @@ use katana_primitives::transaction::{L1HandlerTx, TxHash}; use katana_rpc_types::trace::TxExecutionInfo; use serde::ser::{SerializeSeq, Serializer}; use serde::{Deserialize, Deserializer, Serialize}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; /// Based on https://github.com/cartridge-gg/piltover/blob/2be9d46f00c9c71e2217ab74341f77b09f034c81/src/snos_output.cairo#L19-L20 /// With the new state root computed by the prover. #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Default)] pub struct ProgramInput { - pub prev_state_root: FieldElement, + pub prev_state_root: Felt, pub block_number: u64, - pub block_hash: FieldElement, - pub config_hash: FieldElement, + pub block_hash: Felt, + pub config_hash: Felt, #[serde(serialize_with = "MessageToStarknet::serialize_message_to_starknet")] #[serde(deserialize_with = "MessageToStarknet::deserialize_message_to_starknet")] pub message_to_starknet_segment: Vec, @@ -27,13 +28,10 @@ pub struct ProgramInput { #[serde(flatten)] pub state_updates: StateUpdates, #[serde(serialize_with = "serialize_world_da")] - pub world_da: Option>, + pub world_da: Option>, } -fn serialize_world_da( - element: &Option>, - serializer: S, -) -> Result +fn serialize_world_da(element: &Option>, serializer: S) -> Result where S: Serializer, { @@ -41,9 +39,10 @@ where let mut seq = serializer.serialize_seq(Some(da.len()))?; for d in da { - let decimal = d.to_big_decimal(0); // Convert with no decimal places - let num = decimal.to_string(); - seq.serialize_element(&num)?; + // let decimal: BigDecimal = d.to_bigint().into(); // Convert with no decimal places + // let num = decimal.to_string(); + // seq.serialize_element(&num)?; + seq.serialize_element(&d)?; } seq.end() @@ -117,7 +116,7 @@ impl ProgramInput { /// that represent the serialized DA. The length is not included as the array contains /// serialiazed struct with two members: key and value. /// TODO: migrate to cainome + simple rust vec for better devX in the future. - pub fn fill_da(&mut self, world: FieldElement) { + pub fn fill_da(&mut self, world: Felt) { let updates = self .state_updates .storage_updates @@ -183,7 +182,7 @@ impl ProgramInput { }) } - pub fn da_as_calldata(&self, world: FieldElement) -> Vec { + pub fn da_as_calldata(&self, world: Felt) -> Vec { let updates = self .state_updates .storage_updates @@ -196,37 +195,37 @@ impl ProgramInput { updates } - fn serialize_to_prover_args(&self) -> Vec { + fn serialize_to_prover_args(&self) -> Vec { let mut out = vec![ self.prev_state_root, - FieldElement::from(self.block_number), + Felt::from(self.block_number), self.block_hash, self.config_hash, ]; - out.push(FieldElement::from(self.state_updates.nonce_updates.len())); + out.push(Felt::from(self.state_updates.nonce_updates.len())); for (k, v) in &self.state_updates.nonce_updates { out.push(**k); out.push(*v); } - out.push(FieldElement::from(self.state_updates.storage_updates.len())); + out.push(Felt::from(self.state_updates.storage_updates.len())); for (c, h) in &self.state_updates.storage_updates { out.push(**c); - out.push(FieldElement::from(h.len())); + out.push(Felt::from(h.len())); for (k, v) in h { out.push(*k); out.push(*v); } } - out.push(FieldElement::from(self.state_updates.contract_updates.len())); + out.push(Felt::from(self.state_updates.contract_updates.len())); for (k, v) in &self.state_updates.contract_updates { out.push(**k); out.push(*v); } - out.push(FieldElement::from(self.state_updates.declared_classes.len())); + out.push(Felt::from(self.state_updates.declared_classes.len())); for (k, v) in &self.state_updates.declared_classes { out.push(*k); out.push(*v); @@ -237,7 +236,7 @@ impl ProgramInput { .iter() .flat_map(|m| m.serialize().unwrap()) .collect::>(); - out.push(FieldElement::from(starknet_messages.len())); + out.push(Felt::from(starknet_messages.len())); out.extend(starknet_messages); let appchain_messages = self @@ -246,13 +245,13 @@ impl ProgramInput { .flat_map(|m| m.serialize().unwrap()) .collect::>(); - out.push(FieldElement::from(appchain_messages.len())); + out.push(Felt::from(appchain_messages.len())); out.extend(appchain_messages); - out.push(FieldElement::from(self.world_da.as_ref().unwrap().len() / 2)); + out.push(Felt::from(self.world_da.as_ref().unwrap().len() / 2)); out.extend(self.world_da.as_ref().unwrap().iter().cloned()); - out.push(FieldElement::from(0u64)); // Proofs + out.push(Felt::from(0u64)); // Proofs out } @@ -261,7 +260,10 @@ impl ProgramInput { let serialized = inputs.iter().flat_map(|input| input.serialize_to_prover_args()).collect::>(); - let joined = serialized.iter().map(|f| f.to_big_decimal(0).to_string()).collect::>(); + let joined = serialized + .iter() + .map(|f| BigDecimal::from(f.to_bigint()).to_string()) + .collect::>(); format!("[{} {}]", inputs.len(), joined.join(" ")) } @@ -272,7 +274,7 @@ impl ProgramInput { pub struct MessageToStarknet { pub from_address: ContractAddress, pub to_address: ContractAddress, - pub payload: Vec, + pub payload: Vec, } impl MessageToStarknet { @@ -288,17 +290,18 @@ impl MessageToStarknet { let serialized = message.serialize().unwrap(); // Instead of adding serialized as an array, add each element individually for field_element in serialized { - let decimal = field_element.to_big_decimal(0); // Assuming no decimal places for simplicity - let num = decimal.to_string(); - seq.serialize_element(&num)?; + // let decimal: BigDecimal = field_element.to_bigint().into(); // Assuming no + // decimal places for simplicity let num = decimal.to_string(); + // seq.serialize_element(&num)?; + seq.serialize_element(&field_element)?; } } seq.end() } - pub fn serialize(&self) -> anyhow::Result> { + pub fn serialize(&self) -> anyhow::Result> { let mut result = vec![*self.from_address, *self.to_address]; - result.push(FieldElement::from(self.payload.len())); + result.push(Felt::from(self.payload.len())); result.extend(self.payload.iter().cloned()); Ok(result) } @@ -325,19 +328,33 @@ impl MessageToStarknet { let mut messages = Vec::new(); while let Some(from_address) = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) { let to_address = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) .unwrap_or_default(); + let payload_length_str = seq.next_element::()?.unwrap_or_default(); - let payload_length: usize = payload_length_str.parse().unwrap_or_default(); + // TODO: for compatibility reason, the length can be in either decimal or hex + // format. maybe should just expect all values to be in hex format. + let payload_length = payload_length_str + .parse::() + .or_else(|_| { + usize::from_str_radix( + payload_length_str + .strip_prefix("0x") + .unwrap_or(&payload_length_str), + 16, + ) + }) + .expect("invalid length value"); + let mut payload = Vec::new(); for _ in 0..payload_length { if let Some(element) = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) { payload.push(element); } @@ -361,9 +378,9 @@ impl MessageToStarknet { pub struct MessageToAppchain { pub from_address: ContractAddress, pub to_address: ContractAddress, - pub nonce: FieldElement, - pub selector: FieldElement, - pub payload: Vec, + pub nonce: Felt, + pub selector: Felt, + pub payload: Vec, } impl MessageToAppchain { @@ -378,17 +395,18 @@ impl MessageToAppchain { for message in messages { let serialized = message.serialize().unwrap(); for field_element in serialized { - let decimal = field_element.to_big_decimal(0); // Assuming no decimal places for simplicity - let num = decimal.to_string(); - seq.serialize_element(&num)?; + // let decimal: BigDecimal = field_element.to_bigint().into(); // Assuming no + // decimal places for simplicity let num = decimal.to_string(); + // seq.serialize_element(&num)?; + seq.serialize_element(&field_element)?; } } seq.end() } - pub fn serialize(&self) -> anyhow::Result> { + pub fn serialize(&self) -> anyhow::Result> { let mut result = vec![*self.from_address, *self.to_address, self.nonce, self.selector]; - result.push(FieldElement::from(self.payload.len())); + result.push(Felt::from(self.payload.len())); result.extend(self.payload.iter().cloned()); Ok(result) } @@ -415,27 +433,41 @@ impl MessageToAppchain { let mut messages = Vec::new(); while let Some(from_address) = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) { let to_address = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) .unwrap_or_default(); let nonce = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) .unwrap_or_default(); let selector = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) .unwrap_or_default(); + let payload_length_str = seq.next_element::()?.unwrap_or_default(); - let payload_length: usize = payload_length_str.parse().unwrap_or_default(); + // TODO: for compatibility reason, the length can be in either decimal or hex + // format. maybe should just expect all values to be in hex format. + let payload_length = payload_length_str + .parse::() + .or_else(|_| { + usize::from_str_radix( + payload_length_str + .strip_prefix("0x") + .unwrap_or(&payload_length_str), + 16, + ) + }) + .expect("invalid length value"); + let mut payload = Vec::new(); for _ in 0..payload_length { if let Some(element) = seq .next_element::()? - .map(|num| FieldElement::from_str(&num.to_string()).unwrap()) + .map(|num| Felt::from_str(&num.to_string()).unwrap()) { payload.push(element); } @@ -461,53 +493,52 @@ fn test_deserialize_input() -> anyhow::Result<()> { use std::str::FromStr; let input = r#"{ - "prev_state_root":"101", - "block_number":102, - "block_hash":"103", - "config_hash":"104", - "message_to_starknet_segment":["105","106","1","1"], - "message_to_appchain_segment":["108","109","110","111","1","112"], + "prev_state_root":"0x65", + "block_number": 102, + "block_hash":"0x67", + "config_hash":"0x68", + "message_to_starknet_segment":["0x69","0x6a","0x1","0x1"], + "message_to_appchain_segment":["0x6c","0x6d","0x6e","0x6f","0x1","0x70"], "storage_updates":{ - "42": { - "2010": "1200", - "2012": "1300" + "0x2a": { + "0x7dc": "0x514", + "0x7da": "0x4b0" } }, "nonce_updates":{ - "1111": "22222", - "1116": "22223" + "0x457": "0x56ce", + "0x45c": "0x56cf" }, "contract_updates":{ - "3": "437267489" + "0x3": "0x1a102c21" }, "declared_classes":{ - "1234": "12345" + "0x4d2": "0x3039" } }"#; - let mut expected = ProgramInput { - prev_state_root: FieldElement::from_str("101")?, + prev_state_root: Felt::from_str("101")?, block_number: 102, - block_hash: FieldElement::from_str("103")?, - config_hash: FieldElement::from_str("104")?, + block_hash: Felt::from_str("103")?, + config_hash: Felt::from_str("104")?, message_to_starknet_segment: vec![MessageToStarknet { - from_address: ContractAddress::from(FieldElement::from_str("105")?), - to_address: ContractAddress::from(FieldElement::from_str("106")?), - payload: vec![FieldElement::from_str("1")?], + from_address: ContractAddress::from(Felt::from_str("105")?), + to_address: ContractAddress::from(Felt::from_str("106")?), + payload: vec![Felt::from_str("1")?], }], message_to_appchain_segment: vec![MessageToAppchain { - from_address: ContractAddress::from(FieldElement::from_str("108")?), - to_address: ContractAddress::from(FieldElement::from_str("109")?), - nonce: FieldElement::from_str("110")?, - selector: FieldElement::from_str("111")?, - payload: vec![FieldElement::from_str("112")?], + from_address: ContractAddress::from(Felt::from_str("108")?), + to_address: ContractAddress::from(Felt::from_str("109")?), + nonce: Felt::from_str("110")?, + selector: Felt::from_str("111")?, + payload: vec![Felt::from_str("112")?], }], state_updates: StateUpdates { storage_updates: vec![( - ContractAddress::from(FieldElement::from_str("42")?), + ContractAddress::from(Felt::from_str("42")?), vec![ - (FieldElement::from_str("2010")?, FieldElement::from_str("1200")?), - (FieldElement::from_str("2012")?, FieldElement::from_str("1300")?), + (Felt::from_str("2010")?, Felt::from_str("1200")?), + (Felt::from_str("2012")?, Felt::from_str("1300")?), ] .into_iter() .collect(), @@ -516,43 +547,34 @@ fn test_deserialize_input() -> anyhow::Result<()> { .collect(), nonce_updates: vec![ - ( - ContractAddress::from(FieldElement::from_str("1111")?), - FieldElement::from_str("22222")?, - ), - ( - ContractAddress::from(FieldElement::from_str("1116")?), - FieldElement::from_str("22223")?, - ), + (ContractAddress::from(Felt::from_str("1111")?), Felt::from_str("22222")?), + (ContractAddress::from(Felt::from_str("1116")?), Felt::from_str("22223")?), ] .into_iter() .collect(), contract_updates: vec![( - ContractAddress::from(FieldElement::from_str("3")?), - FieldElement::from_str("437267489")?, + ContractAddress::from(Felt::from_str("3")?), + Felt::from_str("437267489")?, )] .into_iter() .collect(), - declared_classes: vec![( - FieldElement::from_str("1234")?, - FieldElement::from_str("12345")?, - )] - .into_iter() - .collect(), + declared_classes: vec![(Felt::from_str("1234")?, Felt::from_str("12345")?)] + .into_iter() + .collect(), }, world_da: None, }; let mut deserialized = serde_json::from_str::(input)?; assert_eq!(expected, deserialized); - deserialized.fill_da(FieldElement::from_str("42")?); + deserialized.fill_da(Felt::from_str("42")?); expected.world_da = Some(vec![ - FieldElement::from_str("2010")?, - FieldElement::from_str("1200")?, - FieldElement::from_str("2012")?, - FieldElement::from_str("1300")?, + Felt::from_str("2010")?, + Felt::from_str("1200")?, + Felt::from_str("2012")?, + Felt::from_str("1300")?, ]); Ok(()) @@ -563,28 +585,28 @@ fn test_serialize_input() -> anyhow::Result<()> { use std::str::FromStr; let input = ProgramInput { - prev_state_root: FieldElement::from_str("101")?, + prev_state_root: Felt::from_str("101")?, block_number: 102, - block_hash: FieldElement::from_str("103")?, - config_hash: FieldElement::from_str("104")?, + block_hash: Felt::from_str("103")?, + config_hash: Felt::from_str("104")?, message_to_starknet_segment: vec![MessageToStarknet { - from_address: ContractAddress::from(FieldElement::from_str("105")?), - to_address: ContractAddress::from(FieldElement::from_str("106")?), - payload: vec![FieldElement::from_str("1")?], + from_address: ContractAddress::from(Felt::from_str("105")?), + to_address: ContractAddress::from(Felt::from_str("106")?), + payload: vec![Felt::from_str("1")?], }], message_to_appchain_segment: vec![MessageToAppchain { - from_address: ContractAddress::from(FieldElement::from_str("108")?), - to_address: ContractAddress::from(FieldElement::from_str("109")?), - nonce: FieldElement::from_str("110")?, - selector: FieldElement::from_str("111")?, - payload: vec![FieldElement::from_str("112")?], + from_address: ContractAddress::from(Felt::from_str("108")?), + to_address: ContractAddress::from(Felt::from_str("109")?), + nonce: Felt::from_str("110")?, + selector: Felt::from_str("111")?, + payload: vec![Felt::from_str("112")?], }], state_updates: StateUpdates { storage_updates: vec![( - ContractAddress::from(FieldElement::from_str("42")?), + ContractAddress::from(Felt::from_str("42")?), vec![ - (FieldElement::from_str("2010")?, FieldElement::from_str("1200")?), - (FieldElement::from_str("2012")?, FieldElement::from_str("1300")?), + (Felt::from_str("2010")?, Felt::from_str("1200")?), + (Felt::from_str("2012")?, Felt::from_str("1300")?), ] .into_iter() .collect(), @@ -593,37 +615,28 @@ fn test_serialize_input() -> anyhow::Result<()> { .collect(), nonce_updates: vec![ - ( - ContractAddress::from(FieldElement::from_str("1111")?), - FieldElement::from_str("22222")?, - ), - ( - ContractAddress::from(FieldElement::from_str("1116")?), - FieldElement::from_str("22223")?, - ), + (ContractAddress::from(Felt::from_str("1111")?), Felt::from_str("22222")?), + (ContractAddress::from(Felt::from_str("1116")?), Felt::from_str("22223")?), ] .into_iter() .collect(), contract_updates: vec![( - ContractAddress::from(FieldElement::from_str("3")?), - FieldElement::from_str("437267489")?, + ContractAddress::from(Felt::from_str("3")?), + Felt::from_str("437267489")?, )] .into_iter() .collect(), - declared_classes: vec![( - FieldElement::from_str("1234")?, - FieldElement::from_str("12345")?, - )] - .into_iter() - .collect(), + declared_classes: vec![(Felt::from_str("1234")?, Felt::from_str("12345")?)] + .into_iter() + .collect(), }, world_da: Some(vec![ - FieldElement::from_str("2010")?, - FieldElement::from_str("1200")?, - FieldElement::from_str("2012")?, - FieldElement::from_str("1300")?, + Felt::from_str("2010")?, + Felt::from_str("1200")?, + Felt::from_str("2012")?, + Felt::from_str("1300")?, ]), }; @@ -637,31 +650,31 @@ fn test_serialize_input() -> anyhow::Result<()> { #[test] fn test_serialize_to_prover_args() -> anyhow::Result<()> { let input = r#"{ - "prev_state_root":"101", + "prev_state_root":"0x65", "block_number":102, - "block_hash":"103", - "config_hash":"104", + "block_hash":"0x67", + "config_hash":"0x68", "nonce_updates":{ - "1111": "22222" + "0x457": "0x56ce" }, "storage_updates":{ - "333": { - "4444": "555" + "0x14d": { + "0x115c": "0x22b" } }, "contract_updates":{ - "66666": "7777" + "0x1046a": "0x1e61" }, "declared_classes":{ - "88888": "99999" + "0x15b38": "0x1869f" }, - "message_to_starknet_segment":["123","456","123","128"], - "message_to_appchain_segment":["108","109","110","111","1","112"] + "message_to_starknet_segment":["0x7b","0x1c8","0x7b","0x80"], + "message_to_appchain_segment":["0x6c","0x6d","0x6e","0x6f","0x1","0x70"] }"#; let mut input = serde_json::from_str::(input)?; - input.fill_da(FieldElement::from_str("333")?); + input.fill_da(Felt::from_str("333")?); - println!("{:?}", input); + // println!("{:?}", input); let serialized = input.serialize_to_prover_args(); @@ -670,7 +683,7 @@ fn test_serialize_to_prover_args() -> anyhow::Result<()> { 4, 123, 456, 1, 128, 6, 108, 109, 110, 111, 1, 112, 1, 4444, 555, 0u64, ] .into_iter() - .map(FieldElement::from) + .map(Felt::from) .collect::>(); assert_eq!(serialized, expected); diff --git a/crates/saya/core/src/prover/state_diff.rs b/crates/saya/core/src/prover/state_diff.rs index 2155688533..3e68cd41f9 100644 --- a/crates/saya/core/src/prover/state_diff.rs +++ b/crates/saya/core/src/prover/state_diff.rs @@ -1,9 +1,9 @@ use katana_primitives::state::StateUpdates; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; pub struct ProvedStateDiff { - pub genesis_state_hash: FieldElement, - pub prev_state_hash: FieldElement, + pub genesis_state_hash: Felt, + pub prev_state_hash: Felt, pub state_updates: StateUpdates, } diff --git a/crates/saya/core/src/verifier/mod.rs b/crates/saya/core/src/verifier/mod.rs index 5cad2bb643..c9334456c8 100644 --- a/crates/saya/core/src/verifier/mod.rs +++ b/crates/saya/core/src/verifier/mod.rs @@ -7,7 +7,7 @@ //! an interface to query the on-chain verifier, but also //! submitting facts and proofs. -use ::starknet::core::types::FieldElement; +use ::starknet::core::types::Felt; use serde::{Deserialize, Serialize}; use crate::StarknetAccountData; @@ -17,16 +17,16 @@ mod starknet; /// Supported verifiers. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] pub enum VerifierIdentifier { - HerodotusStarknetSepolia(FieldElement), + HerodotusStarknetSepolia(Felt), StoneLocal, StarkwareEthereum, } pub async fn verify( verifier: VerifierIdentifier, - serialized_proof: Vec, + serialized_proof: Vec, account: StarknetAccountData, -) -> anyhow::Result<(String, FieldElement)> { +) -> anyhow::Result<(String, Felt)> { match verifier { VerifierIdentifier::HerodotusStarknetSepolia(fact_registry_address) => { starknet::starknet_verify(fact_registry_address, serialized_proof, account).await diff --git a/crates/saya/core/src/verifier/starknet.rs b/crates/saya/core/src/verifier/starknet.rs index 3c8f78f38e..5f5cbd8f95 100644 --- a/crates/saya/core/src/verifier/starknet.rs +++ b/crates/saya/core/src/verifier/starknet.rs @@ -4,7 +4,7 @@ use anyhow::Context; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use starknet::accounts::{Account, Call, ConnectedAccount}; -use starknet::core::types::{FieldElement, TransactionExecutionStatus, TransactionStatus}; +use starknet::core::types::{Felt, TransactionExecutionStatus, TransactionStatus}; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; use tokio::time::sleep; @@ -13,17 +13,17 @@ use crate::dojo_os::get_starknet_account; use crate::StarknetAccountData; pub async fn starknet_verify( - fact_registry_address: FieldElement, - serialized_proof: Vec, + fact_registry_address: Felt, + serialized_proof: Vec, starknet_config: StarknetAccountData, -) -> anyhow::Result<(String, FieldElement)> { +) -> anyhow::Result<(String, Felt)> { let txn_config = TxnConfig { wait: true, receipt: true, ..Default::default() }; let account = get_starknet_account(starknet_config)?; let account = account.lock().await; let nonce = account.get_nonce().await?; let tx = account - .execute(vec![Call { + .execute_v1(vec![Call { to: fact_registry_address, selector: get_selector_from_name("verify_and_register_fact").expect("invalid selector"), calldata: serialized_proof, diff --git a/crates/saya/provider/Cargo.toml b/crates/saya/provider/Cargo.toml index 4730c123e7..2c1d7f15df 100644 --- a/crates/saya/provider/Cargo.toml +++ b/crates/saya/provider/Cargo.toml @@ -23,6 +23,7 @@ flate2.workspace = true futures.workspace = true jsonrpsee = { workspace = true, features = [ "client" ] } lazy_static.workspace = true +num-traits.workspace = true serde.workspace = true serde_json.workspace = true serde_with.workspace = true diff --git a/crates/saya/provider/src/error.rs b/crates/saya/provider/src/error.rs index df3074c664..6a32acd45d 100644 --- a/crates/saya/provider/src/error.rs +++ b/crates/saya/provider/src/error.rs @@ -11,6 +11,6 @@ pub enum ProviderError { BlockNotFound(katana_primitives::block::BlockIdOrTag), #[error(transparent)] StarknetProvider(#[from] starknet::providers::ProviderError), - #[error(transparent)] - ValueOutOfRange(#[from] starknet::core::types::ValueOutOfRangeError), + #[error("Value out of range")] + ValueOutOfRange, } diff --git a/crates/saya/provider/src/provider.rs b/crates/saya/provider/src/provider.rs index 72e445c4d7..c0dafece58 100644 --- a/crates/saya/provider/src/provider.rs +++ b/crates/saya/provider/src/provider.rs @@ -1,7 +1,7 @@ use katana_primitives::block::{BlockNumber, SealedBlock}; use katana_primitives::state::StateUpdatesWithDeclaredClasses; use katana_rpc_types::trace::TxExecutionInfo; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use crate::ProviderResult; @@ -28,7 +28,7 @@ pub trait Provider { async fn fetch_state_updates( &self, block_number: BlockNumber, - ) -> ProviderResult<(StateUpdatesWithDeclaredClasses, Vec)>; + ) -> ProviderResult<(StateUpdatesWithDeclaredClasses, Vec)>; /// Fetches the transactions executions info for a given block. /// This method returns the all the executions info for each diff --git a/crates/saya/provider/src/rpc/mod.rs b/crates/saya/provider/src/rpc/mod.rs index e6a8ab8a3c..45e9993b05 100644 --- a/crates/saya/provider/src/rpc/mod.rs +++ b/crates/saya/provider/src/rpc/mod.rs @@ -15,8 +15,9 @@ use katana_primitives::transaction::TxWithHash; use katana_primitives::version::Version; use katana_rpc_api::saya::SayaApiClient; use katana_rpc_types::trace::TxExecutionInfo; +use num_traits::ToPrimitive; use starknet::core::types::{ - ContractClass, FieldElement, MaybePendingBlockWithTxs, MaybePendingStateUpdate, + ContractClass, Felt, MaybePendingBlockWithTxs, MaybePendingStateUpdate, }; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider as StarknetProvider}; @@ -92,8 +93,8 @@ impl Provider for JsonRpcProvider { parent_hash: block.parent_hash, number: block.block_number, gas_prices: GasPrices::new( - block.l1_gas_price.price_in_wei.try_into().unwrap(), - block.l1_gas_price.price_in_fri.try_into().unwrap(), + block.l1_gas_price.price_in_wei.to_u128().unwrap(), + block.l1_gas_price.price_in_fri.to_u128().unwrap(), ), timestamp: block.timestamp, state_root: block.new_root, @@ -108,7 +109,7 @@ impl Provider for JsonRpcProvider { async fn fetch_state_updates( &self, block_number: BlockNumber, - ) -> ProviderResult<(StateUpdatesWithDeclaredClasses, Vec)> { + ) -> ProviderResult<(StateUpdatesWithDeclaredClasses, Vec)> { let rpc_state_update = match self .starknet_provider .get_state_update(BlockIdOrTag::Number(block_number)) diff --git a/crates/saya/provider/src/rpc/state.rs b/crates/saya/provider/src/rpc/state.rs index 072b30c939..fa359b3789 100644 --- a/crates/saya/provider/src/rpc/state.rs +++ b/crates/saya/provider/src/rpc/state.rs @@ -15,9 +15,10 @@ use std::collections::{HashMap, HashSet}; use alloy_primitives::U256; use katana_primitives::contract::ContractAddress; use katana_primitives::state::StateUpdates; +use num_traits::ToPrimitive; use starknet::core::types::{ - ContractStorageDiffItem, DeclaredClassItem, DeployedContractItem, FieldElement, NonceUpdate, - StateDiff, StateUpdate, + ContractStorageDiffItem, DeclaredClassItem, DeployedContractItem, Felt, NonceUpdate, StateDiff, + StateUpdate, }; use crate::ProviderResult; @@ -26,7 +27,6 @@ use crate::ProviderResult; const CLASS_INFO_FLAG_TRUE: &str = "100000000000000000000000000000000"; /// Converts the [`StateUpdate`] RPC type into [`StateUpdate`] Katana primitive. -/// /// # Arguments /// /// * `state_update` - The RPC state update to convert. @@ -65,7 +65,7 @@ pub fn state_updates_from_rpc(state_update: &StateUpdate) -> ProviderResult`]. +/// Converts the [`StateDiff`] from RPC types into a [`Vec`]. /// /// Currently, Katana does not support `replaced_classes` and `deprecated_declared_classes`: /// . @@ -76,7 +76,7 @@ pub fn state_updates_from_rpc(state_update: &StateUpdate) -> ProviderResult Vec { +pub fn state_diff_to_felts(state_diff: &StateDiff) -> Vec { let mut data = vec![]; // Order matters here, storage then nonce then deployed. @@ -100,17 +100,14 @@ pub fn state_diff_to_felts(state_diff: &StateDiff) -> Vec { /// Serializes for the DA all the contracts that have at least one storage update. /// This may include nonce and/or deployed-declared updates. -/// Returns a [`HashSet`] of all the contract addresses that +/// Returns a [`HashSet`] of all the contract addresses that /// were uniquely processed. /// /// # Arguments /// /// * `state_diff` - The state diff to process. /// * `out` - The output buffer to serialize into. -fn serialize_storage_updates( - state_diff: &StateDiff, - out: &mut Vec, -) -> HashSet { +fn serialize_storage_updates(state_diff: &StateDiff, out: &mut Vec) -> HashSet { let mut processed_addresses = HashSet::new(); for contract_diff in &state_diff.storage_diffs { @@ -154,8 +151,8 @@ fn serialize_storage_updates( /// * `out` - The output buffer to serialize into. fn serialize_nonce_updates( state_diff: &StateDiff, - processed_addresses: &mut HashSet, - out: &mut Vec, + processed_addresses: &mut HashSet, + out: &mut Vec, ) { for nonce_update in &state_diff.nonces { let NonceUpdate { contract_address, nonce: new_nonce } = *nonce_update; @@ -189,8 +186,8 @@ fn serialize_nonce_updates( /// * `out` - The output buffer to serialize into. fn serialize_deployed_updates( state_diff: &StateDiff, - processed_addresses: &mut HashSet, - out: &mut Vec, + processed_addresses: &mut HashSet, + out: &mut Vec, ) { for deployed in &state_diff.deployed_contracts { let DeployedContractItem { address, class_hash } = *deployed; @@ -217,10 +214,10 @@ fn serialize_deployed_updates( /// * `is_storage_only` - True if the contract address was only modified with storage updates. False /// if the contract was deployed or it's class hash replaced during this state update. fn compute_update_meta_info( - new_nonce: Option, + new_nonce: Option, n_storage_updates: u64, is_storage_only: bool, -) -> FieldElement { +) -> Felt { let mut meta = if is_storage_only { U256::from(0) } else { @@ -229,13 +226,13 @@ fn compute_update_meta_info( if let Some(nonce) = new_nonce { // At the moment, v0.11 and forward are packing the nonce into 64 bits. - let nonce_u64: u64 = nonce.try_into().expect("Nonce too large for DA serialization"); + let nonce_u64: u64 = nonce.to_u64().expect("Nonce too large for DA serialization"); meta += U256::from((nonce_u64 as u128) << 64) } meta += U256::from(n_storage_updates); - FieldElement::from_hex_be(format!("0x{:064x}", meta).as_str()).unwrap() + Felt::from_hex(format!("0x{:064x}", meta).as_str()).unwrap() } #[cfg(test)] @@ -247,13 +244,13 @@ mod tests { #[test] fn compute_update_meta_info_no_flag() { - let info = compute_update_meta_info(Some(FieldElement::ONE), 1, true); + let info = compute_update_meta_info(Some(Felt::ONE), 1, true); assert_eq!(info, felt!("0x00000000000000010000000000000001")); } #[test] fn compute_update_meta_info_with_flag() { - let info = compute_update_meta_info(Some(FieldElement::ONE), 1, false); + let info = compute_update_meta_info(Some(Felt::ONE), 1, false); assert_eq!(info, felt!("0x100000000000000010000000000000001")); } diff --git a/crates/saya/provider/src/rpc/transaction.rs b/crates/saya/provider/src/rpc/transaction.rs index bbc39b316b..4632975ed8 100644 --- a/crates/saya/provider/src/rpc/transaction.rs +++ b/crates/saya/provider/src/rpc/transaction.rs @@ -4,8 +4,9 @@ use katana_primitives::transaction::{ DeclareTx, DeclareTxV1, DeclareTxV2, DeclareTxV3, DeployAccountTx, DeployAccountTxV1, DeployAccountTxV3, InvokeTx, InvokeTxV1, InvokeTxV3, L1HandlerTx, Tx, TxWithHash, }; +use num_traits::ToPrimitive; use starknet::core::types::{ - DeclareTransaction, DeployAccountTransaction, FieldElement, InvokeTransaction, Transaction, + DeclareTransaction, DeployAccountTransaction, InvokeTransaction, Transaction, }; use crate::ProviderResult; @@ -17,7 +18,7 @@ pub fn tx_from_rpc(tx_rpc: &Transaction, chain_id: ChainId) -> ProviderResult ProviderResult Ok(TxWithHash { hash: tx.transaction_hash, transaction: Tx::Invoke(InvokeTx::V1(InvokeTxV1 { - max_fee: tx.max_fee.try_into()?, + max_fee: tx.max_fee.to_u128().expect("valid u128"), chain_id, calldata: tx.calldata.clone(), signature: tx.signature.clone(), @@ -62,7 +63,7 @@ pub fn tx_from_rpc(tx_rpc: &Transaction, chain_id: ChainId) -> ProviderResult ProviderResult Ok(TxWithHash { hash: tx.transaction_hash, transaction: Tx::Declare(DeclareTx::V1(DeclareTxV1 { - max_fee: tx.max_fee.try_into()?, + max_fee: tx.max_fee.to_u128().expect("valid u128"), chain_id, class_hash: tx.class_hash, signature: tx.signature.clone(), @@ -86,7 +87,7 @@ pub fn tx_from_rpc(tx_rpc: &Transaction, chain_id: ChainId) -> ProviderResult ProviderResult ProviderResult Result { + pub fn deploy_account_address(&self) -> Result { let undeployed_status = match &self.deployment { DeploymentStatus::Undeployed(value) => value, DeploymentStatus::Deployed(_) => { @@ -54,7 +52,7 @@ impl AccountConfig { undeployed_status.salt, undeployed_status.class_hash, &[oz.public_key], - FieldElement::ZERO, + Felt::ZERO, )), } } @@ -71,7 +69,7 @@ pub enum AccountVariant { pub struct OzAccountConfig { pub version: u64, #[serde_as(as = "UfeHex")] - pub public_key: FieldElement, + pub public_key: Felt, #[serde(default = "true_as_default")] pub legacy: bool, } @@ -84,7 +82,7 @@ pub enum DeploymentStatus { } impl DeploymentStatus { - pub fn to_deployed(&mut self, address: FieldElement) { + pub fn to_deployed(&mut self, address: Felt) { match self { DeploymentStatus::Undeployed(status) => { *self = DeploymentStatus::Deployed(DeployedStatus { @@ -103,27 +101,27 @@ impl DeploymentStatus { #[derive(Serialize, Deserialize)] pub struct UndeployedStatus { #[serde_as(as = "UfeHex")] - pub class_hash: FieldElement, + pub class_hash: Felt, #[serde_as(as = "UfeHex")] - pub salt: FieldElement, + pub salt: Felt, } #[serde_as] #[derive(Serialize, Deserialize)] pub struct DeployedStatus { #[serde_as(as = "UfeHex")] - pub class_hash: FieldElement, + pub class_hash: Felt, #[serde_as(as = "UfeHex")] - pub address: FieldElement, + pub address: Felt, } enum MaxFeeType { - Manual { max_fee: FieldElement }, - Estimated { estimate: FieldElement, estimate_with_buffer: FieldElement }, + Manual { max_fee: Felt }, + Estimated { estimate: Felt, estimate_with_buffer: Felt }, } impl MaxFeeType { - pub fn max_fee(&self) -> FieldElement { + pub fn max_fee(&self) -> Felt { match self { Self::Manual { max_fee } => *max_fee, Self::Estimated { estimate_with_buffer, .. } => *estimate_with_buffer, @@ -133,7 +131,7 @@ impl MaxFeeType { #[derive(Debug)] pub enum FeeSetting { - Manual(FieldElement), + Manual(Felt), EstimateOnly, None, } @@ -191,7 +189,7 @@ pub async fn deploy( provider: JsonRpcClient, signer: LocalWallet, txn_action: TxnAction, - nonce: Option, + nonce: Option, poll_interval: u64, file: PathBuf, no_confirmation: bool, @@ -236,7 +234,7 @@ pub async fn deploy( } }; - let account_deployment = factory.deploy(undeployed_status.salt); + let account_deployment = factory.deploy_v1(undeployed_status.salt); let target_deployment_address = account.deploy_account_address()?; @@ -268,10 +266,10 @@ pub async fn deploy( let fee_estimate_multiplier = fee_estimate_multiplier.unwrap_or(1.1); - let estimated_fee_with_buffer = (((TryInto::::try_into(estimated_fee)? as f64) - * fee_estimate_multiplier) - as u64) - .into(); + let estimated_fee_with_buffer = + (((estimated_fee.to_u64().context("Invalid u64")? as f64) + * fee_estimate_multiplier) as u64) + .into(); MaxFeeType::Estimated { estimate: estimated_fee, @@ -308,7 +306,9 @@ pub async fn deploy( })? .overall_fee; - println!("{} ETH", format!("{}", estimated_fee.to_big_decimal(18)).bright_yellow()); + let decimal = utils::felt_to_bigdecimal(estimated_fee, 18); + println!("{} ETH", format!("{decimal}").bright_yellow()); + Ok(()) } TxnAction::Simulate => { @@ -322,9 +322,9 @@ pub async fn deploy( async fn do_account_deploy( max_fee: MaxFeeType, txn_config: TxnConfig, - target_deployment_address: FieldElement, + target_deployment_address: Felt, no_confirmation: bool, - account_deployment: starknet::accounts::AccountDeployment< + account_deployment: starknet::accounts::AccountDeploymentV1< '_, OpenZeppelinAccountFactory>, >, @@ -337,16 +337,17 @@ async fn do_account_deploy( eprintln!( "You've manually specified the account deployment fee to be {}. Therefore, fund \ at least:\n {}", - format!("{} ETH", max_fee.to_big_decimal(18)).bright_yellow(), - format!("{} ETH", max_fee.to_big_decimal(18)).bright_yellow(), + format!("{} ETH", utils::felt_to_bigdecimal(max_fee, 18)).bright_yellow(), + format!("{} ETH", utils::felt_to_bigdecimal(max_fee, 18)).bright_yellow(), ); } MaxFeeType::Estimated { estimate, estimate_with_buffer } => { eprintln!( "The estimated account deployment fee is {}. However, to avoid failure, fund at \ least:\n {}", - format!("{} ETH", estimate.to_big_decimal(18)).bright_yellow(), - format!("{} ETH", estimate_with_buffer.to_big_decimal(18)).bright_yellow() + format!("{} ETH", utils::felt_to_bigdecimal(estimate, 18)).bright_yellow(), + format!("{} ETH", utils::felt_to_bigdecimal(estimate_with_buffer, 18)) + .bright_yellow() ); } } @@ -412,7 +413,7 @@ fn write_account_to_file(file: PathBuf, account: AccountConfig) -> Result<(), an } async fn simulate_account_deploy( - account_deployment: &starknet::accounts::AccountDeployment< + account_deployment: &starknet::accounts::AccountDeploymentV1< '_, OpenZeppelinAccountFactory>, >, @@ -430,7 +431,7 @@ pub async fn fetch( provider: JsonRpcClient, force: bool, output: PathBuf, - address: FieldElement, + address: Felt, ) -> Result<()> { if output.exists() && !force { anyhow::bail!("account config file already exists"); diff --git a/crates/sozo/ops/src/auth.rs b/crates/sozo/ops/src/auth.rs index 9edb851b48..5abdaec4a2 100644 --- a/crates/sozo/ops/src/auth.rs +++ b/crates/sozo/ops/src/auth.rs @@ -8,21 +8,20 @@ use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use scarb_ui::Ui; use starknet::accounts::{Account, ConnectedAccount}; -use starknet::core::types::{BlockId, BlockTag}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::core::utils::{get_selector_from_name, parse_cairo_short_string}; -use starknet_crypto::FieldElement; use crate::utils; #[derive(Debug, Clone, PartialEq)] pub enum ResourceType { Contract(String), - Model(FieldElement), + Model(Felt), } #[derive(Debug, Clone, PartialEq)] pub struct ModelContract { - pub model: FieldElement, + pub model: Felt, pub contract: String, } @@ -50,7 +49,7 @@ impl FromStr for ModelContract { #[derive(Debug, Clone, PartialEq)] pub struct OwnerResource { pub resource: ResourceType, - pub owner: FieldElement, + pub owner: Felt, } impl FromStr for OwnerResource { @@ -67,7 +66,7 @@ impl FromStr for OwnerResource { ), }; - let owner = FieldElement::from_hex_be(owner_part) + let owner = Felt::from_hex(owner_part) .map_err(|_| anyhow::anyhow!("Invalid owner address: {}", owner_part))?; let resource_parts = resource_part.split_once(':'); @@ -129,7 +128,7 @@ where if !calls.is_empty() { let res = world .account - .execute(calls) + .execute_v1(calls) .send_with_cfg(&txn_config) .await .with_context(|| "Failed to send transaction")?; @@ -178,7 +177,7 @@ where let res = world .account - .execute(calls) + .execute_v1(calls) .send_with_cfg(&txn_config) .await .with_context(|| "Failed to send transaction")?; @@ -235,7 +234,7 @@ where if !calls.is_empty() { let res = world .account - .execute(calls) + .execute_v1(calls) .send_with_cfg(&txn_config) .await .with_context(|| "Failed to send transaction")?; @@ -284,7 +283,7 @@ where let res = world .account - .execute(calls) + .execute_v1(calls) .send_with_cfg(&txn_config) .await .with_context(|| "Failed to send transaction")?; diff --git a/crates/sozo/ops/src/call.rs b/crates/sozo/ops/src/call.rs index 14bb487b5b..3f3a125f40 100644 --- a/crates/sozo/ops/src/call.rs +++ b/crates/sozo/ops/src/call.rs @@ -1,6 +1,6 @@ use anyhow::{Context, Result}; use dojo_world::contracts::WorldContractReader; -use starknet::core::types::{BlockId, BlockTag, FieldElement, FunctionCall}; +use starknet::core::types::{BlockId, BlockTag, Felt, FunctionCall}; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; @@ -10,7 +10,7 @@ pub async fn call( world_reader: WorldContractReader

, contract: String, entrypoint: String, - calldata: Vec, + calldata: Vec, block_id: Option, ) -> Result<()> { let contract_address = get_contract_address_from_reader(&world_reader, contract).await?; diff --git a/crates/sozo/ops/src/events.rs b/crates/sozo/ops/src/events.rs index b567157201..4c7073929a 100644 --- a/crates/sozo/ops/src/events.rs +++ b/crates/sozo/ops/src/events.rs @@ -6,7 +6,7 @@ use cainome::parser::tokens::{CompositeInner, CompositeInnerKind, CoreBasic, Tok use cainome::parser::AbiParser; use camino::Utf8PathBuf; use dojo_world::manifest::{AbiFormat, DeploymentManifest, ManifestMethods, MANIFESTS_DIR}; -use starknet::core::types::{BlockId, EventFilter, FieldElement}; +use starknet::core::types::{BlockId, EventFilter, Felt}; use starknet::core::utils::{parse_cairo_short_string, starknet_keccak}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider}; @@ -15,7 +15,7 @@ pub fn get_event_filter( from_block: Option, to_block: Option, events: Option>, - world_address: Option, + world_address: Option, ) -> EventFilter { let from_block = from_block.map(BlockId::Number); let to_block = to_block.map(BlockId::Number); @@ -143,11 +143,7 @@ fn parse_and_print_events( Ok(()) } -fn parse_core_basic( - cb: &CoreBasic, - value: &FieldElement, - include_felt_string: bool, -) -> Result { +fn parse_core_basic(cb: &CoreBasic, value: &Felt, include_felt_string: bool) -> Result { match cb.type_name().as_str() { "felt252" => { let hex = format!("{:#x}", value); @@ -159,7 +155,7 @@ fn parse_core_basic( } } "bool" => { - if *value == FieldElement::ZERO { + if *value == Felt::ZERO { Ok("false".to_string()) } else { Ok("true".to_string()) @@ -198,8 +194,8 @@ fn parse_event( fn process_inners( inners: &[CompositeInner], - data: &mut VecDeque, - keys: &mut VecDeque, + data: &mut VecDeque, + keys: &mut VecDeque, ) -> Result { let mut ret = String::new(); @@ -362,21 +358,21 @@ mod tests { let event = EmittedEvent { keys: vec![starknet_keccak("TestEvent".as_bytes())], data: vec![ - FieldElement::from_hex_be("0x5465737431").unwrap(), - FieldElement::from(1u8), // bool true - FieldElement::from(1u8), - FieldElement::from(2u16), - FieldElement::from(3u32), - FieldElement::from(4u64), - FieldElement::from(5u128), - FieldElement::from(6usize), - FieldElement::from_hex_be("0x54657374").unwrap(), - FieldElement::from_hex_be("0x54657374").unwrap(), + Felt::from_hex("0x5465737431").unwrap(), + Felt::from(1u8), // bool true + Felt::from(1u8), + Felt::from(2u16), + Felt::from(3u32), + Felt::from(4u64), + Felt::from(5u128), + Felt::from(6usize), + Felt::from_hex("0x54657374").unwrap(), + Felt::from_hex("0x54657374").unwrap(), ], - from_address: FieldElement::from_hex_be("0x123").unwrap(), - block_hash: FieldElement::from_hex_be("0x456").ok(), + from_address: Felt::from_hex("0x123").unwrap(), + block_hash: Felt::from_hex("0x456").ok(), block_number: Some(1), - transaction_hash: FieldElement::from_hex_be("0x789").unwrap(), + transaction_hash: Felt::from_hex("0x789").unwrap(), }; let expected_output = "Event name: dojo::world::world::TestEvent\nfelt252: 0x5465737431 \ @@ -432,16 +428,16 @@ mod tests { let event = EmittedEvent { keys: vec![starknet_keccak("StoreDelRecord".as_bytes())], data: vec![ - FieldElement::from_hex_be("0x54657374").unwrap(), - FieldElement::from(3u128), - FieldElement::from_hex_be("0x5465737431").unwrap(), - FieldElement::from_hex_be("0x5465737432").unwrap(), - FieldElement::from_hex_be("0x5465737433").unwrap(), + Felt::from_hex("0x54657374").unwrap(), + Felt::from(3u128), + Felt::from_hex("0x5465737431").unwrap(), + Felt::from_hex("0x5465737432").unwrap(), + Felt::from_hex("0x5465737433").unwrap(), ], - from_address: FieldElement::from_hex_be("0x123").unwrap(), - block_hash: FieldElement::from_hex_be("0x456").ok(), + from_address: Felt::from_hex("0x123").unwrap(), + block_hash: Felt::from_hex("0x456").ok(), block_number: Some(1), - transaction_hash: FieldElement::from_hex_be("0x789").unwrap(), + transaction_hash: Felt::from_hex("0x789").unwrap(), }; let expected_output = "Event name: dojo::world::world::StoreDelRecord\ntable: 0x54657374 \ @@ -508,14 +504,14 @@ mod tests { let event = EmittedEvent { keys: vec![ starknet_keccak("CustomEvent".as_bytes()), - FieldElement::from(3u128), - FieldElement::from_hex_be("0x5465737431").unwrap(), + Felt::from(3u128), + Felt::from_hex("0x5465737431").unwrap(), ], - data: vec![FieldElement::from(1u128), FieldElement::from(2u128)], - from_address: FieldElement::from_hex_be("0x123").unwrap(), - block_hash: FieldElement::from_hex_be("0x456").ok(), + data: vec![Felt::from(1u128), Felt::from(2u128)], + from_address: Felt::from_hex("0x123").unwrap(), + block_hash: Felt::from_hex("0x456").ok(), block_number: Some(1), - transaction_hash: FieldElement::from_hex_be("0x789").unwrap(), + transaction_hash: Felt::from_hex("0x789").unwrap(), }; let expected_output = "Event name: dojo::world::world::CustomEvent\nkey_1: 3\nkey_2: \ @@ -570,16 +566,16 @@ mod tests { let event = EmittedEvent { keys: vec![starknet_keccak("StoreDelRecord".as_bytes())], data: vec![ - FieldElement::from_hex_be("0x0").unwrap(), - FieldElement::from(3u128), - FieldElement::from_hex_be("0x0").unwrap(), - FieldElement::from_hex_be("0x1").unwrap(), - FieldElement::from_hex_be("0x2").unwrap(), + Felt::from_hex("0x0").unwrap(), + Felt::from(3u128), + Felt::from_hex("0x0").unwrap(), + Felt::from_hex("0x1").unwrap(), + Felt::from_hex("0x2").unwrap(), ], - from_address: FieldElement::from_hex_be("0x123").unwrap(), - block_hash: FieldElement::from_hex_be("0x456").ok(), + from_address: Felt::from_hex("0x123").unwrap(), + block_hash: Felt::from_hex("0x456").ok(), block_number: Some(1), - transaction_hash: FieldElement::from_hex_be("0x789").unwrap(), + transaction_hash: Felt::from_hex("0x789").unwrap(), }; let expected_output = "Event name: dojo::world::world::StoreDelRecord\ntable: 0x0\nkeys: \ diff --git a/crates/sozo/ops/src/execute.rs b/crates/sozo/ops/src/execute.rs index ad5054b14a..5fc69a9727 100644 --- a/crates/sozo/ops/src/execute.rs +++ b/crates/sozo/ops/src/execute.rs @@ -4,7 +4,7 @@ use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use scarb_ui::Ui; use starknet::accounts::{Call, ConnectedAccount}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::get_selector_from_name; use crate::utils; @@ -13,7 +13,7 @@ pub async fn execute( ui: &Ui, contract: String, entrypoint: String, - calldata: Vec, + calldata: Vec, world: &WorldContract, txn_config: &TxnConfig, ) -> Result<()> @@ -23,7 +23,7 @@ where let contract_address = utils::get_contract_address(world, contract).await?; let res = world .account - .execute(vec![Call { + .execute_v1(vec![Call { calldata, to: contract_address, selector: get_selector_from_name(&entrypoint)?, diff --git a/crates/sozo/ops/src/keystore.rs b/crates/sozo/ops/src/keystore.rs index fcfa19d902..0f3adb15a2 100644 --- a/crates/sozo/ops/src/keystore.rs +++ b/crates/sozo/ops/src/keystore.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use anyhow::{bail, Result}; use colored::Colorize; use starknet::signers::SigningKey; -use starknet_crypto::FieldElement; +use starknet_crypto::Felt; pub fn new(password: Option, force: bool, file: PathBuf) -> Result<()> { if file.exists() && !force { @@ -36,7 +36,7 @@ pub fn from_key( } else { rpassword::prompt_password("Enter private key: ")? }; - let private_key = FieldElement::from_hex_be(private_key.trim())?; + let private_key = Felt::from_hex(private_key.trim())?; let password = get_password(password, false)?; diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index 1ab610e24e..d948f9305c 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -23,13 +23,12 @@ use scarb::core::Workspace; use scarb_ui::Ui; use starknet::accounts::ConnectedAccount; use starknet::core::types::{ - BlockId, BlockTag, FunctionCall, InvokeTransactionResult, StarknetError, + BlockId, BlockTag, Felt, FunctionCall, InvokeTransactionResult, StarknetError, }; use starknet::core::utils::{ cairo_short_string_to_felt, get_contract_address, get_selector_from_name, }; use starknet::providers::{Provider, ProviderError}; -use starknet_crypto::FieldElement; use tokio::fs; use super::ui::{bold_message, italic_message, MigrationUi}; @@ -41,7 +40,7 @@ pub fn prepare_migration( target_dir: &Utf8PathBuf, diff: WorldDiff, name: &str, - world_address: Option, + world_address: Option, ui: &Ui, ) -> Result { ui.print_step(3, "📦", "Preparing for migration..."); @@ -128,7 +127,7 @@ where A::SignError: 'static, { let ui = ws.config().ui(); - let mut world_tx_hash: Option = None; + let mut world_tx_hash: Option = None; let mut world_block_number: Option = None; match &strategy.base { @@ -256,7 +255,7 @@ where /// on success. async fn upload_on_ipfs_and_create_resource( ui: &Ui, - resource_id: FieldElement, + resource_id: Felt, metadata: ResourceMetadata, ) -> Result { match metadata.upload().await { @@ -277,10 +276,7 @@ async fn upload_on_ipfs_and_create_resource( /// # Returns /// A [`ResourceData`] object to register in the Dojo resource register /// on success. -fn create_resource_metadata( - resource_id: FieldElement, - hash: String, -) -> Result { +fn create_resource_metadata(resource_id: Felt, hash: String) -> Result { let metadata_uri = cairo_utils::encode_uri(&format!("ipfs://{hash}"))?; Ok(world::ResourceMetadata { resource_id, metadata_uri }) } @@ -321,7 +317,7 @@ where if migration_output.world_tx_hash.is_some() { match dojo_metadata.world.upload().await { Ok(hash) => { - let resource = create_resource_metadata(FieldElement::ZERO, hash.clone())?; + let resource = create_resource_metadata(Felt::ZERO, hash.clone())?; ui.print_sub(format!("world: ipfs://{}", hash)); resources.push(resource); } @@ -374,7 +370,7 @@ where let calls = resources.iter().map(|r| world.set_metadata_getcall(r)).collect::>(); let InvokeTransactionResult { transaction_hash } = - migrator.execute(calls).send_with_cfg(&txn_config).await.map_err(|e| { + migrator.execute_v1(calls).send_with_cfg(&txn_config).await.map_err(|e| { ui.verbose(format!("{e:?}")); anyhow!("Failed to register metadata into the resource registry: {e}") })?; @@ -394,7 +390,7 @@ where async fn register_dojo_models( models: &[ClassMigration], - world_address: FieldElement, + world_address: Felt, migrator: A, ui: &Ui, txn_config: &TxnConfig, @@ -405,7 +401,7 @@ where { if models.is_empty() { return Ok(RegisterOutput { - transaction_hash: FieldElement::ZERO, + transaction_hash: Felt::ZERO, declare_output: vec![], registered_model_names: vec![], }); @@ -455,7 +451,7 @@ where .collect::>(); let InvokeTransactionResult { transaction_hash } = - world.account.execute(calls).send_with_cfg(txn_config).await.map_err(|e| { + world.account.execute_v1(calls).send_with_cfg(txn_config).await.map_err(|e| { ui.verbose(format!("{e:?}")); anyhow!("Failed to register models to World: {e}") })?; @@ -469,7 +465,7 @@ where async fn register_dojo_contracts( contracts: &Vec, - world_address: FieldElement, + world_address: Felt, migrator: A, ui: &Ui, txn_config: &TxnConfig, @@ -558,7 +554,7 @@ where async fn deploy_contract( contract: &ContractMigration, contract_id: &str, - constructor_calldata: Vec, + constructor_calldata: Vec, migrator: A, ui: &Ui, txn_config: &TxnConfig, @@ -600,8 +596,8 @@ where async fn upgrade_contract( contract: &ContractMigration, contract_id: &str, - original_class_hash: FieldElement, - original_base_class_hash: FieldElement, + original_class_hash: Felt, + original_base_class_hash: Felt, migrator: A, ui: &Ui, txn_config: &TxnConfig, @@ -656,7 +652,7 @@ pub fn handle_artifact_error(ui: &Ui, artifact_path: &Path, error: anyhow::Error pub async fn get_contract_operation_name

( provider: P, contract: &ContractMigration, - world_address: Option, + world_address: Option, ) -> String where P: Provider + Sync + Send, @@ -698,7 +694,7 @@ pub async fn print_strategy

( ui: &Ui, provider: P, strategy: &MigrationStrategy, - world_address: FieldElement, + world_address: Felt, ) where P: Provider + Sync + Send, { @@ -756,7 +752,7 @@ pub async fn update_manifests_and_abis( manifest_dir: &Utf8PathBuf, profile_name: &str, rpc_url: &str, - world_address: FieldElement, + world_address: Felt, migration_output: Option, salt: &str, ) -> Result<()> { @@ -809,7 +805,7 @@ pub async fn update_manifests_and_abis( } local_manifest.contracts.iter_mut().for_each(|contract| { - if contract.inner.base_class_hash != FieldElement::ZERO { + if contract.inner.base_class_hash != Felt::ZERO { let salt = generate_salt(&contract.name); contract.inner.address = Some(get_contract_address( salt, diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index 915fb5fa5e..e234759dff 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -13,7 +13,7 @@ use dojo_world::migration::world::WorldDiff; use dojo_world::migration::{DeployOutput, TxnConfig, UpgradeOutput}; use scarb::core::Workspace; use starknet::accounts::ConnectedAccount; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; mod auto_auth; mod migrate; @@ -29,8 +29,8 @@ use self::ui::MigrationUi; #[derive(Debug, Default, Clone)] pub struct MigrationOutput { - pub world_address: FieldElement, - pub world_tx_hash: Option, + pub world_address: Felt, + pub world_tx_hash: Option, pub world_block_number: Option, // Represents if full migration got completeled. // If false that means migration got partially completed. @@ -43,14 +43,14 @@ pub struct MigrationOutput { #[derive(Debug, Default, Clone)] pub struct ContractMigrationOutput { pub name: String, - pub contract_address: FieldElement, - pub base_class_hash: FieldElement, + pub contract_address: Felt, + pub base_class_hash: Felt, } #[allow(clippy::too_many_arguments)] pub async fn migrate( ws: &Workspace<'_>, - world_address: Option, + world_address: Option, rpc_url: String, account: A, name: &str, @@ -174,7 +174,7 @@ where #[allow(dead_code)] enum ContractDeploymentOutput { - AlreadyDeployed(FieldElement), + AlreadyDeployed(Felt), Output(DeployOutput), } diff --git a/crates/sozo/ops/src/migration/utils.rs b/crates/sozo/ops/src/migration/utils.rs index 1afe38f305..88a52a8e13 100644 --- a/crates/sozo/ops/src/migration/utils.rs +++ b/crates/sozo/ops/src/migration/utils.rs @@ -6,7 +6,7 @@ use dojo_world::manifest::{ }; use scarb_ui::Ui; use starknet::accounts::ConnectedAccount; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use super::ui::MigrationUi; @@ -16,7 +16,7 @@ use super::ui::MigrationUi; pub(super) async fn load_world_manifests( profile_dir: &Utf8PathBuf, account: A, - world_address: Option, + world_address: Option, ui: &Ui, skip_migration: Option>, ) -> Result<(BaseManifest, Option)> diff --git a/crates/sozo/ops/src/model.rs b/crates/sozo/ops/src/model.rs index 1bfe108e96..8bf245c3ea 100644 --- a/crates/sozo/ops/src/model.rs +++ b/crates/sozo/ops/src/model.rs @@ -3,7 +3,8 @@ use cainome::cairo_serde::{ByteArray, CairoSerde}; use dojo_types::schema::Ty; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; -use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use num_traits::ToPrimitive; +use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; @@ -12,7 +13,7 @@ const INDENT: &str = " "; pub async fn model_class_hash( name: String, - world_address: FieldElement, + world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { let mut world_reader = WorldContractReader::new(world_address, &provider); @@ -27,7 +28,7 @@ pub async fn model_class_hash( pub async fn model_contract_address( name: String, - world_address: FieldElement, + world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { let mut world_reader = WorldContractReader::new(world_address, &provider); @@ -42,7 +43,7 @@ pub async fn model_contract_address( pub async fn model_layout( name: String, - world_address: FieldElement, + world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { let mut world_reader = WorldContractReader::new(world_address, &provider); @@ -65,7 +66,7 @@ pub async fn model_layout( pub async fn model_schema( name: String, - world_address: FieldElement, + world_address: Felt, provider: JsonRpcClient, to_json: bool, ) -> Result<()> { @@ -86,8 +87,8 @@ pub async fn model_schema( pub async fn model_get( name: String, - keys: Vec, - world_address: FieldElement, + keys: Vec, + world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { if keys.is_empty() { @@ -399,7 +400,7 @@ fn _start_indent(level: usize, start_indent: bool) -> String { fn format_primitive( p: &dojo_types::primitive::Primitive, - values: &mut Vec, + values: &mut Vec, level: usize, start_indent: bool, ) -> String { @@ -409,7 +410,7 @@ fn format_primitive( format!("{}{}", _start_indent(level, start_indent), _p.to_sql_value().unwrap()) } -fn format_byte_array(values: &mut Vec, level: usize, start_indent: bool) -> String { +fn format_byte_array(values: &mut Vec, level: usize, start_indent: bool) -> String { let bytearray = ByteArray::cairo_deserialize(values, 0).unwrap(); values.drain(0..ByteArray::cairo_serialized_size(&bytearray)); @@ -418,7 +419,7 @@ fn format_byte_array(values: &mut Vec, level: usize, start_indent: fn format_field_value( member: &dojo_types::schema::Member, - values: &mut Vec, + values: &mut Vec, level: usize, ) -> String { let field_repr = format_record_value(&member.ty, values, level, false); @@ -427,11 +428,11 @@ fn format_field_value( fn format_array( item: &dojo_types::schema::Ty, - values: &mut Vec, + values: &mut Vec, level: usize, start_indent: bool, ) -> String { - let length: u32 = values.remove(0).try_into().unwrap(); + let length: u32 = values.remove(0).to_u32().unwrap(); let mut items = vec![]; for _ in 0..length { @@ -448,7 +449,7 @@ fn format_array( fn format_tuple( items: &[dojo_types::schema::Ty], - values: &mut Vec, + values: &mut Vec, level: usize, start_indent: bool, ) -> String { @@ -467,7 +468,7 @@ fn format_tuple( fn format_struct( schema: &dojo_types::schema::Struct, - values: &mut Vec, + values: &mut Vec, level: usize, start_indent: bool, ) -> String { @@ -487,11 +488,11 @@ fn format_struct( fn format_enum( schema: &dojo_types::schema::Enum, - values: &mut Vec, + values: &mut Vec, level: usize, start_indent: bool, ) -> String { - let variant_index: u8 = values.remove(0).try_into().unwrap(); + let variant_index: u8 = values.remove(0).to_u8().unwrap(); let variant_index: usize = variant_index.into(); let variant_name = format!("{}::{}", schema.name, schema.options[variant_index].name); let variant_data = @@ -511,7 +512,7 @@ fn format_enum( fn format_record_value( schema: &dojo_types::schema::Ty, - values: &mut Vec, + values: &mut Vec, level: usize, start_indent: bool, ) -> String { @@ -526,11 +527,7 @@ fn format_record_value( } // print the structured record values -fn deep_print_record( - schema: &dojo_types::schema::Ty, - keys: &[FieldElement], - values: &[FieldElement], -) { +fn deep_print_record(schema: &dojo_types::schema::Ty, keys: &[Felt], values: &[Felt]) { let mut model_values = vec![]; model_values.extend(keys); model_values.extend(values); diff --git a/crates/sozo/ops/src/register.rs b/crates/sozo/ops/src/register.rs index c1edf97264..8a094d47e8 100644 --- a/crates/sozo/ops/src/register.rs +++ b/crates/sozo/ops/src/register.rs @@ -8,17 +8,17 @@ use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use scarb::core::Config; use starknet::accounts::ConnectedAccount; +use starknet::core::types::Felt; use starknet::providers::Provider; -use starknet_crypto::FieldElement; use crate::utils::handle_transaction_result; pub async fn model_register( - models: Vec, + models: Vec, world: &WorldContract, txn_config: TxnConfig, world_reader: WorldContractReader

, - world_address: FieldElement, + world_address: Felt, config: &Config, ) -> Result<()> where @@ -66,7 +66,7 @@ where let res = world .account - .execute(calls) + .execute_v1(calls) .send_with_cfg(&txn_config) .await .with_context(|| "Failed to send transaction")?; diff --git a/crates/sozo/ops/src/tests/call.rs b/crates/sozo/ops/src/tests/call.rs index 84d6c4f5bc..26c0f3802e 100644 --- a/crates/sozo/ops/src/tests/call.rs +++ b/crates/sozo/ops/src/tests/call.rs @@ -1,10 +1,10 @@ use dojo_world::contracts::WorldContractReader; use katana_runner::KatanaRunner; use starknet::accounts::SingleOwnerAccount; +use starknet::core::types::Felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use starknet::signers::LocalWallet; -use starknet_crypto::FieldElement; use super::setup; use crate::{call, utils}; @@ -25,7 +25,7 @@ async fn call_with_bad_address() { world_reader, "0xBadCoffeeBadCode".to_string(), ENTRYPOINT.to_string(), - vec![FieldElement::ZERO, FieldElement::ZERO], + vec![Felt::ZERO, Felt::ZERO], None ) .await @@ -46,7 +46,7 @@ async fn call_with_bad_name() { world_reader, "BadName".to_string(), ENTRYPOINT.to_string(), - vec![FieldElement::ZERO, FieldElement::ZERO], + vec![Felt::ZERO, Felt::ZERO], None ) .await @@ -67,7 +67,7 @@ async fn call_with_bad_entrypoint() { world_reader, CONTRACT_NAME.to_string(), "BadEntryPoint".to_string(), - vec![FieldElement::ZERO, FieldElement::ZERO], + vec![Felt::ZERO, Felt::ZERO], None ) .await @@ -103,7 +103,7 @@ async fn call_with_contract_name() { world_reader, CONTRACT_NAME.to_string(), ENTRYPOINT.to_string(), - vec![FieldElement::ZERO, FieldElement::ZERO], + vec![Felt::ZERO, Felt::ZERO], None, ) .await @@ -130,7 +130,7 @@ async fn call_with_contract_address() { world_reader, format!("{:#x}", contract_address), ENTRYPOINT.to_string(), - vec![FieldElement::ZERO, FieldElement::ZERO], + vec![Felt::ZERO, Felt::ZERO], None, ) .await diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 1cc6b0b3a8..16fd117229 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -18,12 +18,11 @@ use dojo_world::migration::TxnConfig; use futures::TryStreamExt; use ipfs_api_backend_hyper::{HyperBackend, IpfsApi, IpfsClient, TryFromUri}; use katana_runner::{KatanaRunner, KatanaRunnerConfig}; -use starknet::core::types::{BlockId, BlockTag}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::core::utils::get_selector_from_name; use starknet::macros::felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; -use starknet_crypto::FieldElement; use super::setup; use crate::migration::{auto_authorize, execute_strategy, upload_metadata}; @@ -275,7 +274,7 @@ async fn migrate_with_metadata() { dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); // check world metadata - let resource = world_reader.metadata(&FieldElement::ZERO).call().await.unwrap(); + let resource = world_reader.metadata(&Felt::ZERO).call().await.unwrap(); let element_name = WORLD_CONTRACT_NAME.to_string(); let full_uri = resource.metadata_uri.to_string().unwrap(); @@ -586,7 +585,7 @@ async fn check_ipfs_metadata( async fn check_artifact_metadata( client: &HyperBackend, world_reader: &WorldContractReader

, - resource_id: FieldElement, + resource_id: Felt, element_name: &String, dojo_metadata: &DojoMetadata, ) { diff --git a/crates/sozo/ops/src/tests/utils.rs b/crates/sozo/ops/src/tests/utils.rs index 6fe0351fd4..70cb3e03c4 100644 --- a/crates/sozo/ops/src/tests/utils.rs +++ b/crates/sozo/ops/src/tests/utils.rs @@ -2,7 +2,7 @@ use dojo_world::contracts::world::WorldContract; use dojo_world::contracts::WorldContractReader; use katana_runner::KatanaRunner; use starknet::accounts::ConnectedAccount; -use starknet::core::types::{BlockId, BlockTag, FieldElement}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use super::setup; use crate::utils; @@ -18,7 +18,7 @@ async fn get_contract_address_from_world() { let contract_address = utils::get_contract_address(&world, ACTION_CONTRACT_NAME.to_string()).await.unwrap(); - assert!(contract_address != FieldElement::ZERO); + assert!(contract_address != Felt::ZERO); } #[tokio::test(flavor = "multi_thread")] @@ -26,11 +26,11 @@ async fn get_contract_address_from_string() { let sequencer = KatanaRunner::new().expect("Failed to start runner."); let account = sequencer.account(0); - let world = WorldContract::new(FieldElement::ZERO, account); + let world = WorldContract::new(Felt::ZERO, account); let contract_address = utils::get_contract_address(&world, "0x1234".to_string()).await.unwrap(); - assert_eq!(contract_address, FieldElement::from_hex_be("0x1234").unwrap()); + assert_eq!(contract_address, Felt::from_hex("0x1234").unwrap()); } #[tokio::test(flavor = "multi_thread")] @@ -47,7 +47,7 @@ async fn get_contract_address_from_world_with_world_reader() { .await .unwrap(); - assert!(contract_address != FieldElement::ZERO); + assert!(contract_address != Felt::ZERO); } #[tokio::test(flavor = "multi_thread")] @@ -56,12 +56,12 @@ async fn get_contract_address_from_string_with_world_reader() { let account = sequencer.account(0); let provider = account.provider(); - let world_reader = WorldContractReader::new(FieldElement::ZERO, provider); + let world_reader = WorldContractReader::new(Felt::ZERO, provider); let contract_address = utils::get_contract_address_from_reader(&world_reader, "0x1234".to_string()).await.unwrap(); - assert_eq!(contract_address, FieldElement::from_hex_be("0x1234").unwrap()); + assert_eq!(contract_address, Felt::from_hex("0x1234").unwrap()); } #[test] @@ -78,7 +78,7 @@ fn parse_block_id_bad_string() { fn parse_block_id_hash() { assert!( utils::parse_block_id("0x1234".to_string()).unwrap() - == BlockId::Hash(FieldElement::from_hex_be("0x1234").unwrap()) + == BlockId::Hash(Felt::from_hex("0x1234").unwrap()) ); } diff --git a/crates/sozo/ops/src/utils.rs b/crates/sozo/ops/src/utils.rs index 5fd777fc11..aeb5407959 100644 --- a/crates/sozo/ops/src/utils.rs +++ b/crates/sozo/ops/src/utils.rs @@ -1,17 +1,16 @@ use anyhow::{anyhow, Result}; -use dojo_world::contracts::world::{WorldContract, WorldContractReader}; +use bigdecimal::BigDecimal; +use dojo_world::contracts::{WorldContract, WorldContractReader}; use dojo_world::migration::strategy::generate_salt; -use dojo_world::utils::{execution_status_from_maybe_pending_receipt, TransactionWaiter}; +use dojo_world::utils::{execution_status_from_receipt, TransactionWaiter}; use scarb_ui::Ui; use starknet::accounts::ConnectedAccount; -use starknet::core::types::{ - BlockId, BlockTag, ExecutionResult, FieldElement, InvokeTransactionResult, -}; +use starknet::core::types::{BlockId, BlockTag, ExecutionResult, Felt, InvokeTransactionResult}; use starknet::providers::Provider; /// Retrieves a contract address from it's name /// using the world's data, or parses a hex string into -/// a [`FieldElement`]. +/// a [`Felt`]. /// /// # Arguments /// @@ -20,13 +19,13 @@ use starknet::providers::Provider; /// /// # Returns /// -/// A [`FieldElement`] with the address of the contract on success. +/// A [`Felt`] with the address of the contract on success. pub async fn get_contract_address( world: &WorldContract, name_or_address: String, -) -> Result { +) -> Result { if name_or_address.starts_with("0x") { - FieldElement::from_hex_be(&name_or_address).map_err(anyhow::Error::from) + Felt::from_hex(&name_or_address).map_err(anyhow::Error::from) } else { let contract_class_hash = world.base().call().await?; Ok(starknet::core::utils::get_contract_address( @@ -40,7 +39,7 @@ pub async fn get_contract_address( /// Retrieves a contract address from its name /// using a world contract reader, or parses a hex string into -/// a [`FieldElement`]. +/// a [`Felt`]. /// /// # Arguments /// @@ -49,13 +48,13 @@ pub async fn get_contract_address( /// /// # Returns /// -/// A [`FieldElement`] with the address of the contract on success. +/// A [`Felt`] with the address of the contract on success. pub async fn get_contract_address_from_reader( world_reader: &WorldContractReader

, name_or_address: String, -) -> Result { +) -> Result { if name_or_address.starts_with("0x") { - FieldElement::from_hex_be(&name_or_address).map_err(anyhow::Error::from) + Felt::from_hex(&name_or_address).map_err(anyhow::Error::from) } else { let contract_class_hash = world_reader.base().call().await?; Ok(starknet::core::utils::get_contract_address( @@ -95,7 +94,7 @@ where if show_receipt { ui.print(format!("Receipt:\n{}", serde_json::to_string_pretty(&receipt)?)); } else { - match execution_status_from_maybe_pending_receipt(&receipt) { + match execution_status_from_receipt(&receipt.receipt) { ExecutionResult::Succeeded => { ui.print("Status: OK".to_string()); } @@ -122,7 +121,7 @@ where /// The parsed [`BlockId`] on success. pub fn parse_block_id(block_str: String) -> Result { if block_str.starts_with("0x") { - let hash = FieldElement::from_hex_be(&block_str) + let hash = Felt::from_hex(&block_str) .map_err(|_| anyhow!("Unable to parse block hash: {}", block_str))?; Ok(BlockId::Hash(hash)) } else if block_str.eq("pending") { @@ -136,3 +135,12 @@ pub fn parse_block_id(block_str: String) -> Result { } } } + +/// Convert a [`Felt`] into a [`BigDecimal`] with a given number of decimals. +pub fn felt_to_bigdecimal(felt: F, decimals: D) -> BigDecimal +where + F: AsRef, + D: Into, +{ + BigDecimal::from((felt.as_ref().to_bigint(), decimals.into())) +} diff --git a/crates/sozo/signers/src/lib.rs b/crates/sozo/signers/src/lib.rs index 3c3816aed8..b833a6dc0c 100644 --- a/crates/sozo/signers/src/lib.rs +++ b/crates/sozo/signers/src/lib.rs @@ -1,6 +1,6 @@ use std::env; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::signers::{LocalWallet, SigningKey}; pub trait FromEnv { @@ -12,7 +12,7 @@ pub trait FromEnv { impl FromEnv for LocalWallet { fn from_env() -> anyhow::Result { let private_key_str = env::var("STARK_PRIVATE_KEY")?; - let private_key = FieldElement::from_hex_be(&private_key_str)?; + let private_key = Felt::from_hex(&private_key_str)?; Ok(LocalWallet::from_signing_key(SigningKey::from_secret_scalar(private_key))) } diff --git a/crates/torii/client/Cargo.toml b/crates/torii/client/Cargo.toml index ba8775d482..97023170ec 100644 --- a/crates/torii/client/Cargo.toml +++ b/crates/torii/client/Cargo.toml @@ -13,6 +13,7 @@ dojo-world = { path = "../../dojo-world", features = [ "contracts" ] } futures-util.workspace = true futures.workspace = true libp2p-gossipsub = "0.46.1" +num-traits.workspace = true parking_lot.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index 0f7a096317..d68b73e199 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -12,14 +12,14 @@ use dojo_types::WorldMetadata; use dojo_world::contracts::WorldContractReader; use futures::lock::Mutex; use parking_lot::{RwLock, RwLockReadGuard}; +use starknet::core::types::Felt; use starknet::core::utils::cairo_short_string_to_felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; -use starknet_crypto::FieldElement; use tokio::sync::RwLock as AsyncRwLock; use torii_grpc::client::{EntityUpdateStreaming, EventUpdateStreaming, ModelDiffsStreaming}; use torii_grpc::proto::world::{RetrieveEntitiesResponse, RetrieveEventsResponse}; -use torii_grpc::types::schema::{Entity, SchemaError}; +use torii_grpc::types::schema::Entity; use torii_grpc::types::{EntityKeysClause, Event, EventQuery, KeysClause, ModelKeysClause, Query}; use torii_relay::client::EventLoop; use torii_relay::types::Message; @@ -55,7 +55,7 @@ impl Client { torii_url: String, rpc_url: String, relay_url: String, - world: FieldElement, + world: Felt, ) -> Result { let mut grpc_client = torii_grpc::client::WorldClient::new(torii_url, world).await?; @@ -135,11 +135,7 @@ impl Client { pub async fn starknet_events(&self, query: EventQuery) -> Result, Error> { let mut grpc_client = self.inner.write().await; let RetrieveEventsResponse { events } = grpc_client.retrieve_events(query).await?; - Ok(events - .into_iter() - .map(TryInto::try_into) - .collect::, _>>() - .map_err(SchemaError::SliceError)?) + Ok(events.into_iter().map(Event::from).collect::>()) } /// A direct stream to grpc subscribe entities @@ -283,7 +279,7 @@ impl Client { Ok(stream) } - async fn initiate_model(&self, model: &str, keys: Vec) -> Result<(), Error> { + async fn initiate_model(&self, model: &str, keys: Vec) -> Result<(), Error> { let model_reader = self.world_reader.model_reader(model).await?; let values = model_reader.entity_storage(&keys).await?; self.storage.set_model_storage( diff --git a/crates/torii/client/src/client/storage.rs b/crates/torii/client/src/client/storage.rs index cc20ac2d92..7b13f2b180 100644 --- a/crates/torii/client/src/client/storage.rs +++ b/crates/torii/client/src/client/storage.rs @@ -4,16 +4,16 @@ use std::sync::Arc; use dojo_types::WorldMetadata; use futures::channel::mpsc::{channel, Receiver, Sender}; use parking_lot::{Mutex, RwLock}; +use starknet::core::types::Felt; use starknet::core::utils::parse_cairo_short_string; -use starknet_crypto::FieldElement; use super::error::{Error, ParseError}; use crate::utils::compute_all_storage_addresses; -pub type EntityKeys = Vec; +pub type EntityKeys = Vec; -pub type StorageKey = FieldElement; -pub type StorageValue = FieldElement; +pub type StorageKey = Felt; +pub type StorageValue = Felt; /// An in-memory storage for storing the component values of entities. // TODO: check if we can use sql db instead. @@ -21,7 +21,7 @@ pub struct ModelStorage { metadata: Arc>, storage: RwLock>, // a map of model name to a set of model keys. - model_index: RwLock>>, + model_index: RwLock>>, // listener for storage updates. senders: Mutex>>, @@ -47,11 +47,7 @@ impl ModelStorage { /// /// # Returns /// A receiver that will receive updates for the specified storage keys. - pub fn add_listener( - &self, - model: FieldElement, - keys: &[FieldElement], - ) -> Result, Error> { + pub fn add_listener(&self, model: Felt, keys: &[Felt]) -> Result, Error> { let storage_addresses = self.get_model_storage_addresses(model, keys)?; let (sender, receiver) = channel(128); @@ -68,9 +64,9 @@ impl ModelStorage { /// Retrieves the raw values of an model. pub fn get_model_storage( &self, - model: FieldElement, - raw_keys: &[FieldElement], - ) -> Result>, Error> { + model: Felt, + raw_keys: &[Felt], + ) -> Result>, Error> { let storage_addresses = self.get_model_storage_addresses(model, raw_keys)?; Ok(storage_addresses .into_iter() @@ -81,9 +77,9 @@ impl ModelStorage { /// Set the raw values of an model. pub fn set_model_storage( &self, - model: FieldElement, - raw_keys: Vec, - raw_values: Vec, + model: Felt, + raw_keys: Vec, + raw_values: Vec, ) -> Result<(), Error> { let storage_addresses = self.get_model_storage_addresses(model, &raw_keys)?; self.set_storages_at(storage_addresses.into_iter().zip(raw_values).collect()); @@ -93,7 +89,7 @@ impl ModelStorage { } /// Set the value of storage slots in bulk - pub(super) fn set_storages_at(&self, storage_models: Vec<(FieldElement, FieldElement)>) { + pub(super) fn set_storages_at(&self, storage_models: Vec<(Felt, Felt)>) { let mut senders: HashSet = Default::default(); for (key, _) in &storage_models { @@ -119,9 +115,9 @@ impl ModelStorage { fn get_model_storage_addresses( &self, - model: FieldElement, - raw_keys: &[FieldElement], - ) -> Result, Error> { + model: Felt, + raw_keys: &[Felt], + ) -> Result, Error> { let model_name = parse_cairo_short_string(&model).map_err(ParseError::ParseCairoShortString)?; @@ -135,7 +131,7 @@ impl ModelStorage { Ok(compute_all_storage_addresses(model, raw_keys, model_packed_size)) } - fn index_model(&self, model: FieldElement, raw_keys: Vec) { + fn index_model(&self, model: Felt, raw_keys: Vec) { self.model_index.write().entry(model).or_default().insert(raw_keys); } } diff --git a/crates/torii/client/src/client/subscription.rs b/crates/torii/client/src/client/subscription.rs index 73415975e3..0a02cc67c1 100644 --- a/crates/torii/client/src/client/subscription.rs +++ b/crates/torii/client/src/client/subscription.rs @@ -8,9 +8,8 @@ use dojo_types::WorldMetadata; use futures::channel::mpsc::{self, Receiver, Sender}; use futures_util::StreamExt; use parking_lot::{Mutex, RwLock}; -use starknet::core::types::{StateDiff, StateUpdate}; +use starknet::core::types::{Felt, StateDiff, StateUpdate}; use starknet::core::utils::cairo_short_string_to_felt; -use starknet_crypto::FieldElement; use torii_grpc::client::ModelDiffsStreaming; use torii_grpc::types::ModelKeysClause; @@ -26,7 +25,7 @@ pub struct SubscribedModels { metadata: Arc>, pub(crate) models_keys: RwLock>, /// All the relevant storage addresses derived from the subscribed models - pub(crate) subscribed_storage_addresses: RwLock>, + pub(crate) subscribed_storage_addresses: RwLock>, } impl SubscribedModels { @@ -199,7 +198,7 @@ impl SubscriptionService { return; }; - let entries: Vec<(FieldElement, FieldElement)> = { + let entries: Vec<(Felt, Felt)> = { let subscribed_models = self.subscribed_models.subscribed_storage_addresses.read(); entries .into_iter() diff --git a/crates/torii/client/src/utils.rs b/crates/torii/client/src/utils.rs index 77cefb837b..b476ba91c3 100644 --- a/crates/torii/client/src/utils.rs +++ b/crates/torii/client/src/utils.rs @@ -1,21 +1,22 @@ +use num_traits::FromPrimitive; +use starknet::core::types::Felt; use starknet::macros::short_string; -use starknet_crypto::{poseidon_hash_many, FieldElement}; +use starknet_crypto::poseidon_hash_many; /// Compute the base storage address for a given component of an entity. -pub fn compute_storage_base_address( - model: FieldElement, - entity_keys: &[FieldElement], -) -> FieldElement { +pub fn compute_storage_base_address(model: Felt, entity_keys: &[Felt]) -> Felt { poseidon_hash_many(&[short_string!("dojo_storage"), model, poseidon_hash_many(entity_keys)]) } /// Compute all the storage addresses that are used for a given component of an entity when it is /// stored in the World storage. pub(crate) fn compute_all_storage_addresses( - model: FieldElement, - entity_keys: &[FieldElement], + model: Felt, + entity_keys: &[Felt], packed_size: u32, -) -> Vec { +) -> Vec { let base = compute_storage_base_address(model, entity_keys); - (0..packed_size).map(|i| base + i.into()).collect::>() + (0..packed_size) + .map(|i| base + Felt::from_u32(i).expect("u32 should fit in Felt")) + .collect::>() } diff --git a/crates/torii/core/Cargo.toml b/crates/torii/core/Cargo.toml index 4f0168d20f..8ca61922eb 100644 --- a/crates/torii/core/Cargo.toml +++ b/crates/torii/core/Cargo.toml @@ -22,6 +22,7 @@ futures-util.workspace = true hex.workspace = true lazy_static.workspace = true log.workspace = true +num-traits.workspace = true once_cell.workspace = true reqwest.workspace = true scarb-ui.workspace = true diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index 409c879ef1..9e1d7906f6 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -4,12 +4,12 @@ use std::time::Duration; use anyhow::Result; use dojo_world::contracts::world::WorldContractReader; use starknet::core::types::{ - BlockId, BlockTag, Event, EventFilter, MaybePendingBlockWithTxHashes, MaybePendingBlockWithTxs, - MaybePendingTransactionReceipt, PendingTransactionReceipt, Transaction, TransactionReceipt, + BlockId, BlockTag, Event, EventFilter, Felt, MaybePendingBlockWithTxHashes, + MaybePendingBlockWithTxs, ReceiptBlock, Transaction, TransactionReceipt, + TransactionReceiptWithBlockInfo, }; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; -use starknet_crypto::FieldElement; use tokio::sync::broadcast::Sender; use tokio::sync::mpsc::Sender as BoundedSender; use tokio::time::sleep; @@ -121,8 +121,8 @@ impl Engine

{ pub async fn sync_to_head( &mut self, from: u64, - mut pending_block_tx: Option, - ) -> Result<(u64, Option)> { + mut pending_block_tx: Option, + ) -> Result<(u64, Option)> { let latest_block_number = self.provider.block_hash_and_number().await?.block_number; if from < latest_block_number { @@ -139,8 +139,8 @@ impl Engine

{ pub async fn sync_pending( &mut self, block_number: u64, - mut pending_block_tx: Option, - ) -> Result> { + mut pending_block_tx: Option, + ) -> Result> { let block = if let MaybePendingBlockWithTxs::PendingBlock(pending) = self.provider.get_block_with_txs(BlockId::Tag(BlockTag::Pending)).await? { @@ -207,8 +207,8 @@ impl Engine

{ &mut self, from: u64, to: u64, - pending_block_tx: Option, - ) -> Result> { + pending_block_tx: Option, + ) -> Result> { // Process all blocks from current to latest. let get_events = |token: Option| { self.provider.get_events( @@ -246,15 +246,20 @@ impl Engine

{ // receipt Should not/rarely happen. Thus the additional // fetch is acceptable. None => { - match self.provider.get_transaction_receipt(event.transaction_hash).await? { - MaybePendingTransactionReceipt::Receipt( - TransactionReceipt::Invoke(receipt), - ) => receipt.block_number, - MaybePendingTransactionReceipt::Receipt( - TransactionReceipt::L1Handler(receipt), - ) => receipt.block_number, - // If it's a pending transaction, we assume the block number is the - // latest + 1 + let TransactionReceiptWithBlockInfo { receipt, block } = + self.provider.get_transaction_receipt(event.transaction_hash).await?; + + match receipt { + TransactionReceipt::Invoke(_) | TransactionReceipt::L1Handler(_) => { + if let ReceiptBlock::Block { block_number, .. } = block { + block_number + } else { + // If the block is pending, we assume the block number is the + // latest + 1 + to + 1 + } + } + _ => to + 1, } } @@ -343,25 +348,15 @@ impl Engine

{ async fn process_transaction_and_receipt( &mut self, - transaction_hash: FieldElement, + transaction_hash: Felt, transaction: &Transaction, block_number: u64, block_timestamp: u64, ) -> Result<()> { let receipt = self.provider.get_transaction_receipt(transaction_hash).await?; - let events = match &receipt { - MaybePendingTransactionReceipt::Receipt(TransactionReceipt::Invoke(receipt)) => { - Some(&receipt.events) - } - MaybePendingTransactionReceipt::Receipt(TransactionReceipt::L1Handler(receipt)) => { - Some(&receipt.events) - } - MaybePendingTransactionReceipt::PendingReceipt(PendingTransactionReceipt::Invoke( - receipt, - )) => Some(&receipt.events), - MaybePendingTransactionReceipt::PendingReceipt( - PendingTransactionReceipt::L1Handler(receipt), - ) => Some(&receipt.events), + let events = match &receipt.receipt { + TransactionReceipt::Invoke(receipt) => Some(&receipt.events), + TransactionReceipt::L1Handler(receipt) => Some(&receipt.events), _ => None, }; @@ -416,8 +411,8 @@ impl Engine

{ &mut self, block_number: u64, block_timestamp: u64, - transaction_receipt: &MaybePendingTransactionReceipt, - transaction_hash: FieldElement, + transaction_receipt: &TransactionReceiptWithBlockInfo, + transaction_hash: Felt, transaction: &Transaction, ) -> Result<()> { for processor in &self.processors.transaction { @@ -441,14 +436,14 @@ impl Engine

{ &mut self, block_number: u64, block_timestamp: u64, - transaction_receipt: &MaybePendingTransactionReceipt, + transaction_receipt: &TransactionReceiptWithBlockInfo, event_id: &str, event: &Event, ) -> Result<()> { self.db.store_event( event_id, event, - *transaction_receipt.transaction_hash(), + *transaction_receipt.receipt.transaction_hash(), block_timestamp, ); for processor in &self.processors.event { diff --git a/crates/torii/core/src/error.rs b/crates/torii/core/src/error.rs index 28fdc6039a..5006d83ded 100644 --- a/crates/torii/core/src/error.rs +++ b/crates/torii/core/src/error.rs @@ -2,7 +2,7 @@ use std::num::ParseIntError; use dojo_types::primitive::PrimitiveError; use dojo_types::schema::EnumError; -use starknet::core::types::{FromByteSliceError, FromStrError}; +use starknet::core::types::FromStrError; use starknet::core::utils::{CairoShortStringToFeltError, NonAsciiNameError}; #[derive(Debug, thiserror::Error)] @@ -28,8 +28,6 @@ pub enum ParseError { #[error(transparent)] CairoShortStringToFelt(#[from] CairoShortStringToFeltError), #[error(transparent)] - FromByteSliceError(#[from] FromByteSliceError), - #[error(transparent)] ParseIntError(#[from] ParseIntError), #[error(transparent)] CairoSerdeError(#[from] cainome::cairo_serde::Error), diff --git a/crates/torii/core/src/lib.rs b/crates/torii/core/src/lib.rs index abd0af414a..bf88c9fd51 100644 --- a/crates/torii/core/src/lib.rs +++ b/crates/torii/core/src/lib.rs @@ -1,7 +1,7 @@ use serde::Deserialize; use sqlx::FromRow; -use crate::types::SQLFieldElement; +use crate::types::SQLFelt; pub mod cache; pub mod engine; @@ -18,11 +18,11 @@ pub mod utils; #[derive(FromRow, Deserialize)] pub struct World { #[sqlx(try_from = "String")] - world_address: SQLFieldElement, + world_address: SQLFelt, #[sqlx(try_from = "String")] - world_class_hash: SQLFieldElement, + world_class_hash: SQLFelt, #[sqlx(try_from = "String")] - executor_address: SQLFieldElement, + executor_address: SQLFelt, #[sqlx(try_from = "String")] - executor_class_hash: SQLFieldElement, + executor_class_hash: SQLFelt, } diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index 39a28aad14..e9d21749fd 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -9,7 +9,7 @@ use dojo_world::contracts::abi::model::Layout; use dojo_world::contracts::model::ModelReader; use sqlx::sqlite::SqliteRow; use sqlx::{Pool, Row, Sqlite}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::core::utils::get_selector_from_name; use super::error::{self, Error}; @@ -19,9 +19,9 @@ pub struct ModelSQLReader { /// The name of the model name: String, /// The class hash of the model - class_hash: FieldElement, + class_hash: Felt, /// The contract address of the model - contract_address: FieldElement, + contract_address: Felt, pool: Pool, packed_size: u32, unpacked_size: u32, @@ -45,10 +45,9 @@ impl ModelSQLReader { .fetch_one(&pool) .await?; - let class_hash = - FieldElement::from_hex_be(&class_hash).map_err(error::ParseError::FromStr)?; + let class_hash = Felt::from_hex(&class_hash).map_err(error::ParseError::FromStr)?; let contract_address = - FieldElement::from_hex_be(&contract_address).map_err(error::ParseError::FromStr)?; + Felt::from_hex(&contract_address).map_err(error::ParseError::FromStr)?; let layout = serde_json::from_str(&layout).map_err(error::ParseError::FromJsonStr)?; @@ -63,16 +62,16 @@ impl ModelReader for ModelSQLReader { self.name.to_string() } - fn selector(&self) -> FieldElement { + fn selector(&self) -> Felt { // this should never fail get_selector_from_name(&self.name).unwrap() } - fn class_hash(&self) -> FieldElement { + fn class_hash(&self) -> Felt { self.class_hash } - fn contract_address(&self) -> FieldElement { + fn contract_address(&self) -> Felt { self.contract_address } @@ -452,20 +451,19 @@ pub fn map_row_to_ty( } Primitive::Felt252(_) => { let value = row.try_get::(&column_name)?; - primitive.set_felt252(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, - ))?; + primitive + .set_felt252(Some(Felt::from_str(&value).map_err(ParseError::FromStr)?))?; } Primitive::ClassHash(_) => { let value = row.try_get::(&column_name)?; primitive.set_contract_address(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + Felt::from_str(&value).map_err(ParseError::FromStr)?, ))?; } Primitive::ContractAddress(_) => { let value = row.try_get::(&column_name)?; primitive.set_contract_address(Some( - FieldElement::from_str(&value).map_err(ParseError::FromStr)?, + Felt::from_str(&value).map_err(ParseError::FromStr)?, ))?; } }; diff --git a/crates/torii/core/src/processors/event_message.rs b/crates/torii/core/src/processors/event_message.rs index f74bc730a9..cb8e7a1971 100644 --- a/crates/torii/core/src/processors/event_message.rs +++ b/crates/torii/core/src/processors/event_message.rs @@ -2,7 +2,7 @@ use anyhow::{Error, Result}; use async_trait::async_trait; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; -use starknet::core::types::{Event, MaybePendingTransactionReceipt}; +use starknet::core::types::{Event, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; use tracing::info; @@ -42,7 +42,7 @@ where db: &mut Sql, _block_number: u64, block_timestamp: u64, - _transaction_receipt: &MaybePendingTransactionReceipt, + _transaction_receipt: &TransactionReceiptWithBlockInfo, event_id: &str, event: &Event, ) -> Result<(), Error> { diff --git a/crates/torii/core/src/processors/metadata_update.rs b/crates/torii/core/src/processors/metadata_update.rs index ed2432f712..12bd45e46e 100644 --- a/crates/torii/core/src/processors/metadata_update.rs +++ b/crates/torii/core/src/processors/metadata_update.rs @@ -8,9 +8,8 @@ use cainome::cairo_serde::{ByteArray, CairoSerde}; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::{Uri, WorldMetadata}; use reqwest::Client; -use starknet::core::types::{Event, MaybePendingTransactionReceipt}; +use starknet::core::types::{Event, Felt, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; -use starknet_crypto::FieldElement; use tokio_util::bytes::Bytes; use tracing::{error, info}; @@ -53,7 +52,7 @@ where db: &mut Sql, _block_number: u64, block_timestamp: u64, - _transaction_receipt: &MaybePendingTransactionReceipt, + _transaction_receipt: &TransactionReceiptWithBlockInfo, _event_id: &str, event: &Event, ) -> Result<(), Error> { @@ -77,7 +76,7 @@ where } } -async fn try_retrieve(mut db: Sql, resource: FieldElement, uri_str: String) { +async fn try_retrieve(mut db: Sql, resource: Felt, uri_str: String) { match metadata(uri_str.clone()).await { Ok((metadata, icon_img, cover_img)) => { db.update_metadata(&resource, &uri_str, &metadata, &icon_img, &cover_img) diff --git a/crates/torii/core/src/processors/mod.rs b/crates/torii/core/src/processors/mod.rs index 5dfd43c766..fcc30e0e1a 100644 --- a/crates/torii/core/src/processors/mod.rs +++ b/crates/torii/core/src/processors/mod.rs @@ -1,9 +1,8 @@ use anyhow::{Error, Result}; use async_trait::async_trait; use dojo_world::contracts::world::WorldContractReader; -use starknet::core::types::{Event, MaybePendingTransactionReceipt, Transaction}; +use starknet::core::types::{Event, Felt, Transaction, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; -use starknet_crypto::FieldElement; use crate::sql::Sql; @@ -37,7 +36,7 @@ where db: &mut Sql, block_number: u64, block_timestamp: u64, - transaction_receipt: &MaybePendingTransactionReceipt, + transaction_receipt: &TransactionReceiptWithBlockInfo, event_id: &str, event: &Event, ) -> Result<(), Error>; @@ -64,8 +63,8 @@ pub trait TransactionProcessor { provider: &P, block_number: u64, block_timestamp: u64, - transaction_receipt: &MaybePendingTransactionReceipt, - transaction_hash: FieldElement, + transaction_receipt: &TransactionReceiptWithBlockInfo, + transaction_hash: Felt, transaction: &Transaction, ) -> Result<(), Error>; } diff --git a/crates/torii/core/src/processors/register_model.rs b/crates/torii/core/src/processors/register_model.rs index b23afab5d3..c57896e303 100644 --- a/crates/torii/core/src/processors/register_model.rs +++ b/crates/torii/core/src/processors/register_model.rs @@ -3,7 +3,7 @@ use async_trait::async_trait; use cainome::cairo_serde::{ByteArray, CairoSerde}; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; -use starknet::core::types::{Event, MaybePendingTransactionReceipt}; +use starknet::core::types::{Event, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; use tracing::{debug, info}; @@ -43,7 +43,7 @@ where db: &mut Sql, _block_number: u64, block_timestamp: u64, - _transaction_receipt: &MaybePendingTransactionReceipt, + _transaction_receipt: &TransactionReceiptWithBlockInfo, _event_id: &str, event: &Event, ) -> Result<(), Error> { diff --git a/crates/torii/core/src/processors/store_del_record.rs b/crates/torii/core/src/processors/store_del_record.rs index c3dc2328d2..bc53f5d98f 100644 --- a/crates/torii/core/src/processors/store_del_record.rs +++ b/crates/torii/core/src/processors/store_del_record.rs @@ -2,7 +2,7 @@ use anyhow::{Error, Ok, Result}; use async_trait::async_trait; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; -use starknet::core::types::{Event, MaybePendingTransactionReceipt}; +use starknet::core::types::{Event, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; use tracing::info; @@ -43,7 +43,7 @@ where db: &mut Sql, _block_number: u64, _block_timestamp: u64, - _transaction_receipt: &MaybePendingTransactionReceipt, + _transaction_receipt: &TransactionReceiptWithBlockInfo, _event_id: &str, event: &Event, ) -> Result<(), Error> { diff --git a/crates/torii/core/src/processors/store_set_record.rs b/crates/torii/core/src/processors/store_set_record.rs index f1f6e20e96..548fe49fbe 100644 --- a/crates/torii/core/src/processors/store_set_record.rs +++ b/crates/torii/core/src/processors/store_set_record.rs @@ -1,8 +1,9 @@ -use anyhow::{Error, Ok, Result}; +use anyhow::{Context, Error, Ok, Result}; use async_trait::async_trait; use dojo_world::contracts::model::ModelReader; use dojo_world::contracts::world::WorldContractReader; -use starknet::core::types::{Event, MaybePendingTransactionReceipt}; +use num_traits::ToPrimitive; +use starknet::core::types::{Event, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; use tracing::info; @@ -43,7 +44,7 @@ where db: &mut Sql, _block_number: u64, block_timestamp: u64, - _transaction_receipt: &MaybePendingTransactionReceipt, + _transaction_receipt: &TransactionReceiptWithBlockInfo, event_id: &str, event: &Event, ) -> Result<(), Error> { @@ -58,13 +59,15 @@ where ); let keys_start = NUM_KEYS_INDEX + 1; - let keys_end: usize = keys_start + usize::from(u8::try_from(event.data[NUM_KEYS_INDEX])?); + let keys_end: usize = + keys_start + event.data[NUM_KEYS_INDEX].to_usize().context("invalid usize")?; let keys = event.data[keys_start..keys_end].to_vec(); // keys_end is already the length of the values array. let values_start = keys_end + 1; - let values_end: usize = values_start + usize::from(u8::try_from(event.data[keys_end])?); + let values_end: usize = + values_start + event.data[keys_end].to_usize().context("invalid usize")?; let values = event.data[values_start..values_end].to_vec(); let mut keys_and_unpacked = [keys, values].concat(); diff --git a/crates/torii/core/src/processors/store_transaction.rs b/crates/torii/core/src/processors/store_transaction.rs index 7ceaaf0d89..b94d5552a2 100644 --- a/crates/torii/core/src/processors/store_transaction.rs +++ b/crates/torii/core/src/processors/store_transaction.rs @@ -1,8 +1,7 @@ use anyhow::{Error, Ok, Result}; use async_trait::async_trait; -use starknet::core::types::{MaybePendingTransactionReceipt, Transaction}; +use starknet::core::types::{Felt, Transaction, TransactionReceiptWithBlockInfo}; use starknet::providers::Provider; -use starknet_crypto::FieldElement; use super::TransactionProcessor; use crate::sql::Sql; @@ -18,8 +17,8 @@ impl TransactionProcessor

for StoreTransactionProcessor { _provider: &P, block_number: u64, block_timestamp: u64, - _receipt: &MaybePendingTransactionReceipt, - transaction_hash: FieldElement, + _receipt: &TransactionReceiptWithBlockInfo, + transaction_hash: Felt, transaction: &Transaction, ) -> Result<(), Error> { let transaction_id = format!("{:#064x}:{:#x}", block_number, transaction_hash); diff --git a/crates/torii/core/src/query_queue.rs b/crates/torii/core/src/query_queue.rs index 106a57cf17..c623bb218d 100644 --- a/crates/torii/core/src/query_queue.rs +++ b/crates/torii/core/src/query_queue.rs @@ -1,7 +1,7 @@ use std::collections::VecDeque; use sqlx::{Executor, Pool, Sqlite}; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; #[derive(Debug, Clone)] pub enum Argument { @@ -9,7 +9,7 @@ pub enum Argument { Int(i64), Bool(bool), String(String), - FieldElement(FieldElement), + FieldElement(Felt), } #[derive(Debug, Clone)] diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 2f972c7c43..eaafa3a92a 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -9,7 +9,7 @@ use dojo_world::contracts::abi::model::Layout; use dojo_world::metadata::WorldMetadata; use sqlx::pool::PoolConnection; use sqlx::{Pool, Sqlite}; -use starknet::core::types::{Event, FieldElement, InvokeTransaction, Transaction}; +use starknet::core::types::{Event, Felt, InvokeTransaction, Transaction}; use starknet::core::utils::get_selector_from_name; use starknet_crypto::poseidon_hash_many; @@ -31,13 +31,13 @@ mod test; #[derive(Debug, Clone)] pub struct Sql { - world_address: FieldElement, + world_address: Felt, pub pool: Pool, query_queue: QueryQueue, } impl Sql { - pub async fn new(pool: Pool, world_address: FieldElement) -> Result { + pub async fn new(pool: Pool, world_address: Felt) -> Result { let mut query_queue = QueryQueue::new(pool.clone()); query_queue.enqueue( @@ -54,7 +54,7 @@ impl Sql { Ok(Self { pool, world_address, query_queue }) } - pub async fn head(&self) -> Result<(u64, Option)> { + pub async fn head(&self) -> Result<(u64, Option)> { let mut conn: PoolConnection = self.pool.acquire().await?; let indexer_query = sqlx::query_as::<_, (i64, Option)>( "SELECT head, pending_block_tx FROM indexers WHERE id = ?", @@ -64,11 +64,11 @@ impl Sql { let indexer: (i64, Option) = indexer_query.fetch_one(&mut *conn).await?; Ok(( indexer.0.try_into().expect("doesn't fit in u64"), - indexer.1.map(|f| FieldElement::from_str(&f)).transpose()?, + indexer.1.map(|f| Felt::from_str(&f)).transpose()?, )) } - pub fn set_head(&mut self, head: u64, pending_block_tx: Option) { + pub fn set_head(&mut self, head: u64, pending_block_tx: Option) { let head = Argument::Int(head.try_into().expect("doesn't fit in u64")); let id = Argument::FieldElement(self.world_address); let pending_block_tx = if let Some(f) = pending_block_tx { @@ -98,8 +98,8 @@ impl Sql { &mut self, model: Ty, layout: Layout, - class_hash: FieldElement, - contract_address: FieldElement, + class_hash: Felt, + contract_address: Felt, packed_size: u32, unpacked_size: u32, block_timestamp: u64, @@ -254,7 +254,7 @@ impl Sql { Ok(()) } - pub async fn delete_entity(&mut self, keys: Vec, entity: Ty) -> Result<()> { + pub async fn delete_entity(&mut self, keys: Vec, entity: Ty) -> Result<()> { let entity_id = format!("{:#x}", poseidon_hash_many(&keys)); let path = vec![entity.name()]; // delete entity models data @@ -272,7 +272,7 @@ impl Sql { Ok(()) } - pub fn set_metadata(&mut self, resource: &FieldElement, uri: &str, block_timestamp: u64) { + pub fn set_metadata(&mut self, resource: &Felt, uri: &str, block_timestamp: u64) { let resource = Argument::FieldElement(*resource); let uri = Argument::String(uri.to_string()); let executed_at = Argument::String(utc_dt_string_from_timestamp(block_timestamp)); @@ -287,7 +287,7 @@ impl Sql { pub async fn update_metadata( &mut self, - resource: &FieldElement, + resource: &Felt, uri: &str, metadata: &WorldMetadata, icon_img: &Option, @@ -324,7 +324,7 @@ impl Sql { } } - pub async fn entity(&self, model: String, key: FieldElement) -> Result> { + pub async fn entity(&self, model: String, key: Felt) -> Result> { let query = sqlx::query_as::<_, (i32, String, String)>("SELECT * FROM ? WHERE id = ?") .bind(model) .bind(format!("{:#x}", key)); @@ -334,7 +334,7 @@ impl Sql { Ok(serde_json::from_str(&row.2).unwrap()) } - pub async fn entities(&self, model: String) -> Result>> { + pub async fn entities(&self, model: String) -> Result>> { let query = sqlx::query_as::<_, (i32, String, String)>("SELECT * FROM ?").bind(model); let mut conn: PoolConnection = self.pool.acquire().await?; let mut rows = query.fetch_all(&mut *conn).await?; @@ -369,8 +369,8 @@ impl Sql { Argument::FieldElement(l1_handler_transaction.transaction_hash), Argument::FieldElement(l1_handler_transaction.contract_address), Argument::String(felts_sql_string(&l1_handler_transaction.calldata)), - Argument::FieldElement(FieldElement::ZERO), // has no max_fee - Argument::String("".to_string()), // has no signature + Argument::FieldElement(Felt::ZERO), // has no max_fee + Argument::String("".to_string()), // has no signature Argument::FieldElement((l1_handler_transaction.nonce).into()), ), _ => return, @@ -398,7 +398,7 @@ impl Sql { &mut self, event_id: &str, event: &Event, - transaction_hash: FieldElement, + transaction_hash: Felt, block_timestamp: u64, ) { let id = Argument::String(event_id.to_string()); @@ -1027,7 +1027,7 @@ impl Sql { } } -fn felts_sql_string(felts: &[FieldElement]) -> String { +fn felts_sql_string(felts: &[Felt]) -> String { felts.iter().map(|k| format!("{:#x}", k)).collect::>().join(FELT_DELIMITER) + FELT_DELIMITER } diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index baf7b65e6f..9edc00a56b 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -12,11 +12,11 @@ use scarb::ops; use sozo_ops::migration::execute_strategy; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use starknet::accounts::{Account, Call}; -use starknet::core::types::{BlockId, BlockTag}; +use starknet::core::types::{BlockId, BlockTag, Felt}; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider}; -use starknet_crypto::{poseidon_hash_many, FieldElement}; +use starknet_crypto::poseidon_hash_many; use tokio::sync::broadcast; use crate::engine::{Engine, EngineConfig, Processors}; @@ -101,7 +101,7 @@ async fn test_load_from_remote() { // spawn let tx = account - .execute(vec![Call { + .execute_v1(vec![Call { to: migration_output .contracts .first() @@ -225,7 +225,7 @@ async fn test_load_from_remote_del() { // spawn account - .execute(vec![Call { + .execute_v1(vec![Call { to: migration_output .contracts .first() @@ -244,7 +244,7 @@ async fn test_load_from_remote_del() { // Set player config. account - .execute(vec![Call { + .execute_v1(vec![Call { to: migration_output .contracts .first() @@ -254,7 +254,7 @@ async fn test_load_from_remote_del() { .contract_address, selector: get_selector_from_name("set_player_config").unwrap(), // Empty ByteArray. - calldata: vec![FieldElement::ZERO, FieldElement::ZERO, FieldElement::ZERO], + calldata: vec![Felt::ZERO, Felt::ZERO, Felt::ZERO], }]) .send_with_cfg(&TxnConfig::init_wait()) .await @@ -263,7 +263,7 @@ async fn test_load_from_remote_del() { tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; account - .execute(vec![Call { + .execute_v1(vec![Call { to: migration_output .contracts .first() diff --git a/crates/torii/core/src/types.rs b/crates/torii/core/src/types.rs index f410c594c4..b92f9e2364 100644 --- a/crates/torii/core/src/types.rs +++ b/crates/torii/core/src/types.rs @@ -4,26 +4,26 @@ use chrono::{DateTime, Utc}; use dojo_types::schema::Ty; use serde::{Deserialize, Serialize}; use sqlx::FromRow; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; #[derive(Serialize, Deserialize)] -pub struct SQLFieldElement(pub FieldElement); +pub struct SQLFelt(pub Felt); -impl From for FieldElement { - fn from(field_element: SQLFieldElement) -> Self { +impl From for Felt { + fn from(field_element: SQLFelt) -> Self { field_element.0 } } -impl TryFrom for SQLFieldElement { +impl TryFrom for SQLFelt { type Error = anyhow::Error; fn try_from(value: String) -> Result { - Ok(SQLFieldElement(FieldElement::from_hex_be(&value)?)) + Ok(SQLFelt(Felt::from_hex(&value)?)) } } -impl fmt::LowerHex for SQLFieldElement { +impl fmt::LowerHex for SQLFelt { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } diff --git a/crates/torii/graphql/src/tests/entities_test.rs b/crates/torii/graphql/src/tests/entities_test.rs index c6efd000d9..a0e1ccf936 100644 --- a/crates/torii/graphql/src/tests/entities_test.rs +++ b/crates/torii/graphql/src/tests/entities_test.rs @@ -3,7 +3,8 @@ mod tests { use anyhow::Result; use async_graphql::dynamic::Schema; use serde_json::Value; - use starknet_crypto::{poseidon_hash_many, FieldElement}; + use starknet::core::types::Felt; + use starknet_crypto::poseidon_hash_many; use crate::schema::build_schema; use crate::tests::{ @@ -38,7 +39,7 @@ mod tests { result.get("entities").ok_or("entities not found").unwrap().clone() } - async fn entity_model_query(schema: &Schema, id: &FieldElement) -> Value { + async fn entity_model_query(schema: &Schema, id: &Felt) -> Value { let query = format!( r#" {{ @@ -226,7 +227,7 @@ mod tests { assert_eq!(connection.page_info.end_cursor, None); // entity model union - let id = poseidon_hash_many(&[FieldElement::ZERO]); + let id = poseidon_hash_many(&[Felt::ZERO]); let entity = entity_model_query(&schema, &id).await; let models = entity.get("models").ok_or("no models found").unwrap(); @@ -239,7 +240,7 @@ mod tests { assert_eq!(&record_sibling.__typename, "RecordSibling"); assert_eq!(record_sibling.record_id, 0); - let id = poseidon_hash_many(&[FieldElement::ZERO, FieldElement::ONE]); + let id = poseidon_hash_many(&[Felt::ZERO, Felt::ONE]); let entity = entity_model_query(&schema, &id).await; let models = entity.get("models").ok_or("no models found").unwrap(); let subrecord: Subrecord = serde_json::from_value(models[0].clone()).unwrap(); diff --git a/crates/torii/graphql/src/tests/metadata_test.rs b/crates/torii/graphql/src/tests/metadata_test.rs index c834ea1d3c..fd386cdf98 100644 --- a/crates/torii/graphql/src/tests/metadata_test.rs +++ b/crates/torii/graphql/src/tests/metadata_test.rs @@ -2,13 +2,13 @@ mod tests { use dojo_world::metadata::{project_to_world_metadata, ProjectMetadata}; use sqlx::SqlitePool; - use starknet_crypto::FieldElement; + use starknet::core::types::Felt; use torii_core::sql::Sql; use crate::schema::build_schema; use crate::tests::{run_graphql_query, Connection, Content, Metadata as SqlMetadata, Social}; - const RESOURCE: FieldElement = FieldElement::ZERO; + const RESOURCE: Felt = Felt::ZERO; const URI: &str = "ipfs://QmcDVFdDph5N2AoW7L2vruyhy6A3wiU8Mh5hEyfVY68ynh"; const BLOCK_TIMESTAMP: u64 = 1710754478; const QUERY: &str = r#" @@ -47,7 +47,7 @@ mod tests { #[sqlx::test(migrations = "../migrations")] async fn test_metadata(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); let schema = build_schema(&pool).await.unwrap(); let cover_img = "QWxsIHlvdXIgYmFzZSBiZWxvbmcgdG8gdXM="; @@ -93,7 +93,7 @@ mod tests { #[sqlx::test(migrations = "../migrations")] async fn test_empty_content(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); let schema = build_schema(&pool).await.unwrap(); db.set_metadata(&RESOURCE, URI, BLOCK_TIMESTAMP); diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index 4a39faae1d..40c6ca43ee 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -23,7 +23,7 @@ use sozo_ops::migration::execute_strategy; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use sqlx::SqlitePool; use starknet::accounts::{Account, Call}; -use starknet::core::types::{BlockId, BlockTag, FieldElement, InvokeTransactionResult}; +use starknet::core::types::{BlockId, BlockTag, Felt, InvokeTransactionResult}; use starknet::macros::selector; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; @@ -263,8 +263,8 @@ pub async fn model_fixtures(db: &mut Sql) { ], }), Layout::Fixed(vec![]), - FieldElement::ONE, - FieldElement::TWO, + Felt::ONE, + Felt::TWO, 0, 0, 1710754478_u64, @@ -319,8 +319,8 @@ pub async fn spinup_types_test() -> Result { manifest.contracts.iter().find(|contract| contract.name.eq("records")).unwrap(); let record_contract_address = records_contract.inner.address.unwrap(); let InvokeTransactionResult { transaction_hash } = account - .execute(vec![Call { - calldata: vec![FieldElement::from_str("0xa").unwrap()], + .execute_v1(vec![Call { + calldata: vec![Felt::from_str("0xa").unwrap()], to: record_contract_address, selector: selector!("create"), }]) @@ -332,8 +332,8 @@ pub async fn spinup_types_test() -> Result { // Execute `delete` and delete Record with id 20 let InvokeTransactionResult { transaction_hash } = account - .execute(vec![Call { - calldata: vec![FieldElement::from_str("0x14").unwrap()], + .execute_v1(vec![Call { + calldata: vec![Felt::from_str("0x14").unwrap()], to: record_contract_address, selector: selector!("delete"), }]) diff --git a/crates/torii/graphql/src/tests/models_test.rs b/crates/torii/graphql/src/tests/models_test.rs index 4787549187..99cd71ffcb 100644 --- a/crates/torii/graphql/src/tests/models_test.rs +++ b/crates/torii/graphql/src/tests/models_test.rs @@ -5,7 +5,7 @@ mod tests { use anyhow::Result; use async_graphql::dynamic::Schema; use serde_json::Value; - use starknet_crypto::FieldElement; + use starknet::core::types::Felt; use crate::schema::build_schema; use crate::tests::{ @@ -301,9 +301,9 @@ mod tests { records_model_query(&schema, "(order: { field: RANDOM_U128, direction: ASC })").await; let connection: Connection = serde_json::from_value(records).unwrap(); let first_record_felt = - FieldElement::from_str(&connection.edges.first().unwrap().node.random_u128).unwrap(); + Felt::from_str(&connection.edges.first().unwrap().node.random_u128).unwrap(); let last_record_felt = - FieldElement::from_str(&connection.edges.last().unwrap().node.random_u128).unwrap(); + Felt::from_str(&connection.edges.last().unwrap().node.random_u128).unwrap(); assert_eq!(connection.total_count, 10); assert!(first_record_felt <= last_record_felt); diff --git a/crates/torii/graphql/src/tests/subscription_test.rs b/crates/torii/graphql/src/tests/subscription_test.rs index ab971f193d..09b84c40cd 100644 --- a/crates/torii/graphql/src/tests/subscription_test.rs +++ b/crates/torii/graphql/src/tests/subscription_test.rs @@ -9,9 +9,9 @@ mod tests { use dojo_world::contracts::abi::model::Layout; use serial_test::serial; use sqlx::SqlitePool; - use starknet::core::types::Event; + use starknet::core::types::{Event, Felt}; use starknet::core::utils::get_selector_from_name; - use starknet_crypto::{poseidon_hash_many, FieldElement}; + use starknet_crypto::poseidon_hash_many; use tokio::sync::mpsc; use torii_core::sql::Sql; @@ -20,12 +20,12 @@ mod tests { #[sqlx::test(migrations = "../migrations")] #[serial] async fn test_entity_subscription(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); model_fixtures(&mut db).await; // 0. Preprocess expected entity value let model_name = "Record".to_string(); - let key = vec![FieldElement::ONE]; + let key = vec![Felt::ONE]; let entity_id = format!("{:#x}", poseidon_hash_many(&key)); let keys_str = key.iter().map(|k| format!("{:#x}", k)).collect::>().join(","); let block_timestamp = 1710754478_u64; @@ -40,8 +40,8 @@ mod tests { "typeU16": 1, "type_u64": "0x1", "typeBool": true, - "type_felt": format!("{:#x}", FieldElement::from(1u128)), - "typeContractAddress": format!("{:#x}", FieldElement::ONE) + "type_felt": format!("{:#x}", Felt::from(1u128)), + "typeContractAddress": format!("{:#x}", Felt::ONE) }] } }); @@ -93,12 +93,12 @@ mod tests { Member { name: "type_felt".to_string(), key: false, - ty: Ty::Primitive(Primitive::Felt252(Some(FieldElement::from(1u128)))), + ty: Ty::Primitive(Primitive::Felt252(Some(Felt::from(1u128)))), }, Member { name: "typeContractAddress".to_string(), key: true, - ty: Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE))), + ty: Ty::Primitive(Primitive::ContractAddress(Some(Felt::ONE))), }, ], }), @@ -116,7 +116,7 @@ mod tests { &pool, r#"subscription { entityUpdated { - id + id keys models { __typename @@ -143,12 +143,12 @@ mod tests { #[sqlx::test(migrations = "../migrations")] #[serial] async fn test_entity_subscription_with_id(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); model_fixtures(&mut db).await; // 0. Preprocess expected entity value let model_name = "Record".to_string(); - let key = vec![FieldElement::ONE]; + let key = vec![Felt::ONE]; let entity_id = format!("{:#x}", poseidon_hash_many(&key)); let block_timestamp = 1710754478_u64; let keys_str = key.iter().map(|k| format!("{:#x}", k)).collect::>().join(","); @@ -160,8 +160,8 @@ mod tests { "__typename": model_name, "depth": "Zero", "record_id": 0, - "type_felt": format!("{:#x}", FieldElement::from(1u128)), - "typeContractAddress": format!("{:#x}", FieldElement::ONE) + "type_felt": format!("{:#x}", Felt::from(1u128)), + "typeContractAddress": format!("{:#x}", Felt::ONE) }] } }); @@ -198,12 +198,12 @@ mod tests { Member { name: "type_felt".to_string(), key: false, - ty: Ty::Primitive(Primitive::Felt252(Some(FieldElement::from(1u128)))), + ty: Ty::Primitive(Primitive::Felt252(Some(Felt::from(1u128)))), }, Member { name: "typeContractAddress".to_string(), key: true, - ty: Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE))), + ty: Ty::Primitive(Primitive::ContractAddress(Some(Felt::ONE))), }, ], }), @@ -221,7 +221,7 @@ mod tests { &pool, r#"subscription { entityUpdated(id: "0x579e8877c7755365d5ec1ec7d3a94a457eff5d1f40482bbe9729c064cdead2") { - id + id keys models { __typename @@ -245,12 +245,12 @@ mod tests { #[sqlx::test(migrations = "../migrations")] #[serial] async fn test_model_subscription(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); // 0. Preprocess model value let model_name = "Subrecord".to_string(); let model_id = format!("{:#x}", get_selector_from_name(&model_name).unwrap()); - let class_hash = FieldElement::TWO; - let contract_address = FieldElement::THREE; + let class_hash = Felt::TWO; + let contract_address = Felt::THREE; let block_timestamp: u64 = 1710754478_u64; let expected_value: async_graphql::Value = value!({ "modelRegistered": { "id": model_id, "name":model_name } @@ -306,12 +306,12 @@ mod tests { #[sqlx::test(migrations = "../migrations")] #[serial] async fn test_model_subscription_with_id(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); // 0. Preprocess model value let model_name = "Subrecord".to_string(); let model_id = format!("{:#x}", get_selector_from_name(&model_name).unwrap()); - let class_hash = FieldElement::TWO; - let contract_address = FieldElement::THREE; + let class_hash = Felt::TWO; + let contract_address = Felt::THREE; let block_timestamp: u64 = 1710754478_u64; let expected_value: async_graphql::Value = value!({ "modelRegistered": { "id": model_id, "name":model_name } @@ -369,7 +369,7 @@ mod tests { #[sqlx::test(migrations = "../migrations")] #[serial] async fn test_event_emitted(pool: SqlitePool) { - let mut db = Sql::new(pool.clone(), FieldElement::ZERO).await.unwrap(); + let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); let block_timestamp: u64 = 1710754478_u64; let (tx, mut rx) = mpsc::channel(7); tokio::spawn(async move { @@ -378,17 +378,17 @@ mod tests { db.store_event( "0x0", &Event { - from_address: FieldElement::ZERO, + from_address: Felt::ZERO, keys: vec![ - FieldElement::from_str("0xdead").unwrap(), - FieldElement::from_str("0xbeef").unwrap(), + Felt::from_str("0xdead").unwrap(), + Felt::from_str("0xbeef").unwrap(), ], data: vec![ - FieldElement::from_str("0xc0de").unwrap(), - FieldElement::from_str("0xface").unwrap(), + Felt::from_str("0xc0de").unwrap(), + Felt::from_str("0xface").unwrap(), ], }, - FieldElement::ZERO, + Felt::ZERO, block_timestamp, ); @@ -407,19 +407,19 @@ mod tests { }} }} "#, - FieldElement::from_str("0xbeef").unwrap() + Felt::from_str("0xbeef").unwrap() ), ) .await; let expected_value: async_graphql::Value = value!({ "eventEmitted": { "keys": vec![ - format!("{:#x}", FieldElement::from_str("0xdead").unwrap()), - format!("{:#x}", FieldElement::from_str("0xbeef").unwrap()) + format!("{:#x}", Felt::from_str("0xdead").unwrap()), + format!("{:#x}", Felt::from_str("0xbeef").unwrap()) ], "data": vec![ - format!("{:#x}", FieldElement::from_str("0xc0de").unwrap()), - format!("{:#x}", FieldElement::from_str("0xface").unwrap()) - ], "transactionHash": format!("{:#x}", FieldElement::ZERO)} + format!("{:#x}", Felt::from_str("0xc0de").unwrap()), + format!("{:#x}", Felt::from_str("0xface").unwrap()) + ], "transactionHash": format!("{:#x}", Felt::ZERO)} }); assert_eq!(response_value, expected_value); diff --git a/crates/torii/grpc/Cargo.toml b/crates/torii/grpc/Cargo.toml index 3673a790a2..73ade208de 100644 --- a/crates/torii/grpc/Cargo.toml +++ b/crates/torii/grpc/Cargo.toml @@ -10,6 +10,7 @@ bytes.workspace = true dojo-types = { path = "../../dojo-types" } futures-util.workspace = true futures.workspace = true +num-traits.workspace = true parking_lot.workspace = true rayon.workspace = true starknet-crypto.workspace = true diff --git a/crates/torii/grpc/src/client.rs b/crates/torii/grpc/src/client.rs index e0c994283d..7a0fd4a9b8 100644 --- a/crates/torii/grpc/src/client.rs +++ b/crates/torii/grpc/src/client.rs @@ -3,8 +3,7 @@ use std::num::ParseIntError; use futures_util::stream::MapOk; use futures_util::{Stream, StreamExt, TryStreamExt}; -use starknet::core::types::{FromStrError, StateDiff, StateUpdate}; -use starknet_crypto::FieldElement; +use starknet::core::types::{Felt, FromStrError, StateDiff, StateUpdate}; use crate::proto::world::{ world_client, MetadataRequest, RetrieveEntitiesRequest, RetrieveEntitiesResponse, @@ -32,7 +31,7 @@ pub enum Error { /// A lightweight wrapper around the grpc client. pub struct WorldClient { - _world_address: FieldElement, + _world_address: Felt, #[cfg(not(target_arch = "wasm32"))] inner: world_client::WorldClient, #[cfg(target_arch = "wasm32")] @@ -41,7 +40,7 @@ pub struct WorldClient { impl WorldClient { #[cfg(not(target_arch = "wasm32"))] - pub async fn new(dst: D, _world_address: FieldElement) -> Result + pub async fn new(dst: D, _world_address: Felt) -> Result where D: TryInto, D::Error: Into>, @@ -54,7 +53,7 @@ impl WorldClient { // we make this function async so that we can keep the function signature similar #[cfg(target_arch = "wasm32")] - pub async fn new(endpoint: String, _world_address: FieldElement) -> Result { + pub async fn new(endpoint: String, _world_address: Felt) -> Result { Ok(Self { _world_address, inner: world_client::WorldClient::new(tonic_web_wasm_client::Client::new(endpoint)), @@ -116,7 +115,7 @@ impl WorldClient { Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| match res.entity { Some(entity) => entity.try_into().expect("must able to serialize"), - None => Entity { hashed_keys: FieldElement::ZERO, models: vec![] }, + None => Entity { hashed_keys: Felt::ZERO, models: vec![] }, })))) } @@ -135,7 +134,7 @@ impl WorldClient { Ok(EntityUpdateStreaming(stream.map_ok(Box::new(|res| match res.entity { Some(entity) => entity.try_into().expect("must able to serialize"), - None => Entity { hashed_keys: FieldElement::ZERO, models: vec![] }, + None => Entity { hashed_keys: Felt::ZERO, models: vec![] }, })))) } @@ -154,8 +153,8 @@ impl WorldClient { .map(|res| res.into_inner())?; Ok(EventUpdateStreaming(stream.map_ok(Box::new(|res| match res.event { - Some(event) => event.try_into().expect("must able to serialize"), - None => Event { keys: vec![], data: vec![], transaction_hash: FieldElement::ZERO }, + Some(event) => event.into(), + None => Event { keys: vec![], data: vec![], transaction_hash: Felt::ZERO }, })))) } @@ -235,9 +234,9 @@ impl Stream for EventUpdateStreaming { fn empty_state_update() -> StateUpdate { StateUpdate { - block_hash: FieldElement::ZERO, - new_root: FieldElement::ZERO, - old_root: FieldElement::ZERO, + block_hash: Felt::ZERO, + new_root: Felt::ZERO, + old_root: Felt::ZERO, state_diff: StateDiff { declared_classes: vec![], deployed_contracts: vec![], diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index f0394fb30b..9cd741ec89 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -20,10 +20,10 @@ use proto::world::{ }; use sqlx::sqlite::SqliteRow; use sqlx::{Pool, Row, Sqlite}; +use starknet::core::types::Felt; use starknet::core::utils::{cairo_short_string_to_felt, get_selector_from_name}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; -use starknet_crypto::FieldElement; use subscriptions::event::EventManager; use tokio::net::TcpListener; use tokio::sync::mpsc::Receiver; @@ -56,7 +56,7 @@ pub(crate) static EVENT_MESSAGES_ENTITY_RELATION_COLUMN: &str = "event_message_i #[derive(Clone)] pub struct DojoWorld { pool: Pool, - world_address: FieldElement, + world_address: Felt, model_cache: Arc, entity_manager: Arc, event_message_manager: Arc, @@ -68,7 +68,7 @@ impl DojoWorld { pub fn new( pool: Pool, block_rx: Receiver, - world_address: FieldElement, + world_address: Felt, provider: Arc>, ) -> Self { let model_cache = Arc::new(ModelCache::new(pool.clone())); @@ -216,11 +216,7 @@ impl DojoWorld { let ids = hashed_keys .hashed_keys .iter() - .map(|id| { - Ok(FieldElement::from_byte_slice_be(id) - .map(|id| format!("{table}.id = '{id:#x}'")) - .map_err(ParseError::FromByteSliceError)?) - }) + .map(|id| Ok(format!("{table}.id = '{:#x}'", Felt::from_bytes_be_slice(id)))) .collect::, Error>>()?; format!("WHERE {}", ids.join(" OR ")) @@ -535,9 +531,7 @@ impl DojoWorld { .hashed_keys .iter() .map(|id| { - Ok(FieldElement::from_byte_slice_be(id) - .map(|id| format!("{table}.id = '{id:#x}'")) - .map_err(ParseError::FromByteSliceError)?) + Ok(format!("{table}.id = '{:#x}'", Felt::from_bytes_be_slice(id))) }) .collect::, Error>>()?; where_clauses.push(format!("({})", ids.join(" OR "))); @@ -728,7 +722,7 @@ impl DojoWorld { &self, keys: Option, ) -> Result>, Error> { - self.entity_manager.add_subscriber(keys.map(|keys| keys.try_into().unwrap())).await + self.entity_manager.add_subscriber(keys.map(|keys| keys.into())).await } async fn retrieve_entities( @@ -805,7 +799,7 @@ impl DojoWorld { &self, keys: Option, ) -> Result>, Error> { - self.event_message_manager.add_subscriber(keys.map(|keys| keys.try_into().unwrap())).await + self.event_message_manager.add_subscriber(keys.map(|keys| keys.into())).await } async fn retrieve_event_messages( @@ -893,7 +887,7 @@ impl DojoWorld { &self, clause: proto::types::KeysClause, ) -> Result>, Error> { - self.event_manager.add_subscriber(clause.try_into().unwrap()).await + self.event_manager.add_subscriber(clause.into()).await } } @@ -901,9 +895,7 @@ fn process_event_field(data: &str) -> Result>, Error> { Ok(data .trim_end_matches('/') .split('/') - .map(|d| { - FieldElement::from_str(d).map_err(ParseError::FromStr).map(|f| f.to_bytes_be().to_vec()) - }) + .map(|d| Felt::from_str(d).map_err(ParseError::FromStr).map(|f| f.to_bytes_be().to_vec())) .collect::, _>>()?) } @@ -911,7 +903,7 @@ fn map_row_to_event(row: &(String, String, String)) -> Result>, schemas: &[Ty], ) -> Result { - let hashed_keys = - FieldElement::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; + let hashed_keys = Felt::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; let models = schemas .iter() .map(|schema| { @@ -944,9 +935,7 @@ fn build_keys_pattern(clause: &proto::types::KeysClause) -> Result, Error>>()?; let mut keys_pattern = format!("^{}", keys.join("/")); @@ -1097,7 +1086,7 @@ pub async fn new( mut shutdown_rx: tokio::sync::broadcast::Receiver<()>, pool: &Pool, block_rx: Receiver, - world_address: FieldElement, + world_address: Felt, provider: Arc>, ) -> Result< (SocketAddr, impl Future> + 'static), diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index b93385ad07..8f00cbdd5d 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -9,7 +9,7 @@ use futures::Stream; use futures_util::StreamExt; use rand::Rng; use sqlx::{Pool, Sqlite}; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::RwLock; use torii_core::cache::ModelCache; @@ -91,12 +91,12 @@ impl Service { entity: &Entity, ) -> Result<(), Error> { let mut closed_stream = Vec::new(); - let hashed = FieldElement::from_str(&entity.id).map_err(ParseError::FromStr)?; + let hashed = Felt::from_str(&entity.id).map_err(ParseError::FromStr)?; let keys = entity .keys .trim_end_matches(FELT_DELIMITER) .split(FELT_DELIMITER) - .map(FieldElement::from_str) + .map(Felt::from_str) .collect::, _>>() .map_err(ParseError::FromStr)?; diff --git a/crates/torii/grpc/src/server/subscriptions/event.rs b/crates/torii/grpc/src/server/subscriptions/event.rs index 856f2211e6..59cba5fedf 100644 --- a/crates/torii/grpc/src/server/subscriptions/event.rs +++ b/crates/torii/grpc/src/server/subscriptions/event.rs @@ -8,7 +8,7 @@ use std::task::{Context, Poll}; use futures::Stream; use futures_util::StreamExt; use rand::Rng; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::RwLock; use torii_core::error::{Error, ParseError}; @@ -75,14 +75,14 @@ impl Service { .keys .trim_end_matches(FELT_DELIMITER) .split(FELT_DELIMITER) - .map(FieldElement::from_str) + .map(Felt::from_str) .collect::, _>>() .map_err(ParseError::from)?; let data = event .data .trim_end_matches(FELT_DELIMITER) .split(FELT_DELIMITER) - .map(FieldElement::from_str) + .map(Felt::from_str) .collect::, _>>() .map_err(ParseError::from)?; @@ -121,7 +121,7 @@ impl Service { event: Some(proto::types::Event { keys: keys.iter().map(|k| k.to_bytes_be().to_vec()).collect(), data: data.iter().map(|d| d.to_bytes_be().to_vec()).collect(), - transaction_hash: FieldElement::from_str(&event.transaction_hash) + transaction_hash: Felt::from_str(&event.transaction_hash) .map_err(ParseError::from)? .to_bytes_be() .to_vec(), diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index b345710bf0..568ea85e6e 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -9,7 +9,7 @@ use futures::Stream; use futures_util::StreamExt; use rand::Rng; use sqlx::{Pool, Sqlite}; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::RwLock; use torii_core::cache::ModelCache; @@ -90,12 +90,12 @@ impl Service { entity: &EventMessage, ) -> Result<(), Error> { let mut closed_stream = Vec::new(); - let hashed = FieldElement::from_str(&entity.id).map_err(ParseError::FromStr)?; + let hashed = Felt::from_str(&entity.id).map_err(ParseError::FromStr)?; let keys = entity .keys .trim_end_matches(FELT_DELIMITER) .split(FELT_DELIMITER) - .map(FieldElement::from_str) + .map(Felt::from_str) .collect::, _>>() .map_err(ParseError::FromStr)?; diff --git a/crates/torii/grpc/src/server/subscriptions/model_diff.rs b/crates/torii/grpc/src/server/subscriptions/model_diff.rs index fbd90d01b8..f5088f072d 100644 --- a/crates/torii/grpc/src/server/subscriptions/model_diff.rs +++ b/crates/torii/grpc/src/server/subscriptions/model_diff.rs @@ -5,17 +5,18 @@ use std::task::Poll; use futures_util::future::BoxFuture; use futures_util::FutureExt; +use num_traits::FromPrimitive; use rand::Rng; use rayon::prelude::{IntoParallelIterator, ParallelIterator}; use starknet::core::types::{ - BlockId, ContractStorageDiffItem, MaybePendingStateUpdate, StateUpdate, StorageEntry, + BlockId, ContractStorageDiffItem, Felt, MaybePendingStateUpdate, StateUpdate, StorageEntry, }; use starknet::macros::short_string; use starknet::providers::Provider; -use starknet_crypto::{poseidon_hash_many, FieldElement}; +use starknet_crypto::poseidon_hash_many; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio::sync::RwLock; -use torii_core::error::{Error, ParseError}; +use torii_core::error::Error; use tracing::{debug, error, trace}; use super::error::SubscriptionError; @@ -26,7 +27,7 @@ use crate::types::ModelKeysClause; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::model_diff"; pub struct ModelMetadata { - pub name: FieldElement, + pub name: Felt, pub packed_size: usize, } @@ -39,7 +40,7 @@ impl ModelDiffRequest {} pub struct ModelDiffSubscriber { /// The storage addresses that the subscriber is interested in. - storage_addresses: HashSet, + storage_addresses: HashSet, /// The channel to send the response back to the subscriber. sender: Sender>, } @@ -62,8 +63,7 @@ impl StateDiffManager { let storage_addresses = reqs .into_iter() .map(|req| { - let keys: ModelKeysClause = - req.keys.try_into().map_err(ParseError::FromByteSliceError)?; + let keys: ModelKeysClause = req.keys.into(); let base = poseidon_hash_many(&[ short_string!("dojo_storage"), @@ -73,15 +73,15 @@ impl StateDiffManager { let res = (0..req.model.packed_size) .into_par_iter() - .map(|i| base + i.into()) - .collect::>(); + .map(|i| base + Felt::from_usize(i).expect("failed to convert usize to Felt")) + .collect::>(); Ok(res) }) .collect::, Error>>()? .into_iter() .flatten() - .collect::>(); + .collect::>(); // NOTE: unlock issue with firefox/safari // initially send empty stream message to return from @@ -106,7 +106,7 @@ type RequestStateUpdateResult = Result { - world_address: FieldElement, + world_address: Felt, idle_provider: Option

, block_num_rcv: Receiver, state_update_queue: VecDeque, @@ -121,7 +121,7 @@ where { pub fn new_with_block_rcv( block_num_rcv: Receiver, - world_address: FieldElement, + world_address: Felt, provider: P, subs_manager: Arc, ) -> Self { @@ -146,7 +146,7 @@ where async fn publish_updates( subs: Arc, - contract_address: FieldElement, + contract_address: Felt, state_update: StateUpdate, ) -> PublishStateUpdateResult { let mut closed_stream = Vec::new(); diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 9c3d2a710d..c32076e496 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -73,7 +73,7 @@ async fn test_entities_queries() { // spawn let tx = account - .execute(vec![Call { + .execute_v1(vec![Call { to: migration_output .contracts .first() diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index 3840daa1f0..0666e382f9 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -6,9 +6,8 @@ use dojo_types::primitive::Primitive; use dojo_types::schema::Ty; use serde::{Deserialize, Serialize}; use starknet::core::types::{ - ContractStorageDiffItem, FromByteSliceError, FromStrError, StateDiff, StateUpdate, StorageEntry, + ContractStorageDiffItem, Felt, FromStrError, StateDiff, StateUpdate, StorageEntry, }; -use starknet_crypto::FieldElement; use strum_macros::{AsRefStr, EnumIter, FromRepr}; use crate::proto::{self}; @@ -31,19 +30,19 @@ pub enum Clause { #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub enum EntityKeysClause { - HashedKeys(Vec), + HashedKeys(Vec), Keys(KeysClause), } #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct ModelKeysClause { pub model: String, - pub keys: Vec, + pub keys: Vec, } #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct KeysClause { - pub keys: Vec>, + pub keys: Vec>, pub pattern_matching: PatternMatching, pub models: Vec, } @@ -136,15 +135,15 @@ impl TryFrom for dojo_types::schema::ModelMetadata type Error = FromStrError; fn try_from(value: proto::types::ModelMetadata) -> Result { let schema: Ty = serde_json::from_slice(&value.schema).unwrap(); - let layout: Vec = value.layout.into_iter().map(FieldElement::from).collect(); + let layout: Vec = value.layout.into_iter().map(Felt::from).collect(); Ok(Self { schema, layout, name: value.name, packed_size: value.packed_size, unpacked_size: value.unpacked_size, - class_hash: FieldElement::from_str(&value.class_hash)?, - contract_address: FieldElement::from_str(&value.contract_address)?, + class_hash: Felt::from_str(&value.class_hash)?, + contract_address: Felt::from_str(&value.contract_address)?, }) } } @@ -160,8 +159,8 @@ impl TryFrom for dojo_types::WorldMetadata { Ok(dojo_types::WorldMetadata { models, - world_address: FieldElement::from_str(&value.world_address)?, - world_class_hash: FieldElement::from_str(&value.world_class_hash)?, + world_address: Felt::from_str(&value.world_address)?, + world_class_hash: Felt::from_str(&value.world_class_hash)?, }) } } @@ -195,19 +194,15 @@ impl From for proto::types::KeysClause { } } -impl TryFrom for KeysClause { - type Error = FromByteSliceError; - - fn try_from(value: proto::types::KeysClause) -> Result { +impl From for KeysClause { + fn from(value: proto::types::KeysClause) -> Self { let keys = value .keys .iter() - .map(|k| { - if k.is_empty() { Ok(None) } else { Ok(Some(FieldElement::from_byte_slice_be(k)?)) } - }) - .collect::>, _>>()?; + .map(|k| if k.is_empty() { None } else { Some(Felt::from_bytes_be_slice(k)) }) + .collect::>>(); - Ok(Self { keys, pattern_matching: value.pattern_matching().into(), models: value.models }) + Self { keys, pattern_matching: value.pattern_matching().into(), models: value.models } } } @@ -244,23 +239,20 @@ impl From for proto::types::EntityKeysClause { } } -impl TryFrom for EntityKeysClause { - type Error = FromByteSliceError; - - fn try_from(value: proto::types::EntityKeysClause) -> Result { +impl From for EntityKeysClause { + fn from(value: proto::types::EntityKeysClause) -> Self { match value.clause_type.expect("must have") { proto::types::entity_keys_clause::ClauseType::HashedKeys(clause) => { let keys = clause .hashed_keys .into_iter() - .map(|k| FieldElement::from_byte_slice_be(&k)) - .collect::, _>>()?; + .map(|k| Felt::from_bytes_be_slice(&k)) + .collect::>(); - Ok(Self::HashedKeys(keys)) - } - proto::types::entity_keys_clause::ClauseType::Keys(clause) => { - Ok(Self::Keys(clause.try_into()?)) + Self::HashedKeys(keys) } + + proto::types::entity_keys_clause::ClauseType::Keys(clause) => Self::Keys(clause.into()), } } } @@ -274,17 +266,10 @@ impl From for proto::types::ModelKeysClause { } } -impl TryFrom for ModelKeysClause { - type Error = FromByteSliceError; - - fn try_from(value: proto::types::ModelKeysClause) -> Result { - let keys = value - .keys - .into_iter() - .map(|k| FieldElement::from_byte_slice_be(&k)) - .collect::, _>>()?; - - Ok(Self { model: value.model, keys }) +impl From for ModelKeysClause { + fn from(value: proto::types::ModelKeysClause) -> Self { + let keys = value.keys.into_iter().map(|v| Felt::from_bytes_be_slice(&v)).collect(); + Self { model: value.model, keys } } } @@ -326,10 +311,7 @@ impl From for proto::types::Value { impl TryFrom for StorageEntry { type Error = FromStrError; fn try_from(value: proto::types::StorageEntry) -> Result { - Ok(Self { - key: FieldElement::from_str(&value.key)?, - value: FieldElement::from_str(&value.value)?, - }) + Ok(Self { key: Felt::from_str(&value.key)?, value: Felt::from_str(&value.value)? }) } } @@ -337,7 +319,7 @@ impl TryFrom for ContractStorageDiffItem { type Error = FromStrError; fn try_from(value: proto::types::StorageDiff) -> Result { Ok(Self { - address: FieldElement::from_str(&value.address)?, + address: Felt::from_str(&value.address)?, storage_entries: value .storage_entries .into_iter() @@ -369,9 +351,9 @@ impl TryFrom for StateUpdate { type Error = FromStrError; fn try_from(value: proto::types::ModelUpdate) -> Result { Ok(Self { - new_root: FieldElement::ZERO, - old_root: FieldElement::ZERO, - block_hash: FieldElement::from_str(&value.block_hash)?, + new_root: Felt::ZERO, + old_root: Felt::ZERO, + block_hash: Felt::from_str(&value.block_hash)?, state_diff: value.model_diff.expect("must have").try_into()?, }) } @@ -379,32 +361,17 @@ impl TryFrom for StateUpdate { #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct Event { - pub keys: Vec, - pub data: Vec, - pub transaction_hash: FieldElement, + pub keys: Vec, + pub data: Vec, + pub transaction_hash: Felt, } -impl TryFrom for Event { - type Error = FromByteSliceError; - - fn try_from(value: proto::types::Event) -> Result { - let keys = value - .keys - .into_iter() - .map(|k| FieldElement::from_byte_slice_be(&k)) - .collect::, _>>()?; - - let data = value - .data - .into_iter() - .map(|d| FieldElement::from_byte_slice_be(&d)) - .collect::, _>>()?; - - Ok(Self { - keys, - data, - transaction_hash: FieldElement::from_byte_slice_be(&value.transaction_hash)?, - }) +impl From for Event { + fn from(value: proto::types::Event) -> Self { + let keys = value.keys.into_iter().map(|k| Felt::from_bytes_be_slice(&k)).collect(); + let data = value.data.into_iter().map(|d| Felt::from_bytes_be_slice(&d)).collect(); + let transaction_hash = Felt::from_bytes_be_slice(&value.transaction_hash); + Self { keys, data, transaction_hash } } } diff --git a/crates/torii/grpc/src/types/schema.rs b/crates/torii/grpc/src/types/schema.rs index 36c0e926b3..728a5da5f6 100644 --- a/crates/torii/grpc/src/types/schema.rs +++ b/crates/torii/grpc/src/types/schema.rs @@ -2,8 +2,7 @@ use crypto_bigint::{Encoding, U256}; use dojo_types::primitive::Primitive; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use serde::{Deserialize, Serialize}; -use starknet::core::types::FromByteSliceError; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use crate::proto::{self}; @@ -13,13 +12,11 @@ pub enum SchemaError { MissingExpectedData, #[error("Unsupported type")] UnsupportedType, - #[error(transparent)] - SliceError(#[from] FromByteSliceError), } #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct Entity { - pub hashed_keys: FieldElement, + pub hashed_keys: Felt, pub models: Vec, } @@ -33,7 +30,7 @@ impl TryFrom for Entity { type Error = SchemaError; fn try_from(entity: proto::types::Entity) -> Result { Ok(Self { - hashed_keys: FieldElement::from_byte_slice_be(&entity.hashed_keys)?, + hashed_keys: Felt::from_bytes_be_slice(&entity.hashed_keys), models: entity .models .into_iter() @@ -230,10 +227,7 @@ impl TryFrom for Primitive { | Some(proto::types::PrimitiveType::Felt252) | Some(proto::types::PrimitiveType::ClassHash) | Some(proto::types::PrimitiveType::ContractAddress) => { - Primitive::Felt252(Some( - FieldElement::from_byte_slice_be(bytes) - .map_err(SchemaError::SliceError)?, - )) + Primitive::Felt252(Some(Felt::from_bytes_be_slice(bytes))) } Some(proto::types::PrimitiveType::U256) => { Primitive::U256(Some(U256::from_be_slice(bytes))) diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index 83803a55ab..2e4bec0c91 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -20,10 +20,10 @@ use libp2p::swarm::{NetworkBehaviour, SwarmEvent}; use libp2p::{identify, identity, noise, ping, relay, tcp, yamux, PeerId, Swarm, Transport}; use libp2p_webrtc as webrtc; use rand::thread_rng; -use starknet::core::types::{BlockId, BlockTag, FunctionCall}; +use starknet::core::types::{BlockId, BlockTag, Felt, FunctionCall}; use starknet::core::utils::get_selector_from_name; use starknet::providers::Provider; -use starknet_crypto::{poseidon_hash_many, verify, FieldElement}; +use starknet_crypto::{poseidon_hash_many, verify}; use torii_core::sql::Sql; use tracing::{info, warn}; use webrtc::tokio::Certificate; @@ -271,18 +271,17 @@ impl Relay

{ } } - let entity_identity = - match FieldElement::from_str(&entity_identity.unwrap()) { - Ok(identity) => identity, - Err(e) => { - warn!( - target: LOG_TARGET, - error = %e, - "Parsing identity." - ); - continue; - } - }; + let entity_identity = match Felt::from_str(&entity_identity.unwrap()) { + Ok(identity) => identity, + Err(e) => { + warn!( + target: LOG_TARGET, + error = %e, + "Parsing identity." + ); + continue; + } + }; // TODO: have a nonce in model to check // against entity nonce and message nonce @@ -428,7 +427,7 @@ impl Relay

{ } } -fn ty_keys(ty: &Ty) -> Result, Error> { +fn ty_keys(ty: &Ty) -> Result, Error> { if let Ty::Struct(s) = &ty { let mut keys = Vec::new(); for m in s.keys() { @@ -585,13 +584,13 @@ pub fn parse_value_to_ty(value: &PrimitiveType, ty: &mut Ty) -> Result<(), Error *v = Some(u128::from_str(string).unwrap()); } Primitive::Felt252(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); + *v = Some(Felt::from_str(string).unwrap()); } Primitive::ClassHash(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); + *v = Some(Felt::from_str(string).unwrap()); } Primitive::ContractAddress(v) => { - *v = Some(FieldElement::from_str(string).unwrap()); + *v = Some(Felt::from_str(string).unwrap()); } Primitive::Bool(v) => { *v = Some(bool::from_str(string).unwrap()); diff --git a/crates/torii/libp2p/src/tests.rs b/crates/torii/libp2p/src/tests.rs index 7db5ab677b..9d61f02cc0 100644 --- a/crates/torii/libp2p/src/tests.rs +++ b/crates/torii/libp2p/src/tests.rs @@ -12,7 +12,7 @@ mod test { use dojo_types::primitive::Primitive; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use serde_json::Number; - use starknet_crypto::FieldElement; + use starknet::core::types::Felt; #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; @@ -65,17 +65,17 @@ mod test { let mut ty = Ty::Primitive(Primitive::Felt252(None)); let value = PrimitiveType::String("1".to_string()); parse_value_to_ty(&value, &mut ty).unwrap(); - assert_eq!(ty, Ty::Primitive(Primitive::Felt252(Some(FieldElement::ONE)))); + assert_eq!(ty, Ty::Primitive(Primitive::Felt252(Some(Felt::ONE)))); let mut ty = Ty::Primitive(Primitive::ClassHash(None)); let value = PrimitiveType::String("1".to_string()); parse_value_to_ty(&value, &mut ty).unwrap(); - assert_eq!(ty, Ty::Primitive(Primitive::ClassHash(Some(FieldElement::ONE)))); + assert_eq!(ty, Ty::Primitive(Primitive::ClassHash(Some(Felt::ONE)))); let mut ty = Ty::Primitive(Primitive::ContractAddress(None)); let value = PrimitiveType::String("1".to_string()); parse_value_to_ty(&value, &mut ty).unwrap(); - assert_eq!(ty, Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE)))); + assert_eq!(ty, Ty::Primitive(Primitive::ContractAddress(Some(Felt::ONE)))); let mut ty = Ty::Primitive(Primitive::Bool(None)); let value = PrimitiveType::Bool(true); @@ -203,7 +203,7 @@ mod test { children: vec![ Member { name: "player".to_string(), - ty: Ty::Primitive(Primitive::ContractAddress(Some(FieldElement::ONE))), + ty: Ty::Primitive(Primitive::ContractAddress(Some(Felt::ONE))), key: true, }, Member { @@ -280,7 +280,7 @@ mod test { use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use starknet::signers::SigningKey; - use starknet_crypto::FieldElement; + use starknet_crypto::Felt; use tokio::select; use tokio::time::sleep; use torii_core::sql::Sql; @@ -307,7 +307,7 @@ mod test { let account = sequencer.raw_account(); - let mut db = Sql::new(pool.clone(), FieldElement::from_bytes_be(&[0; 32]).unwrap()).await?; + let mut db = Sql::new(pool.clone(), Felt::from_bytes_be(&[0; 32])).await?; // Register the model of our Message db.register_model( @@ -327,8 +327,8 @@ mod test { ], }), Layout::Fixed(vec![]), - FieldElement::ZERO, - FieldElement::ZERO, + Felt::ZERO, + Felt::ZERO, 0, 0, 0, diff --git a/crates/torii/libp2p/src/typed_data.rs b/crates/torii/libp2p/src/typed_data.rs index 733c7ca29d..6877596273 100644 --- a/crates/torii/libp2p/src/typed_data.rs +++ b/crates/torii/libp2p/src/typed_data.rs @@ -4,8 +4,9 @@ use cainome::cairo_serde::ByteArray; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use serde_json::Number; +use starknet::core::types::Felt; use starknet::core::utils::{cairo_short_string_to_felt, get_selector_from_name}; -use starknet_crypto::{poseidon_hash_many, FieldElement}; +use starknet_crypto::poseidon_hash_many; use crate::errors::Error; @@ -233,8 +234,8 @@ pub(crate) fn get_value_type( Err(Error::InvalidMessageError(format!("Field {} not found in types", name))) } -fn get_hex(value: &str) -> Result { - if let Ok(felt) = FieldElement::from_str(value) { +fn get_hex(value: &str) -> Result { + if let Ok(felt) = Felt::from_str(value) { Ok(felt) } else { // assume its a short string and encode @@ -250,7 +251,7 @@ impl PrimitiveType { types: &IndexMap>, preset_types: &IndexMap>, ctx: &mut Ctx, - ) -> Result { + ) -> Result { match self { PrimitiveType::Object(obj) => { ctx.is_preset = preset_types.contains_key(r#type); @@ -273,7 +274,7 @@ impl PrimitiveType { }; // variant index - hashes.push(FieldElement::from(variant_type.index as u32)); + hashes.push(Felt::from(variant_type.index as u32)); // variant parameters for (idx, param) in arr.iter().enumerate() { @@ -329,8 +330,7 @@ impl PrimitiveType { .as_slice(), )), PrimitiveType::Bool(boolean) => { - let v = - if *boolean { FieldElement::from(1_u32) } else { FieldElement::from(0_u32) }; + let v = if *boolean { Felt::from(1_u32) } else { Felt::from(0_u32) }; Ok(v) } PrimitiveType::String(string) => match r#type { @@ -341,14 +341,14 @@ impl PrimitiveType { Error::InvalidMessageError(format!("Invalid string for bytearray: {}", e)) })?; - let mut hashes = vec![FieldElement::from(byte_array.data.len())]; + let mut hashes = vec![Felt::from(byte_array.data.len())]; for hash in byte_array.data { hashes.push(hash.felt()); } hashes.push(byte_array.pending_word); - hashes.push(FieldElement::from(byte_array.pending_word_len)); + hashes.push(Felt::from(byte_array.pending_word_len)); Ok(poseidon_hash_many(hashes.as_slice())) } @@ -363,7 +363,7 @@ impl PrimitiveType { _ => Err(Error::InvalidMessageError(format!("Invalid type {} for string", r#type))), }, PrimitiveType::Number(number) => { - let felt = FieldElement::from_str(&number.to_string()).map_err(|_| { + let felt = Felt::from_str(&number.to_string()).map_err(|_| { Error::InvalidMessageError(format!("Invalid number {}", number)) })?; Ok(felt) @@ -391,7 +391,7 @@ impl Domain { } } - pub fn encode(&self, types: &IndexMap>) -> Result { + pub fn encode(&self, types: &IndexMap>) -> Result { let mut object = IndexMap::new(); object.insert("name".to_string(), PrimitiveType::String(self.name.clone())); @@ -430,7 +430,7 @@ impl TypedData { Self { types, primary_type: primary_type.to_string(), domain, message } } - pub fn encode(&self, account: FieldElement) -> Result { + pub fn encode(&self, account: Felt) -> Result { let preset_types = get_preset_types(); if self.domain.revision.clone().unwrap_or("1".to_string()) != "1" { @@ -460,7 +460,7 @@ impl TypedData { #[cfg(test)] mod tests { use starknet::core::utils::starknet_keccak; - use starknet_crypto::FieldElement; + use starknet_crypto::Felt; use super::*; @@ -579,17 +579,14 @@ mod tests { assert_eq!( domain_hash, - FieldElement::from_hex_be( - "0x555f72e550b308e50c1a4f8611483a174026c982a9893a05c185eeb85399657" - ) - .unwrap() + Felt::from_hex("0x555f72e550b308e50c1a4f8611483a174026c982a9893a05c185eeb85399657") + .unwrap() ); } #[test] fn test_message_hash() { - let address = - FieldElement::from_hex_be("0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826").unwrap(); + let address = Felt::from_hex("0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826").unwrap(); let path = "mocks/example_baseTypes.json"; let file = std::fs::File::open(path).unwrap(); @@ -601,10 +598,8 @@ mod tests { assert_eq!( message_hash, - FieldElement::from_hex_be( - "0x790d9fa99cf9ad91c515aaff9465fcb1c87784d9cfb27271ed193675cd06f9c" - ) - .unwrap() + Felt::from_hex("0x790d9fa99cf9ad91c515aaff9465fcb1c87784d9cfb27271ed193675cd06f9c") + .unwrap() ); let path = "mocks/example_enum.json"; @@ -617,10 +612,8 @@ mod tests { assert_eq!( message_hash, - FieldElement::from_hex_be( - "0x3df10475ad5a8f49db4345a04a5b09164d2e24b09f6e1e236bc1ccd87627cc" - ) - .unwrap() + Felt::from_hex("0x3df10475ad5a8f49db4345a04a5b09164d2e24b09f6e1e236bc1ccd87627cc") + .unwrap() ); let path = "mocks/example_presetTypes.json"; @@ -633,10 +626,8 @@ mod tests { assert_eq!( message_hash, - FieldElement::from_hex_be( - "0x26e7b8cedfa63cdbed14e7e51b60ee53ac82bdf26724eb1e3f0710cb8987522" - ) - .unwrap() + Felt::from_hex("0x26e7b8cedfa63cdbed14e7e51b60ee53ac82bdf26724eb1e3f0710cb8987522") + .unwrap() ); } } diff --git a/crates/torii/libp2p/src/types.rs b/crates/torii/libp2p/src/types.rs index cfad2d5b87..927167123b 100644 --- a/crates/torii/libp2p/src/types.rs +++ b/crates/torii/libp2p/src/types.rs @@ -1,11 +1,11 @@ use serde::{Deserialize, Serialize}; -use starknet_crypto::FieldElement; +use starknet::core::types::Felt; use crate::typed_data::TypedData; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Message { pub message: TypedData, - pub signature_r: FieldElement, - pub signature_s: FieldElement, + pub signature_r: Felt, + pub signature_s: Felt, } diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index 20ffa2fec2..50ca9b8af4 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -15,7 +15,7 @@ source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e [[package]] name = "types_test" -version = "0.7.2" +version = "0.7.3" dependencies = [ "dojo", ] diff --git a/examples/rpc/starknet/starknet_getBlockWithReceipts.hurl b/examples/rpc/starknet/starknet_getBlockWithReceipts.hurl new file mode 100644 index 0000000000..9df401069a --- /dev/null +++ b/examples/rpc/starknet/starknet_getBlockWithReceipts.hurl @@ -0,0 +1,21 @@ +POST http://0.0.0.0:5050 +Content-Type: application/json +{ + "jsonrpc": "2.0", + "method": "starknet_getBlockWithReceipts", + "params": [ + "latest" + ], + "id":1 +} + +HTTP 200 +[Asserts] +jsonpath "$.error" not exists +jsonpath "$.result.transactions" isCollection +jsonpath "$.result.block_number" isInteger +jsonpath "$.result.block_hash" matches /^0x[A-Fa-f0-9]+$/ +jsonpath "$.result.parent_hash" matches /^0x[A-Fa-f0-9]+$/ +jsonpath "$.result.starknet_version" matches /^[0-9]+.[0-9]+.[0-9]+$/ +jsonpath "$.result.transactions[*].transaction" exists +jsonpath "$.result.transactions[*].receipt" exists diff --git a/examples/rpc/starknet/starknet_specVersion.hurl b/examples/rpc/starknet/starknet_specVersion.hurl index 2372882226..7ccc8bdefe 100644 --- a/examples/rpc/starknet/starknet_specVersion.hurl +++ b/examples/rpc/starknet/starknet_specVersion.hurl @@ -10,4 +10,4 @@ Content-Type: application/json HTTP 200 [Asserts] jsonpath "$.error" not exists -jsonpath "$.result" equals "0.6.0" +jsonpath "$.result" equals "0.7.1" diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index dd1c6d6c47..6d38546cd6 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -10,7 +10,7 @@ dependencies = [ [[package]] name = "dojo_examples" -version = "0.7.2" +version = "0.7.3" dependencies = [ "dojo", ] From 0ff19cc4df1b3f1c29fea3457f1d5844a50204e7 Mon Sep 17 00:00:00 2001 From: glihm Date: Fri, 5 Jul 2024 22:38:15 -0600 Subject: [PATCH 78/88] fix(katana-node-bindings): use new Felt (#2146) --- Cargo.lock | 2 +- crates/katana/node-bindings/Cargo.toml | 1 - crates/katana/node-bindings/src/lib.rs | 20 ++++++++++---------- crates/katana/runner/src/lib.rs | 8 ++++---- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a661166da3..7bd95ca5c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8541,7 +8541,7 @@ version = "0.7.3" dependencies = [ "serde", "serde_json", - "starknet", + "starknet 0.11.0", "tempfile", "thiserror", "tokio", diff --git a/crates/katana/node-bindings/Cargo.toml b/crates/katana/node-bindings/Cargo.toml index 4fccee0f08..6c68d9cfa1 100644 --- a/crates/katana/node-bindings/Cargo.toml +++ b/crates/katana/node-bindings/Cargo.toml @@ -2,7 +2,6 @@ description = "Utilities for working with the Katana binary" edition.workspace = true license-file.workspace = true -license.workspace = true name = "katana-node-bindings" repository.workspace = true version.workspace = true diff --git a/crates/katana/node-bindings/src/lib.rs b/crates/katana/node-bindings/src/lib.rs index 72bd86eef9..e82904e216 100644 --- a/crates/katana/node-bindings/src/lib.rs +++ b/crates/katana/node-bindings/src/lib.rs @@ -13,7 +13,7 @@ use std::process::{Child, Command}; use std::str::FromStr; use std::time::{Duration, Instant}; -use starknet::core::types::{FieldElement, FromStrError}; +use starknet::core::types::{Felt, FromStrError}; use starknet::macros::short_string; use starknet::signers::SigningKey; use thiserror::Error; @@ -29,7 +29,7 @@ const KATANA_STARTUP_TIMEOUT_MILLIS: u64 = 10_000; #[derive(Debug, Clone)] pub struct Account { /// The account contract address - pub address: FieldElement, + pub address: Felt, /// The private key, if any pub private_key: Option, } @@ -42,7 +42,7 @@ pub struct KatanaInstance { port: u16, child: Child, accounts: Vec, - chain_id: FieldElement, + chain_id: Felt, } impl KatanaInstance { @@ -62,7 +62,7 @@ impl KatanaInstance { } /// Returns the chain of the katana instance - pub fn chain_id(&self) -> FieldElement { + pub fn chain_id(&self) -> Felt { self.chain_id } @@ -179,7 +179,7 @@ pub struct Katana { disable_validate: bool, // Environment options - chain_id: Option, + chain_id: Option, validate_max_steps: Option, invoke_max_steps: Option, eth_gas_price: Option, @@ -335,7 +335,7 @@ impl Katana { } /// Sets the chain ID. - pub const fn chain_id(mut self, id: FieldElement) -> Self { + pub const fn chain_id(mut self, id: Felt) -> Self { self.chain_id = Some(id); self } @@ -508,8 +508,8 @@ impl Katana { port = addr.port(); for (address, info) in account_infos { - let address = FieldElement::from_str(&address)?; - let private_key = FieldElement::from_str(&info.private_key)?; + let address = Felt::from_str(&address)?; + let private_key = Felt::from_str(&info.private_key)?; let key = SigningKey::from_secret_scalar(private_key); accounts.push(Account { address, private_key: Some(key) }); } @@ -547,7 +547,7 @@ impl Katana { .ok_or(Error::MissingAccountAddress)? .trim(); - let address = FieldElement::from_str(hex)?; + let address = Felt::from_str(hex)?; let account = Account { address, private_key: None }; current_account = Some(account); } @@ -566,7 +566,7 @@ impl Katana { .ok_or(Error::MissingAccountPrivateKey)? .trim(); - let private_key = FieldElement::from_str(hex)?; + let private_key = Felt::from_str(hex)?; let signing_key = SigningKey::from_secret_scalar(private_key); accounts.push(Account { private_key: Some(signing_key), ..acc }); } diff --git a/crates/katana/runner/src/lib.rs b/crates/katana/runner/src/lib.rs index 435e0d5ea0..2e09aa6b77 100644 --- a/crates/katana/runner/src/lib.rs +++ b/crates/katana/runner/src/lib.rs @@ -11,7 +11,7 @@ use anyhow::{Context, Result}; use assert_fs::TempDir; use katana_node_bindings::{Katana, KatanaInstance}; pub use runner_macro::{katana_test, runner}; -use starknet::core::types::FieldElement; +use starknet::core::types::Felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use tokio::sync::Mutex; @@ -23,7 +23,7 @@ pub struct KatanaRunner { instance: KatanaInstance, provider: JsonRpcClient, log_file_path: PathBuf, - contract: Mutex>, + contract: Mutex>, } /// Configuration for the KatanaRunner. @@ -150,12 +150,12 @@ impl KatanaRunner { // A contract needs to be deployed only once for each instance // In proptest runner is static but deployment would happen for each test, unless it is // persisted here. - pub async fn set_contract(&self, contract_address: FieldElement) { + pub async fn set_contract(&self, contract_address: Felt) { let mut lock = self.contract.lock().await; *lock = Some(contract_address); } - pub async fn contract(&self) -> Option { + pub async fn contract(&self) -> Option { *self.contract.lock().await } } From 0c50c7d6e09a1f77494cf787d03d7f3588dc958f Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Sat, 6 Jul 2024 12:49:43 +0800 Subject: [PATCH 79/88] docs(katana-node-bindings): add json log docs (#2145) --- crates/katana/node-bindings/src/json.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/katana/node-bindings/src/json.rs b/crates/katana/node-bindings/src/json.rs index 3dec9efcd3..ca717d38a1 100644 --- a/crates/katana/node-bindings/src/json.rs +++ b/crates/katana/node-bindings/src/json.rs @@ -1,4 +1,17 @@ //! Utilities for parsing the logs in JSON format. This is when katana is run with `--json-log`. +//! +//! When JSON log is enabled, the startup details are all printed in a single log message. +//! Example startup log in JSON format: +//! +//! ```json +//! {"timestamp":"2024-07-06T03:35:00.410846Z","level":"INFO","fields":{"message":"{\"accounts\":[[\ +//! "318027405971194400117186968443431282813445578359155272415686954645506762954\",{\"balance\":\" +//! 0x21e19e0c9bab2400000\",\"class_hash\":\" +//! 0x5400e90f7e0ae78bd02c77cd75527280470e2fe19c54970dd79dc37a9d3645c\",\"private_key\":\" +//! 0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a\",\"public_key\":\" +//! 0x640466ebd2ce505209d3e5c4494b4276ed8f1cde764d757eb48831961f7cdea\"}]],\"address\":\"0.0.0.0: +//! 5050\",\"seed\":\"0\"}"},"target":"katana::cli"} +//! ``` use serde::Deserialize; From ed9f0cedef1db52ff596beb88ab7fa82b055ea9e Mon Sep 17 00:00:00 2001 From: glihm Date: Sat, 6 Jul 2024 18:12:23 -0600 Subject: [PATCH 80/88] feat: namespaces (#2148) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Namespace feature * Handle namespace for models and contracts (#2023) * fix(migrate): when `init_calldata` depends on contract that was already deployed (#2058) * fix(migrate): when `init_calldata` depends on contract that was already deployed * add tests * fix(ci): ensure katana runs in debian:bookworm-slim (#2073) * Ensure katana runs in debian:bookworm-slim * chore: switch to cartridge fork and adjust CI to 4 core to build Katana * chore: add old prover-sdk version to check CI fail * fix katana bin permissions * chore: add ensure-docker as requirement for big jobs * chore: point to http-prover using rustls-tls * dbg * wip * chore: bump to artifacts v4 * fix: typo * wip * fix: don't use path explicitely * wip * fix: fix artifacts managment * add ls * fix: use other path with checkout * fix: remove prints --------- Co-authored-by: glihm * [dojo-core]: update gas logs (#1877) dojo-core: update gas logs Co-authored-by: glihm * Prepare release: v0.7.1 (#2076) Co-authored-by: glihm * fix: allow the use of self and world in an exclusive manner (#2063) * fix: allow the use of self and world in an exclusive manner * fix: fmt * fix: cairo fmt * fix: ensure a warning is emitted with generate trait and world * fix: cairo fmt * Update devcontainer image: v0.7.1 (#2077) Co-authored-by: glihm * Namespace feature --------- Co-authored-by: lambda-0x <0xlambda@protonmail.com> Co-authored-by: Tarrence van As Co-authored-by: glihm Co-authored-by: notV4l <122404722+notV4l@users.noreply.github.com> Co-authored-by: glihm * fix: update manifests * fix: update manifests * fix: update world address in Scarb.toml * fix world_test * Namespace feature improvements (#2108) * standardize model/system interface for name/namespace/selectors * wip * Overlays (#2127) * load custom overlay manifests * update metadata management + some fixes * update sozo commands with namespace * fix: change tag separator to `-` (#2132) * wip * fix tests * update sozo auth command + auto-auth feature (#2134) * update sozo auth command + auto-auth feature * fix: fix some tests --------- Co-authored-by: glihm * replace {WORLD,BASE}_CONTRACT_NAME by {WORLD,BASE}_CONTRACT_TAG (#2136) * replace {WORLD,BASE}_CONTRACT_NAME by {WORLD,BASE}_CONTRACT_TAG * fix: ensure model selector correctly computed in tests * fix: wip on tests and use Katana Runner --------- Co-authored-by: glihm * fix(sozo): migration with seed and world address both provided (#2135) * initial commit * add seed to manifest and remove from cli * add overlays for dojo_init * make tests compile * fix some tests * fix lints * fix: use same name for seed tests --------- Co-authored-by: glihm * feat(torii-core): namespace in processor & db migration (#2130) * feat(torii-core): namespace in processor & db migration * refactor: selector logic and model readers for new namespace * feat: compute correct selector on model register * fix: contract address in event data * refactor: update proto for new namespace * feat: update torii client for new namespaces * refactor: cache and schema types * feat: rebase from main update to new types * feat: update grpc service to support namespaces * feat: add namespace to broker * feat: fix libp2p and update grpc subs for pattern on models * feat: finish up refactor on grpc * chore: revert changes on proto to use onlky model field * feat: first graphql support * fix: composite clauses & wrap up * fix: storage and tests * refactor: storage to use selector * fix: storage subscriptions * escape composite tbales * Overlays (#2127) * load custom overlay manifests * update metadata management + some fixes * update sozo commands with namespace * fix: change tag separator to `-` (#2132) * wip * fix tests * merge and remove print * fix: remove print * fix: fmt and clippy wip * fix: graphql tests * model tests * query test * fmt * fix: query * chore: graphql subscription tests * wip: fix testing * wip: wip on testing * fix: fix typo * fix: use correct model name * wip: testing * feat: add namespace to model object * fix: fix subscription tests * fix: fix tests * fix: fmt * fix: clippy * wip: latest torii test * fix: fmt * fix(torii-libp2p): validate namespace message * fix(torii-libp2p): escape table name * fmt --------- Co-authored-by: Rémy Baranx Co-authored-by: glihm * fix: fix compiler diags by rewriting the function with rewrite node (#2141) * fix: fix compiler diags by rewriting the function with rewrite node * fix: ensure dojo init also shows correct diagnostics * fix: fmt + clippy * fix: ensure impl is correctly impl with RewriteNode * fix: add missing mapping to interfaces * fix: ensure wasm compatibility * fix: test fixes for wasm32 changes (#2144) * fix: test fixes for wasm32 changes * fix: fix cairo tests * fix: clean subcommand (#2122) * fix: clean should only remove target/manifest file of particular profile by defaul * fix lints * fix formatting * fix: ensure every target is considered independently --------- Co-authored-by: glihm * fix: uncomment tests * fix: add more tests * fix: fix metadata test * fix: add tests and fix metadata * fix: attempt to fix flaky test with 1s delay --------- Co-authored-by: remy.baranx@gmail.com Co-authored-by: lambda-0x <0xlambda@protonmail.com> Co-authored-by: Tarrence van As Co-authored-by: notV4l <122404722+notV4l@users.noreply.github.com> Co-authored-by: glihm Co-authored-by: notV4l Co-authored-by: Larko <59736843+Larkooo@users.noreply.github.com> --- .vscode/launch.json | 15 + Cargo.lock | 15 + bin/sozo/src/commands/auth.rs | 230 +- bin/sozo/src/commands/build.rs | 5 +- bin/sozo/src/commands/call.rs | 17 +- bin/sozo/src/commands/clean.rs | 235 +- bin/sozo/src/commands/dev.rs | 17 +- bin/sozo/src/commands/events.rs | 6 +- bin/sozo/src/commands/execute.rs | 21 +- bin/sozo/src/commands/migrate.rs | 25 +- bin/sozo/src/commands/model.rs | 54 +- .../commands/options/account/controller.rs | 13 +- bin/sozo/src/commands/print_env.rs | 11 +- bin/sozo/src/utils.rs | 14 +- bin/sozo/tests/register_test.rs | 19 +- bin/sozo/tests/test_build.rs | 5 +- bin/sozo/tests/test_migrate.rs | 47 + .../contracts/src/tests/test_world.cairo | 2 +- crates/dojo-bindgen/src/lib.rs | 90 +- .../src/plugins/typescript/mod.rs | 23 +- .../src/plugins/typescript_v2/mod.rs | 60 +- crates/dojo-bindgen/src/plugins/unity/mod.rs | 18 +- crates/dojo-core/Scarb.lock | 4 +- crates/dojo-core/src/base_test.cairo | 38 +- crates/dojo-core/src/contract.cairo | 15 + crates/dojo-core/src/lib.cairo | 4 + crates/dojo-core/src/model.cairo | 25 +- crates/dojo-core/src/packing_test.cairo | 3 - crates/dojo-core/src/resource_metadata.cairo | 30 +- crates/dojo-core/src/test_utils.cairo | 5 +- crates/dojo-core/src/utils.cairo | 6 + crates/dojo-core/src/utils_test.cairo | 17 + crates/dojo-core/src/world.cairo | 500 ++- crates/dojo-core/src/world_test.cairo | 442 +- crates/dojo-lang/Cargo.toml | 5 +- crates/dojo-lang/src/compiler.rs | 313 +- crates/dojo-lang/src/compiler_test.rs | 5 +- crates/dojo-lang/src/contract.rs | 411 +- crates/dojo-lang/src/interface.rs | 53 +- crates/dojo-lang/src/lib.rs | 1 + .../compiler_cairo/Scarb.toml | 2 + ...v240.json => ccf-cairo_v240-8d921297.json} | 0 ...v260.json => ccf-cairo_v260-465ec7fe.json} | 0 .../manifests/dev/abis/base/dojo-base.json | 49 +- ...{dojo_world_world.json => dojo-world.json} | 117 +- ...v240.toml => ccf-cairo_v240-8d921297.toml} | 5 +- ...v260.toml => ccf-cairo_v260-465ec7fe.toml} | 5 +- .../manifests/dev/base/dojo-base.toml | 4 +- .../manifests/dev/base/dojo-world.toml | 6 + .../manifests/dev/base/dojo_world_world.toml | 5 - crates/dojo-lang/src/model.rs | 112 +- crates/dojo-lang/src/plugin.rs | 54 +- crates/dojo-lang/src/plugin_test_data/model | 1520 ++++++- crates/dojo-lang/src/plugin_test_data/system | 698 +-- crates/dojo-lang/src/utils.rs | 47 + crates/dojo-test-utils/build.rs | 16 +- crates/dojo-test-utils/src/compiler.rs | 21 +- crates/dojo-test-utils/src/migration.rs | 29 +- crates/dojo-types/src/lib.rs | 6 +- crates/dojo-types/src/schema.rs | 1 + crates/dojo-world/Cargo.toml | 5 +- crates/dojo-world/src/contracts/abi/world.rs | 117 +- crates/dojo-world/src/contracts/mod.rs | 1 + crates/dojo-world/src/contracts/model.rs | 39 +- crates/dojo-world/src/contracts/model_test.rs | 21 +- crates/dojo-world/src/contracts/naming.rs | 146 + crates/dojo-world/src/contracts/world.rs | 18 +- crates/dojo-world/src/contracts/world_test.rs | 55 +- .../dojo-world/src/manifest/manifest_test.rs | 336 +- crates/dojo-world/src/manifest/mod.rs | 314 +- crates/dojo-world/src/manifest/types.rs | 21 +- crates/dojo-world/src/metadata.rs | 144 +- crates/dojo-world/src/metadata_test.rs | 105 +- crates/dojo-world/src/migration/class.rs | 5 +- crates/dojo-world/src/migration/contract.rs | 5 +- crates/dojo-world/src/migration/mod.rs | 8 +- crates/dojo-world/src/migration/strategy.rs | 82 +- crates/dojo-world/src/migration/world.rs | 52 +- crates/dojo-world/src/migration/world_test.rs | 106 +- crates/dojo-world/src/utils.rs | 1 + crates/katana/core/tests/sequencer.rs | 9 +- crates/sozo/ops/Cargo.toml | 2 + crates/sozo/ops/src/auth.rs | 242 +- crates/sozo/ops/src/call.rs | 4 +- crates/sozo/ops/src/events.rs | 100 +- crates/sozo/ops/src/execute.rs | 4 +- crates/sozo/ops/src/migration/auto_auth.rs | 29 +- crates/sozo/ops/src/migration/migrate.rs | 158 +- crates/sozo/ops/src/migration/mod.rs | 205 +- crates/sozo/ops/src/migration/utils.rs | 17 +- crates/sozo/ops/src/model.rs | 22 +- crates/sozo/ops/src/register.rs | 12 +- crates/sozo/ops/src/tests/auth.rs | 54 +- crates/sozo/ops/src/tests/call.rs | 41 +- crates/sozo/ops/src/tests/migration.rs | 252 +- crates/sozo/ops/src/tests/setup.rs | 20 +- crates/sozo/ops/src/tests/utils.rs | 6 +- crates/sozo/ops/src/utils.rs | 23 +- crates/torii/client/src/client/error.rs | 5 +- crates/torii/client/src/client/mod.rs | 32 +- crates/torii/client/src/client/storage.rs | 35 +- .../torii/client/src/client/subscription.rs | 43 +- crates/torii/core/src/cache.rs | 44 +- crates/torii/core/src/error.rs | 2 + crates/torii/core/src/model.rs | 163 +- .../core/src/processors/event_message.rs | 2 +- .../core/src/processors/register_model.rs | 14 +- .../core/src/processors/store_del_record.rs | 2 +- .../core/src/processors/store_set_record.rs | 2 +- crates/torii/core/src/sql.rs | 83 +- crates/torii/core/src/sql_test.rs | 98 +- crates/torii/core/src/types.rs | 1 + crates/torii/graphql/Cargo.toml | 1 + crates/torii/graphql/src/object/entity.rs | 19 +- crates/torii/graphql/src/object/model.rs | 1 + crates/torii/graphql/src/object/model_data.rs | 17 +- crates/torii/graphql/src/query/data.rs | 6 +- crates/torii/graphql/src/query/mod.rs | 7 +- crates/torii/graphql/src/schema.rs | 21 +- .../torii/graphql/src/tests/entities_test.rs | 12 +- .../torii/graphql/src/tests/metadata_test.rs | 4 + crates/torii/graphql/src/tests/mod.rs | 58 +- crates/torii/graphql/src/tests/models_test.rs | 26 +- .../graphql/src/tests/subscription_test.rs | 34 +- crates/torii/graphql/src/utils.rs | 13 + crates/torii/grpc/Cargo.toml | 3 +- crates/torii/grpc/proto/types.proto | 46 +- crates/torii/grpc/src/server/mod.rs | 183 +- .../grpc/src/server/subscriptions/entity.rs | 29 +- .../src/server/subscriptions/event_message.rs | 29 +- .../src/server/subscriptions/model_diff.rs | 4 +- .../grpc/src/server/tests/entities_test.rs | 43 +- crates/torii/grpc/src/types/mod.rs | 14 +- crates/torii/grpc/src/types/schema.rs | 119 +- crates/torii/libp2p/Cargo.toml | 1 + crates/torii/libp2p/src/server/mod.rs | 31 +- crates/torii/libp2p/src/tests.rs | 30 +- .../20240702140704_model_namespace.sql | 3 + crates/torii/types-test/Scarb.toml | 10 +- .../manifests/dev/base/dojo_world_world.toml | 5 - examples/spawn-and-move/Scarb.toml | 6 +- ...on => dojo_examples-actions-40b6994c.json} | 88 +- .../dojo_examples-mock_token-31599eb2.json} | 91 +- .../dojo_examples-others-61de2c18.json} | 70 +- .../abis/base/dojo-base.json} | 49 +- ...{dojo_world_world.json => dojo-world.json} | 117 +- ...xamples-ContractInitialized-376b7bd6.json} | 33 + .../dojo_examples-Message-1bb1d226.json} | 33 + .../dojo_examples-MockToken-38903c7c.json} | 33 + .../models/dojo_examples-Moved-318ae40d.json} | 33 + ...json => dojo_examples-Moves-2e2accba.json} | 33 + .../dojo_examples-PlayerConfig-3adad785.json} | 33 + .../dojo_examples-Position-1e145e26.json} | 33 + ...dojo_examples-ServerProfile-4caad1e6.json} | 33 + ...on => dojo_examples-actions-40b6994c.json} | 88 +- .../dojo_examples-mock_token-31599eb2.json | 195 + .../dojo_examples-others-61de2c18.json} | 70 +- ...{dojo_world_world.json => dojo-world.json} | 117 +- ...xamples-ContractInitialized-376b7bd6.json} | 33 + ...on => dojo_examples-Message-1bb1d226.json} | 33 + .../dojo_examples-MockToken-38903c7c.json} | 33 + .../models/dojo_examples-Moved-318ae40d.json} | 33 + .../models/dojo_examples-Moves-2e2accba.json} | 33 + .../dojo_examples-PlayerConfig-3adad785.json} | 33 + ...n => dojo_examples-Position-1e145e26.json} | 33 + ...dojo_examples-ServerProfile-4caad1e6.json} | 33 + .../models/dojo_examples_models_moves.json | 393 -- ...es_others_others_contract_initialized.json | 367 -- .../dojo_examples-actions-40b6994c.toml | 11 + .../dojo_examples-mock_token-31599eb2.toml | 11 + .../dojo_examples-others-61de2c18.toml | 11 + .../dojo_examples_actions_actions.toml | 10 - .../dojo_examples_mock_token_mock_token.toml | 10 - .../dojo_examples_others_others.toml | 10 - .../{dojo_base_base.toml => dojo-base.toml} | 4 +- .../manifests/dev/base/dojo-world.toml | 6 + .../manifests/dev/base/dojo_world_world.toml | 5 - ...examples-ContractInitialized-376b7bd6.toml | 21 + .../dojo_examples-Message-1bb1d226.toml | 26 + .../dojo_examples-MockToken-38903c7c.toml | 16 + .../models/dojo_examples-Moved-318ae40d.toml | 16 + .../models/dojo_examples-Moves-2e2accba.toml | 21 + .../dojo_examples-PlayerConfig-3adad785.toml | 26 + .../dojo_examples-Position-1e145e26.toml | 16 + .../dojo_examples-ServerProfile-4caad1e6.toml | 21 + .../dojo_examples_actions_actions_moved.toml | 15 - .../models/dojo_examples_models_message.toml | 25 - .../dojo_examples_models_mock_token.toml | 15 - .../models/dojo_examples_models_moves.toml | 20 - .../dojo_examples_models_player_config.toml | 25 - .../models/dojo_examples_models_position.toml | 15 - .../dojo_examples_models_server_profile.toml | 20 - ...es_others_others_contract_initialized.toml | 20 - .../manifests/dev/manifest.json | 981 ++++- .../manifests/dev/manifest.toml | 171 +- .../dojo_examples_actions_actions.toml | 4 - .../dojo_examples_others_others.toml | 4 - .../dev/overlays/dojo_base_base.toml | 1 - .../dev/overlays/dojo_world_world.toml | 1 - .../dojo_examples_actions_actions_moved.toml | 1 - .../dojo_examples_models_emote_message.toml | 1 - .../models/dojo_examples_models_moves.toml | 1 - .../dojo_examples_models_player_config.toml | 1 - .../models/dojo_examples_models_position.toml | 1 - ...es_others_others_contract_initialized.toml | 1 - ...on => dojo_examples-actions-40b6994c.json} | 126 +- .../dojo_examples-mock_token-31599eb2.json | 195 + .../dojo_examples-others-61de2c18.json} | 70 +- .../abis/base/dojo-base.json} | 49 +- ...{dojo_world_world.json => dojo-world.json} | 117 +- ...xamples-ContractInitialized-376b7bd6.json} | 33 + .../dojo_examples-Message-1bb1d226.json} | 33 + .../dojo_examples-MockToken-38903c7c.json} | 33 + .../models/dojo_examples-Moved-318ae40d.json} | 33 + .../models/dojo_examples-Moves-2e2accba.json} | 33 + .../dojo_examples-PlayerConfig-3adad785.json} | 33 + .../dojo_examples-Position-1e145e26.json} | 33 + ...dojo_examples-ServerProfile-4caad1e6.json} | 69 +- .../dojo_examples_actions_actions.json | 290 -- .../abis/deployments/dojo_world_world.json | 996 ----- .../dojo_examples_actions_actions_moved.json | 389 -- .../dojo_examples_models_emote_message.json | 389 -- .../models/dojo_examples_models_message.json | 371 -- .../models/dojo_examples_models_position.json | 377 -- .../dojo_examples-actions-40b6994c.toml | 11 + .../dojo_examples-mock_token-31599eb2.toml | 11 + .../dojo_examples-others-61de2c18.toml | 11 + .../dojo_examples_actions_actions.toml | 10 - .../dojo_examples_mock_token_mock_token.toml | 10 - .../dojo_examples_others_others.toml | 10 - .../manifests/release/base/dojo-base.toml | 4 +- .../manifests/release/base/dojo-world.toml | 6 + .../release/base/dojo_world_world.toml | 5 - ...examples-ContractInitialized-376b7bd6.toml | 21 + .../dojo_examples-Message-1bb1d226.toml | 26 + .../dojo_examples-MockToken-38903c7c.toml | 16 + .../models/dojo_examples-Moved-318ae40d.toml | 16 + .../models/dojo_examples-Moves-2e2accba.toml | 21 + .../dojo_examples-PlayerConfig-3adad785.toml | 26 + .../dojo_examples-Position-1e145e26.toml | 16 + .../dojo_examples-ServerProfile-4caad1e6.toml | 21 + .../dojo_examples_actions_actions_moved.toml | 15 - .../models/dojo_examples_models_message.toml | 25 - .../dojo_examples_models_mock_token.toml | 15 - .../models/dojo_examples_models_moves.toml | 20 - .../dojo_examples_models_player_config.toml | 25 - .../models/dojo_examples_models_position.toml | 15 - ...es_others_others_contract_initialized.toml | 20 - .../manifests/release/manifest.json | 3910 ----------------- .../manifests/release/manifest.toml | 185 - .../dojo_examples_actions_actions.toml | 4 - .../dojo_examples_others_others.toml | 8 - .../release/overlays/dojo_base_base.toml | 1 - .../release/overlays/dojo_world_world.toml | 1 - .../dojo_examples_actions_actions_moved.toml | 1 - .../models/dojo_examples_models_message.toml | 1 - .../dojo_examples_models_mock_token.toml | 1 - .../models/dojo_examples_models_moves.toml | 1 - .../dojo_examples_models_player_config.toml | 1 - .../models/dojo_examples_models_position.toml | 1 - ...es_others_others_contract_initialized.toml | 1 - .../spawn-and-move/overlays/dev/actions.toml | 2 + .../spawn-and-move/overlays/dev/others.toml | 2 + examples/spawn-and-move/src/actions.cairo | 2 +- scripts/rebuild_test_artifacts.sh | 10 + 265 files changed, 9908 insertions(+), 11604 deletions(-) create mode 100644 bin/sozo/tests/test_migrate.rs create mode 100644 crates/dojo-core/src/contract.cairo create mode 100644 crates/dojo-core/src/utils.cairo create mode 100644 crates/dojo-core/src/utils_test.cairo rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/{compiler_cairo_cairo_24_cairo_v240.json => ccf-cairo_v240-8d921297.json} (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/{compiler_cairo_cairo_26_cairo_v260.json => ccf-cairo_v260-465ec7fe.json} (100%) rename examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json => crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json (67%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/{dojo_world_world.json => dojo-world.json} (89%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/{compiler_cairo_cairo_24_cairo_v240.toml => ccf-cairo_v240-8d921297.toml} (66%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/{compiler_cairo_cairo_26_cairo_v260.toml => ccf-cairo_v260-465ec7fe.toml} (66%) rename examples/spawn-and-move/manifests/release/base/dojo_base_base.toml => crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml (66%) create mode 100644 crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml delete mode 100644 crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml create mode 100644 crates/dojo-lang/src/utils.rs create mode 100644 crates/dojo-world/src/contracts/naming.rs create mode 100644 crates/torii/migrations/20240702140704_model_namespace.sql delete mode 100644 crates/torii/types-test/manifests/dev/base/dojo_world_world.toml rename examples/spawn-and-move/manifests/dev/abis/base/contracts/{dojo_examples_actions_actions.json => dojo_examples-actions-40b6994c.json} (85%) rename examples/spawn-and-move/manifests/dev/abis/{deployments/contracts/dojo_examples_others_others.json => base/contracts/dojo_examples-mock_token-31599eb2.json} (61%) rename examples/spawn-and-move/manifests/{release/abis/deployments/contracts/dojo_examples_others_others.json => dev/abis/base/contracts/dojo_examples-others-61de2c18.json} (67%) rename examples/spawn-and-move/manifests/{release/abis/base/contracts/dojo_examples_mock_token_mock_token.json => dev/abis/base/dojo-base.json} (67%) rename examples/spawn-and-move/manifests/dev/abis/base/{dojo_world_world.json => dojo-world.json} (89%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_others_others_contract_initialized.json => dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json} (92%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_models_message.json => dev/abis/base/models/dojo_examples-Message-1bb1d226.json} (91%) rename examples/spawn-and-move/manifests/dev/abis/{deployments/models/dojo_examples_models_mock_token.json => base/models/dojo_examples-MockToken-38903c7c.json} (91%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_actions_actions_moved.json => dev/abis/base/models/dojo_examples-Moved-318ae40d.json} (92%) rename examples/spawn-and-move/manifests/dev/abis/base/models/{dojo_examples_models_moves.json => dojo_examples-Moves-2e2accba.json} (92%) rename examples/spawn-and-move/manifests/dev/abis/{deployments/models/dojo_examples_models_player_config.json => base/models/dojo_examples-PlayerConfig-3adad785.json} (92%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_models_position.json => dev/abis/base/models/dojo_examples-Position-1e145e26.json} (92%) rename examples/spawn-and-move/manifests/dev/abis/{deployments/models/dojo_examples_models_server_profile.json => base/models/dojo_examples-ServerProfile-4caad1e6.json} (91%) rename examples/spawn-and-move/manifests/dev/abis/deployments/contracts/{dojo_examples_actions_actions.json => dojo_examples-actions-40b6994c.json} (85%) create mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json rename examples/spawn-and-move/manifests/{release/abis/base/contracts/dojo_examples_others_others.json => dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json} (67%) rename examples/spawn-and-move/manifests/dev/abis/deployments/{dojo_world_world.json => dojo-world.json} (89%) rename examples/spawn-and-move/manifests/{release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json => dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json} (92%) rename examples/spawn-and-move/manifests/dev/abis/deployments/models/{dojo_examples_models_message.json => dojo_examples-Message-1bb1d226.json} (91%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_models_mock_token.json => dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json} (91%) rename examples/spawn-and-move/manifests/dev/abis/{base/models/dojo_examples_actions_actions_moved.json => deployments/models/dojo_examples-Moved-318ae40d.json} (92%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_models_moves.json => dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json} (92%) rename examples/spawn-and-move/manifests/{release/abis/base/models/dojo_examples_models_player_config.json => dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json} (92%) rename examples/spawn-and-move/manifests/dev/abis/deployments/models/{dojo_examples_models_position.json => dojo_examples-Position-1e145e26.json} (92%) rename examples/spawn-and-move/manifests/dev/abis/{base/models/dojo_examples_models_server_profile.json => deployments/models/dojo_examples-ServerProfile-4caad1e6.json} (91%) delete mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_moves.json delete mode 100644 examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json create mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml rename examples/spawn-and-move/manifests/dev/base/{dojo_base_base.toml => dojo-base.toml} (66%) create mode 100644 examples/spawn-and-move/manifests/dev/base/dojo-world.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml create mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml delete mode 100644 examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml delete mode 100644 examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml rename examples/spawn-and-move/manifests/release/abis/base/contracts/{dojo_examples_actions_actions.json => dojo_examples-actions-40b6994c.json} (75%) create mode 100644 examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json rename examples/spawn-and-move/manifests/{dev/abis/base/contracts/dojo_examples_others_others.json => release/abis/base/contracts/dojo_examples-others-61de2c18.json} (67%) rename examples/spawn-and-move/manifests/{dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json => release/abis/base/dojo-base.json} (67%) rename examples/spawn-and-move/manifests/release/abis/base/{dojo_world_world.json => dojo-world.json} (89%) rename examples/spawn-and-move/manifests/{dev/abis/base/models/dojo_examples_others_others_contract_initialized.json => release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json} (92%) rename examples/spawn-and-move/manifests/{dev/abis/base/models/dojo_examples_models_message.json => release/abis/base/models/dojo_examples-Message-1bb1d226.json} (91%) rename examples/spawn-and-move/manifests/{dev/abis/base/models/dojo_examples_models_mock_token.json => release/abis/base/models/dojo_examples-MockToken-38903c7c.json} (91%) rename examples/spawn-and-move/manifests/{dev/abis/deployments/models/dojo_examples_actions_actions_moved.json => release/abis/base/models/dojo_examples-Moved-318ae40d.json} (92%) rename examples/spawn-and-move/manifests/release/abis/{deployments/models/dojo_examples_models_moves.json => base/models/dojo_examples-Moves-2e2accba.json} (92%) rename examples/spawn-and-move/manifests/release/abis/{deployments/models/dojo_examples_models_player_config.json => base/models/dojo_examples-PlayerConfig-3adad785.json} (92%) rename examples/spawn-and-move/manifests/{dev/abis/base/models/dojo_examples_models_position.json => release/abis/base/models/dojo_examples-Position-1e145e26.json} (92%) rename examples/spawn-and-move/manifests/{dev/abis/base/models/dojo_examples_models_player_config.json => release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json} (88%) delete mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json delete mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json delete mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json delete mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json delete mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json delete mode 100644 examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json create mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml create mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml create mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_base_base.toml => examples/spawn-and-move/manifests/release/base/dojo-base.toml (65%) create mode 100644 examples/spawn-and-move/manifests/release/base/dojo-world.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/dojo_world_world.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml create mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml delete mode 100644 examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml delete mode 100644 examples/spawn-and-move/manifests/release/manifest.json delete mode 100644 examples/spawn-and-move/manifests/release/manifest.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml delete mode 100644 examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml create mode 100644 examples/spawn-and-move/overlays/dev/actions.toml create mode 100644 examples/spawn-and-move/overlays/dev/others.toml diff --git a/.vscode/launch.json b/.vscode/launch.json index 89693441c5..f141a5a8c7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,6 +23,21 @@ "apply" ] }, + { + "name": "Sozo", + "type": "lldb", + "request": "launch", + "program": "${workspaceFolder}/target/debug/sozo", + "args": [ + "--manifest-path", + "examples/spawn-and-move/Scarb.toml", + "events", + "--world", + "0x04c972a756d796d716f665a8079dbf9aff05bbba41a2b8194553073f31d7d393", + "--chunk-size", + "100" + ] + }, { "type": "lldb", "request": "launch", diff --git a/Cargo.lock b/Cargo.lock index 7bd95ca5c5..8e116f949c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5097,6 +5097,7 @@ name = "dojo-lang" version = "0.7.3" dependencies = [ "anyhow", + "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -5128,6 +5129,7 @@ dependencies = [ "num-traits 0.2.19", "once_cell", "pretty_assertions", + "regex", "salsa", "scarb", "semver 1.0.23", @@ -5136,6 +5138,7 @@ dependencies = [ "serde_with 2.3.3", "smol_str", "starknet 0.11.0", + "starknet-crypto 0.7.1", "test-log", "thiserror", "toml 0.8.14", @@ -5260,6 +5263,7 @@ dependencies = [ "topological-sort", "tracing", "url", + "walkdir", ] [[package]] @@ -13431,6 +13435,7 @@ dependencies = [ "dojo-world", "futures", "ipfs-api-backend-hyper", + "itertools 0.12.1", "katana-runner", "num-bigint", "num-traits 0.2.19", @@ -13444,6 +13449,7 @@ dependencies = [ "smol_str", "starknet 0.11.0", "starknet-crypto 0.7.1", + "tee", "thiserror", "tokio", "toml 0.8.14", @@ -14422,6 +14428,12 @@ dependencies = [ "xattr", ] +[[package]] +name = "tee" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c12559dba7383625faaff75be24becf35bfc885044375bcab931111799a3da" + [[package]] name = "tempfile" version = "3.10.1" @@ -15050,6 +15062,7 @@ dependencies = [ "dojo-test-utils", "dojo-types", "dojo-world", + "katana-runner", "lazy_static", "regex", "scarb", @@ -15088,6 +15101,7 @@ dependencies = [ "futures-util", "hex", "hyper 0.14.29", + "katana-runner", "num-traits 0.2.19", "parking_lot 0.12.3", "prost 0.11.9", @@ -15133,6 +15147,7 @@ dependencies = [ "dojo-world", "futures", "indexmap 2.2.6", + "katana-runner", "libp2p", "libp2p-webrtc", "libp2p-webrtc-websys", diff --git a/bin/sozo/src/commands/auth.rs b/bin/sozo/src/commands/auth.rs index 554f7fe945..550ece1124 100644 --- a/bin/sozo/src/commands/auth.rs +++ b/bin/sozo/src/commands/auth.rs @@ -1,6 +1,6 @@ use anyhow::Result; use clap::{Args, Subcommand}; -use dojo_world::metadata::Environment; +use dojo_world::metadata::{get_default_namespace_from_ws, Environment}; use scarb::core::Config; use scarb_ui::Ui; use sozo_ops::auth; @@ -63,6 +63,9 @@ impl AuthArgs { let env_metadata = utils::load_metadata_from_config(config)?; trace!(metadata=?env_metadata, "Loaded environment."); + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let default_namespace = get_default_namespace_from_ws(&ws); + match self.command { AuthCommand::Grant { kind, world, starknet, account, transaction } => { config.tokio_handle().block_on(grant( @@ -74,6 +77,7 @@ impl AuthArgs { kind, transaction, config, + &default_namespace, )) } AuthCommand::Revoke { kind, world, starknet, account, transaction } => { @@ -86,6 +90,7 @@ impl AuthArgs { kind, transaction, config, + &default_namespace, )) } } @@ -94,26 +99,38 @@ impl AuthArgs { #[derive(Debug, Subcommand)] pub enum AuthKind { - #[command(about = "Grant a contract permission to write to a model.")] + #[command(about = "Grant a contract permission to write to a resource (contract, model or \ + namespace).")] Writer { #[arg(num_args = 1..)] #[arg(required = true)] - #[arg(value_name = "model,contract_address")] - #[arg(help = "A list of models and contract address to grant write access to. Comma \ - separated values to indicate model name and contract address e.g. \ - model_name,path::to::contract model_name,contract_address ")] - models_contracts: Vec, + #[arg(value_name = "resource,contract_tag_or_address")] + #[arg(help = "A list of resource/contract couples to grant write access to. +Comma separated values to indicate resource identifier and contract tag or address. +A resource identifier must use the following format: \ + :.\n +Some examples: + model:dojo_examples-Moves,0x1234 + m:Moves,0x1234 + ns:dojo_examples,actions +")] + models_contracts: Vec, }, - #[command(about = "Grant ownership of a resource.")] + #[command(about = "Grant ownership of a resource (contract, model or namespace).")] Owner { #[arg(num_args = 1..)] #[arg(required = true)] #[arg(value_name = "resource,owner_address")] - #[arg(help = "A list of owners and resources to grant ownership to. Comma separated \ - values to indicate owner address and resouce e.g. \ - contract:path::to::contract,0x1234 contract:contract_address,0x1111, \ - model:model_name,0xbeef")] - owners_resources: Vec, + #[arg(help = "A list of resources and owners to grant ownership to. +Comma separated values to indicate resource identifier and owner address. +A resource identifier must use the following format: \ + :.\n +Some examples: + model:dojo_examples-Moves,0x1234 + m:Moves,0x1234 + ns:dojo_examples,0xbeef +")] + owners_resources: Vec, }, } @@ -127,6 +144,7 @@ pub async fn grant( kind: AuthKind, transaction: TransactionOptions, config: &Config, + default_namespace: &str, ) -> Result<()> { trace!(?kind, ?world, ?starknet, ?account, ?transaction, "Executing Grant command."); let world = @@ -138,14 +156,16 @@ pub async fn grant( contracts=?models_contracts, "Granting Writer permissions." ); - auth::grant_writer(ui, &world, models_contracts, transaction.into()).await + auth::grant_writer(ui, &world, models_contracts, transaction.into(), default_namespace) + .await } AuthKind::Owner { owners_resources } => { trace!( resources=?owners_resources, "Granting Owner permissions." ); - auth::grant_owner(ui, &world, owners_resources, transaction.into()).await + auth::grant_owner(ui, &world, owners_resources, transaction.into(), default_namespace) + .await } } } @@ -160,6 +180,7 @@ pub async fn revoke( kind: AuthKind, transaction: TransactionOptions, config: &Config, + default_namespace: &str, ) -> Result<()> { trace!(?kind, ?world, ?starknet, ?account, ?transaction, "Executing Revoke command."); let world = @@ -171,14 +192,16 @@ pub async fn revoke( contracts=?models_contracts, "Revoking Writer permissions." ); - auth::revoke_writer(ui, &world, models_contracts, transaction.into()).await + auth::revoke_writer(ui, &world, models_contracts, transaction.into(), default_namespace) + .await } AuthKind::Owner { owners_resources } => { trace!( resources=?owners_resources, "Revoking Owner permissions." ); - auth::revoke_owner(ui, &world, owners_resources, transaction.into()).await + auth::revoke_owner(ui, &world, owners_resources, transaction.into(), default_namespace) + .await } } } @@ -187,50 +210,149 @@ pub async fn revoke( mod tests { use std::str::FromStr; - use dojo_world::contracts::cairo_utils; use starknet::core::types::Felt; use super::*; #[test] - fn test_owner_resource_from_str() { - // Test valid input - let input = "contract:path::to::contract,0x1234"; - let expected_owner = Felt::from_hex("0x1234").unwrap(); - let expected_resource = auth::ResourceType::Contract("path::to::contract".to_string()); - let expected = auth::OwnerResource { owner: expected_owner, resource: expected_resource }; - let result = auth::OwnerResource::from_str(input).unwrap(); - assert_eq!(result, expected); - - // Test valid input with model - let input = "model:model_name,0x1234"; - let expected_owner = Felt::from_hex("0x1234").unwrap(); - let expected_model = cairo_utils::str_to_felt("model_name").unwrap(); - let expected_resource = auth::ResourceType::Model(expected_model); - let expected = auth::OwnerResource { owner: expected_owner, resource: expected_resource }; - let result = auth::OwnerResource::from_str(input).unwrap(); - assert_eq!(result, expected); - - // Test invalid input - let input = "invalid_input"; - let result = auth::OwnerResource::from_str(input); - assert!(result.is_err()); + fn test_resource_type_from_str() { + let inputs = [ + ( + "contract:name:contract_name", + auth::ResourceType::Contract("name:contract_name".to_string()), + ), + ("c:0x1234", auth::ResourceType::Contract("0x1234".to_string())), + ("model:name:model_name", auth::ResourceType::Model("name:model_name".to_string())), + ("m:name:model_name", auth::ResourceType::Model("name:model_name".to_string())), + ( + "namespace:namespace_name", + auth::ResourceType::Namespace("namespace_name".to_string()), + ), + ("ns:namespace_name", auth::ResourceType::Namespace("namespace_name".to_string())), + ]; + + for (input, expected) in inputs { + let res = auth::ResourceType::from_str(input); + assert!(res.is_ok(), "Unable to parse input '{input}'"); + + let resource = res.unwrap(); + assert!( + resource == expected, + "Wrong resource type: expected: {:#?} got: {:#?}", + expected, + resource + ); + } + } + + #[test] + fn test_resource_type_from_str_bad_resource_identifier() { + let input = "other:model_name"; + let res = auth::ResourceType::from_str(input); + assert!(res.is_err(), "Bad identifier: This resource should not be accepted: '{input}'"); + } + + #[test] + fn test_resource_type_from_str_bad_resource_format() { + let input = "model_name"; + let res = auth::ResourceType::from_str(input); + assert!(res.is_err(), "Bad format: This resource should not be accepted: '{input}'"); + } + + #[test] + fn test_resource_writer_from_str() { + let inputs = [ + ( + "model:name:model_name,name:contract_name", + auth::ResourceWriter { + resource: auth::ResourceType::Model("name:model_name".to_string()), + tag_or_address: "name:contract_name".to_string(), + }, + ), + ( + "ns:namespace_name,0x1234", + auth::ResourceWriter { + resource: auth::ResourceType::Namespace("namespace_name".to_string()), + tag_or_address: "0x1234".to_string(), + }, + ), + ]; + + for (input, expected) in inputs { + let res = auth::ResourceWriter::from_str(input); + assert!(res.is_ok(), "Unable to parse input '{input}'"); + + let writer = res.unwrap(); + assert!( + writer == expected, + "Wrong resource writer: expected: {:#?} got: {:#?}", + expected, + writer + ); + } + } + + #[test] + fn test_resource_writer_from_str_bad_format() { + let input = "model_name"; + let res = auth::ResourceWriter::from_str(input); + assert!(res.is_err(), "Bad format: This resource writer should not be accepted: '{input}'"); + } + + #[test] + fn test_resource_writer_from_str_bad_owner_address() { + let input = "model:model_name:bad_address"; + let res = auth::ResourceWriter::from_str(input); + assert!( + res.is_err(), + "Bad address: This resource writer should not be accepted: '{input}'" + ); + } + + #[test] + fn test_resource_owner_from_str() { + let inputs = [ + ( + "model:name:model_name,0x1234", + auth::ResourceOwner { + resource: auth::ResourceType::Model("name:model_name".to_string()), + owner: Felt::from_hex("0x1234").unwrap(), + }, + ), + ( + "ns:namespace_name,0x1111", + auth::ResourceOwner { + resource: auth::ResourceType::Namespace("namespace_name".to_string()), + owner: Felt::from_hex("0x1111").unwrap(), + }, + ), + ]; + + for (input, expected) in inputs { + let res = auth::ResourceOwner::from_str(input); + assert!(res.is_ok(), "Unable to parse input '{input}'"); + + let owner = res.unwrap(); + assert!( + owner == expected, + "Wrong resource owner: expected: {:#?} got: {:#?}", + expected, + owner + ); + } + } + + #[test] + fn test_resource_owner_from_str_bad_format() { + let input = "model_name"; + let res = auth::ResourceOwner::from_str(input); + assert!(res.is_err(), "Bad format: This resource owner should not be accepted: '{input}'"); } #[test] - fn test_model_contract_from_str() { - // Test valid input - let input = "model_name,0x1234"; - let expected_model = cairo_utils::str_to_felt("model_name").unwrap(); - let expected_contract = "0x1234"; - let expected = - auth::ModelContract { model: expected_model, contract: expected_contract.to_string() }; - let result = auth::ModelContract::from_str(input).unwrap(); - assert_eq!(result, expected); - - // Test invalid input - let input = "invalid_input"; - let result = auth::ModelContract::from_str(input); - assert!(result.is_err()); + fn test_resource_owner_from_str_bad_owner_address() { + let input = "model:model_name:bad_address"; + let res = auth::ResourceOwner::from_str(input); + assert!(res.is_err(), "Bad address: This resource owner should not be accepted: '{input}'"); } } diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index f7384266f0..da94807c98 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -127,7 +127,7 @@ impl BuildArgs { trace!(pluginManager=?bindgen, "Generating bindings."); // Only generate bindgen if a current package is defined with dojo metadata. - if let Some(dojo_metadata) = dojo_metadata_from_workspace(&ws) { + if let Ok(dojo_metadata) = dojo_metadata_from_workspace(&ws) { tokio::runtime::Runtime::new() .unwrap() .block_on(bindgen.generate(dojo_metadata.skip_migration)) @@ -184,6 +184,7 @@ mod tests { use dojo_test_utils::compiler; use prettytable::format::consts::FORMAT_NO_LINESEP_WITH_TITLE; use prettytable::{format, Cell, Row, Table}; + use scarb::compiler::Profile; use sozo_ops::statistics::ContractStatistics; use super::{create_stats_table, BuildArgs, *}; @@ -195,7 +196,7 @@ mod tests { let source_project_dir = Utf8PathBuf::from("../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../crates/dojo-core"); - let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); let build_args = BuildArgs { bindings_output: "generated".to_string(), diff --git a/bin/sozo/src/commands/call.rs b/bin/sozo/src/commands/call.rs index e4caf0b554..fcac0ac293 100644 --- a/bin/sozo/src/commands/call.rs +++ b/bin/sozo/src/commands/call.rs @@ -1,5 +1,7 @@ use anyhow::Result; use clap::Args; +use dojo_world::contracts::naming::ensure_namespace; +use dojo_world::metadata::get_default_namespace_from_ws; use scarb::core::Config; use starknet::core::types::Felt; use tracing::trace; @@ -11,8 +13,8 @@ use crate::utils; #[derive(Debug, Args)] #[command(about = "Call a system with the given calldata.")] pub struct CallArgs { - #[arg(help = "The address or the fully qualified name of the contract to call.")] - pub contract: String, + #[arg(help = "The tag or address of the contract to call.")] + pub tag_or_address: String, #[arg(help = "The name of the entrypoint to call.")] pub entrypoint: String, @@ -40,6 +42,15 @@ impl CallArgs { let env_metadata = utils::load_metadata_from_config(config)?; trace!(?env_metadata, "Loaded metadata from config."); + + let tag_or_address = if utils::is_address(&self.tag_or_address) { + self.tag_or_address + } else { + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let default_namespace = get_default_namespace_from_ws(&ws); + ensure_namespace(&self.tag_or_address, &default_namespace) + }; + config.tokio_handle().block_on(async { let world_reader = utils::world_reader_from_env_metadata(self.world, self.starknet, &env_metadata) @@ -48,7 +59,7 @@ impl CallArgs { sozo_ops::call::call( world_reader, - self.contract, + tag_or_address, self.entrypoint, self.calldata, self.block_id, diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index bf44226bb8..54650fcd96 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -1,18 +1,23 @@ use std::fs; -use anyhow::Result; +use anyhow::{Context, Result}; use camino::Utf8PathBuf; use clap::Args; use dojo_world::manifest::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; use scarb::core::Config; +use scarb::ops; use tracing::trace; #[derive(Debug, Args)] pub struct CleanArgs { - #[arg(short, long)] + #[arg(long)] #[arg(help = "Removes all the generated files, including scarb artifacts and ALL the \ manifests files.")] - pub all: bool, + pub full: bool, + + #[arg(long)] + #[arg(help = "Clean all profiles.")] + pub all_profiles: bool, } impl CleanArgs { @@ -39,109 +44,211 @@ impl CleanArgs { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; trace!(ws=?ws, "Workspace read successfully."); - let profile_name = - ws.current_profile().expect("Scarb profile is expected at this point.").to_string(); - - // Manifest path is always a file, we can unwrap safely to get the - // parent folder. - let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + let profile_names = if self.all_profiles { + let mut profiles = ws.profile_names().expect("given method never returns an error"); + // currently scarb can return duplicate profiles and since the vector is sorted we can + // remove duplicates by calling dedup + profiles.dedup(); + profiles + } else { + vec![ + ws.current_profile().expect("Scarb profile is expected at this point.").to_string(), + ] + }; + + for profile_name in profile_names { + // Manifest path is always a file, we can unwrap safely to get the + // parent folder. + let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + + // By default, this command cleans the build manifests and scarb artifacts. + trace!("Cleaning Scarb artifacts and build manifests."); + + { + // copied from scarb::ops::clean since scarb cleans build file of all the profiles + // we only want to clean build files for specified profile + // + // cleaning build files for all profiles would create inconsistency with the + // manifest files in `manifests` directory + let ws = ops::read_workspace(config.manifest_path(), config)?; + let path = ws.target_dir().path_unchecked().join(&profile_name); + if path.exists() { + fs::remove_dir_all(path).context("failed to clean generated artifacts")?; + } + } - let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(profile_name); + let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(&profile_name); - // By default, this command cleans the build manifests and scarb artifacts. - trace!("Cleaning Scarb artifacts and build manifests."); - scarb::ops::clean(config)?; - Self::clean_manifests(&profile_dir)?; + Self::clean_manifests(&profile_dir)?; - if self.all && profile_dir.exists() { - trace!(?profile_dir, "Removing entire profile directory."); - fs::remove_dir_all(profile_dir)?; + if self.full && profile_dir.exists() { + trace!(?profile_dir, "Removing entire profile directory."); + fs::remove_dir_all(profile_dir)?; + } } Ok(()) } } +// these tests assume `example/spawn-and-move` is build for `dev` and `release` profile, +// which are normally built by the `build.rs` of `dojo-test-utils`. #[cfg(test)] mod tests { use dojo_test_utils::compiler; - use dojo_world::metadata::dojo_metadata_from_workspace; - use dojo_world::migration::TxnConfig; - use katana_runner::KatanaRunner; - use sozo_ops::migration; + use scarb::compiler::Profile; use super::*; #[test] - fn test_clean() { - let source_project = "../../examples/spawn-and-move/Scarb.toml"; + fn default_clean_works() { + let source_project = "../../examples/spawn-and-move"; let dojo_core_path = "../../crates/dojo-core"; - // Build a completely new project in it's own directory. - let (temp_project_dir, config, _) = - compiler::copy_build_project_temp(source_project, dojo_core_path, true); + let config = compiler::copy_tmp_config( + &Utf8PathBuf::from(source_project), + &Utf8PathBuf::from(dojo_core_path), + Profile::DEV, + ); + + let temp_project_dir = config.manifest_path().parent().unwrap().to_path_buf(); + + let clean_cmd = CleanArgs { full: false, all_profiles: false }; + clean_cmd.run(&config).unwrap(); + + let dev_profile_name = "dev"; + let release_profile_name = "release"; + + let target_dev_dir = temp_project_dir.join("target").join(dev_profile_name); + let target_release_dir = temp_project_dir.join("target").join(release_profile_name); + + let dev_manifests_dir = temp_project_dir.join("manifests").join(dev_profile_name); + let release_manifests_dir = temp_project_dir.join("manifests").join(release_profile_name); + + let dev_manifests_base_dir = dev_manifests_dir.join("base"); + let dev_manifests_abis_base_dir = dev_manifests_dir.join("abis").join("base"); + let release_manifests_base_dir = release_manifests_dir.join("base"); + let release_manifests_abis_base_dir = release_manifests_dir.join("abis").join("base"); + + let dev_manifests_abis_depl_dir = dev_manifests_dir.join("abis").join("deployments"); + + let dev_manifest_toml = dev_manifests_dir.join("manifest").with_extension("toml"); + let dev_manifest_json = dev_manifests_dir.join("manifest").with_extension("json"); + + assert!(fs::read_dir(target_dev_dir).is_err(), "Expected 'target/dev' to be empty"); + assert!( + fs::read_dir(target_release_dir).is_ok(), + "Expected 'target/release' to be present" + ); + + assert!( + fs::read_dir(dev_manifests_base_dir).is_err(), + "Expected 'manifests/dev/base' to be empty" + ); + assert!( + fs::read_dir(dev_manifests_abis_base_dir).is_err(), + "Expected 'manifests/dev/abis/base' to be empty" + ); + assert!( + fs::read_dir(&dev_manifests_abis_depl_dir).is_ok(), + "Expected 'manifests/dev/abis/deployments' to not be empty" + ); + + // we expect release profile to be not affected + assert!( + fs::read_dir(release_manifests_base_dir).is_ok(), + "Expected 'manifests/release/base' to be non empty" + ); + assert!( + fs::read_dir(release_manifests_abis_base_dir).is_ok(), + "Expected 'manifests/release/abis/base' to be non empty" + ); - let runner = KatanaRunner::new().expect("Fail to set runner"); + assert!(dev_manifest_toml.exists(), "Expected 'manifest.toml' to exist"); + assert!(dev_manifest_json.exists(), "Expected 'manifest.json' to exist"); - let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + let clean_cmd = CleanArgs { full: true, all_profiles: false }; + clean_cmd.run(&config).unwrap(); - let dojo_metadata = dojo_metadata_from_workspace(&ws).expect( - "No current package with dojo metadata found, clean is not yet support for workspaces.", + assert!( + fs::read_dir(&dev_manifests_abis_depl_dir).is_err(), + "Expected 'manifests/dev/abis/deployments' to be empty" ); + assert!(!dev_manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); + assert!(!dev_manifest_json.exists(), "Expected 'manifest.json' to not exist"); + } - // Plan the migration to generate some manifests other than base. - config.tokio_handle().block_on(async { - migration::migrate( - &ws, - None, - runner.endpoint(), - runner.account(0), - "dojo_examples", - true, - TxnConfig::default(), - dojo_metadata.skip_migration, - ) - .await - .unwrap() - }); - - let clean_cmd = CleanArgs { all: false }; + #[test] + fn all_profile_clean_works() { + let source_project = "../../examples/spawn-and-move"; + let dojo_core_path = "../../crates/dojo-core"; + + let config = compiler::copy_tmp_config( + &Utf8PathBuf::from(source_project), + &Utf8PathBuf::from(dojo_core_path), + Profile::DEV, + ); + + let temp_project_dir = config.manifest_path().parent().unwrap().to_path_buf(); + + let clean_cmd = CleanArgs { full: false, all_profiles: true }; clean_cmd.run(&config).unwrap(); - let profile_name = config.profile().to_string(); + let dev_profile_name = "dev"; + let release_profile_name = "release"; + + let target_dev_dir = temp_project_dir.join("target").join(dev_profile_name); + let target_release_dir = temp_project_dir.join("target").join(release_profile_name); + + let dev_manifests_dir = temp_project_dir.join("manifests").join(dev_profile_name); + let release_manifests_dir = temp_project_dir.join("manifests").join(release_profile_name); - let target_dev_dir = temp_project_dir.join("target").join(&profile_name); - let profile_manifests_dir = temp_project_dir.join("manifests").join(&profile_name); - let manifests_dev_base_dir = profile_manifests_dir.join("base"); - let manifests_dev_abis_base_dir = profile_manifests_dir.join("abis").join("base"); - let manifests_dev_abis_depl_dir = profile_manifests_dir.join("abis").join("deployments"); - let manifest_toml = profile_manifests_dir.join("manifest").with_extension("toml"); - let manifest_json = profile_manifests_dir.join("manifest").with_extension("json"); + let dev_manifests_base_dir = dev_manifests_dir.join("base"); + let dev_manifests_abis_base_dir = dev_manifests_dir.join("abis").join("base"); + let release_manifests_base_dir = release_manifests_dir.join("base"); + let release_manifests_abis_base_dir = release_manifests_dir.join("abis").join("base"); + + let dev_manifests_abis_depl_dir = dev_manifests_dir.join("abis").join("deployments"); + + let dev_manifest_toml = dev_manifests_dir.join("manifest").with_extension("toml"); + let dev_manifest_json = dev_manifests_dir.join("manifest").with_extension("json"); assert!(fs::read_dir(target_dev_dir).is_err(), "Expected 'target/dev' to be empty"); + assert!(fs::read_dir(target_release_dir).is_err(), "Expected 'target/release' to be empty"); + assert!( - fs::read_dir(manifests_dev_base_dir).is_err(), + fs::read_dir(dev_manifests_base_dir).is_err(), "Expected 'manifests/dev/base' to be empty" ); assert!( - fs::read_dir(manifests_dev_abis_base_dir).is_err(), + fs::read_dir(dev_manifests_abis_base_dir).is_err(), "Expected 'manifests/dev/abis/base' to be empty" ); assert!( - fs::read_dir(&manifests_dev_abis_depl_dir).is_ok(), + fs::read_dir(&dev_manifests_abis_depl_dir).is_ok(), "Expected 'manifests/dev/abis/deployments' to not be empty" ); - assert!(manifest_toml.exists(), "Expected 'manifest.toml' to exist"); - assert!(manifest_json.exists(), "Expected 'manifest.json' to exist"); - let clean_cmd = CleanArgs { all: true }; + assert!( + fs::read_dir(release_manifests_base_dir).is_err(), + "Expected 'manifests/release/base' to be empty" + ); + assert!( + fs::read_dir(release_manifests_abis_base_dir).is_err(), + "Expected 'manifests/release/abis/base' to be empty" + ); + + assert!(dev_manifest_toml.exists(), "Expected 'manifest.toml' to exist"); + assert!(dev_manifest_json.exists(), "Expected 'manifest.json' to exist"); + + let clean_cmd = CleanArgs { full: true, all_profiles: true }; clean_cmd.run(&config).unwrap(); assert!( - fs::read_dir(&manifests_dev_abis_depl_dir).is_err(), + fs::read_dir(&dev_manifests_abis_depl_dir).is_err(), "Expected 'manifests/dev/abis/deployments' to be empty" ); - assert!(!manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); - assert!(!manifest_json.exists(), "Expected 'manifest.json' to not exist"); + assert!(!dev_manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); + assert!(!dev_manifest_json.exists(), "Expected 'manifest.json' to not exist"); } } diff --git a/bin/sozo/src/commands/dev.rs b/bin/sozo/src/commands/dev.rs index 53e7687ae8..72b8687cac 100644 --- a/bin/sozo/src/commands/dev.rs +++ b/bin/sozo/src/commands/dev.rs @@ -16,12 +16,6 @@ use super::options::world::WorldOptions; #[derive(Debug, Args)] pub struct DevArgs { - #[arg(long)] - #[arg(help = "Name of the World.")] - #[arg(long_help = "Name of the World. It's hash will be used as a salt when deploying the \ - contract to avoid address conflicts.")] - pub name: Option, - #[command(flatten)] pub world: WorldOptions, @@ -53,13 +47,9 @@ impl DevArgs { BuildArgs::default().run(config)?; info!("Initial build completed."); - let _ = MigrateArgs::new_apply( - self.name.clone(), - self.world.clone(), - self.starknet.clone(), - self.account.clone(), - ) - .run(config); + let _ = + MigrateArgs::new_apply(self.world.clone(), self.starknet.clone(), self.account.clone()) + .run(config); info!( directory = watched_directory.to_string(), @@ -89,7 +79,6 @@ impl DevArgs { let _ = BuildArgs::default().run(config); let _ = MigrateArgs::new_apply( - self.name.clone(), self.world.clone(), self.starknet.clone(), self.account.clone(), diff --git a/bin/sozo/src/commands/events.rs b/bin/sozo/src/commands/events.rs index c0766d8566..0028ca2558 100644 --- a/bin/sozo/src/commands/events.rs +++ b/bin/sozo/src/commands/events.rs @@ -49,8 +49,8 @@ impl EventsArgs { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; trace!(ws_members_count = ws.members().count(), "Read workspace."); - let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); - trace!(?manifest_dir, "Manifest directory defined from workspace."); + let project_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + trace!(?project_dir, "Project directory defined from workspace."); let provider = self.starknet.provider(env_metadata.as_ref())?; trace!(?provider, "Starknet RPC client provider."); @@ -79,7 +79,7 @@ impl EventsArgs { self.continuation_token, event_filter, self.json, - &manifest_dir, + &project_dir, &profile_name, ) .await diff --git a/bin/sozo/src/commands/execute.rs b/bin/sozo/src/commands/execute.rs index 243c1595a8..a100285df0 100644 --- a/bin/sozo/src/commands/execute.rs +++ b/bin/sozo/src/commands/execute.rs @@ -1,5 +1,7 @@ use anyhow::Result; use clap::Args; +use dojo_world::contracts::naming::ensure_namespace; +use dojo_world::metadata::get_default_namespace_from_ws; use scarb::core::Config; use sozo_ops::execute; use tracing::trace; @@ -14,9 +16,10 @@ use crate::utils; #[derive(Debug, Args)] #[command(about = "Execute a system with the given calldata.")] pub struct ExecuteArgs { - #[arg(help = "The address of the contract to be executed. Or fully qualified contract name \ - (ex: dojo_example::actions::actions")] - pub contract: String, + #[arg( + help = "The address or the tag (ex: dojo_examples:actions) of the contract to be executed." + )] + pub tag_or_address: String, #[arg(help = "The name of the entrypoint to be executed.")] pub entrypoint: String, @@ -49,6 +52,14 @@ impl ExecuteArgs { trace!(args = ?self); let env_metadata = utils::load_metadata_from_config(config)?; + let tag_or_address = if utils::is_address(&self.tag_or_address) { + self.tag_or_address + } else { + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + let default_namespace = get_default_namespace_from_ws(&ws); + ensure_namespace(&self.tag_or_address, &default_namespace) + }; + config.tokio_handle().block_on(async { let world = utils::world_from_env_metadata( self.world, @@ -62,7 +73,7 @@ impl ExecuteArgs { let tx_config = self.transaction.into(); trace!( - contract=?self.contract, + contract=?tag_or_address, entrypoint=self.entrypoint, calldata=?self.calldata, "Executing Execute command." @@ -76,7 +87,7 @@ impl ExecuteArgs { execute::execute( &config.ui(), - self.contract, + tag_or_address, self.entrypoint, calldata, &world, diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index c4dfc43fb5..c697a15e7c 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -24,13 +24,6 @@ pub struct MigrateArgs { #[command(subcommand)] pub command: MigrateCommand, - #[arg(long, global = true)] - #[arg(help = "Name of the World.")] - #[arg(long_help = "Name of the World. It's hash will be used as a salt when deploying the \ - contract to avoid address conflicts. If not provided root package's name \ - will be used.")] - name: Option, - #[command(flatten)] world: WorldOptions, @@ -57,14 +50,12 @@ pub enum MigrateCommand { impl MigrateArgs { /// Creates a new `MigrateArgs` with the `Apply` command. pub fn new_apply( - name: Option, world: WorldOptions, starknet: StarknetOptions, account: AccountOptions, ) -> Self { Self { command: MigrateCommand::Apply { transaction: TransactionOptions::init_wait() }, - name, world, starknet, account, @@ -74,15 +65,7 @@ impl MigrateArgs { pub fn run(self, config: &Config) -> Result<()> { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - - let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { - metadata - } else { - return Err(anyhow!( - "No current package with dojo metadata found, migrate is not yet support for \ - workspaces." - )); - }; + let dojo_metadata = dojo_metadata_from_workspace(&ws)?; // This variant is tested before the match on `self.command` to avoid // having the need to spin up a Katana to generate the files. @@ -103,11 +86,9 @@ impl MigrateArgs { return Err(anyhow!("Build project using `sozo build` first")); } - let MigrateArgs { name, world, starknet, account, .. } = self; + let MigrateArgs { world, starknet, account, .. } = self; - let name = name.unwrap_or_else(|| { - ws.current_package().expect("Root package to be present").id.name.to_string() - }); + let name = dojo_metadata.world.seed; let (world_address, account, rpc_url) = config.tokio_handle().block_on(async { setup_env(&ws, account, starknet, world, &name, env_metadata.as_ref()).await diff --git a/bin/sozo/src/commands/model.rs b/bin/sozo/src/commands/model.rs index d004cf7f13..c0e1997582 100644 --- a/bin/sozo/src/commands/model.rs +++ b/bin/sozo/src/commands/model.rs @@ -1,5 +1,7 @@ use anyhow::Result; use clap::{Args, Subcommand}; +use dojo_world::contracts::naming::ensure_namespace; +use dojo_world::metadata::get_default_namespace_from_ws; use scarb::core::Config; use sozo_ops::model; use starknet::core::types::Felt; @@ -19,8 +21,8 @@ pub struct ModelArgs { pub enum ModelCommand { #[command(about = "Retrieve the class hash of a model")] ClassHash { - #[arg(help = "The name of the model")] - name: String, + #[arg(help = "The tag or name of the model")] + tag_or_name: String, #[command(flatten)] world: WorldOptions, @@ -31,8 +33,8 @@ pub enum ModelCommand { #[command(about = "Retrieve the contract address of a model")] ContractAddress { - #[arg(help = "The name of the model")] - name: String, + #[arg(help = "The tag or name of the model")] + tag_or_name: String, #[command(flatten)] world: WorldOptions, @@ -62,8 +64,8 @@ hashes, called 'hash' in the following documentation. final storage location = hash('dojo_storage', model_selector, record_key)")] Layout { - #[arg(help = "The name of the model")] - name: String, + #[arg(help = "The tag or name of the model")] + tag_or_name: String, #[command(flatten)] world: WorldOptions, @@ -74,8 +76,8 @@ hashes, called 'hash' in the following documentation. #[command(about = "Retrieve the schema for a model")] Schema { - #[arg(help = "The name of the model")] - name: String, + #[arg(help = "The tag or name of the model")] + tag_or_name: String, #[command(flatten)] world: WorldOptions, @@ -90,8 +92,8 @@ hashes, called 'hash' in the following documentation. #[command(about = "Get a models value for the provided key")] Get { - #[arg(help = "The name of the model")] - name: String, + #[arg(help = "The tag or name of the model")] + tag_or_name: String, #[arg(value_name = "KEYS")] #[arg(value_delimiter = ',')] @@ -109,34 +111,46 @@ hashes, called 'hash' in the following documentation. impl ModelArgs { pub fn run(self, config: &Config) -> Result<()> { trace!(args = ?self); + let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; let env_metadata = utils::load_metadata_from_config(config)?; + let default_namespace = get_default_namespace_from_ws(&ws); config.tokio_handle().block_on(async { match self.command { - ModelCommand::ClassHash { name, starknet, world } => { + ModelCommand::ClassHash { tag_or_name, starknet, world } => { + let tag = ensure_namespace(&tag_or_name, &default_namespace); + let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); - model::model_class_hash(name, world_address, provider).await + model::model_class_hash(tag, world_address, provider).await } - ModelCommand::ContractAddress { name, starknet, world } => { + ModelCommand::ContractAddress { tag_or_name, starknet, world } => { + let tag = ensure_namespace(&tag_or_name, &default_namespace); + let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); - model::model_contract_address(name, world_address, provider).await + model::model_contract_address(tag, world_address, provider).await } - ModelCommand::Layout { name, starknet, world } => { + ModelCommand::Layout { tag_or_name, starknet, world } => { + let tag = ensure_namespace(&tag_or_name, &default_namespace); + let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); - model::model_layout(name, world_address, provider).await + model::model_layout(tag, world_address, provider).await } - ModelCommand::Schema { name, to_json, starknet, world } => { + ModelCommand::Schema { tag_or_name, to_json, starknet, world } => { + let tag = ensure_namespace(&tag_or_name, &default_namespace); + let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); - model::model_schema(name, world_address, provider, to_json).await + model::model_schema(tag, world_address, provider, to_json).await } - ModelCommand::Get { name, keys, starknet, world } => { + ModelCommand::Get { tag_or_name, keys, starknet, world } => { + let tag = ensure_namespace(&tag_or_name, &default_namespace); + let world_address = world.address(env_metadata.as_ref()).unwrap(); let provider = starknet.provider(env_metadata.as_ref()).unwrap(); - model::model_get(name, keys, world_address, provider).await + model::model_get(tag, keys, world_address, provider).await } } }) diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs index 3cdd75fad2..cc2b385ba4 100644 --- a/bin/sozo/src/commands/options/account/controller.rs +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -4,6 +4,7 @@ use account_sdk::deploy_contract::UDC_ADDRESS; use account_sdk::signers::HashSigner; use anyhow::{Context, Result}; use camino::{Utf8Path, Utf8PathBuf}; +use dojo_world::contracts::naming::get_name_from_tag; use dojo_world::manifest::{BaseManifest, DojoContract, Manifest}; use dojo_world::migration::strategy::generate_salt; use scarb::core::Config; @@ -155,13 +156,13 @@ fn collect_policies_from_base_manifest( let contract_address = get_dojo_contract_address(world_address, &contract); let abis = contract.inner.abi.unwrap().load_abi_string(&base_path)?; let abis = serde_json::from_str::>(&abis)?; - policies_from_abis(&mut policies, &contract.name, contract_address, &abis); + policies_from_abis(&mut policies, &contract.inner.tag, contract_address, &abis); } // get method from world contract let abis = manifest.world.inner.abi.unwrap().load_abi_string(&base_path)?; let abis = serde_json::from_str::>(&abis)?; - policies_from_abis(&mut policies, &manifest.world.name, world_address, &abis); + policies_from_abis(&mut policies, "world", world_address, &abis); // special policy for sending declare tx // corresponds to [account_sdk::account::DECLARATION_SELECTOR] @@ -181,7 +182,7 @@ fn collect_policies_from_base_manifest( /// ABIs in the project. fn policies_from_abis( policies: &mut Vec, - contract_name: &str, + contract_tag: &str, contract_address: Felt, entries: &[AbiEntry], ) { @@ -191,13 +192,13 @@ fn policies_from_abis( // we only create policies for non-view functions if let StateMutability::External = f.state_mutability { let policy = Policy { target: contract_address, method: f.name.to_string() }; - trace!(name = contract_name, target = format!("{:#x}", policy.target), method = %policy.method, "Adding policy"); + trace!(tag = contract_tag, target = format!("{:#x}", policy.target), method = %policy.method, "Adding policy"); policies.push(policy); } } AbiEntry::Interface(i) => { - policies_from_abis(policies, contract_name, contract_address, &i.items) + policies_from_abis(policies, contract_tag, contract_address, &i.items) } _ => {} @@ -209,7 +210,7 @@ fn get_dojo_contract_address(world_address: Felt, manifest: &Manifest Result, Error> { let env_metadata = if config.manifest_path().exists() { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(&ws) { - metadata - } else { - return Err(anyhow!( - "No current package with dojo metadata found, workspaces are not suppored yet." - )); - }; + let dojo_metadata = dojo_metadata_from_workspace(&ws)?; dojo_metadata.env().cloned() } else { @@ -135,3 +129,7 @@ pub fn generate_version() -> String { ); version_string } + +pub fn is_address(tag_or_address: &str) -> bool { + tag_or_address.starts_with("0x") +} diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index 31607e3624..f9dd35f063 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -3,9 +3,10 @@ mod utils; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_world::metadata::dojo_metadata_from_workspace; +use dojo_world::metadata::{dojo_metadata_from_workspace, get_default_namespace_from_ws}; use dojo_world::migration::TxnConfig; use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use scarb::ops; use sozo_ops::migration::execute_strategy; use starknet::accounts::Account; @@ -17,7 +18,7 @@ async fn reregister_models() { let source_project_dir = Utf8PathBuf::from("../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../crates/dojo-core"); - let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); @@ -27,9 +28,15 @@ async fn reregister_models() { let target_path = ws.target_dir().path_existent().unwrap().join(ws.config().profile().to_string()); - let migration = - prepare_migration(source_project_dir.clone(), target_path, dojo_metadata.skip_migration) - .unwrap(); + let default_namespace = get_default_namespace_from_ws(&ws); + + let migration = prepare_migration( + source_project_dir.clone(), + target_path, + dojo_metadata.skip_migration, + &default_namespace, + ) + .unwrap(); let sequencer = KatanaRunner::new().expect("Failed to start runner."); @@ -44,7 +51,7 @@ async fn reregister_models() { let rpc_url = &sequencer.url().to_string(); let moves_model = - migration.models.iter().find(|m| m.diff.name == "dojo_examples::models::moves").unwrap(); + migration.models.iter().find(|m| m.diff.tag == "dojo_examples-Moves").unwrap(); let moves_model_class_hash = &format!("0x{:x}", moves_model.diff.local_class_hash); let args_vec = [ "register", diff --git a/bin/sozo/tests/test_build.rs b/bin/sozo/tests/test_build.rs index 552f62f1fc..722d231036 100644 --- a/bin/sozo/tests/test_build.rs +++ b/bin/sozo/tests/test_build.rs @@ -3,11 +3,12 @@ mod utils; use std::fs; use utils::snapbox::get_snapbox; -use utils::stdout::expected_stdout; #[test] fn test_invalid_cairo_version() { let path = fs::canonicalize("./tests/test_data/invalid_cairo_version"); let assert = get_snapbox().arg("build").current_dir(path.unwrap()).assert().failure(); - assert.stdout_eq(expected_stdout("wrong-cairo-version")); + assert.stdout_matches( + "[..]Specified cairo version not supported by dojo. Please verify and update dojo[..]", + ); } diff --git a/bin/sozo/tests/test_migrate.rs b/bin/sozo/tests/test_migrate.rs new file mode 100644 index 0000000000..35d4a57fa7 --- /dev/null +++ b/bin/sozo/tests/test_migrate.rs @@ -0,0 +1,47 @@ +mod utils; + +use camino::Utf8PathBuf; +use dojo_test_utils::compiler; +use katana_runner::KatanaRunner; +use scarb::compiler::Profile; +use starknet::accounts::Account; +use starknet::core::types::{BlockId, BlockTag}; +use utils::snapbox::get_snapbox; + +#[tokio::test(flavor = "multi_thread")] +async fn migrate_dry_run() { + let source_project_dir = Utf8PathBuf::from("../../examples/spawn-and-move/"); + let dojo_core_path = Utf8PathBuf::from("../../crates/dojo-core"); + + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); + + let sequencer = KatanaRunner::new().expect("Failed to start runner."); + + let mut account = sequencer.account(0); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + + let account_address = &format!("0x{:x}", account.address()); + let private_key = + &format!("0x{:x}", sequencer.account_data(0).private_key.as_ref().unwrap().secret_scalar()); + let rpc_url = &sequencer.url().to_string(); + + let args_vec = [ + "migrate", + "plan", + "--account-address", + account_address, + "--rpc-url", + rpc_url, + "--private-key", + private_key, + "--manifest-path", + config.manifest_path().as_ref(), + ]; + + let assert = get_snapbox().args(args_vec.iter()).assert().success(); + assert!(format!("{:?}", assert.get_output()).contains("Migration Strategy")); + assert!(format!("{:?}", assert.get_output()).contains("# Base Contract")); + assert!(format!("{:?}", assert.get_output()).contains("# Models (8)")); + assert!(format!("{:?}", assert.get_output()).contains("# World")); + assert!(format!("{:?}", assert.get_output()).contains("# Contracts (3)")); +} diff --git a/crates/benches/contracts/src/tests/test_world.cairo b/crates/benches/contracts/src/tests/test_world.cairo index b7c8309913..74dfd8023e 100644 --- a/crates/benches/contracts/src/tests/test_world.cairo +++ b/crates/benches/contracts/src/tests/test_world.cairo @@ -25,7 +25,7 @@ mod tests { let mut models = array![position::TEST_CLASS_HASH, moves::TEST_CLASS_HASH]; // deploy world with models - let world = spawn_test_world(models); + let world = spawn_test_world("benches", models); // deploy systems contract let contract_address = world diff --git a/crates/dojo-bindgen/src/lib.rs b/crates/dojo-bindgen/src/lib.rs index 97e8074868..06b2225ada 100644 --- a/crates/dojo-bindgen/src/lib.rs +++ b/crates/dojo-bindgen/src/lib.rs @@ -5,10 +5,9 @@ use std::path::PathBuf; use cainome::parser::tokens::Token; use cainome::parser::{AbiParser, TokenizedAbi}; use camino::Utf8PathBuf; -use convert_case::{Case, Casing}; use dojo_world::manifest::BaseManifest; pub mod error; -use error::{BindgenResult, Error}; +use error::BindgenResult; mod plugins; use plugins::typescript::TypescriptPlugin; @@ -19,10 +18,8 @@ pub use plugins::BuiltinPlugins; #[derive(Debug, PartialEq)] pub struct DojoModel { - /// PascalCase name of the model. - pub name: String, - /// Fully qualified path of the model type in cairo code. - pub qualified_path: String, + /// model tag. + pub tag: String, /// List of tokens found in the model contract ABI. /// Only structs and enums are currently used. pub tokens: TokenizedAbi, @@ -30,8 +27,8 @@ pub struct DojoModel { #[derive(Debug, PartialEq)] pub struct DojoContract { - /// Contract's fully qualified name. - pub qualified_path: String, + /// Contract tag. + pub tag: String, /// Full ABI of the contract in case the plugin wants to make extra checks, /// or generated other functions than the systems. pub tokens: TokenizedAbi, @@ -122,7 +119,7 @@ fn gather_dojo_data( let mut base_manifest = BaseManifest::load_from_path(&base_manifest_dir)?; if let Some(skip_manifests) = skip_migration { - base_manifest.remove_items(skip_manifests); + base_manifest.remove_tags(skip_manifests); } let mut models = HashMap::new(); @@ -138,6 +135,7 @@ fn gather_dojo_data( .load_abi_string(&root_dir)?; let tokens = AbiParser::tokens_from_abi_string(&abi, &HashMap::new())?; + let tag = contract_manifest.inner.tag.clone(); // Identify the systems -> for now only take the functions from the // interfaces. @@ -151,12 +149,7 @@ fn gather_dojo_data( } } - let contract_name = contract_manifest.name.to_string(); - - contracts.insert( - contract_name.clone(), - DojoContract { qualified_path: contract_name, tokens, systems }, - ); + contracts.insert(tag.clone(), DojoContract { tag, tokens, systems }); } for model_manifest in &base_manifest.models { @@ -169,27 +162,11 @@ fn gather_dojo_data( .load_abi_string(&root_dir)?; let tokens = AbiParser::tokens_from_abi_string(&abi, &HashMap::new())?; + let tag = model_manifest.inner.tag.clone(); - let name = model_manifest.name.to_string(); + let model = DojoModel { tag: tag.clone(), tokens: filter_model_tokens(&tokens) }; - if let Some(model_name) = model_name_from_fully_qualified_path(&name) { - let model_pascal_case = model_name.from_case(Case::Snake).to_case(Case::Pascal); - - let model = DojoModel { - name: model_pascal_case.clone(), - qualified_path: name - .replace(&model_name, &model_pascal_case) - .trim_end_matches(".json") - .to_string(), - tokens: filter_model_tokens(&tokens), - }; - - models.insert(model_pascal_case, model); - } else { - return Err(Error::Format(format!( - "Could not extract model name from file name `{name}`" - ))); - } + models.insert(tag.clone(), model); } let world = DojoWorld { name: root_package_name.to_string() }; @@ -234,36 +211,14 @@ fn filter_model_tokens(tokens: &TokenizedAbi) -> TokenizedAbi { TokenizedAbi { structs, enums, ..Default::default() } } -/// Extracts a model name from the fully qualified path of the model. -/// -/// # Example -/// -/// The fully qualified name "dojo_examples::models::position" should return "position". -/// -/// # Arguments -/// -/// * `file_name` - Fully qualified model name. -fn model_name_from_fully_qualified_path(file_name: &str) -> Option { - let parts: Vec<&str> = file_name.split("::").collect(); - - // TODO: we may want to have inside the manifest the name of the model struct - // instead of extracting it from the file's name. - parts.last().map(|last_part| last_part.to_string()) -} - #[cfg(test)] mod tests { use dojo_test_utils::compiler; use dojo_world::metadata::dojo_metadata_from_workspace; + use scarb::compiler::Profile; use super::*; - #[test] - fn model_name_from_fully_qualified_path_ok() { - let file_name = "dojo_examples::models::position"; - assert_eq!(model_name_from_fully_qualified_path(file_name), Some("position".to_string())); - } - #[test] fn gather_data_ok() { let manifest_path = Utf8PathBuf::from("src/test_data/spawn-and-move/Scarb.toml"); @@ -271,6 +226,7 @@ mod tests { let config = compiler::copy_tmp_config( &Utf8PathBuf::from("../../examples/spawn-and-move"), &Utf8PathBuf::from("../dojo-core"), + Profile::DEV, ); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); @@ -287,20 +243,16 @@ mod tests { assert_eq!(data.world.name, "dojo_example"); - let pos = data.models.get("Position").unwrap(); - assert_eq!(pos.name, "Position"); - assert_eq!(pos.qualified_path, "dojo_examples::models::Position"); + let pos = data.models.get("dojo_examples-Position").unwrap(); + assert_eq!(pos.tag, "dojo_examples-Position"); - let moves = data.models.get("Moves").unwrap(); - assert_eq!(moves.name, "Moves"); - assert_eq!(moves.qualified_path, "dojo_examples::models::Moves"); + let moves = data.models.get("dojo_examples-Moves").unwrap(); + assert_eq!(moves.tag, "dojo_examples-Moves"); - let moved = data.models.get("Message").unwrap(); - assert_eq!(moved.name, "Message"); - assert_eq!(moved.qualified_path, "dojo_examples::models::Message"); + let moved = data.models.get("dojo_examples-Message").unwrap(); + assert_eq!(moved.tag, "dojo_examples-Message"); - let player_config = data.models.get("PlayerConfig").unwrap(); - assert_eq!(player_config.name, "PlayerConfig"); - assert_eq!(player_config.qualified_path, "dojo_examples::models::PlayerConfig"); + let player_config = data.models.get("dojo_examples-PlayerConfig").unwrap(); + assert_eq!(player_config.tag, "dojo_examples-PlayerConfig"); } } diff --git a/crates/dojo-bindgen/src/plugins/typescript/mod.rs b/crates/dojo-bindgen/src/plugins/typescript/mod.rs index 9b00739fe8..d44496b9b7 100644 --- a/crates/dojo-bindgen/src/plugins/typescript/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript/mod.rs @@ -3,6 +3,7 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; use cainome::parser::tokens::{Composite, CompositeType, Function, Token}; +use dojo_world::contracts::naming; use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; @@ -264,7 +265,7 @@ type {} = ", } // first index is our model struct - if token.type_name() == model.name { + if token.type_name() == naming::get_name_from_tag(&model.tag) { models_structs.push(token.to_composite().unwrap().clone()); } @@ -378,12 +379,10 @@ export function defineContractComponents(world: World) { ) } - // Formats a contract file path into a pretty contract name - // eg. dojo_examples::actions::actions.json -> Actions - fn formatted_contract_name(contract_file_name: &str) -> String { - let contract_name = - contract_file_name.split("::").last().unwrap().trim_end_matches(".json"); - contract_name.to_string() + // Formats a contract tag into a pretty contract name + // eg. dojo_examples-actions -> Actions + fn formatted_contract_name(tag: &str) -> String { + naming::capitalize(&naming::get_name_from_tag(tag)) } // Handles a contract definition and its underlying systems @@ -430,10 +429,10 @@ export function defineContractComponents(world: World) { }}; }} ", - contract.qualified_path, + contract.tag, // capitalize contract name - TypescriptPlugin::formatted_contract_name(&contract.qualified_path), - TypescriptPlugin::formatted_contract_name(&contract.qualified_path), + TypescriptPlugin::formatted_contract_name(&contract.tag), + TypescriptPlugin::formatted_contract_name(&contract.tag), systems, contract .systems @@ -453,8 +452,8 @@ export function defineContractComponents(world: World) { .map(|c| { format!( "{}: {}()", - TypescriptPlugin::formatted_contract_name(&c.qualified_path), - TypescriptPlugin::formatted_contract_name(&c.qualified_path) + TypescriptPlugin::formatted_contract_name(&c.tag), + TypescriptPlugin::formatted_contract_name(&c.tag) ) }) .collect::>() diff --git a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs index d7846ceef0..a4b8c1076e 100644 --- a/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs +++ b/crates/dojo-bindgen/src/plugins/typescript_v2/mod.rs @@ -4,6 +4,7 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; use cainome::parser::tokens::{Composite, CompositeType, Function, Token}; use convert_case::Casing; +use dojo_world::contracts::naming; use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; @@ -112,10 +113,15 @@ import { let mut result_mapping = Vec::new(); for model in models { - query_fields - .push(format!("{model_name}: ModelClause<{model_name}>;", model_name = model.name)); - - result_mapping.push(format!("{model_name}: {model_name};", model_name = model.name)); + query_fields.push(format!( + "{model_name}: ModelClause<{model_name}>;", + model_name = naming::get_name_from_tag(&model.tag) + )); + + result_mapping.push(format!( + "{model_name}: {model_name};", + model_name = naming::get_name_from_tag(&model.tag) + )); } format!( @@ -241,7 +247,7 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ {} }} ", - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) + TypeScriptV2Plugin::formatted_contract_name(&contract.tag) .to_case(convert_case::Case::Pascal), systems, ); @@ -256,7 +262,7 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ .map(|contract| { format!( "{}Address: string;", - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) + TypeScriptV2Plugin::formatted_contract_name(&contract.tag) .to_case(convert_case::Case::Camel) ) }) @@ -299,12 +305,10 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ format!( "{camel_case_name}: {pascal_case_name}Calls; {camel_case_name}Address: string;", - camel_case_name = - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) - .to_case(convert_case::Case::Camel), - pascal_case_name = - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) - .to_case(convert_case::Case::Pascal) + camel_case_name = TypeScriptV2Plugin::formatted_contract_name(&contract.tag) + .to_case(convert_case::Case::Camel), + pascal_case_name = TypeScriptV2Plugin::formatted_contract_name(&contract.tag) + .to_case(convert_case::Case::Pascal) ) }) .collect::>() @@ -324,9 +328,8 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ }} this.{contract_name}Address = {contract_name}Address;", - contract_name = - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) - .to_case(convert_case::Case::Camel) + contract_name = TypeScriptV2Plugin::formatted_contract_name(&contract.tag) + .to_case(convert_case::Case::Camel) ) }) .collect::>() @@ -337,9 +340,8 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ .map(|contract| { format!( "this.{camel_case_name}Address = params.{camel_case_name}Address;", - camel_case_name = - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) - .to_case(convert_case::Case::Camel), + camel_case_name = TypeScriptV2Plugin::formatted_contract_name(&contract.tag) + .to_case(convert_case::Case::Camel), ) }) .collect::>() @@ -351,12 +353,10 @@ function convertQueryToToriiClause(query: Query): Clause | undefined {{ format!( "this.{camel_case_name} = new \ {pascal_case_name}Calls(this.{camel_case_name}Address, this._account);", - camel_case_name = - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) - .to_case(convert_case::Case::Camel), - pascal_case_name = - TypeScriptV2Plugin::formatted_contract_name(&contract.qualified_path) - .to_case(convert_case::Case::Pascal) + camel_case_name = TypeScriptV2Plugin::formatted_contract_name(&contract.tag) + .to_case(convert_case::Case::Camel), + pascal_case_name = TypeScriptV2Plugin::formatted_contract_name(&contract.tag) + .to_case(convert_case::Case::Pascal) ) }) .collect::>() @@ -576,12 +576,10 @@ type {} = ", ) } - // Formats a contract file path into a pretty contract name - // eg. dojo_examples::actions::actions.json -> Actions - fn formatted_contract_name(contract_file_name: &str) -> String { - let contract_name = - contract_file_name.split("::").last().unwrap().trim_end_matches(".json"); - contract_name.to_string() + // Formats a contract tag into a pretty contract name + // eg. dojo_examples-actions -> Actions + fn formatted_contract_name(tag: &str) -> String { + naming::capitalize(&naming::get_name_from_tag(tag)) } fn generate_code_content(data: &DojoData) -> String { @@ -632,6 +630,7 @@ mod tests { use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_world::metadata::dojo_metadata_from_workspace; + use scarb::compiler::Profile; use super::*; use crate::gather_dojo_data; @@ -652,6 +651,7 @@ mod tests { let config = compiler::copy_tmp_config( &Utf8PathBuf::from("../../examples/spawn-and-move"), &Utf8PathBuf::from("../dojo-core"), + Profile::DEV, ); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index 8fe748a940..dadd24dd20 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -3,6 +3,7 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; use cainome::parser::tokens::{Composite, CompositeType, Function, FunctionOutputKind, Token}; +use dojo_world::contracts::naming; use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; @@ -235,7 +236,7 @@ public class {} : ModelInstance {{ handled_tokens.insert(token.type_path(), token.to_composite().unwrap().to_owned()); // first index is our model struct - if token.type_name() == model.name { + if token.type_name() == naming::get_name_from_tag(&model.tag) { model_struct = Some(token.to_composite().unwrap()); continue; } @@ -474,13 +475,10 @@ public class {} : ModelInstance {{ ) } - // Formats a contract file path into a pretty contract name - // eg. dojo_examples::actions::actions.json -> Actions - fn formatted_contract_name(contract_file_name: &str) -> String { - let contract_name = - contract_file_name.split("::").last().unwrap().trim_end_matches(".json"); - // capitalize contract name - contract_name.chars().next().unwrap().to_uppercase().to_string() + &contract_name[1..] + // Formats a contract tag into a pretty contract name + // eg. dojo_examples-actions.json -> Actions + fn formatted_contract_name(tag: &str) -> String { + naming::capitalize(&naming::get_name_from_tag(tag)) } // Handles a contract definition and its underlying systems @@ -515,9 +513,9 @@ public class {} : MonoBehaviour {{ {} }} ", - contract.qualified_path, + contract.tag, // capitalize contract name - UnityPlugin::formatted_contract_name(&contract.qualified_path), + UnityPlugin::formatted_contract_name(&contract.tag), systems ); diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index 137f6cc0e0..7ce0b7bfe8 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -10,5 +10,5 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.3.11" -source = "git+https://github.com/dojoengine/dojo?tag=v0.3.11#1e651b5d4d3b79b14a7d8aa29a92062fcb9e6659" +version = "0.4.1" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index a90d40b071..0532c1fa1b 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -49,7 +49,7 @@ use contract_upgrade::{IQuantumLeapDispatcher, IQuantumLeapDispatcherTrait}; // Utils fn deploy_world() -> IWorldDispatcher { - spawn_test_world(array![]) + spawn_test_world("dojo", array![]) } // A test contract needs to be used instead of previously used base contract since. @@ -111,6 +111,8 @@ fn test_upgrade_direct() { trait IMetadataOnly { fn selector(self: @T) -> felt252; fn name(self: @T) -> ByteArray; + fn namespace(self: @T) -> ByteArray; + fn namespace_selector(self: @T) -> felt252; } #[starknet::contract] @@ -125,6 +127,14 @@ mod invalid_legacy_model { 0x1b1edb46931b1a98d8c6ecf2703e8483ec1d85fb75b3e9c061eab383fc8f8f1 } + fn namespace(self: @ContractState) -> ByteArray { + "dojo" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::utils::hash(@Self::namespace(self)) + } + fn name(self: @ContractState) -> ByteArray { "invalid_legacy_model" } @@ -144,6 +154,14 @@ mod invalid_legacy_model_world { 0 } + fn namespace(self: @ContractState) -> ByteArray { + "dojo" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::utils::hash(@Self::namespace(self)) + } + fn name(self: @ContractState) -> ByteArray { "invalid_legacy_model" } @@ -160,7 +178,15 @@ mod invalid_model { fn selector(self: @ContractState) -> felt252 { // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x1b1edb46931b1a98d8c6ecf2703e8483ec1d85fb75b3e9c061eab383fc8f8f1 + 0x3f692e9669a95a2ace68e1eec4fdc26594d4b1413d78a62262249d9108c4194 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::utils::hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { @@ -182,6 +208,14 @@ mod invalid_model_world { 0 } + fn namespace(self: @ContractState) -> ByteArray { + "dojo" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::utils::hash(@Self::namespace(self)) + } + fn name(self: @ContractState) -> ByteArray { "invalid_model_world" } diff --git a/crates/dojo-core/src/contract.cairo b/crates/dojo-core/src/contract.cairo new file mode 100644 index 0000000000..c791225c3e --- /dev/null +++ b/crates/dojo-core/src/contract.cairo @@ -0,0 +1,15 @@ +#[starknet::interface] +trait IContract { + fn contract_name(self: @T) -> ByteArray; + fn selector(self: @T) -> felt252; + + /// Returns the namespace of a contract. + fn namespace(self: @T) -> ByteArray; + + // Returns the namespace selector built from its name. + /// namespace_selector = hash(namespace_name) + fn namespace_selector(self: @T) -> felt252; + + // Returns the contract tag + fn tag(self: @T) -> ByteArray; +} diff --git a/crates/dojo-core/src/lib.cairo b/crates/dojo-core/src/lib.cairo index adbe199c73..2aed7f15fe 100644 --- a/crates/dojo-core/src/lib.cairo +++ b/crates/dojo-core/src/lib.cairo @@ -7,12 +7,16 @@ mod database; mod database_test; mod interfaces; mod model; +mod contract; mod packing; #[cfg(test)] mod packing_test; mod world; #[cfg(test)] mod world_test; +mod utils; +#[cfg(test)] +mod utils_test; // Since Scarb 2.6.0 there's an optimization that does not // build tests for dependencies and it's not configurable. diff --git a/crates/dojo-core/src/model.cairo b/crates/dojo-core/src/model.cairo index 934e3619c7..f577b41d58 100644 --- a/crates/dojo-core/src/model.cairo +++ b/crates/dojo-core/src/model.cairo @@ -5,10 +5,26 @@ trait Model { fn entity( world: IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout ) -> T; + + /// Returns the name of the model as it was written in Cairo code. fn name() -> ByteArray; fn version() -> u8; + + /// Returns the model selector built from its name and its namespace. + /// model selector = hash(hash(namespace_name), hash(model_name)) fn selector() -> felt252; fn instance_selector(self: @T) -> felt252; + + /// Returns the namespace of the model as it was written in the `dojo::model` attribute. + fn namespace() -> ByteArray; + + /// Returns the model namespace selector built from its namespace. + /// namespace_selector = hash(namespace_name) + fn namespace_selector() -> felt252; + + // Returns the model tag + fn tag() -> ByteArray; + fn keys(self: @T) -> Span; fn values(self: @T) -> Span; fn layout() -> dojo::database::introspect::Layout; @@ -21,6 +37,9 @@ trait IModel { fn selector(self: @T) -> felt252; fn name(self: @T) -> ByteArray; fn version(self: @T) -> u8; + fn namespace(self: @T) -> ByteArray; + fn namespace_selector(self: @T) -> felt252; + fn tag(self: @T) -> ByteArray; fn unpacked_size(self: @T) -> Option; fn packed_size(self: @T) -> Option; fn layout(self: @T) -> dojo::database::introspect::Layout; @@ -36,12 +55,14 @@ trait IModel { /// * `class_hash` - Class Hash of the model. fn deploy_and_get_metadata( salt: felt252, class_hash: starknet::ClassHash -) -> SyscallResult<(starknet::ContractAddress, ByteArray, felt252)> { +) -> SyscallResult<(starknet::ContractAddress, ByteArray, felt252, ByteArray, felt252)> { let (contract_address, _) = starknet::deploy_syscall( class_hash, salt, array![].span(), false, )?; let model = IModelDispatcher { contract_address }; let name = model.name(); let selector = model.selector(); - Result::Ok((contract_address, name, selector)) + let namespace = model.namespace(); + let namespace_selector = model.namespace_selector(); + Result::Ok((contract_address, name, selector, namespace, namespace_selector)) } diff --git a/crates/dojo-core/src/packing_test.cairo b/crates/dojo-core/src/packing_test.cairo index 58d340aff6..5a26c19e3b 100644 --- a/crates/dojo-core/src/packing_test.cairo +++ b/crates/dojo-core/src/packing_test.cairo @@ -349,9 +349,6 @@ fn test_pack_with_offset() { assert!(packed.len() == 2, "bad packed length"); - println!("first item: {}", *packed.at(0)); - println!("second item: {}", *packed.at(1)); - assert!(*packed.at(0) == 0x70006, "bad packed first item"); assert!(*packed.at(1) == 0x0900000000000000000000000000000008, "bad packed second item"); } diff --git a/crates/dojo-core/src/resource_metadata.cairo b/crates/dojo-core/src/resource_metadata.cairo index 16935479b8..270742a521 100644 --- a/crates/dojo-core/src/resource_metadata.cairo +++ b/crates/dojo-core/src/resource_metadata.cairo @@ -3,12 +3,9 @@ //! Manually expand to ensure that dojo-core //! does not depend on dojo plugin to be built. //! -use dojo::world::IWorldDispatcherTrait; - +use dojo::world::{IWorldDispatcherTrait}; use dojo::model::Model; -const RESOURCE_METADATA_SELECTOR: felt252 = selector!("ResourceMetadata"); - fn initial_address() -> starknet::ContractAddress { starknet::contract_address_const::<0>() } @@ -19,7 +16,7 @@ fn initial_class_hash() -> starknet::ClassHash { >() } -#[derive(Drop, Serde, PartialEq, Clone)] +#[derive(Drop, Serde, PartialEq, Clone, Debug)] struct ResourceMetadata { // #[key] resource_id: felt252, @@ -32,7 +29,7 @@ impl ResourceMetadataModel of dojo::model::Model { keys: Span, layout: dojo::database::introspect::Layout ) -> ResourceMetadata { - let values = world.entity(RESOURCE_METADATA_SELECTOR, keys, layout); + let values = world.entity(Self::selector(), keys, layout); let mut serialized = core::array::ArrayTrait::new(); core::array::serialize_array_helper(keys, ref serialized); core::array::serialize_array_helper(values, ref serialized); @@ -60,7 +57,9 @@ impl ResourceMetadataModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - RESOURCE_METADATA_SELECTOR + poseidon::poseidon_hash_span( + array![Self::namespace_selector(), dojo::utils::hash(@Self::name())].span() + ) } #[inline(always)] @@ -68,6 +67,18 @@ impl ResourceMetadataModel of dojo::model::Model { Self::selector() } + fn namespace() -> ByteArray { + "__DOJO__" + } + + fn namespace_selector() -> felt252 { + dojo::utils::hash(@Self::namespace()) + } + + fn tag() -> ByteArray { + "__DOJO__:ResourceMetadata" + } + #[inline(always)] fn keys(self: @ResourceMetadata) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -145,7 +156,6 @@ impl ResourceMetadataIntrospect<> of dojo::database::introspect::Introspect ByteArray { + ResourceMetadataModel::namespace() + } + #[external(v0)] fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() diff --git a/crates/dojo-core/src/test_utils.cairo b/crates/dojo-core/src/test_utils.cairo index 1bb6c91286..8efd9e2ccf 100644 --- a/crates/dojo-core/src/test_utils.cairo +++ b/crates/dojo-core/src/test_utils.cairo @@ -40,7 +40,7 @@ fn deploy_with_world_address(class_hash: felt252, world: IWorldDispatcher) -> Co deploy_contract(class_hash, array![world.contract_address.into()].span()) } -fn spawn_test_world(models: Array) -> IWorldDispatcher { +fn spawn_test_world(namespace: ByteArray, models: Array) -> IWorldDispatcher { let salt = testing::get_available_gas(); // deploy world @@ -54,6 +54,9 @@ fn spawn_test_world(models: Array) -> IWorldDispatcher { let world = IWorldDispatcher { contract_address: world_address }; + // register namespace + world.register_namespace(namespace); + // register models let mut index = 0; loop { diff --git a/crates/dojo-core/src/utils.cairo b/crates/dojo-core/src/utils.cairo new file mode 100644 index 0000000000..92654ce538 --- /dev/null +++ b/crates/dojo-core/src/utils.cairo @@ -0,0 +1,6 @@ +/// Compute the poseidon hash of a serialized ByteArray +fn hash(data: @ByteArray) -> felt252 { + let mut serialized = ArrayTrait::new(); + Serde::serialize(data, ref serialized); + poseidon::poseidon_hash_span(serialized.span()) +} diff --git a/crates/dojo-core/src/utils_test.cairo b/crates/dojo-core/src/utils_test.cairo new file mode 100644 index 0000000000..2a28ed4546 --- /dev/null +++ b/crates/dojo-core/src/utils_test.cairo @@ -0,0 +1,17 @@ +#[derive(Drop, Copy, Serde)] +#[dojo::model(namespace: "my_namespace")] +struct MyModel { + #[key] + x: u8, + y: u8 +} + +#[test] +fn test_hash_computation() { + // Be sure that the namespace hash computed in `dojo-lang` in Rust is equal + // to the one computed in Cairo by dojo::utils:hash + let namespace = dojo::model::Model::::namespace(); + let namespace_selector = dojo::model::Model::::namespace_selector(); + + assert(dojo::utils::hash(@namespace) == namespace_selector, 'invalid computed hash'); +} diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index e58610bdec..bfe194ff02 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -9,6 +9,7 @@ trait IWorld { fn set_metadata(ref self: T, metadata: ResourceMetadata); fn model(self: @T, selector: felt252) -> (ClassHash, ContractAddress); fn register_model(ref self: T, class_hash: ClassHash); + fn register_namespace(ref self: T, namespace: ByteArray); fn deploy_contract( ref self: T, salt: felt252, class_hash: ClassHash, init_calldata: Span ) -> ContractAddress; @@ -29,13 +30,21 @@ trait IWorld { ref self: T, model: felt252, keys: Span, layout: dojo::database::introspect::Layout ); fn base(self: @T) -> ClassHash; + + /// In Dojo, there are 2 levels of authorization: `owner` and `writer`. + /// Only accounts can own a resource while any contract can write to a resource, + /// as soon as it has granted the write access from an owner of the resource. fn is_owner(self: @T, address: ContractAddress, resource: felt252) -> bool; fn grant_owner(ref self: T, address: ContractAddress, resource: felt252); fn revoke_owner(ref self: T, address: ContractAddress, resource: felt252); - fn is_writer(self: @T, model: felt252, contract: ContractAddress) -> bool; - fn grant_writer(ref self: T, model: felt252, contract: ContractAddress); - fn revoke_writer(ref self: T, model: felt252, contract: ContractAddress); + fn is_writer(self: @T, resource: felt252, contract: ContractAddress) -> bool; + fn grant_writer(ref self: T, resource: felt252, contract: ContractAddress); + fn revoke_writer(ref self: T, resource: felt252, contract: ContractAddress); + + fn can_write_resource(self: @T, resource_id: felt252, contract: ContractAddress) -> bool; + fn can_write_model(self: @T, model_id: felt252, contract: ContractAddress) -> bool; + fn can_write_namespace(self: @T, namespace_id: felt252, contract: ContractAddress) -> bool; } #[starknet::interface] @@ -48,18 +57,22 @@ trait IWorldProvider { fn world(self: @T) -> IWorldDispatcher; } -#[starknet::interface] -trait IDojoResourceProvider { - fn dojo_resource(self: @T) -> felt252; -} - mod Errors { const METADATA_DESER: felt252 = 'metadata deser error'; const NOT_OWNER: felt252 = 'not owner'; const NOT_OWNER_WRITER: felt252 = 'not owner or writer'; + const NO_WRITE_ACCESS: felt252 = 'no write access'; + const NO_MODEL_WRITE_ACCESS: felt252 = 'no model write access'; + const NO_NAMESPACE_WRITE_ACCESS: felt252 = 'no namespace write access'; + const NAMESPACE_NOT_REGISTERED: felt252 = 'namespace not registered'; + const NOT_REGISTERED: felt252 = 'resource not registered'; const INVALID_MODEL_NAME: felt252 = 'invalid model name'; + const INVALID_NAMESPACE_NAME: felt252 = 'invalid namespace name'; + const INVALID_RESOURCE_SELECTOR: felt252 = 'invalid resource selector'; const OWNER_ONLY_UPGRADE: felt252 = 'only owner can upgrade'; const OWNER_ONLY_UPDATE: felt252 = 'only owner can update'; + const NAMESPACE_ALREADY_REGISTERED: felt252 = 'namespace already registered'; + const UNEXPECTED_ERROR: felt252 = 'unexpected error'; } #[starknet::contract] @@ -85,15 +98,16 @@ mod world { use dojo::database; use dojo::database::introspect::{Introspect, Layout, FieldLayout}; use dojo::components::upgradeable::{IUpgradeableDispatcher, IUpgradeableDispatcherTrait}; + use dojo::contract::{IContractDispatcher, IContractDispatcherTrait}; use dojo::config::component::Config; - use dojo::model::Model; + use dojo::model::{Model, IModelDispatcher, IModelDispatcherImpl}; use dojo::interfaces::{ IUpgradeableState, IFactRegistryDispatcher, IFactRegistryDispatcherImpl, StorageUpdate, ProgramOutput }; use dojo::world::{IWorldDispatcher, IWorld, IUpgradeableWorld}; use dojo::resource_metadata; - use dojo::resource_metadata::{ResourceMetadata, RESOURCE_METADATA_SELECTOR}; + use dojo::resource_metadata::ResourceMetadata; use super::Errors; @@ -112,12 +126,13 @@ mod world { #[event] #[derive(Drop, starknet::Event)] - enum Event { + pub enum Event { WorldSpawned: WorldSpawned, ContractDeployed: ContractDeployed, ContractUpgraded: ContractUpgraded, WorldUpgraded: WorldUpgraded, MetadataUpdate: MetadataUpdate, + NamespaceRegistered: NamespaceRegistered, ModelRegistered: ModelRegistered, StoreSetRecord: StoreSetRecord, StoreDelRecord: StoreDelRecord, @@ -148,6 +163,8 @@ mod world { salt: felt252, class_hash: ClassHash, address: ContractAddress, + namespace: ByteArray, + name: ByteArray } #[derive(Drop, starknet::Event)] @@ -162,9 +179,16 @@ mod world { uri: ByteArray } + #[derive(Drop, starknet::Event, Debug, PartialEq)] + pub struct NamespaceRegistered { + namespace: ByteArray, + hash: felt252 + } + #[derive(Drop, starknet::Event)] struct ModelRegistered { name: ByteArray, + namespace: ByteArray, class_hash: ClassHash, prev_class_hash: ClassHash, address: ContractAddress, @@ -186,7 +210,7 @@ mod world { #[derive(Drop, starknet::Event)] struct WriterUpdated { - model: felt252, + resource: felt252, contract: ContractAddress, value: bool } @@ -203,8 +227,7 @@ mod world { contract_base: ClassHash, nonce: usize, models_count: usize, - models: LegacyMap::, - deployed_contracts: LegacyMap::, + resources: LegacyMap::, owners: LegacyMap::<(felt252, ContractAddress), bool>, writers: LegacyMap::<(felt252, ContractAddress), bool>, #[substorage(v0)] @@ -212,17 +235,45 @@ mod world { initialized_contract: LegacyMap::, } + #[derive(Drop, starknet::Store, Default, Debug)] + enum ResourceData { + Model: (ClassHash, ContractAddress), + Contract, + Namespace, + #[default] + None, + } + + #[generate_trait] + impl ResourceDataIsNoneImpl of ResourceDataIsNoneTrait { + fn is_none(self: @ResourceData) -> bool { + match self { + ResourceData::None => true, + _ => false + } + } + } + #[constructor] fn constructor(ref self: ContractState, contract_base: ClassHash) { let creator = starknet::get_tx_info().unbox().account_contract_address; self.contract_base.write(contract_base); - self.owners.write((WORLD, creator), true); + + self.resources.write(WORLD, ResourceData::Contract); self - .models + .resources .write( - RESOURCE_METADATA_SELECTOR, - (resource_metadata::initial_class_hash(), resource_metadata::initial_address()) + dojo::model::Model::::selector(), + ResourceData::Model( + (resource_metadata::initial_class_hash(), resource_metadata::initial_address()) + ) ); + self.owners.write((WORLD, creator), true); + + let dojo_namespace_hash = dojo::utils::hash(@"__DOJO__"); + + self.resources.write(dojo_namespace_hash, ResourceData::Namespace); + self.owners.write((dojo_namespace_hash, creator), true); self.config.initializer(creator); @@ -239,7 +290,7 @@ mod world { fn metadata(self: @ContractState, resource_id: felt252) -> ResourceMetadata { let mut data = self ._read_model_data( - RESOURCE_METADATA_SELECTOR, + dojo::model::Model::::selector(), array![resource_id].span(), Model::::layout() ); @@ -258,7 +309,10 @@ mod world { /// /// `metadata` - The metadata content for the resource. fn set_metadata(ref self: ContractState, metadata: ResourceMetadata) { - assert_can_write(@self, metadata.resource_id, get_caller_address()); + assert( + self.can_write_resource(metadata.resource_id, get_caller_address()), + Errors::NO_WRITE_ACCESS + ); let model = Model::::selector(); let keys = Model::::keys(@metadata); @@ -289,16 +343,17 @@ mod world { /// Grants ownership of the resource to the address. /// Can only be called by an existing owner or the world admin. - /// + /// + /// Note that this resource must have been registered to the world first. + /// /// # Arguments /// /// * `address` - The contract address. /// * `resource` - The resource. fn grant_owner(ref self: ContractState, address: ContractAddress, resource: felt252) { - let caller = get_caller_address(); - assert( - self.is_owner(caller, resource) || self.is_owner(caller, WORLD), Errors::NOT_OWNER - ); + assert(!self.resources.read(resource).is_none(), Errors::NOT_REGISTERED); + assert(self.is_account_owner(resource), Errors::NOT_OWNER); + self.owners.write((resource, address), true); EventEmitter::emit(ref self, OwnerUpdated { address, resource, value: true }); @@ -307,72 +362,158 @@ mod world { /// Revokes owner permission to the contract for the model. /// Can only be called by an existing owner or the world admin. /// + /// Note that this resource must have been registered to the world first. + /// /// # Arguments /// /// * `address` - The contract address. /// * `resource` - The resource. fn revoke_owner(ref self: ContractState, address: ContractAddress, resource: felt252) { - let caller = get_caller_address(); - assert( - self.is_owner(caller, resource) || self.is_owner(caller, WORLD), Errors::NOT_OWNER - ); + assert(!self.resources.read(resource).is_none(), Errors::NOT_REGISTERED); + assert(self.is_account_owner(resource), Errors::NOT_OWNER); + self.owners.write((resource, address), false); EventEmitter::emit(ref self, OwnerUpdated { address, resource, value: false }); } - /// Checks if the provided contract is a writer of the model. + /// Checks if the provided contract is a writer of the resource. + /// + /// Note: that this function just indicates if a contract has the `writer` role for the resource, + /// without applying any specific rule. For example, for a model, the write access right + /// to the model namespace is not checked. + /// It does not even check if the contract is an owner of the resource. + /// Please use more high-level functions such `can_write_model` for that. /// /// # Arguments /// - /// * `model` - The name of the model. + /// * `resource` - The hash of the resource name. /// * `contract` - The name of the contract. /// /// # Returns /// - /// * `bool` - True if the contract is a writer of the model, false otherwise - fn is_writer(self: @ContractState, model: felt252, contract: ContractAddress) -> bool { - self.writers.read((model, contract)) + /// * `bool` - True if the contract is a writer of the resource, false otherwise + fn is_writer(self: @ContractState, resource: felt252, contract: ContractAddress) -> bool { + self.writers.read((resource, contract)) } - /// Grants writer permission to the contract for the model. - /// Can only be called by an existing model owner or the world admin. + /// Grants writer permission to the contract for the resource. + /// Can only be called by an existing resource owner or the world admin. + /// + /// Note that this resource must have been registered to the world first. /// /// # Arguments /// - /// * `model` - The name of the model. + /// * `resource` - The hash of the resource name. /// * `contract` - The name of the contract. - fn grant_writer(ref self: ContractState, model: felt252, contract: ContractAddress) { - let caller = get_caller_address(); + fn grant_writer(ref self: ContractState, resource: felt252, contract: ContractAddress) { + assert(!self.resources.read(resource).is_none(), Errors::NOT_REGISTERED); + assert(self.is_account_owner(resource), Errors::NOT_OWNER); - assert( - self.is_owner(caller, model) || self.is_owner(caller, WORLD), - Errors::NOT_OWNER_WRITER - ); - self.writers.write((model, contract), true); + self.writers.write((resource, contract), true); - EventEmitter::emit(ref self, WriterUpdated { model, contract, value: true }); + EventEmitter::emit(ref self, WriterUpdated { resource, contract, value: true }); } /// Revokes writer permission to the contract for the model. /// Can only be called by an existing model writer, owner or the world admin. /// + /// Note that this resource must have been registered to the world first. + /// /// # Arguments /// /// * `model` - The name of the model. /// * `contract` - The name of the contract. - fn revoke_writer(ref self: ContractState, model: felt252, contract: ContractAddress) { - let caller = get_caller_address(); + fn revoke_writer(ref self: ContractState, resource: felt252, contract: ContractAddress) { + assert(!self.resources.read(resource).is_none(), Errors::NOT_REGISTERED); + let caller = get_caller_address(); assert( - self.is_writer(model, caller) - || self.is_owner(caller, model) - || self.is_owner(caller, WORLD), + self.is_writer(resource, caller) || self.is_account_owner(resource), Errors::NOT_OWNER_WRITER ); - self.writers.write((model, contract), false); + self.writers.write((resource, contract), false); - EventEmitter::emit(ref self, WriterUpdated { model, contract, value: false }); + EventEmitter::emit(ref self, WriterUpdated { resource, contract, value: false }); + } + + /// Checks if the provided contract can write to the resource. + /// + /// Note: Contrary to `is_writer`, this function checks resource specific rules. + /// For example, for a model, it checks if the contract is a write/owner of the resource, + /// OR a write/owner of the namespace. + /// + /// # Arguments + /// + /// * `resource_id` - The resource IUpgradeableDispatcher. + /// * `contract` - The name of the contract. + /// + /// # Returns + /// + /// * `bool` - True if the contract can write to the resource, false otherwise + fn can_write_resource( + self: @ContractState, resource_id: felt252, contract: ContractAddress + ) -> bool { + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(resource_id); + match resource { + ResourceData::Model((_, model_address)) => self + ._check_model_write_access(resource_id, model_address, contract), + ResourceData::Namespace | + ResourceData::Contract => self._check_basic_write_access(resource_id, contract), + ResourceData::None => panic_with_felt252(Errors::INVALID_RESOURCE_SELECTOR) + } + } + + /// Checks if the provided contract can write to the model. + /// It panics if the resource selector is not a model. + /// + /// Note: Contrary to `is_writer`, this function checks if the contract is a write/owner of the model, + /// OR a write/owner of the namespace. + /// + /// # Arguments + /// + /// * `model_id` - The model selector. + /// * `contract` - The name of the contract. + /// + /// # Returns + /// + /// * `bool` - True if the contract can write to the model, false otherwise + fn can_write_model( + self: @ContractState, model_id: felt252, contract: ContractAddress + ) -> bool { + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(model_id); + match resource { + ResourceData::Model((_, model_address)) => self + ._check_model_write_access(model_id, model_address, contract), + _ => panic_with_felt252(Errors::INVALID_RESOURCE_SELECTOR) + } + } + + /// Checks if the provided contract can write to the namespace. + /// It panics if the resource selector is not a namespace. + /// + /// Note: Contrary to `is_writer`, this function also checks if the caller account is + /// the owner of the namespace. + /// + /// # Arguments + /// + /// * `namespace_id` - The namespace selector. + /// * `contract` - The name of the contract. + /// + /// # Returns + /// + /// * `bool` - True if the contract can write to the namespace, false otherwise + fn can_write_namespace( + self: @ContractState, namespace_id: felt252, contract: ContractAddress + ) -> bool { + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(namespace_id); + match resource { + ResourceData::Namespace => self._check_basic_write_access(namespace_id, contract), + _ => panic_with_felt252(Errors::INVALID_RESOURCE_SELECTOR) + } } /// Registers a model in the world. If the model is already registered, @@ -385,7 +526,8 @@ mod world { let caller = get_caller_address(); let salt = self.models_count.read(); - let (address, name, selector) = dojo::model::deploy_and_get_metadata( + let (address, name, selector, namespace, namespace_selector) = + dojo::model::deploy_and_get_metadata( salt.into(), class_hash ) .unwrap_syscall(); @@ -396,31 +538,75 @@ mod world { starknet::contract_address::ContractAddressZeroable::zero(), ); - // Avoids a model name to conflict with already deployed contract, - // which can cause ACL issue with current ACL implementation. - if selector.is_zero() || self.deployed_contracts.read(selector).is_non_zero() { + assert( + self._is_namespace_registered(namespace_selector), Errors::NAMESPACE_NOT_REGISTERED + ); + assert( + self.can_write_namespace(namespace_selector, get_caller_address()), + Errors::NO_NAMESPACE_WRITE_ACCESS + ); + + if selector.is_zero() { panic_with_felt252(Errors::INVALID_MODEL_NAME); } - // If model is already registered, validate permission to update. - let model_data: (ClassHash, ContractAddress) = self.models.read(selector); - let (current_class_hash, current_address) = model_data; - - if current_class_hash.is_non_zero() { - assert(self.is_owner(caller, selector), Errors::OWNER_ONLY_UPDATE); - prev_class_hash = current_class_hash; - prev_address = current_address; - } else { - self.owners.write((selector, caller), true); + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(selector); + + match resource { + // If model is already registered, validate permission to update. + ResourceData::Model(( + model_hash, model_address + )) => { + assert(self.is_account_owner(selector), Errors::OWNER_ONLY_UPDATE); + prev_class_hash = model_hash; + prev_address = model_address; + }, + // new model + ResourceData::None => { self.owners.write((selector, caller), true); }, + // Avoids a model name to conflict with already registered resource, + // which can cause ACL issue with current ACL implementation. + _ => panic_with_felt252(Errors::INVALID_MODEL_NAME) }; - self.models.write(selector, (class_hash, address)); + self.resources.write(selector, ResourceData::Model((class_hash, address))); EventEmitter::emit( ref self, - ModelRegistered { name, prev_address, address, class_hash, prev_class_hash } + ModelRegistered { + name, namespace, prev_address, address, class_hash, prev_class_hash + } ); } + /// Registers a namespace in the world. + /// + /// # Arguments + /// + /// * `namespace` - The name of the namespace to be registered. + fn register_namespace(ref self: ContractState, namespace: ByteArray) { + let caller_account = self._get_account_address(); + + let hash = dojo::utils::hash(@namespace); + + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(hash); + match resource { + ResourceData::Namespace => { + if !self.is_account_owner(hash) { + panic_with_felt252(Errors::NAMESPACE_ALREADY_REGISTERED); + } + }, + ResourceData::None => { + self.resources.write(hash, ResourceData::Namespace); + self.owners.write((hash, caller_account), true); + + EventEmitter::emit(ref self, NamespaceRegistered { namespace, hash }); + }, + _ => { panic_with_felt252(Errors::INVALID_NAMESPACE_NAME); } + }; + } + + /// Gets the class hash of a registered model. /// /// # Arguments @@ -431,7 +617,12 @@ mod world { /// /// * (`ClassHash`, `ContractAddress`) - The class hash and the contract address of the model. fn model(self: @ContractState, selector: felt252) -> (ClassHash, ContractAddress) { - self.models.read(selector) + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(selector); + match resource { + ResourceData::Model(m) => m, + _ => panic_with_felt252(Errors::INVALID_RESOURCE_SELECTOR) + } } /// Deploys a contract associated with the world. @@ -458,6 +649,19 @@ mod world { let upgradeable_dispatcher = IUpgradeableDispatcher { contract_address }; upgradeable_dispatcher.upgrade(class_hash); + // namespace checking + let dispatcher = IContractDispatcher { contract_address }; + let namespace = dispatcher.namespace(); + let name = dispatcher.contract_name(); + let namespace_selector = dispatcher.namespace_selector(); + assert( + self._is_namespace_registered(namespace_selector), Errors::NAMESPACE_NOT_REGISTERED + ); + assert( + self.can_write_namespace(namespace_selector, get_caller_address()), + Errors::NO_NAMESPACE_WRITE_ACCESS + ); + if self.initialized_contract.read(contract_address.into()) { panic!("Contract has already been initialized"); } else { @@ -468,10 +672,11 @@ mod world { self.owners.write((contract_address.into(), get_caller_address()), true); - self.deployed_contracts.write(contract_address.into(), class_hash.into()); + self.resources.write(contract_address.into(), ResourceData::Contract); EventEmitter::emit( - ref self, ContractDeployed { salt, class_hash, address: contract_address } + ref self, + ContractDeployed { salt, class_hash, address: contract_address, namespace, name } ); contract_address @@ -490,7 +695,7 @@ mod world { fn upgrade_contract( ref self: ContractState, address: ContractAddress, class_hash: ClassHash ) -> ClassHash { - assert(is_account_owner(@self, address.into()), Errors::NOT_OWNER); + assert(self.is_account_owner(address.into()), Errors::NOT_OWNER); IUpgradeableDispatcher { contract_address: address }.upgrade(class_hash); EventEmitter::emit(ref self, ContractUpgraded { class_hash, address }); class_hash @@ -536,7 +741,9 @@ mod world { values: Span, layout: dojo::database::introspect::Layout ) { - assert_can_write(@self, model, get_caller_address()); + assert( + self.can_write_model(model, get_caller_address()), Errors::NO_MODEL_WRITE_ACCESS + ); self._write_model_data(model, keys, values, layout); EventEmitter::emit(ref self, StoreSetRecord { table: model, keys, values }); @@ -557,7 +764,9 @@ mod world { keys: Span, layout: dojo::database::introspect::Layout ) { - assert_can_write(@self, model, get_caller_address()); + assert( + self.can_write_model(model, get_caller_address()), Errors::NO_MODEL_WRITE_ACCESS + ); self._delete_model_data(model, keys, layout); EventEmitter::emit(ref self, StoreDelRecord { table: model, keys }); @@ -605,10 +814,7 @@ mod world { /// * `new_class_hash` - The new world class hash. fn upgrade(ref self: ContractState, new_class_hash: ClassHash) { assert(new_class_hash.is_non_zero(), 'invalid class_hash'); - assert( - IWorld::is_owner(@self, get_tx_info().unbox().account_contract_address, WORLD), - Errors::OWNER_ONLY_UPGRADE, - ); + assert(self.is_account_world_owner(), Errors::OWNER_ONLY_UPGRADE); // upgrade to new_class_hash replace_class_syscall(new_class_hash).unwrap(); @@ -674,37 +880,117 @@ mod world { } } - /// Asserts that the current caller can write to the model. - /// - /// # Arguments - /// - /// * `resource` - The selector of the resource being written to. - /// * `caller` - The selector of the caller writing. - fn assert_can_write(self: @ContractState, resource: felt252, caller: ContractAddress) { - assert( - IWorld::is_writer(self, resource, caller) || is_account_owner(self, resource), - 'not writer' - ); - } - - /// Verifies if the calling account is owner of the resource or the - /// owner of the world. - /// - /// # Arguments - /// - /// * `resource` - The selector of the resource being verified. - /// - /// # Returns - /// - /// * `bool` - True if the calling account is the owner of the resource or the owner of the world, - /// false otherwise. - fn is_account_owner(self: @ContractState, resource: felt252) -> bool { - IWorld::is_owner(self, get_tx_info().unbox().account_contract_address, resource) - || IWorld::is_owner(self, get_tx_info().unbox().account_contract_address, WORLD) - } - #[generate_trait] impl Self of SelfTrait { + #[inline(always)] + fn _get_account_address(self: @ContractState) -> ContractAddress { + get_tx_info().unbox().account_contract_address + } + + /// Verifies if the calling account is owner of the resource or the + /// owner of the world. + /// + /// # Arguments + /// + /// * `resource` - The selector of the resource being verified. + /// + /// # Returns + /// + /// * `bool` - True if the calling account is the owner of the resource or the owner of the world, + /// false otherwise. + #[inline(always)] + fn is_account_owner(self: @ContractState, resource: felt252) -> bool { + IWorld::is_owner(self, self._get_account_address(), resource) + || self.is_account_world_owner() + } + + /// Verifies if the calling account has write access to the resource. + /// + /// # Arguments + /// + /// * `resource` - The selector of the resource being verified. + /// + /// # Returns + /// + /// * `bool` - True if the calling account has write access to the resource, + /// false otherwise. + #[inline(always)] + fn is_account_writer(self: @ContractState, resource: felt252) -> bool { + IWorld::is_writer(self, resource, self._get_account_address()) + } + + /// Verifies if the calling account is the world owner. + /// + /// # Returns + /// + /// * `bool` - True if the calling account is the world owner, false otherwise. + #[inline(always)] + fn is_account_world_owner(self: @ContractState) -> bool { + IWorld::is_owner(self, self._get_account_address(), WORLD) + } + + /// Indicates if the provided namespace is already registered + #[inline(always)] + fn _is_namespace_registered(self: @ContractState, namespace_selector: felt252) -> bool { + // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed + let resource: ResourceData = self.resources.read(namespace_selector); + match resource { + ResourceData::Namespace => true, + _ => false + } + } + + /// Check model write access. + /// That means, check if: + /// - the calling contract has the writer role for the model OR, + /// - the calling account has the owner and/or writer role for the model OR, + /// - the calling contract has the writer role for the model namespace OR + /// - the calling account has the owner and/or writer role for the model namespace. + /// + /// # Arguments + /// * `model_id` - the model selector to check. + /// * `model_address` - the model contract address. + /// * `contract` - the calling contract. + /// + /// # Returns + /// `true` if the write access is allowed, false otherwise. + /// + fn _check_model_write_access( + self: @ContractState, + model_id: felt252, + model_address: ContractAddress, + contract: ContractAddress + ) -> bool { + if !self.is_writer(model_id, contract) + && !self.is_account_owner(model_id) + && !self.is_account_writer(model_id) { + let model = IModelDispatcher { contract_address: model_address }; + self._check_basic_write_access(model.namespace_selector(), contract) + } else { + true + } + } + + /// Check basic resource write access. + /// That means, check if: + /// - the calling contract has the writer role for the resource OR, + /// - the calling account has the owner and/or writer role for the resource. + /// + /// # Arguments + /// * `resource_id` - the resource selector to check. + /// * `contract` - the calling contract. + /// + /// # Returns + /// `true` if the write access is allowed, false otherwise. + /// + fn _check_basic_write_access( + self: @ContractState, resource_id: felt252, contract: ContractAddress + ) -> bool { + self.is_writer(resource_id, contract) + || self.is_account_owner(resource_id) + || self.is_account_writer(resource_id) + } + /// Write a new model record. /// /// # Arguments diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/world_test.cairo index 634309cd61..955ad4a8a6 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/world_test.cairo @@ -11,8 +11,9 @@ use dojo::benchmarks; use dojo::config::interface::{IConfigDispatcher, IConfigDispatcherImpl}; use dojo::world::{ IWorldDispatcher, IWorldDispatcherTrait, world, IUpgradeableWorld, IUpgradeableWorldDispatcher, - IUpgradeableWorldDispatcherTrait, ResourceMetadata + IUpgradeableWorldDispatcherTrait, ResourceMetadata, }; +use dojo::world::world::NamespaceRegistered; use dojo::database::introspect::{Introspect, Layout, FieldLayout}; use dojo::database::MAX_ARRAY_LENGTH; use dojo::test_utils::{spawn_test_world, deploy_with_world_address, assert_array}; @@ -43,6 +44,16 @@ struct Foo { b: u128, } +#[derive(Copy, Drop, Serde)] +#[dojo::model(namespace: "another_namespace")] +struct Buzz { + #[key] + caller: ContractAddress, + a: felt252, + b: u128, +} + + fn create_foo() -> Span { array![1, 2].span() } @@ -248,6 +259,8 @@ fn get_key_test() -> Span { trait IMetadataOnly { fn selector(self: @T) -> felt252; fn name(self: @T) -> ByteArray; + fn namespace(self: @T) -> ByteArray; + fn namespace_selector(self: @T) -> felt252; } #[starknet::contract] @@ -258,7 +271,15 @@ mod resource_metadata_malicious { #[abi(embed_v0)] impl InvalidModelName of super::IMetadataOnly { fn selector(self: @ContractState) -> felt252 { - selector!("ResourceMetadata") + dojo::model::Model::::selector() + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::utils::hash(@Self::namespace(self)) } fn name(self: @ContractState) -> ByteArray { @@ -302,7 +323,7 @@ mod bar { .world .read() .delete_entity( - selector!("Foo"), + dojo::model::Model::::selector(), array![get_caller_address().into()].span(), dojo::model::Model::::layout() ); @@ -408,7 +429,7 @@ fn test_model_class_hash_getter() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - let (foo_class_hash, _) = world.model(selector!("Foo")); + let (foo_class_hash, _) = world.model(dojo::model::Model::::selector()); assert(foo_class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'foo wrong class hash'); } @@ -423,6 +444,66 @@ fn test_legacy_model_class_hash_getter() { assert(foo_class_hash == foo::TEST_CLASS_HASH.try_into().unwrap(), 'foo wrong class hash'); } +#[test] +fn test_register_namespace() { + let world = deploy_world(); + + let caller = starknet::contract_address_const::<0xb0b>(); + starknet::testing::set_account_contract_address(caller); + + drop_all_events(world.contract_address); + + let namespace = "namespace"; + let hash = dojo::utils::hash(@namespace); + + world.register_namespace(namespace); + + assert(world.is_owner(caller, hash), 'namespace not registered'); + + assert_eq!( + starknet::testing::pop_log(world.contract_address), + Option::Some(NamespaceRegistered { namespace: "namespace", hash }) + ); +} + +#[test] +fn test_register_namespace_already_registered_same_caller() { + let world = deploy_world(); + + let caller = starknet::contract_address_const::<0xb0b>(); + starknet::testing::set_account_contract_address(caller); + + let namespace = "namespace"; + let hash = dojo::utils::hash(@namespace); + + world.register_namespace(namespace); + + drop_all_events(world.contract_address); + + world.register_namespace("namespace"); + + assert(world.is_owner(caller, hash), 'namespace not registered'); + + let event = starknet::testing::pop_log_raw(world.contract_address); + assert(event.is_none(), 'unexpected event'); +} + +#[test] +#[should_panic(expected: ('namespace already registered', 'ENTRYPOINT_FAILED',))] +fn test_register_namespace_already_registered_other_caller() { + let world = deploy_world(); + + let account = starknet::contract_address_const::<0xb0b>(); + starknet::testing::set_account_contract_address(account); + + world.register_namespace("namespace"); + + let another_account = starknet::contract_address_const::<0xa11ce>(); + starknet::testing::set_account_contract_address(another_account); + + world.register_namespace("namespace"); +} + #[test] #[available_gas(6000000)] fn test_emit() { @@ -472,7 +553,7 @@ fn test_set_entity_unauthorized() { // Utils fn deploy_world() -> IWorldDispatcher { - spawn_test_world(array![]) + spawn_test_world("dojo", array![]) } #[test] @@ -492,13 +573,13 @@ fn test_set_metadata_world() { #[test] #[available_gas(60000000)] fn test_set_metadata_model_writer() { - let world = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world = spawn_test_world("dojo", array![foo::TEST_CLASS_HASH],); let bar_contract = IbarDispatcher { contract_address: deploy_with_world_address(bar::TEST_CLASS_HASH, world) }; - world.grant_writer(selector!("Foo"), bar_contract.contract_address); + world.grant_writer(dojo::model::Model::::selector(), bar_contract.contract_address); let bob = starknet::contract_address_const::<0xb0b>(); starknet::testing::set_account_contract_address(bob); @@ -507,18 +588,18 @@ fn test_set_metadata_model_writer() { bar_contract.set_foo(1337, 1337); let metadata = ResourceMetadata { - resource_id: selector!("Foo"), metadata_uri: format!("ipfs:bob") + resource_id: dojo::model::Model::::selector(), metadata_uri: format!("ipfs:bob") }; // A system that has write access on a model should be able to update the metadata. // This follows conventional ACL model. world.set_metadata(metadata.clone()); - assert(world.metadata(selector!("Foo")) == metadata, 'bad metadata'); + assert(world.metadata(dojo::model::Model::::selector()) == metadata, 'bad metadata'); } #[test] #[available_gas(60000000)] -#[should_panic(expected: ('not writer', 'ENTRYPOINT_FAILED',))] +#[should_panic(expected: ('no write access', 'ENTRYPOINT_FAILED',))] fn test_set_metadata_same_model_rules() { let world = deploy_world(); @@ -543,6 +624,9 @@ fn test_metadata_update_owner_only() { let bob = starknet::contract_address_const::<0xb0b>(); starknet::testing::set_contract_address(bob); + + world.grant_owner(bob, dojo::utils::hash(@"dojo")); + starknet::testing::set_account_contract_address(bob); world.register_model(resource_metadata_malicious::TEST_CLASS_HASH.try_into().unwrap()); @@ -552,24 +636,26 @@ fn test_metadata_update_owner_only() { #[available_gas(6000000)] fn test_owner() { let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + let foo_selector = dojo::model::Model::::selector(); let alice = starknet::contract_address_const::<0x1337>(); let bob = starknet::contract_address_const::<0x1338>(); assert(!world.is_owner(alice, 0), 'should not be owner'); - assert(!world.is_owner(bob, 42), 'should not be owner'); + assert(!world.is_owner(bob, foo_selector), 'should not be owner'); world.grant_owner(alice, 0); assert(world.is_owner(alice, 0), 'should be owner'); - world.grant_owner(bob, 42); - assert(world.is_owner(bob, 42), 'should be owner'); + world.grant_owner(bob, foo_selector); + assert(world.is_owner(bob, foo_selector), 'should be owner'); world.revoke_owner(alice, 0); assert(!world.is_owner(alice, 0), 'should not be owner'); - world.revoke_owner(bob, 42); - assert(!world.is_owner(bob, 42), 'should not be owner'); + world.revoke_owner(bob, foo_selector); + assert(!world.is_owner(bob, foo_selector), 'should not be owner'); } #[test] @@ -579,7 +665,7 @@ fn test_set_owner_fails_for_non_owner() { let world = deploy_world(); let alice = starknet::contract_address_const::<0x1337>(); - starknet::testing::set_contract_address(alice); + starknet::testing::set_account_contract_address(alice); world.revoke_owner(alice, 0); assert(!world.is_owner(alice, 0), 'should not be owner'); @@ -591,28 +677,39 @@ fn test_set_owner_fails_for_non_owner() { #[available_gas(6000000)] fn test_writer() { let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + let foo_selector = dojo::model::Model::::selector(); - assert(!world.is_writer(42, 69.try_into().unwrap()), 'should not be writer'); + assert(!world.is_writer(foo_selector, 69.try_into().unwrap()), 'should not be writer'); - world.grant_writer(42, 69.try_into().unwrap()); - assert(world.is_writer(42, 69.try_into().unwrap()), 'should be writer'); + world.grant_writer(foo_selector, 69.try_into().unwrap()); + assert(world.is_writer(foo_selector, 69.try_into().unwrap()), 'should be writer'); - world.revoke_writer(42, 69.try_into().unwrap()); - assert(!world.is_writer(42, 69.try_into().unwrap()), 'should not be writer'); + world.revoke_writer(foo_selector, 69.try_into().unwrap()); + assert(!world.is_writer(foo_selector, 69.try_into().unwrap()), 'should not be writer'); +} + +#[test] +#[should_panic(expected: ('resource not registered', 'ENTRYPOINT_FAILED'))] +fn test_writer_not_registered_resource() { + let world = deploy_world(); + + // 42 is not a registered resource ID + world.grant_writer(42, 69.try_into().unwrap()); } #[test] #[available_gas(6000000)] #[should_panic] fn test_system_not_writer_fail() { - let world = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world = spawn_test_world("dojo", array![foo::TEST_CLASS_HASH],); let bar_address = deploy_with_world_address(bar::TEST_CLASS_HASH, world); let bar_contract = IbarDispatcher { contract_address: bar_address }; // Caller is not owner now - let caller = starknet::contract_address_const::<0x1337>(); - starknet::testing::set_account_contract_address(caller); + let account = starknet::contract_address_const::<0xb0b>(); + starknet::testing::set_account_contract_address(account); // Should panic, system not writer bar_contract.set_foo(25, 16); @@ -620,13 +717,13 @@ fn test_system_not_writer_fail() { #[test] fn test_system_writer_access() { - let world = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world = spawn_test_world("dojo", array![foo::TEST_CLASS_HASH],); let bar_address = deploy_with_world_address(bar::TEST_CLASS_HASH, world); let bar_contract = IbarDispatcher { contract_address: bar_address }; - world.grant_writer(selector!("Foo"), bar_address); - assert(world.is_writer(selector!("Foo"), bar_address), 'should be writer'); + world.grant_writer(dojo::model::Model::::selector(), bar_address); + assert(world.is_writer(dojo::model::Model::::selector(), bar_address), 'should be writer'); // Caller is not owner now let caller = starknet::contract_address_const::<0x1337>(); @@ -653,14 +750,14 @@ fn test_set_writer_fails_for_non_owner() { #[test] fn test_execute_multiple_worlds() { // Deploy world contract - let world1 = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world1 = spawn_test_world("dojo", array![foo::TEST_CLASS_HASH],); let bar1_contract = IbarDispatcher { contract_address: deploy_with_world_address(bar::TEST_CLASS_HASH, world1) }; // Deploy another world contract - let world2 = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world2 = spawn_test_world("dojo", array![foo::TEST_CLASS_HASH],); let bar2_contract = IbarDispatcher { contract_address: deploy_with_world_address(bar::TEST_CLASS_HASH, world2) @@ -682,7 +779,7 @@ fn test_execute_multiple_worlds() { #[test] #[available_gas(60000000)] fn bench_execute() { - let world = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world = spawn_test_world("dojo", array![foo::TEST_CLASS_HASH],); let bar_contract = IbarDispatcher { contract_address: deploy_with_world_address(bar::TEST_CLASS_HASH, world) }; @@ -704,7 +801,7 @@ fn bench_execute() { #[test] fn bench_execute_complex() { - let world = spawn_test_world(array![foo::TEST_CLASS_HASH],); + let world = spawn_test_world("dojo", array![benchmarks::character::TEST_CLASS_HASH],); let bar_contract = IbarDispatcher { contract_address: deploy_with_world_address(bar::TEST_CLASS_HASH, world) }; @@ -725,7 +822,6 @@ fn bench_execute_complex() { assert(data.heigth == 1337, 'data not stored'); } - #[starknet::interface] trait IWorldUpgrade { fn hello(self: @TContractState) -> felt252; @@ -844,6 +940,9 @@ trait IDojoInit { #[dojo::contract] mod test_contract {} +#[dojo::contract(namespace: "buzz_namespace")] +mod buzz_contract {} + #[test] #[available_gas(6000000)] #[should_panic(expected: ('Only world can init', 'ENTRYPOINT_FAILED'))] @@ -862,14 +961,12 @@ fn test_can_call_init() { fn test_set_entity_with_fixed_layout() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - - let selector = selector!("foo"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_foo(); let layout = dojo::model::Model::::layout(); world.set_entity(selector, get_key_test(), values, layout); - let read_values = world.entity(selector, keys, layout); assert_array(read_values, values); } @@ -879,7 +976,7 @@ fn test_set_entity_with_struct_layout() { let world = deploy_world(); world.register_model(struct_simple_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_simple_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_model(); let layout = dojo::model::Model::::layout(); @@ -895,7 +992,7 @@ fn test_set_entity_with_struct_tuple_layout() { let world = deploy_world(); world.register_model(struct_with_tuple::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_with_tuple"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_with_tuple(); let layout = dojo::model::Model::::layout(); @@ -911,7 +1008,7 @@ fn test_set_entity_with_struct_enum_layout() { let world = deploy_world(); world.register_model(struct_with_enum::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_with_enum"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_with_enum_first_variant(); let layout = dojo::model::Model::::layout(); @@ -935,7 +1032,7 @@ fn test_set_entity_with_struct_simple_array_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_simple_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_array_model(); let layout = dojo::model::Model::::layout(); @@ -951,7 +1048,7 @@ fn test_set_entity_with_struct_complex_array_layout() { let world = deploy_world(); world.register_model(struct_complex_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_complex_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_complex_array_model(); let layout = dojo::model::Model::::layout(); @@ -967,7 +1064,7 @@ fn test_set_entity_with_struct_layout_and_byte_array() { let world = deploy_world(); world.register_model(struct_byte_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_byte_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_byte_array_model(); let layout = dojo::model::Model::::layout(); @@ -983,7 +1080,7 @@ fn test_set_entity_with_nested_elements() { let world = deploy_world(); world.register_model(struct_nested_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_nested_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_nested_model(); let layout = dojo::model::Model::::layout(); @@ -1010,7 +1107,7 @@ fn test_set_entity_with_struct_generics_enum_layout() { let world = deploy_world(); world.register_model(struct_with_generic::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_with_generic"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_generic_first_variant(); let layout = dojo::model::Model::::layout(); @@ -1033,13 +1130,12 @@ fn test_set_entity_with_struct_generics_enum_layout() { fn test_delete_entity_with_fixed_layout() { let world = deploy_world(); world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); - - let selector = selector!("foo"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_foo(); let layout = dojo::model::Model::::layout(); - world.set_entity(selector, keys, values, layout); + world.set_entity(selector, get_key_test(), values, layout); world.delete_entity(selector, keys, layout); @@ -1054,7 +1150,7 @@ fn test_delete_entity_with_simple_struct_layout() { let world = deploy_world(); world.register_model(struct_simple_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_simple_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_model(); let layout = dojo::model::Model::::layout(); @@ -1074,7 +1170,7 @@ fn test_delete_entity_with_struct_simple_array_layout() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_simple_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_simple_array_model(); let layout = dojo::model::Model::::layout(); @@ -1097,7 +1193,7 @@ fn test_delete_entity_with_complex_array_struct_layout() { let world = deploy_world(); world.register_model(struct_complex_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_complex_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_complex_array_model(); @@ -1121,7 +1217,7 @@ fn test_delete_entity_with_struct_tuple_layout() { let world = deploy_world(); world.register_model(struct_with_tuple::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_with_tuple"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_with_tuple(); let layout = dojo::model::Model::::layout(); @@ -1142,7 +1238,7 @@ fn test_delete_entity_with_struct_enum_layout() { let world = deploy_world(); world.register_model(struct_with_enum::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_with_enum"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_with_enum_first_variant(); let layout = dojo::model::Model::::layout(); @@ -1164,7 +1260,7 @@ fn test_delete_entity_with_struct_layout_and_byte_array() { let world = deploy_world(); world.register_model(struct_byte_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_byte_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_byte_array_model(); let layout = dojo::model::Model::::layout(); @@ -1185,7 +1281,7 @@ fn test_delete_entity_with_nested_elements() { let world = deploy_world(); world.register_model(struct_nested_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_nested_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_nested_model(); let layout = dojo::model::Model::::layout(); @@ -1206,7 +1302,7 @@ fn test_delete_entity_with_struct_generics_enum_layout() { let world = deploy_world(); world.register_model(struct_with_generic::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_with_generic"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values = create_struct_generic_first_variant(); let layout = dojo::model::Model::::layout(); @@ -1234,7 +1330,10 @@ fn test_set_entity_with_unexpected_array_model_layout() { world .set_entity( - selector!("struct_simple_array_model"), array![].span(), array![].span(), layout + dojo::model::Model::::selector(), + array![].span(), + array![].span(), + layout ); } @@ -1250,7 +1349,10 @@ fn test_set_entity_with_unexpected_tuple_model_layout() { world .set_entity( - selector!("struct_simple_array_model"), array![].span(), array![].span(), layout + dojo::model::Model::::selector(), + array![].span(), + array![].span(), + layout ); } @@ -1264,7 +1366,10 @@ fn test_delete_entity_with_unexpected_array_model_layout() { array![dojo::database::introspect::Introspect::::layout()].span() ); - world.delete_entity(selector!("struct_simple_array_model"), array![].span(), layout); + world + .delete_entity( + dojo::model::Model::::selector(), array![].span(), layout + ); } #[test] @@ -1277,7 +1382,10 @@ fn test_delete_entity_with_unexpected_tuple_model_layout() { array![dojo::database::introspect::Introspect::::layout()].span() ); - world.delete_entity(selector!("struct_simple_array_model"), array![].span(), layout); + world + .delete_entity( + dojo::model::Model::::selector(), array![].span(), layout + ); } #[test] @@ -1290,7 +1398,7 @@ fn test_get_entity_with_unexpected_array_model_layout() { array![dojo::database::introspect::Introspect::::layout()].span() ); - world.entity(selector!("struct_simple_array_model"), array![].span(), layout); + world.entity(dojo::model::Model::::selector(), array![].span(), layout); } #[test] @@ -1303,7 +1411,7 @@ fn test_get_entity_with_unexpected_tuple_model_layout() { array![dojo::database::introspect::Introspect::::layout()].span() ); - world.entity(selector!("struct_simple_array_model"), array![].span(), layout); + world.entity(dojo::model::Model::::selector(), array![].span(), layout); } @@ -1311,22 +1419,13 @@ fn test_get_entity_with_unexpected_tuple_model_layout() { #[should_panic(expected: ('Invalid values length', 'ENTRYPOINT_FAILED',))] fn test_set_entity_with_bad_values_length_error_for_array_layout() { let world = deploy_world(); + world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("a_selector"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); - let layout = Layout::Struct( - array![ - FieldLayout { - selector: selector!("a"), - layout: Layout::Array( - array![dojo::database::introspect::Introspect::::layout()].span() - ) - }, - ] - .span() - ); + let layout = dojo::model::Model::::layout(); - world.set_entity(selector, keys, array![].span(), layout); + world.set_entity(selector, keys, array![1].span(), layout); } #[test] @@ -1335,7 +1434,7 @@ fn test_set_entity_with_too_big_array_length() { let world = deploy_world(); world.register_model(struct_simple_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_simple_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values: Span = array![ 1, MAX_ARRAY_LENGTH.try_into().unwrap() + 1, 10, 20, 30, 40, 2 @@ -1352,7 +1451,7 @@ fn test_set_entity_with_struct_layout_and_bad_byte_array_length() { let world = deploy_world(); world.register_model(struct_byte_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_byte_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values: Span = array![ 1, MAX_ARRAY_LENGTH.try_into().unwrap(), 'first', 'second', 'third', 'pending', 7 @@ -1369,10 +1468,201 @@ fn test_set_entity_with_struct_layout_and_bad_value_length_for_byte_array() { let world = deploy_world(); world.register_model(struct_byte_array_model::TEST_CLASS_HASH.try_into().unwrap()); - let selector = selector!("struct_byte_array_model"); + let selector = dojo::model::Model::::selector(); let keys = get_key_test(); let values: Span = array![1, 3, 'first', 'second', 'third', 'pending'].span(); let layout = dojo::model::Model::::layout(); world.set_entity(selector, keys, values, layout); } + +fn write_foo_record(world: dojo::world::IWorldDispatcher) { + let selector = dojo::model::Model::::selector(); + let values = create_foo(); + let layout = dojo::model::Model::::layout(); + + world.set_entity(selector, get_key_test(), values, layout); +} + +#[test] +fn test_write_model_for_namespace_owner() { + let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + + let account = starknet::contract_address_const::<0xb0b>(); + let contract = starknet::contract_address_const::<0xdeadbeef>(); + + // the caller account is a model namespace owner + world.grant_owner(account, dojo::model::Model::::namespace_selector()); + starknet::testing::set_account_contract_address(account); + starknet::testing::set_contract_address(contract); + + write_foo_record(world); +} + +#[test] +fn test_write_model_for_model_owner() { + let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + + // the caller account is a model owner + let account = starknet::contract_address_const::<0xb0b>(); + let contract = starknet::contract_address_const::<0xdeadbeef>(); + + world.grant_owner(account, dojo::model::Model::::selector()); + starknet::testing::set_account_contract_address(account); + starknet::testing::set_contract_address(contract); + + write_foo_record(world); +} + +#[test] +fn test_write_model_for_namespace_writer() { + let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + + let account = starknet::contract_address_const::<0xb0b>(); + let contract = starknet::contract_address_const::<0xdeadbeef>(); + + world.grant_writer(dojo::model::Model::::namespace_selector(), contract); + + // the account does not own anything + starknet::testing::set_account_contract_address(account); + starknet::testing::set_contract_address(contract); + + write_foo_record(world); +} + +#[test] +fn test_write_model_for_model_writer() { + let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + + let account = starknet::contract_address_const::<0xb0b>(); + let contract = starknet::contract_address_const::<0xdeadbeef>(); + + world.grant_writer(dojo::model::Model::::selector(), contract); + + // the account does not own anything + starknet::testing::set_account_contract_address(account); + starknet::testing::set_contract_address(contract); + + write_foo_record(world); +} + +#[test] +fn test_write_namespace_for_namespace_owner() { + let world = deploy_world(); + + let account = starknet::contract_address_const::<0xb0b>(); + let contract = starknet::contract_address_const::<0xdeadbeef>(); + + world.grant_owner(account, dojo::model::Model::::namespace_selector()); + + // the account owns the Foo model namespace so it should be able to deploy + // and register the model. + starknet::testing::set_account_contract_address(account); + starknet::testing::set_contract_address(contract); + + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); +} + +#[test] +fn test_write_namespace_for_namespace_writer() { + let world = deploy_world(); + + let account = starknet::contract_address_const::<0xb0b>(); + let contract = starknet::contract_address_const::<0xdeadbeef>(); + + world.grant_writer(dojo::model::Model::::namespace_selector(), account); + + // the account has write access to the Foo model namespace so it should be able + // to deploy and register the model. + starknet::testing::set_account_contract_address(account); + starknet::testing::set_contract_address(contract); + + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); +} + +#[test] +#[should_panic(expected: ('no model write access', 'ENTRYPOINT_FAILED',))] +fn test_write_model_no_write_access() { + let world = deploy_world(); + world.register_model(foo::TEST_CLASS_HASH.try_into().unwrap()); + + // the caller account does not own the model nor the model namespace nor the world + let account = starknet::contract_address_const::<0xb0b>(); + starknet::testing::set_account_contract_address(account); + + // the contract is not a writer for the model nor for the model namespace + let contract = starknet::contract_address_const::<0xdeadbeef>(); + starknet::testing::set_contract_address(contract); + + write_foo_record(world); +} + +#[test] +#[should_panic(expected: ('namespace not registered', 'ENTRYPOINT_FAILED',))] +fn test_register_model_with_unregistered_namespace() { + let world = deploy_world(); + world.register_model(buzz::TEST_CLASS_HASH.try_into().unwrap()); +} + +#[test] +fn test_deploy_contract_for_namespace_owner() { + let world = deploy_world(); + + let account = starknet::contract_address_const::<0xb0b>(); + world.grant_owner(account, dojo::utils::hash(@"dojo")); + + // the account owns the 'test_contract' namespace so it should be able to deploy + // and register the model. + starknet::testing::set_account_contract_address(account); + + world + .deploy_contract( + 'salt1', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); +} + +#[test] +fn test_deploy_contract_for_namespace_writer() { + let world = deploy_world(); + + let account = starknet::contract_address_const::<0xb0b>(); + world.grant_writer(dojo::utils::hash(@"dojo"), account); + + // the account has write access to the 'test_contract' namespace so it should be able + // to deploy and register the model. + starknet::testing::set_account_contract_address(account); + + world + .deploy_contract( + 'salt1', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); +} + +#[test] +#[should_panic(expected: ('namespace not registered', 'ENTRYPOINT_FAILED',))] +fn test_deploy_contract_with_unregistered_namespace() { + let world = deploy_world(); + world + .deploy_contract( + 'salt1', buzz_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); +} + +#[test] +#[should_panic(expected: ('no namespace write access', 'ENTRYPOINT_FAILED',))] +fn test_deploy_contract_no_namespace_write_access() { + let world = deploy_world(); + + let account = starknet::contract_address_const::<0xb0b>(); + starknet::testing::set_account_contract_address(account); + + world + .deploy_contract( + 'salt1', test_contract::TEST_CLASS_HASH.try_into().unwrap(), array![].span() + ); +} + diff --git a/crates/dojo-lang/Cargo.toml b/crates/dojo-lang/Cargo.toml index 2f7b17357a..e9bf9fa806 100644 --- a/crates/dojo-lang/Cargo.toml +++ b/crates/dojo-lang/Cargo.toml @@ -11,6 +11,7 @@ testing = [ ] [dependencies] anyhow.workspace = true +cainome.workspace = true cairo-lang-compiler.workspace = true cairo-lang-debug.workspace = true cairo-lang-defs.workspace = true @@ -32,12 +33,13 @@ camino.workspace = true convert_case.workspace = true directories = "5" dojo-types = { path = "../dojo-types" } -dojo-world = { path = "../dojo-world", features = [ "manifest" ] } +dojo-world = { path = "../dojo-world", features = [ "manifest", "metadata" ] } indoc.workspace = true itertools.workspace = true lazy_static.workspace = true num-traits.workspace = true once_cell.workspace = true +regex.workspace = true salsa.workspace = true scarb.workspace = true semver.workspace = true @@ -46,6 +48,7 @@ serde_json.workspace = true serde_with.workspace = true smol_str.workspace = true starknet.workspace = true +starknet-crypto.workspace = true thiserror.workspace = true toml.workspace = true tracing.workspace = true diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index a0eac5529b..97eeff00b9 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -1,4 +1,5 @@ use std::collections::{BTreeMap, BTreeSet, HashMap}; +use std::fs; use std::io::Write; use std::iter::zip; use std::ops::DerefMut; @@ -6,7 +7,7 @@ use std::ops::DerefMut; use anyhow::{anyhow, Context, Result}; use cairo_lang_compiler::db::RootDatabase; use cairo_lang_defs::db::DefsGroup; -use cairo_lang_defs::ids::{ModuleId, ModuleItemId}; +use cairo_lang_defs::ids::{ModuleId, ModuleItemId, TopLevelLanguageElementId}; use cairo_lang_filesystem::db::FilesGroup; use cairo_lang_filesystem::ids::{CrateId, CrateLongId}; use cairo_lang_formatter::format_string; @@ -17,17 +18,20 @@ use cairo_lang_starknet::plugin::aux_data::StarkNetContractAuxData; use cairo_lang_starknet_classes::abi; use cairo_lang_starknet_classes::contract_class::ContractClass; use cairo_lang_utils::UpcastMut; -use camino::{Utf8Path, Utf8PathBuf}; +use camino::Utf8PathBuf; use convert_case::{Case, Casing}; +use dojo_world::contracts::naming; use dojo_world::manifest::{ AbiFormat, Class, ComputedValueEntrypoint, DojoContract, DojoModel, Manifest, ManifestMethods, - ABIS_DIR, BASE_CONTRACT_NAME, BASE_DIR, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, - WORLD_CONTRACT_NAME, + ABIS_DIR, BASE_CONTRACT_TAG, BASE_DIR, BASE_QUALIFIED_PATH, CONTRACTS_DIR, MANIFESTS_DIR, + MODELS_DIR, WORLD_CONTRACT_TAG, WORLD_QUALIFIED_PATH, }; +use dojo_world::metadata::get_default_namespace_from_ws; use itertools::Itertools; use scarb::compiler::helpers::{build_compiler_config, collect_main_crate_ids}; use scarb::compiler::{CairoCompilationUnit, CompilationUnitAttributes, Compiler}; use scarb::core::{PackageName, TargetKind, Workspace}; +use scarb::flock::Filesystem; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use smol_str::SmolStr; @@ -36,13 +40,11 @@ use starknet::core::types::Felt; use tracing::{debug, trace, trace_span}; use crate::inline_macros::utils::{SYSTEM_READS, SYSTEM_WRITES}; -use crate::plugin::{ComputedValuesAuxData, DojoAuxData}; +use crate::plugin::{ComputedValuesAuxData, DojoAuxData, Model}; use crate::semantics::utils::find_module_rw; const CAIRO_PATH_SEPARATOR: &str = "::"; -pub const SOURCES_DIR: &str = "src"; - pub(crate) const LOG_TARGET: &str = "dojo_lang::compiler"; #[cfg(test)] @@ -84,7 +86,8 @@ impl Compiler for DojoCompiler { ) -> Result<()> { let props: Props = unit.main_component().target_props()?; let target_dir = unit.target_dir(ws); - let sources_dir = target_dir.child(Utf8Path::new(SOURCES_DIR)); + + let default_namespace = get_default_namespace_from_ws(ws); let compiler_config = build_compiler_config(&unit, ws); @@ -111,44 +114,30 @@ impl Compiler for DojoCompiler { compile_prepared_db(db, &contracts, compiler_config)? }; - // (contract name, class hash) - let mut compiled_classes: HashMap)> = HashMap::new(); + let mut compiled_classes: HashMap = HashMap::new(); for (decl, class) in zip(contracts, classes) { - let contract_full_path = decl.module_id().full_path(db.upcast_mut()); - - // save expanded contract source file - if let Ok(file_id) = db.module_main_file(decl.module_id()) { - if let Some(file_content) = db.file_content(file_id) { - let src_file_name = format!("{contract_full_path}.cairo").replace("::", "_"); - - let mut file = - sources_dir.open_rw(src_file_name.clone(), "source file", ws.config())?; - file.write(format_string(db, file_content.to_string()).as_bytes()) - .with_context(|| { - format!("failed to serialize contract source: {contract_full_path}") - })?; - } else { - return Err(anyhow!("failed to get source file content: {contract_full_path}")); - } - } else { - return Err(anyhow!("failed to get source file: {contract_full_path}")); - } - - // save JSON artifact file - let file_name = format!("{contract_full_path}.json"); - let mut file = target_dir.open_rw(file_name.clone(), "class file", ws.config())?; - serde_json::to_writer_pretty(file.deref_mut(), &class).with_context(|| { - format!("failed to serialize contract artifact: {contract_full_path}") - })?; + // note that the qualified path is in snake case while + // the `full_path()` method of StructId uses the original struct name case. + // (see in `get_dojo_model_artifacts`) + let qualified_path = decl.module_id().full_path(db.upcast_mut()); let class_hash = compute_class_hash_of_contract_class(&class).with_context(|| { - format!("problem computing class hash for contract `{contract_full_path}`") + format!("problem computing class hash for contract `{}`", qualified_path.clone()) })?; - compiled_classes.insert(contract_full_path.into(), (class_hash, class.abi)); + + compiled_classes.insert(qualified_path, (class_hash, class)); } - update_manifest(db, ws, &main_crate_ids, compiled_classes, props.build_external_contracts)?; + update_files( + db, + ws, + &target_dir, + &main_crate_ids, + compiled_classes, + props.build_external_contracts, + &default_namespace, + )?; Ok(()) } } @@ -201,8 +190,8 @@ fn find_project_contracts( pub fn collect_core_crate_ids(db: &RootDatabase) -> Vec { [ - ContractSelector(BASE_CONTRACT_NAME.to_string()), - ContractSelector(WORLD_CONTRACT_NAME.to_string()), + ContractSelector(BASE_QUALIFIED_PATH.to_string()), + ContractSelector(WORLD_QUALIFIED_PATH.to_string()), ] .iter() .map(|selector| selector.package().into()) @@ -223,12 +212,14 @@ pub fn collect_external_crate_ids( .collect::>() } -fn update_manifest( +fn update_files( db: &RootDatabase, ws: &Workspace<'_>, + target_dir: &Filesystem, crate_ids: &[CrateId], - compiled_artifacts: HashMap)>, + compiled_artifacts: HashMap, external_contracts: Option>, + default_namespace: &str, ) -> anyhow::Result<()> { let profile_name = ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); @@ -239,40 +230,40 @@ fn update_manifest( let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); fn get_compiled_artifact_from_map<'a>( - artifacts: &'a HashMap)>, - artifact_name: &str, - ) -> anyhow::Result<&'a (Felt, Option)> { - artifacts.get(artifact_name).context(format!( - "Contract `{artifact_name}` not found. Did you include `dojo` as a dependency?", + artifacts: &'a HashMap, + qualified_artifact_path: &str, + ) -> anyhow::Result<&'a (Felt, ContractClass)> { + artifacts.get(qualified_artifact_path).context(format!( + "Contract `{qualified_artifact_path}` not found. Did you include `dojo` as a \ + dependency?", )) } let mut crate_ids = crate_ids.to_vec(); - let (hash, abi) = get_compiled_artifact_from_map(&compiled_artifacts, WORLD_CONTRACT_NAME)?; - write_manifest_and_abi( - &relative_manifests_dir, - &relative_abis_dir, - &manifest_dir, - &mut Manifest::new( - // abi path will be written by `write_manifest` - Class { class_hash: *hash, abi: None, original_class_hash: *hash }, - WORLD_CONTRACT_NAME.into(), - ), - abi, - )?; - - let (hash, _) = get_compiled_artifact_from_map(&compiled_artifacts, BASE_CONTRACT_NAME)?; - write_manifest_and_abi( - &relative_manifests_dir, - &relative_abis_dir, - &manifest_dir, - &mut Manifest::new( - Class { class_hash: *hash, abi: None, original_class_hash: *hash }, - BASE_CONTRACT_NAME.into(), - ), - &None, - )?; + for (qualified_path, tag) in + [(WORLD_QUALIFIED_PATH, WORLD_CONTRACT_TAG), (BASE_QUALIFIED_PATH, BASE_CONTRACT_TAG)] + { + let (hash, class) = get_compiled_artifact_from_map(&compiled_artifacts, qualified_path)?; + let filename = naming::get_filename_from_tag(tag); + write_manifest_and_abi( + &relative_manifests_dir, + &relative_abis_dir, + &manifest_dir, + &mut Manifest::new( + // abi path will be written by `write_manifest` + Class { + class_hash: *hash, + abi: None, + original_class_hash: *hash, + tag: tag.to_string(), + }, + filename.clone(), + ), + &class.abi, + )?; + save_json_artifact_file(ws, target_dir, class, &filename, tag)?; + } let mut models = BTreeMap::new(); let mut contracts = BTreeMap::new(); @@ -292,33 +283,43 @@ fn update_manifest( .filter_map(|info| info.as_ref().map(|i| &i.aux_data)) .filter_map(|aux_data| aux_data.as_ref().map(|aux_data| aux_data.0.as_any())) { - if let Some(aux_data) = aux_data.downcast_ref::() { - contracts.extend(get_dojo_contract_artifacts( - db, - module_id, - aux_data, - &compiled_artifacts, - )?); - } if let Some(aux_data) = aux_data.downcast_ref::() { get_dojo_computed_values(db, module_id, aux_data, &mut computed); - } + } else if let Some(dojo_aux_data) = aux_data.downcast_ref::() { + for system in &dojo_aux_data.systems { + contracts.extend(get_dojo_contract_artifacts( + db, + module_id, + &naming::get_tag(&system.namespace, &system.name), + &compiled_artifacts, + )?); + } - if let Some(dojo_aux_data) = aux_data.downcast_ref::() { models.extend(get_dojo_model_artifacts( db, - dojo_aux_data, + &dojo_aux_data.models, *module_id, &compiled_artifacts, )?); + } else if let Some(aux_data) = aux_data.downcast_ref::() { + contracts.extend(get_dojo_contract_artifacts( + db, + module_id, + &naming::get_tag(default_namespace, &aux_data.contract_name), + &compiled_artifacts, + )?); } } } } + // `get_dojo_computed_values()` uses the module name as contract name to build the `computed` + // variable. That means, the namespace of the contract is not taken into account, + // but should be retrieved from the dojo::contract attribute. computed.into_iter().for_each(|(contract, computed_value_entrypoint)| { - let contract_data = - contracts.get_mut(&contract).expect("Error: Computed value contract doesn't exist."); + let contract_data = contracts + .get_mut(&contract.to_string()) + .expect("Error: Computed value contract doesn't exist."); contract_data.0.inner.computed = computed_value_entrypoint; }); @@ -326,24 +327,49 @@ fn update_manifest( contracts.remove(model.0.as_str()); } - for (_, (manifest, abi)) in contracts.iter_mut() { + let contracts_dir = target_dir.child(CONTRACTS_DIR); + if !contracts.is_empty() && !contracts_dir.exists() { + fs::create_dir_all(contracts_dir.path_unchecked())?; + } + + for (_, (manifest, class, module_id)) in contracts.iter_mut() { write_manifest_and_abi( &relative_manifests_dir.join(CONTRACTS_DIR), &relative_abis_dir.join(CONTRACTS_DIR), &manifest_dir, manifest, - abi, + &class.abi, + )?; + + let filename = naming::get_filename_from_tag(&manifest.inner.tag); + save_expanded_source_file( + ws, + *module_id, + db, + &contracts_dir, + &filename, + &manifest.inner.tag, )?; + save_json_artifact_file(ws, &contracts_dir, class, &filename, &manifest.inner.tag)?; } - for (_, (manifest, abi)) in models.iter_mut() { + let models_dir = target_dir.child(MODELS_DIR); + if !models.is_empty() && !models_dir.exists() { + fs::create_dir_all(models_dir.path_unchecked())?; + } + + for (_, (manifest, class, module_id)) in models.iter_mut() { write_manifest_and_abi( &relative_manifests_dir.join(MODELS_DIR), &relative_abis_dir.join(MODELS_DIR), &manifest_dir, manifest, - abi, + &class.abi, )?; + + let filename = naming::get_filename_from_tag(&manifest.inner.tag); + save_expanded_source_file(ws, *module_id, db, &models_dir, &filename, &manifest.inner.tag)?; + save_json_artifact_file(ws, &models_dir, class, &filename, &manifest.inner.tag)?; } Ok(()) @@ -354,42 +380,42 @@ fn update_manifest( #[allow(clippy::type_complexity)] fn get_dojo_model_artifacts( db: &RootDatabase, - aux_data: &DojoAuxData, + aux_data: &Vec, module_id: ModuleId, - compiled_classes: &HashMap)>, -) -> anyhow::Result, Option)>> { - let mut models = HashMap::with_capacity(aux_data.models.len()); - - let module_name = module_id.full_path(db); - let module_name = module_name.as_str(); + compiled_classes: &HashMap, +) -> anyhow::Result, ContractClass, ModuleId)>> { + let mut models = HashMap::with_capacity(aux_data.len()); - for model in &aux_data.models { - if let Ok(Some(ModuleItemId::Struct(_))) = + for model in aux_data { + if let Ok(Some(ModuleItemId::Struct(struct_id))) = db.module_item_by_name(module_id, model.name.clone().into()) { - let model_contract_name = model.name.to_case(Case::Snake); - let model_full_name = format!("{module_name}::{}", &model_contract_name); + // The `struct_id` full_path() method uses the original struct name case while + // snake case was used to build `compiled_classes` in `compile()`. + let qualified_path = struct_id.full_path(db).to_case(Case::Snake); + let compiled_class = compiled_classes.get(&qualified_path).cloned(); + let tag = naming::get_tag(&model.namespace, &model.name); - let compiled_class = compiled_classes.get(model_full_name.as_str()).cloned(); - - if let Some((class_hash, abi)) = compiled_class { + if let Some((class_hash, class)) = compiled_class { models.insert( - model_full_name.clone(), + qualified_path.clone(), ( Manifest::new( DojoModel { + tag: tag.clone(), class_hash, abi: None, members: model.members.clone(), original_class_hash: class_hash, }, - model_full_name.into(), + naming::get_filename_from_tag(&tag), ), - abi, + class, + module_id, ), ); } else { - println!("Model {} not found in target.", model_full_name.clone()); + println!("Model {} not found in target.", tag.clone()); } } } @@ -414,7 +440,7 @@ fn get_dojo_computed_values( computed_vals.push(ComputedValueEntrypoint { contract: module_name, entrypoint: aux_data.entrypoint.clone(), - model: aux_data.model.clone(), + tag: aux_data.tag.clone(), }) } } @@ -423,21 +449,19 @@ fn get_dojo_computed_values( fn get_dojo_contract_artifacts( db: &RootDatabase, module_id: &ModuleId, - aux_data: &StarkNetContractAuxData, - compiled_classes: &HashMap)>, -) -> anyhow::Result, Option)>> { - let contract_name = &aux_data.contract_name; - + tag: &str, + compiled_classes: &HashMap, +) -> anyhow::Result, ContractClass, ModuleId)>> { let mut result = HashMap::new(); - if !matches!(contract_name.as_ref(), "world" | "resource_metadata" | "base") { - let module_name: SmolStr = module_id.full_path(db).into(); + if !matches!(naming::get_name_from_tag(tag).as_str(), "world" | "resource_metadata" | "base") { + let qualified_path = module_id.full_path(db).to_string(); - if let Some((class_hash, abi)) = compiled_classes.get(&module_name as &str) { + if let Some((class_hash, class)) = compiled_classes.get(&qualified_path) { let reads = SYSTEM_READS .lock() .unwrap() - .get(&module_name as &str) + .get(&qualified_path as &str) // should use tag instead of qualified_path .map_or_else(Vec::new, |models| { models.clone().into_iter().collect::>().into_iter().collect() }); @@ -445,21 +469,22 @@ fn get_dojo_contract_artifacts( let writes = SYSTEM_WRITES .lock() .unwrap() - .get(&module_name as &str) + .get(&qualified_path as &str) // should use tag instead of qualified_path .map_or_else(Vec::new, |write_ops| find_module_rw(db, module_id, write_ops)); let manifest = Manifest::new( DojoContract { + tag: tag.to_string(), writes, reads, class_hash: *class_hash, original_class_hash: *class_hash, ..Default::default() }, - module_name.clone(), + naming::get_filename_from_tag(tag), ); - result.insert(module_name, (manifest, abi.clone())); + result.insert(qualified_path.to_string(), (manifest, class.clone(), *module_id)); } } @@ -476,10 +501,10 @@ fn write_manifest_and_abi( where T: Serialize + DeserializeOwned + ManifestMethods, { - let name = manifest.name.to_string().replace("::", "_"); - - let relative_manifest_path = relative_manifest_dir.join(name.clone()).with_extension("toml"); - let relative_abi_path = relative_abis_dir.join(name.clone()).with_extension("json"); + let relative_manifest_path = + relative_manifest_dir.join(manifest.manifest_name.clone()).with_extension("toml"); + let relative_abi_path = + relative_abis_dir.join(manifest.manifest_name.clone()).with_extension("json"); if abi.is_some() { manifest.inner.set_abi(Some(AbiFormat::Path(relative_abi_path.clone()))); @@ -514,3 +539,43 @@ where } Ok(()) } + +fn save_expanded_source_file( + ws: &Workspace<'_>, + module_id: ModuleId, + db: &RootDatabase, + contract_dir: &Filesystem, + contract_basename: &str, + contract_tag: &str, +) -> anyhow::Result<()> { + if let Ok(file_id) = db.module_main_file(module_id) { + if let Some(file_content) = db.file_content(file_id) { + let src_file_name = format!("{contract_basename}.cairo"); + + let mut file = + contract_dir.open_rw(src_file_name.clone(), "source file", ws.config())?; + file.write(format_string(db, file_content.to_string()).as_bytes()) + .with_context(|| format!("failed to serialize contract source: {contract_tag}"))?; + } else { + return Err(anyhow!("failed to get source file content: {contract_tag}")); + } + } else { + return Err(anyhow!("failed to get source file: {contract_tag}")); + } + + Ok(()) +} + +fn save_json_artifact_file( + ws: &Workspace<'_>, + contract_dir: &Filesystem, + contract_class: &ContractClass, + contract_basename: &str, + contract_tag: &str, +) -> anyhow::Result<()> { + let mut file = + contract_dir.open_rw(format!("{contract_basename}.json"), "class file", ws.config())?; + serde_json::to_writer_pretty(file.deref_mut(), &contract_class) + .with_context(|| format!("failed to serialize contract artifact: {contract_tag}"))?; + Ok(()) +} diff --git a/crates/dojo-lang/src/compiler_test.rs b/crates/dojo-lang/src/compiler_test.rs index 6357a72649..01d71a6075 100644 --- a/crates/dojo-lang/src/compiler_test.rs +++ b/crates/dojo-lang/src/compiler_test.rs @@ -1,4 +1,5 @@ use dojo_test_utils::compiler::build_test_config; +use scarb::compiler::Profile; use scarb::core::TargetKind; use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; @@ -6,7 +7,9 @@ use crate::scarb_internal; #[test] fn test_compiler_cairo_features() { - let config = build_test_config("./src/manifest_test_data/compiler_cairo/Scarb.toml").unwrap(); + let config = + build_test_config("./src/manifest_test_data/compiler_cairo/Scarb.toml", Profile::DEV) + .unwrap(); let features_opts = FeaturesOpts { features: FeaturesSelector::AllFeatures, no_default_features: false }; diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index 1e4e5147e0..0bd61a7611 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -5,18 +5,28 @@ use cairo_lang_defs::plugin::{ DynGeneratedFileAuxData, PluginDiagnostic, PluginGeneratedFile, PluginResult, }; use cairo_lang_diagnostics::Severity; -use cairo_lang_syntax::node::ast::MaybeModuleBody; +use cairo_lang_syntax::node::ast::{ + ArgClause, Expr, MaybeModuleBody, OptionArgListParenthesized, OptionReturnTypeClause, +}; use cairo_lang_syntax::node::db::SyntaxGroup; use cairo_lang_syntax::node::helpers::QueryAttrs; use cairo_lang_syntax::node::{ast, ids, Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use dojo_types::system::Dependency; +use dojo_world::contracts::naming; -use crate::plugin::{DojoAuxData, SystemAuxData}; +use crate::plugin::{DojoAuxData, SystemAuxData, DOJO_CONTRACT_ATTR}; use crate::syntax::world_param::{self, WorldParamInjectionKind}; use crate::syntax::{self_param, utils as syntax_utils}; +use crate::utils::is_name_valid; const DOJO_INIT_FN: &str = "dojo_init"; +const CONTRACT_NAMESPACE: &str = "namespace"; + +#[derive(Clone, Default)] +pub struct ContractParameters { + namespace: Option, +} pub struct DojoContract { diagnostics: Vec, @@ -24,14 +34,48 @@ pub struct DojoContract { } impl DojoContract { - pub fn from_module(db: &dyn SyntaxGroup, module_ast: ast::ItemModule) -> PluginResult { + pub fn from_module( + db: &dyn SyntaxGroup, + module_ast: &ast::ItemModule, + package_id: String, + ) -> PluginResult { let name = module_ast.name(db).text(db); - let mut system = DojoContract { diagnostics: vec![], dependencies: HashMap::new() }; + let mut diagnostics = vec![]; + let parameters = get_parameters(db, module_ast, &mut diagnostics); + + let mut system = DojoContract { diagnostics, dependencies: HashMap::new() }; + let mut has_event = false; let mut has_storage = false; let mut has_init = false; + let contract_namespace = match parameters.namespace { + Some(x) => x.to_string(), + None => package_id, + }; + + for (id, value) in [("name", &name.to_string()), ("namespace", &contract_namespace)] { + if !is_name_valid(value) { + return PluginResult { + code: None, + diagnostics: vec![PluginDiagnostic { + stable_ptr: module_ast.stable_ptr().0, + message: format!( + "The contract {id} '{value}' can only contain characters (a-z/A-Z), \ + numbers (0-9) and underscore (_)" + ), + severity: Severity::Error, + }], + remove_original_item: false, + }; + } + } + + let contract_tag = naming::get_tag(&contract_namespace, &name); + let contract_name_selector = naming::compute_bytearray_hash(&name); + let contract_namespace_selector = naming::compute_bytearray_hash(&contract_namespace); + if let MaybeModuleBody::Some(body) = module_ast.body(db) { let mut body_nodes: Vec<_> = body .items(db) @@ -101,25 +145,40 @@ impl DojoContract { body_nodes.append(&mut system.create_storage()) } - let mut builder = PatchBuilder::new(db, &module_ast); - builder.add_modified(RewriteNode::interpolate_patched( - " + let mut builder = PatchBuilder::new(db, module_ast); + builder.add_modified(RewriteNode::Mapped { + node: Box::new(RewriteNode::interpolate_patched( + " #[starknet::contract] mod $name$ { use dojo::world; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; - + use dojo::contract::IContract; component!(path: dojo::components::upgradeable::upgradeable, storage: \ - upgradeable, event: UpgradeableEvent); + upgradeable, event: UpgradeableEvent); #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - '$name$' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + \"$name$\" + } + fn selector(self: @ContractState) -> felt252 { + $contract_name_selector$ + } + + fn namespace(self: @ContractState) -> ByteArray { + \"$contract_namespace$\" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + $contract_namespace_selector$ + } + + fn tag(self: @ContractState) -> ByteArray { + \"$contract_tag$\" } } @@ -132,16 +191,31 @@ impl DojoContract { #[abi(embed_v0)] impl UpgradableImpl = \ - dojo::components::upgradeable::upgradeable::UpgradableImpl; + dojo::components::upgradeable::upgradeable::UpgradableImpl; $body$ } ", - &UnorderedHashMap::from([ - ("name".to_string(), RewriteNode::Text(name.to_string())), - ("body".to_string(), RewriteNode::new_modified(body_nodes)), - ]), - )); + &UnorderedHashMap::from([ + ("name".to_string(), RewriteNode::Text(name.to_string())), + ( + "contract_name_selector".to_string(), + RewriteNode::Text(contract_name_selector.to_string()), + ), + ("body".to_string(), RewriteNode::new_modified(body_nodes)), + ( + "contract_namespace".to_string(), + RewriteNode::Text(contract_namespace.clone()), + ), + ( + "contract_namespace_selector".to_string(), + RewriteNode::Text(contract_namespace_selector.to_string()), + ), + ("contract_tag".to_string(), RewriteNode::Text(contract_tag)), + ]), + )), + origin: module_ast.as_syntax_node().span_without_trivia(db), + }); let (code, code_mappings) = builder.build(); @@ -153,6 +227,7 @@ impl DojoContract { models: vec![], systems: vec![SystemAuxData { name, + namespace: contract_namespace.clone(), dependencies: system.dependencies.values().cloned().collect(), }], events: vec![], @@ -173,7 +248,14 @@ impl DojoContract { fn_ast: &ast::FunctionWithBody, ) -> Vec { let fn_decl = fn_ast.declaration(db); - let fn_name = fn_decl.name(db).text(db); + + if let OptionReturnTypeClause::ReturnTypeClause(_) = fn_decl.signature(db).ret_ty(db) { + self.diagnostics.push(PluginDiagnostic { + stable_ptr: fn_ast.stable_ptr().untyped(), + message: "The dojo_init function cannot have a return type.".to_string(), + severity: Severity::Error, + }); + } let (params_str, was_world_injected) = self.rewrite_parameters( db, @@ -181,39 +263,66 @@ impl DojoContract { fn_ast.stable_ptr().untyped(), ); - let mut world_read = ""; - if was_world_injected { - world_read = "let world = self.world_dispatcher.read();"; - } - - let body = fn_ast.body(db).as_syntax_node().get_text(db); + let trait_node = RewriteNode::interpolate_patched( + "#[starknet::interface] + trait IDojoInit { + fn dojo_init($params_str$); + } + ", + &UnorderedHashMap::from([( + "params_str".to_string(), + RewriteNode::Text(params_str.clone()), + )]), + ); - let node = RewriteNode::interpolate_patched( + let impl_node = RewriteNode::Text( " - #[starknet::interface] - trait IDojoInit { - fn $name$($params_str$); - } + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + " + .to_string(), + ); - #[abi(embed_v0)] - impl IDojoInitImpl of IDojoInit { - fn $name$($params_str$) { - $world_read$ - assert(starknet::get_caller_address() == self.world().contract_address, \ - 'Only world can init'); - $body$ - } - } - ", - &UnorderedHashMap::from([ - ("name".to_string(), RewriteNode::Text(fn_name.to_string())), - ("params_str".to_string(), RewriteNode::Text(params_str)), - ("body".to_string(), RewriteNode::Text(body)), - ("world_read".to_string(), RewriteNode::Text(world_read.to_string())), - ]), + let declaration_node = RewriteNode::Mapped { + node: Box::new(RewriteNode::Text(format!("fn dojo_init({}) {{", params_str))), + origin: fn_ast.declaration(db).as_syntax_node().span_without_trivia(db), + }; + + let world_line_node = if was_world_injected { + RewriteNode::Text("let world = self.world_dispatcher.read();".to_string()) + } else { + RewriteNode::empty() + }; + + let assert_world_caller_node = RewriteNode::Text( + "assert(starknet::get_caller_address() == self.world().contract_address, 'Only world \ + can init');" + .to_string(), ); - vec![node] + let func_nodes = fn_ast + .body(db) + .statements(db) + .elements(db) + .iter() + .map(|e| RewriteNode::Mapped { + node: Box::new(RewriteNode::from(e.as_syntax_node())), + origin: e.as_syntax_node().span_without_trivia(db), + }) + .collect::>(); + + let mut nodes = vec![ + trait_node, + impl_node, + declaration_node, + world_line_node, + assert_world_caller_node, + ]; + nodes.extend(func_nodes); + // Close the init function + close the impl block. + nodes.push(RewriteNode::Text("}\n}".to_string())); + + nodes } pub fn merge_event( @@ -366,22 +475,6 @@ impl DojoContract { (params.join(", "), world_injection != WorldParamInjectionKind::None) } - /// Rewrites function statements by adding the reading of `world` at first statement. - pub fn rewrite_statements( - &mut self, - db: &dyn SyntaxGroup, - statement_list: ast::StatementList, - ) -> String { - let mut statements = statement_list - .elements(db) - .iter() - .map(|e| e.as_syntax_node().get_text(db)) - .collect::>(); - - statements.insert(0, "let world = self.world_dispatcher.read();\n".to_string()); - statements.join("") - } - /// Rewrites function declaration by: /// * adding `self` parameter if missing, /// * removing `world` if present as first parameter (self excluded), @@ -395,7 +488,9 @@ impl DojoContract { fn_ast: ast::FunctionWithBody, has_generate_trait: bool, ) -> Vec { - let mut rewritten_fn = RewriteNode::from_ast(&fn_ast); + let fn_name = fn_ast.declaration(db).name(db).text(db); + let return_type = + fn_ast.declaration(db).signature(db).ret_ty(db).as_syntax_node().get_text(db); let (params_str, was_world_injected) = self.rewrite_parameters( db, @@ -403,6 +498,31 @@ impl DojoContract { fn_ast.stable_ptr().untyped(), ); + let declaration_node = RewriteNode::Mapped { + node: Box::new(RewriteNode::Text(format!( + "fn {}({}) {} {{", + fn_name, params_str, return_type + ))), + origin: fn_ast.declaration(db).as_syntax_node().span_without_trivia(db), + }; + + let world_line_node = if was_world_injected { + RewriteNode::Text("let world = self.world_dispatcher.read();".to_string()) + } else { + RewriteNode::empty() + }; + + let func_nodes = fn_ast + .body(db) + .statements(db) + .elements(db) + .iter() + .map(|e| RewriteNode::Mapped { + node: Box::new(RewriteNode::from(e.as_syntax_node())), + origin: e.as_syntax_node().span_without_trivia(db), + }) + .collect::>(); + if has_generate_trait && was_world_injected { self.diagnostics.push(PluginDiagnostic { stable_ptr: fn_ast.stable_ptr().untyped(), @@ -413,26 +533,11 @@ impl DojoContract { }); } - // We always rewrite the params as the self parameter is added based on the - // world mutability. - let rewritten_params = rewritten_fn - .modify_child(db, ast::FunctionWithBody::INDEX_DECLARATION) - .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) - .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); - rewritten_params.set_str(params_str); - - // If the world was injected, we also need to rewrite the statements of the function - // to ensure the `world` injection is effective. - if was_world_injected { - let rewritten_statements = rewritten_fn - .modify_child(db, ast::FunctionWithBody::INDEX_BODY) - .modify_child(db, ast::ExprBlock::INDEX_STATEMENTS); - - rewritten_statements - .set_str(self.rewrite_statements(db, fn_ast.body(db).statements(db))); - } + let mut nodes = vec![declaration_node, world_line_node]; + nodes.extend(func_nodes); + nodes.push(RewriteNode::Text("}".to_string())); - vec![rewritten_fn] + nodes } /// Rewrites all the functions of a Impl block. @@ -441,6 +546,17 @@ impl DojoContract { let has_generate_trait = !generate_attrs.is_empty(); if let ast::MaybeImplBody::Some(body) = impl_ast.body(db) { + // We shouldn't have generic param in the case of contract's endpoints. + let impl_node = RewriteNode::Mapped { + node: Box::new(RewriteNode::Text(format!( + "{} impl {} of {} {{", + impl_ast.attributes(db).as_syntax_node().get_text(db), + impl_ast.name(db).as_syntax_node().get_text(db), + impl_ast.trait_path(db).as_syntax_node().get_text(db), + ))), + origin: impl_ast.as_syntax_node().span_without_trivia(db), + }; + let body_nodes: Vec<_> = body .items(db) .elements(db) @@ -453,26 +569,121 @@ impl DojoContract { }) .collect(); - let mut builder = PatchBuilder::new(db, &impl_ast); - builder.add_modified(RewriteNode::interpolate_patched( - "$body$", - &UnorderedHashMap::from([( - "body".to_string(), - RewriteNode::new_modified(body_nodes), - )]), - )); + let body_node = RewriteNode::Mapped { + node: Box::new(RewriteNode::interpolate_patched( + "$body$", + &UnorderedHashMap::from([( + "body".to_string(), + RewriteNode::new_modified(body_nodes), + )]), + )), + origin: impl_ast.as_syntax_node().span_without_trivia(db), + }; - let mut rewritten_impl = RewriteNode::from_ast(&impl_ast); - let rewritten_items = rewritten_impl - .modify_child(db, ast::ItemImpl::INDEX_BODY) - .modify_child(db, ast::ImplBody::INDEX_ITEMS); + return vec![impl_node, body_node, RewriteNode::Text("}".to_string())]; + } - let (code, _) = builder.build(); + vec![RewriteNode::Copied(impl_ast.as_syntax_node())] + } +} - rewritten_items.set_str(code); - return vec![rewritten_impl]; +/// Get the contract namespace from the `Expr` parameter. +fn get_contract_namespace( + db: &dyn SyntaxGroup, + arg_value: Expr, + diagnostics: &mut Vec, +) -> Option { + match arg_value { + Expr::ShortString(ss) => Some(ss.string_value(db).unwrap()), + Expr::String(s) => Some(s.string_value(db).unwrap()), + _ => { + diagnostics.push(PluginDiagnostic { + message: format!( + "The argument '{}' of dojo::contract must be a string", + CONTRACT_NAMESPACE + ), + stable_ptr: arg_value.stable_ptr().untyped(), + severity: Severity::Error, + }); + Option::None } + } +} - vec![RewriteNode::Copied(impl_ast.as_syntax_node())] +/// Get parameters of the dojo::contract attribute. +/// +/// Parameters: +/// * db: The semantic database. +/// * module_ast: The AST of the contract module. +/// * diagnostics: vector of compiler diagnostics. +/// +/// Returns: +/// * A [`ContractParameters`] object containing all the dojo::contract parameters with their +/// default values if not set in the code. +fn get_parameters( + db: &dyn SyntaxGroup, + module_ast: &ast::ItemModule, + diagnostics: &mut Vec, +) -> ContractParameters { + let mut parameters = ContractParameters::default(); + let mut processed_args: HashMap = HashMap::new(); + + if let OptionArgListParenthesized::ArgListParenthesized(arguments) = + module_ast.attributes(db).query_attr(db, DOJO_CONTRACT_ATTR).first().unwrap().arguments(db) + { + arguments.arguments(db).elements(db).iter().for_each(|a| match a.arg_clause(db) { + ArgClause::Named(x) => { + let arg_name = x.name(db).text(db).to_string(); + let arg_value = x.value(db); + + if processed_args.contains_key(&arg_name) { + diagnostics.push(PluginDiagnostic { + message: format!("Too many '{}' attributes for dojo::contract", arg_name), + stable_ptr: module_ast.stable_ptr().untyped(), + severity: Severity::Error, + }); + } else { + processed_args.insert(arg_name.clone(), true); + + match arg_name.as_str() { + CONTRACT_NAMESPACE => { + parameters.namespace = + get_contract_namespace(db, arg_value, diagnostics); + } + _ => { + diagnostics.push(PluginDiagnostic { + message: format!( + "Unexpected argument '{}' for dojo::contract", + arg_name + ), + stable_ptr: x.stable_ptr().untyped(), + severity: Severity::Warning, + }); + } + } + } + } + ArgClause::Unnamed(arg) => { + let arg_name = arg.value(db).as_syntax_node().get_text(db); + + diagnostics.push(PluginDiagnostic { + message: format!("Unexpected argument '{}' for dojo::contract", arg_name), + stable_ptr: arg.stable_ptr().untyped(), + severity: Severity::Warning, + }); + } + ArgClause::FieldInitShorthand(x) => { + diagnostics.push(PluginDiagnostic { + message: format!( + "Unexpected argument '{}' for dojo::contract", + x.name(db).name(db).text(db).to_string() + ), + stable_ptr: x.stable_ptr().untyped(), + severity: Severity::Warning, + }); + } + }) } + + parameters } diff --git a/crates/dojo-lang/src/interface.rs b/crates/dojo-lang/src/interface.rs index 1fc64b6759..b601ada9d3 100644 --- a/crates/dojo-lang/src/interface.rs +++ b/crates/dojo-lang/src/interface.rs @@ -40,30 +40,36 @@ impl DojoInterface { }) .collect(); - builder.add_modified(RewriteNode::interpolate_patched( - " + builder.add_modified(RewriteNode::Mapped { + node: Box::new(RewriteNode::interpolate_patched( + " #[starknet::interface] trait $name$ { $body$ } ", - &UnorderedHashMap::from([ - ("name".to_string(), RewriteNode::Text(name.to_string())), - ("body".to_string(), RewriteNode::new_modified(body_nodes)), - ]), - )); + &UnorderedHashMap::from([ + ("name".to_string(), RewriteNode::Text(name.to_string())), + ("body".to_string(), RewriteNode::new_modified(body_nodes)), + ]), + )), + origin: trait_ast.as_syntax_node().span_without_trivia(db), + }); } else { // empty trait - builder.add_modified(RewriteNode::interpolate_patched( - " + builder.add_modified(RewriteNode::Mapped { + node: Box::new(RewriteNode::interpolate_patched( + " #[starknet::interface] trait $name$ {} ", - &UnorderedHashMap::from([( - "name".to_string(), - RewriteNode::Text(name.to_string()), - )]), - )); + &UnorderedHashMap::from([( + "name".to_string(), + RewriteNode::Text(name.to_string()), + )]), + )), + origin: trait_ast.as_syntax_node().span_without_trivia(db), + }); } let (code, code_mappings) = builder.build(); @@ -135,11 +141,9 @@ impl DojoInterface { db: &dyn SyntaxGroup, fn_ast: ast::TraitItemFunction, ) -> Vec { - let mut rewritten_fn = RewriteNode::from_ast(&fn_ast); - let rewritten_params = rewritten_fn - .modify_child(db, ast::TraitItemFunction::INDEX_DECLARATION) - .modify_child(db, ast::FunctionDeclaration::INDEX_SIGNATURE) - .modify_child(db, ast::FunctionSignature::INDEX_PARAMETERS); + let fn_name = fn_ast.declaration(db).name(db).text(db); + let return_type = + fn_ast.declaration(db).signature(db).ret_ty(db).as_syntax_node().get_text(db); let params_str = self.rewrite_parameters( db, @@ -147,7 +151,14 @@ impl DojoInterface { fn_ast.stable_ptr().untyped(), ); - rewritten_params.set_str(params_str); - vec![rewritten_fn] + let declaration_node = RewriteNode::Mapped { + node: Box::new(RewriteNode::Text(format!( + "fn {}({}) {};", + fn_name, params_str, return_type + ))), + origin: fn_ast.declaration(db).as_syntax_node().span_without_trivia(db), + }; + + vec![declaration_node] } } diff --git a/crates/dojo-lang/src/lib.rs b/crates/dojo-lang/src/lib.rs index 4f7e0e4bca..4ed4b70c41 100644 --- a/crates/dojo-lang/src/lib.rs +++ b/crates/dojo-lang/src/lib.rs @@ -14,6 +14,7 @@ pub mod plugin; pub mod print; pub mod semantics; pub mod syntax; +pub mod utils; pub(crate) mod version; // Copy of non pub functions from scarb + extension. diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.toml index 971e710469..f22ec5c45f 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.toml @@ -18,6 +18,8 @@ build-external-contracts = [ ] [tool.dojo.world] description = "Cairo compiler features" name = "compiler_cairo_features" +seed = "compiler_cairo_features" +namespace = "ccf" [tool.dojo.env] rpc_url = "http://localhost:5050/" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/compiler_cairo_cairo_24_cairo_v240.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/compiler_cairo_cairo_24_cairo_v240.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/compiler_cairo_cairo_26_cairo_v260.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/compiler_cairo_cairo_26_cairo_v260.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json similarity index 67% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json index f4bde33e6d..ee9ceaac66 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json @@ -1,26 +1,4 @@ [ - { - "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" - }, - { - "type": "interface", - "name": "dojo::world::IDojoResourceProvider", - "items": [ - { - "type": "function", - "name": "dojo_resource", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, { "type": "impl", "name": "WorldProviderImpl", @@ -53,24 +31,6 @@ } ] }, - { - "type": "impl", - "name": "IDojoInitImpl", - "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" - }, - { - "type": "interface", - "name": "dojo_examples::mock_token::mock_token::IDojoInit", - "items": [ - { - "type": "function", - "name": "dojo_init", - "inputs": [], - "outputs": [], - "state_mutability": "view" - } - ] - }, { "type": "impl", "name": "UpgradableImpl", @@ -94,6 +54,11 @@ } ] }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, { "type": "event", "name": "dojo::components::upgradeable::upgradeable::Upgraded", @@ -120,13 +85,13 @@ }, { "type": "event", - "name": "dojo_examples::mock_token::mock_token::Event", + "name": "dojo::base::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" + "kind": "flat" } ] } diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json similarity index 89% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json index c1a2447839..0e5e96210e 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo_world_world.json +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json @@ -194,6 +194,18 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -401,7 +413,7 @@ "name": "is_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -421,7 +433,7 @@ "name": "grant_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -437,7 +449,7 @@ "name": "revoke_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -447,6 +459,66 @@ ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "can_write_resource", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_model", + "inputs": [ + { + "name": "model_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_namespace", + "inputs": [ + { + "name": "namespace_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" } ] }, @@ -692,6 +764,16 @@ "name": "address", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" } ] }, @@ -741,6 +823,23 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world::ModelRegistered", @@ -751,6 +850,11 @@ "type": "core::byte_array::ByteArray", "kind": "data" }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", @@ -818,7 +922,7 @@ "kind": "struct", "members": [ { - "name": "model", + "name": "resource", "type": "core::felt252", "kind": "data" }, @@ -956,6 +1060,11 @@ "type": "dojo::world::world::MetadataUpdate", "kind": "nested" }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world::NamespaceRegistered", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml similarity index 66% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml index d253e1bd66..be3fb94735 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_24_cairo_v240.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml @@ -2,9 +2,10 @@ kind = "DojoContract" class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" original_class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/compiler_cairo_cairo_24_cairo_v240.json" +abi = "manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json" reads = [] writes = [] computed = [] init_calldata = [] -name = "compiler_cairo::cairo_24::cairo_v240" +tag = "ccf-cairo_v240" +manifest_name = "ccf-cairo_v240-8d921297" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml similarity index 66% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml index 4ac01d6fdb..f4443a58d4 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/compiler_cairo_cairo_26_cairo_v260.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml @@ -2,9 +2,10 @@ kind = "DojoContract" class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" original_class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/compiler_cairo_cairo_26_cairo_v260.json" +abi = "manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json" reads = [] writes = [] computed = [] init_calldata = [] -name = "compiler_cairo::cairo_26::cairo_v260" +tag = "ccf-cairo_v260" +manifest_name = "ccf-cairo_v260-465ec7fe" diff --git a/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml similarity index 66% rename from examples/spawn-and-move/manifests/release/base/dojo_base_base.toml rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml index 6c4b5de67e..4e2fc2e0bb 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo_base_base.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml @@ -1,4 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -name = "dojo::base::base" +abi = "manifests/dev/abis/base/dojo-base.json" +tag = "dojo-base" +manifest_name = "dojo-base" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml new file mode 100644 index 0000000000..94821ba3f7 --- /dev/null +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml @@ -0,0 +1,6 @@ +kind = "Class" +class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +abi = "manifests/dev/abis/base/dojo-world.json" +tag = "dojo-world" +manifest_name = "dojo-world" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml deleted file mode 100644 index 2555ec3eda..0000000000 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_world_world.toml +++ /dev/null @@ -1,5 +0,0 @@ -kind = "Class" -class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -abi = "manifests/dev/abis/base/dojo_world_world.json" -name = "dojo::world::world" diff --git a/crates/dojo-lang/src/model.rs b/crates/dojo-lang/src/model.rs index dab07e5efe..29da3a0603 100644 --- a/crates/dojo-lang/src/model.rs +++ b/crates/dojo-lang/src/model.rs @@ -9,22 +9,25 @@ use cairo_lang_syntax::node::helpers::QueryAttrs; use cairo_lang_syntax::node::{Terminal, TypedStablePtr, TypedSyntaxNode}; use cairo_lang_utils::unordered_hash_map::UnorderedHashMap; use convert_case::{Case, Casing}; +use dojo_world::contracts::naming; use dojo_world::manifest::Member; -use starknet::core::utils::get_selector_from_name; use crate::plugin::{DojoAuxData, Model, DOJO_MODEL_ATTR}; +use crate::utils::is_name_valid; const DEFAULT_MODEL_VERSION: u8 = 1; const MODEL_VERSION_NAME: &str = "version"; +const MODEL_NAMESPACE: &str = "namespace"; struct ModelParameters { version: u8, + namespace: Option, } impl Default for ModelParameters { fn default() -> ModelParameters { - ModelParameters { version: DEFAULT_MODEL_VERSION } + ModelParameters { version: DEFAULT_MODEL_VERSION, namespace: Option::None } } } @@ -73,6 +76,29 @@ fn get_model_version( } } +/// Get the model namespace from the `Expr` parameter. +fn get_model_namespace( + db: &dyn SyntaxGroup, + arg_value: Expr, + diagnostics: &mut Vec, +) -> Option { + match arg_value { + Expr::ShortString(ss) => Some(ss.string_value(db).unwrap()), + Expr::String(s) => Some(s.string_value(db).unwrap()), + _ => { + diagnostics.push(PluginDiagnostic { + message: format!( + "The argument '{}' of dojo::model must be a string", + MODEL_NAMESPACE + ), + stable_ptr: arg_value.stable_ptr().untyped(), + severity: Severity::Error, + }); + Option::None + } + } +} + /// Get parameters of the dojo::model attribute. /// /// Note: dojo::model attribute has already been checked so there is one and only one attribute. @@ -114,6 +140,9 @@ fn get_model_parameters( MODEL_VERSION_NAME => { parameters.version = get_model_version(db, arg_value, diagnostics); } + MODEL_NAMESPACE => { + parameters.namespace = get_model_namespace(db, arg_value, diagnostics); + } _ => { diagnostics.push(PluginDiagnostic { message: format!( @@ -163,17 +192,47 @@ pub fn handle_model_struct( db: &dyn SyntaxGroup, aux_data: &mut DojoAuxData, struct_ast: ItemStruct, + package_id: String, ) -> (RewriteNode, Vec) { let mut diagnostics = vec![]; let parameters = get_model_parameters(db, struct_ast.clone(), &mut diagnostics); let model_name = struct_ast.name(db).as_syntax_node().get_text(db).trim().to_string(); + let model_namespace = match parameters.namespace { + Option::Some(x) => x, + Option::None => package_id, + }; + + for (id, value) in [("name", &model_name), ("namespace", &model_namespace)] { + if !is_name_valid(value) { + return ( + RewriteNode::empty(), + vec![PluginDiagnostic { + stable_ptr: struct_ast.name(db).stable_ptr().0, + message: format!( + "The model {id} '{value}' can only contain characters (a-z/A-Z), numbers \ + (0-9) and underscore (_)" + ) + .to_string(), + severity: Severity::Error, + }], + ); + } + } + + let model_tag = naming::get_tag(&model_namespace, &model_name); + let model_name_hash = naming::compute_bytearray_hash(&model_name); + let model_namespace_hash = naming::compute_bytearray_hash(&model_namespace); + let (model_version, model_selector) = match parameters.version { 0 => (RewriteNode::Text("0".to_string()), RewriteNode::Text(format!("\"{model_name}\""))), _ => ( RewriteNode::Text(DEFAULT_MODEL_VERSION.to_string()), - RewriteNode::Text(get_selector_from_name(model_name.as_str()).unwrap().to_string()), + RewriteNode::Text( + naming::compute_model_selector_from_hash(model_namespace_hash, model_name_hash) + .to_string(), + ), ), }; @@ -242,7 +301,11 @@ pub fn handle_model_struct( members.iter().filter_map(|m| serialize_member(m, false)).collect::<_>(); let name = struct_ast.name(db).text(db); - aux_data.models.push(Model { name: name.to_string(), members: members.to_vec() }); + aux_data.models.push(Model { + name: name.to_string(), + namespace: model_namespace.clone(), + members: members.to_vec(), + }); ( RewriteNode::interpolate_patched( @@ -250,8 +313,12 @@ pub fn handle_model_struct( impl $type_name$Model of dojo::model::Model<$type_name$> { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: \ dojo::database::introspect::Layout) -> $type_name$ { - let values = dojo::world::IWorldDispatcherTrait::entity(world, $model_selector$, keys, \ - layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -292,6 +359,21 @@ impl $type_name$Model of dojo::model::Model<$type_name$> { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + \"$model_namespace$\" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + $model_namespace_hash$ + } + + #[inline(always)] + fn tag() -> ByteArray { + \"$model_tag$\" + } + #[inline(always)] fn keys(self: @$type_name$) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -360,7 +442,19 @@ mod $contract_name$ { fn version(self: @ContractState) -> u8 { dojo::model::Model::<$type_name$>::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::<$type_name$>::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::<$type_name$>::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::<$type_name$>::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::<$type_name$>::size() } @@ -393,6 +487,12 @@ mod $contract_name$ { ("serialized_values".to_string(), RewriteNode::new_modified(serialized_values)), ("model_version".to_string(), model_version), ("model_selector".to_string(), model_selector), + ("model_namespace".to_string(), RewriteNode::Text(model_namespace.clone())), + ( + "model_namespace_hash".to_string(), + RewriteNode::Text(model_namespace_hash.to_string()), + ), + ("model_tag".to_string(), RewriteNode::Text(model_tag.clone())), ]), ), diagnostics, diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index 2da354fded..37b91398a8 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -16,6 +16,7 @@ use cairo_lang_syntax::node::helpers::QueryAttrs; use cairo_lang_syntax::node::ids::SyntaxStablePtrId; use cairo_lang_syntax::node::{ast, Terminal, TypedSyntaxNode}; use dojo_types::system::Dependency; +use dojo_world::contracts::naming; use dojo_world::manifest::Member; use scarb::compiler::plugin::builtin::BuiltinStarkNetPlugin; use scarb::compiler::plugin::{CairoPlugin, CairoPluginInstance}; @@ -34,6 +35,7 @@ use crate::interface::DojoInterface; use crate::introspect::{handle_introspect_enum, handle_introspect_struct}; use crate::model::handle_model_struct; use crate::print::{handle_print_enum, handle_print_struct}; +use crate::utils::get_package_id; pub const DOJO_CONTRACT_ATTR: &str = "dojo::contract"; pub const DOJO_INTERFACE_ATTR: &str = "dojo::interface"; @@ -46,12 +48,14 @@ pub const DOJO_PACKED_ATTR: &str = "IntrospectPacked"; #[derive(Clone, Debug, PartialEq)] pub struct Model { pub name: String, + pub namespace: String, pub members: Vec, } #[derive(Debug, PartialEq, Eq)] pub struct SystemAuxData { pub name: SmolStr, + pub namespace: String, pub dependencies: Vec, } @@ -81,7 +85,7 @@ pub struct ComputedValuesAuxData { // Name of entrypoint to get computed value pub entrypoint: SmolStr, // Model to bind to - pub model: Option, + pub tag: Option, } impl GeneratedFileAuxData for ComputedValuesAuxData { @@ -103,9 +107,14 @@ pub const PACKAGE_NAME: &str = "dojo_plugin"; pub struct BuiltinDojoPlugin; impl BuiltinDojoPlugin { - fn handle_mod(&self, db: &dyn SyntaxGroup, module_ast: ast::ItemModule) -> PluginResult { + fn handle_mod( + &self, + db: &dyn SyntaxGroup, + module_ast: ast::ItemModule, + package_id: String, + ) -> PluginResult { if module_ast.has_attr(db, DOJO_CONTRACT_ATTR) { - return DojoContract::from_module(db, module_ast); + return DojoContract::from_module(db, &module_ast, package_id); } PluginResult::default() @@ -131,7 +140,12 @@ impl BuiltinDojoPlugin { } } - fn handle_fn(&self, db: &dyn SyntaxGroup, fn_ast: ast::FunctionWithBody) -> PluginResult { + fn handle_fn( + &self, + db: &dyn SyntaxGroup, + fn_ast: ast::FunctionWithBody, + package_id: String, + ) -> PluginResult { let attrs = fn_ast.attributes(db).query_attr(db, "computed"); if attrs.is_empty() { return PluginResult::default(); @@ -154,10 +168,11 @@ impl BuiltinDojoPlugin { let fn_name = fn_decl.name(db).text(db); let params = fn_decl.signature(db).parameters(db); let param_els = params.elements(db); - let mut model = None; + let mut tag = None; if args.len() == 1 { let model_name = args[0].text(db); - model = Some(model_name.clone()); + tag = Some(naming::get_tag(&model_name, &package_id)); + let model_type_node = param_els[1].type_clause(db).ty(db); if let ast::Expr::Path(model_type_path) = model_type_node { let model_type = model_type_path @@ -167,7 +182,7 @@ impl BuiltinDojoPlugin { .unwrap() .as_syntax_node() .get_text(db); - if model_type != model_name { + if model_type != model_name.clone() { return self.result_with_diagnostic( model_type_path.stable_ptr().0, "Computed functions second parameter should be the model.".into(), @@ -195,7 +210,7 @@ impl BuiltinDojoPlugin { name: fn_name.clone(), content: "".into(), aux_data: Some(DynGeneratedFileAuxData::new(ComputedValuesAuxData { - model, + tag, entrypoint: fn_name, })), code_mappings: vec![], @@ -323,8 +338,25 @@ impl MacroPlugin for BuiltinDojoPlugin { item_ast: ast::ModuleItem, _metadata: &MacroPluginMetadata<'_>, ) -> PluginResult { + let package_id = match get_package_id(db) { + Option::Some(x) => x, + Option::None => { + return PluginResult { + code: Option::None, + diagnostics: vec![PluginDiagnostic { + stable_ptr: item_ast.stable_ptr().0, + message: "Unable to find the package ID. Be sure to have a 'package.name' \ + field in your Scarb.toml file." + .into(), + severity: Severity::Error, + }], + remove_original_item: false, + }; + } + }; + match item_ast { - ast::ModuleItem::Module(module_ast) => self.handle_mod(db, module_ast), + ast::ModuleItem::Module(module_ast) => self.handle_mod(db, module_ast, package_id), ast::ModuleItem::Trait(trait_ast) => self.handle_trait(db, trait_ast), ast::ModuleItem::Enum(enum_ast) => { let aux_data = DojoAuxData::default(); @@ -464,7 +496,7 @@ impl MacroPlugin for BuiltinDojoPlugin { match model_attrs.len().cmp(&1) { Ordering::Equal => { let (model_rewrite_nodes, model_diagnostics) = - handle_model_struct(db, &mut aux_data, struct_ast.clone()); + handle_model_struct(db, &mut aux_data, struct_ast.clone(), package_id); rewrite_nodes.push(model_rewrite_nodes); diagnostics.extend(model_diagnostics); } @@ -502,7 +534,7 @@ impl MacroPlugin for BuiltinDojoPlugin { remove_original_item: false, } } - ast::ModuleItem::FreeFunction(fn_ast) => self.handle_fn(db, fn_ast), + ast::ModuleItem::FreeFunction(fn_ast) => self.handle_fn(db, fn_ast, package_id), _ => PluginResult::default(), } } diff --git a/crates/dojo-lang/src/plugin_test_data/model b/crates/dojo-lang/src/plugin_test_data/model index 092bee2438..620747c774 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -61,6 +61,27 @@ struct Modelv0 { v: Vec3, } +#[dojo::model(namespace: 'MyNamespace')] +struct ModelWithBadNamespaceFormat { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(namespace: 'my_namespace')] +struct ModelWithShortStringNamespace { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(namespace: "my_namespace")] +struct ModelWithStringNamespace { + #[key] + id: felt252, + v: Vec3, +} + #[dojo::model] struct Position { #[key] @@ -195,6 +216,27 @@ struct Modelv0 { v: Vec3, } +#[dojo::model(namespace: 'MyNamespace')] +struct ModelWithBadNamespaceFormat { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(namespace: 'my_namespace')] +struct ModelWithShortStringNamespace { + #[key] + id: felt252, + v: Vec3, +} + +#[dojo::model(namespace: "my_namespace")] +struct ModelWithStringNamespace { + #[key] + id: felt252, + v: Vec3, +} + #[dojo::model] struct Position { #[key] @@ -355,7 +397,12 @@ dojo::database::introspect::Member { impl BadModelMultipleVersionsModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> BadModelMultipleVersions { - let values = dojo::world::IWorldDispatcherTrait::entity(world, "BadModelMultipleVersions", keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -395,6 +442,21 @@ impl BadModelMultipleVersionsModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelMultipleVersions" + } + #[inline(always)] fn keys(self: @BadModelMultipleVersions) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -463,7 +525,19 @@ mod bad_model_multiple_versions { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -531,7 +605,12 @@ dojo::database::introspect::Member { impl BadModelBadVersionTypeModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> BadModelBadVersionType { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 537246025350462187868458942885902086202425585541495898150877285881426926523, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -563,7 +642,7 @@ impl BadModelBadVersionTypeModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 537246025350462187868458942885902086202425585541495898150877285881426926523 + 1257444965375069225632929782137899434201314657712945575000402601057577969467 } #[inline(always)] @@ -571,6 +650,21 @@ impl BadModelBadVersionTypeModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelBadVersionType" + } + #[inline(always)] fn keys(self: @BadModelBadVersionType) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -639,7 +733,19 @@ mod bad_model_bad_version_type { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -707,7 +813,12 @@ dojo::database::introspect::Member { impl BadModelNoVersionValueModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> BadModelNoVersionValue { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 510884764440804248641145470106421715520498065640762121627610646122289418442, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -739,7 +850,7 @@ impl BadModelNoVersionValueModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 510884764440804248641145470106421715520498065640762121627610646122289418442 + 3373097771824053354196231469173076752789704424742154674493295341772858104830 } #[inline(always)] @@ -747,6 +858,21 @@ impl BadModelNoVersionValueModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelNoVersionValue" + } + #[inline(always)] fn keys(self: @BadModelNoVersionValue) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -815,7 +941,19 @@ mod bad_model_no_version_value { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -883,7 +1021,12 @@ dojo::database::introspect::Member { impl BadModelUnexpectedArgWithValueModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> BadModelUnexpectedArgWithValue { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 609798817400410974332175542242790740792842310475593325422194044359199941027, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -915,7 +1058,7 @@ impl BadModelUnexpectedArgWithValueModel of dojo::model::Model felt252 { - 609798817400410974332175542242790740792842310475593325422194044359199941027 + 3590405629214068034212593672218295377527112441964389853941077460616482660871 } #[inline(always)] @@ -923,6 +1066,21 @@ impl BadModelUnexpectedArgWithValueModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelUnexpectedArgWithValue" + } + #[inline(always)] fn keys(self: @BadModelUnexpectedArgWithValue) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -991,7 +1149,19 @@ mod bad_model_unexpected_arg_with_value { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1059,7 +1229,12 @@ dojo::database::introspect::Member { impl BadModelUnexpectedArgModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> BadModelUnexpectedArg { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 949097735839867165379372628344008784789919991740118948112868710933218930849, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -1091,7 +1266,7 @@ impl BadModelUnexpectedArgModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 949097735839867165379372628344008784789919991740118948112868710933218930849 + 1096230073778795894347893795076822536130165745015118585791241737691598280119 } #[inline(always)] @@ -1099,6 +1274,21 @@ impl BadModelUnexpectedArgModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelUnexpectedArg" + } + #[inline(always)] fn keys(self: @BadModelUnexpectedArg) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -1167,7 +1357,19 @@ mod bad_model_unexpected_arg { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1235,7 +1437,12 @@ dojo::database::introspect::Member { impl BadModelNotSupportedVersionModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> BadModelNotSupportedVersion { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 1024306429832444281478160321067399481685861686361100808176928576017034183663, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -1252,12 +1459,636 @@ impl BadModelNotSupportedVersionModel of dojo::model::Model::unwrap(entity) + core::option::OptionTrait::::unwrap(entity) + } + + #[inline(always)] + fn name() -> ByteArray { + "BadModelNotSupportedVersion" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 2618259498257511987977711074037130039442899457131070784132500210658539158686 + } + + #[inline(always)] + fn instance_selector(self: @BadModelNotSupportedVersion) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelNotSupportedVersion" + } + + #[inline(always)] + fn keys(self: @BadModelNotSupportedVersion) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, *self.id); + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @BadModelNotSupportedVersion) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::database::introspect::Layout { + dojo::database::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @BadModelNotSupportedVersion) -> dojo::database::introspect::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + let layout = Self::layout(); + + match layout { + dojo::database::introspect::Layout::Fixed(layout) => { + let mut span_layout = layout; + Option::Some(dojo::packing::calculate_packed_size(ref span_layout)) + }, + dojo::database::introspect::Layout::Struct(_) => Option::None, + dojo::database::introspect::Layout::Array(_) => Option::None, + dojo::database::introspect::Layout::Tuple(_) => Option::None, + dojo::database::introspect::Layout::Enum(_) => Option::None, + dojo::database::introspect::Layout::ByteArray => Option::None, + } + } +} + +#[starknet::interface] +trait Ibad_model_not_supported_version { + fn ensure_abi(self: @T, model: BadModelNotSupportedVersion); +} + +#[starknet::contract] +mod bad_model_not_supported_version { + use super::BadModelNotSupportedVersion; + use super::Ibad_model_not_supported_version; + + #[storage] + struct Storage {} + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name(self: @ContractState) -> ByteArray { + dojo::model::Model::::name() + } + + fn version(self: @ContractState) -> u8 { + dojo::model::Model::::version() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::database::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::database::introspect::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::database::introspect::Ty { + dojo::database::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl bad_model_not_supported_versionImpl of Ibad_model_not_supported_version{ + fn ensure_abi(self: @ContractState, model: BadModelNotSupportedVersion) { + } + } +} + +impl Modelv0Introspect<> of dojo::database::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::database::introspect::Introspect::::size() + } + + fn layout() -> dojo::database::introspect::Layout { + dojo::database::introspect::Layout::Struct( + array![ + dojo::database::introspect::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::database::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::database::introspect::Ty { + dojo::database::introspect::Ty::Struct( + dojo::database::introspect::Struct { + name: 'Modelv0', + attrs: array![].span(), + children: array![ + dojo::database::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::database::introspect::Introspect::::ty() + }, +dojo::database::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::database::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl Modelv0Model of dojo::model::Model { + fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> Modelv0 { + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); + + // TODO: Generate method to deserialize from keys / values directly to avoid + // serializing to intermediate array. + let mut serialized = core::array::ArrayTrait::new(); + core::array::serialize_array_helper(keys, ref serialized); + core::array::serialize_array_helper(values, ref serialized); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity = core::serde::Serde::::deserialize(ref serialized); + + if core::option::OptionTrait::::is_none(@entity) { + panic!( + "Model `Modelv0`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." + ); + } + + core::option::OptionTrait::::unwrap(entity) + } + + #[inline(always)] + fn name() -> ByteArray { + "Modelv0" + } + + #[inline(always)] + fn version() -> u8 { + 0 + } + + #[inline(always)] + fn selector() -> felt252 { + "Modelv0" + } + + #[inline(always)] + fn instance_selector(self: @Modelv0) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Modelv0" + } + + #[inline(always)] + fn keys(self: @Modelv0) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, *self.id); + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @Modelv0) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::database::introspect::Layout { + dojo::database::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @Modelv0) -> dojo::database::introspect::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + let layout = Self::layout(); + + match layout { + dojo::database::introspect::Layout::Fixed(layout) => { + let mut span_layout = layout; + Option::Some(dojo::packing::calculate_packed_size(ref span_layout)) + }, + dojo::database::introspect::Layout::Struct(_) => Option::None, + dojo::database::introspect::Layout::Array(_) => Option::None, + dojo::database::introspect::Layout::Tuple(_) => Option::None, + dojo::database::introspect::Layout::Enum(_) => Option::None, + dojo::database::introspect::Layout::ByteArray => Option::None, + } + } +} + +#[starknet::interface] +trait Imodelv_0 { + fn ensure_abi(self: @T, model: Modelv0); +} + +#[starknet::contract] +mod modelv_0 { + use super::Modelv0; + use super::Imodelv_0; + + #[storage] + struct Storage {} + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name(self: @ContractState) -> ByteArray { + dojo::model::Model::::name() + } + + fn version(self: @ContractState) -> u8 { + dojo::model::Model::::version() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::database::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::database::introspect::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::database::introspect::Ty { + dojo::database::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl modelv_0Impl of Imodelv_0{ + fn ensure_abi(self: @ContractState, model: Modelv0) { + } + } +} + +impl ModelWithBadNamespaceFormatIntrospect<> of dojo::database::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::database::introspect::Introspect::::size() + } + + fn layout() -> dojo::database::introspect::Layout { + dojo::database::introspect::Layout::Struct( + array![ + dojo::database::introspect::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::database::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::database::introspect::Ty { + dojo::database::introspect::Ty::Struct( + dojo::database::introspect::Struct { + name: 'ModelWithBadNamespaceFormat', + attrs: array![].span(), + children: array![ + dojo::database::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::database::introspect::Introspect::::ty() + }, +dojo::database::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::database::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl ModelWithBadNamespaceFormatModel of dojo::model::Model { + fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithBadNamespaceFormat { + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); + + // TODO: Generate method to deserialize from keys / values directly to avoid + // serializing to intermediate array. + let mut serialized = core::array::ArrayTrait::new(); + core::array::serialize_array_helper(keys, ref serialized); + core::array::serialize_array_helper(values, ref serialized); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity = core::serde::Serde::::deserialize(ref serialized); + + if core::option::OptionTrait::::is_none(@entity) { + panic!( + "Model `ModelWithBadNamespaceFormat`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." + ); + } + + core::option::OptionTrait::::unwrap(entity) + } + + #[inline(always)] + fn name() -> ByteArray { + "ModelWithBadNamespaceFormat" + } + + #[inline(always)] + fn version() -> u8 { + 1 + } + + #[inline(always)] + fn selector() -> felt252 { + 3498075185010572568869958326439183660947774785526793544998939163671395407352 + } + + #[inline(always)] + fn instance_selector(self: @ModelWithBadNamespaceFormat) -> felt252 { + Self::selector() + } + + #[inline(always)] + fn namespace() -> ByteArray { + "MyNamespace" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 2518247443458975119180817677753479732439290689944304814934908400279022945373 + } + + #[inline(always)] + fn tag() -> ByteArray { + "MyNamespace-ModelWithBadNamespaceFormat" + } + + #[inline(always)] + fn keys(self: @ModelWithBadNamespaceFormat) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::array::ArrayTrait::append(ref serialized, *self.id); + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn values(self: @ModelWithBadNamespaceFormat) -> Span { + let mut serialized = core::array::ArrayTrait::new(); + core::serde::Serde::serialize(self.v, ref serialized); + core::array::ArrayTrait::span(@serialized) + } + + #[inline(always)] + fn layout() -> dojo::database::introspect::Layout { + dojo::database::introspect::Introspect::::layout() + } + + #[inline(always)] + fn instance_layout(self: @ModelWithBadNamespaceFormat) -> dojo::database::introspect::Layout { + Self::layout() + } + + #[inline(always)] + fn packed_size() -> Option { + let layout = Self::layout(); + + match layout { + dojo::database::introspect::Layout::Fixed(layout) => { + let mut span_layout = layout; + Option::Some(dojo::packing::calculate_packed_size(ref span_layout)) + }, + dojo::database::introspect::Layout::Struct(_) => Option::None, + dojo::database::introspect::Layout::Array(_) => Option::None, + dojo::database::introspect::Layout::Tuple(_) => Option::None, + dojo::database::introspect::Layout::Enum(_) => Option::None, + dojo::database::introspect::Layout::ByteArray => Option::None, + } + } +} + +#[starknet::interface] +trait Imodel_with_bad_namespace_format { + fn ensure_abi(self: @T, model: ModelWithBadNamespaceFormat); +} + +#[starknet::contract] +mod model_with_bad_namespace_format { + use super::ModelWithBadNamespaceFormat; + use super::Imodel_with_bad_namespace_format; + + #[storage] + struct Storage {} + + #[abi(embed_v0)] + impl DojoModelImpl of dojo::model::IModel{ + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() + } + + fn name(self: @ContractState) -> ByteArray { + dojo::model::Model::::name() + } + + fn version(self: @ContractState) -> u8 { + dojo::model::Model::::version() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + + fn unpacked_size(self: @ContractState) -> Option { + dojo::database::introspect::Introspect::::size() + } + + fn packed_size(self: @ContractState) -> Option { + dojo::model::Model::::packed_size() + } + + fn layout(self: @ContractState) -> dojo::database::introspect::Layout { + dojo::model::Model::::layout() + } + + fn schema(self: @ContractState) -> dojo::database::introspect::Ty { + dojo::database::introspect::Introspect::::ty() + } + } + + #[abi(embed_v0)] + impl model_with_bad_namespace_formatImpl of Imodel_with_bad_namespace_format{ + fn ensure_abi(self: @ContractState, model: ModelWithBadNamespaceFormat) { + } + } +} + +impl ModelWithShortStringNamespaceIntrospect<> of dojo::database::introspect::Introspect> { + #[inline(always)] + fn size() -> Option { + dojo::database::introspect::Introspect::::size() + } + + fn layout() -> dojo::database::introspect::Layout { + dojo::database::introspect::Layout::Struct( + array![ + dojo::database::introspect::FieldLayout { + selector: 578691550836206188651404750433984985630363913126316857592149308417275000080, + layout: dojo::database::introspect::Introspect::::layout() + } + ].span() + ) + } + + #[inline(always)] + fn ty() -> dojo::database::introspect::Ty { + dojo::database::introspect::Ty::Struct( + dojo::database::introspect::Struct { + name: 'ModelWithShortStringNamespace', + attrs: array![].span(), + children: array![ + dojo::database::introspect::Member { + name: 'id', + attrs: array!['key'].span(), + ty: dojo::database::introspect::Introspect::::ty() + }, +dojo::database::introspect::Member { + name: 'v', + attrs: array![].span(), + ty: dojo::database::introspect::Introspect::::ty() + } + + ].span() + } + ) + } +} + +impl ModelWithShortStringNamespaceModel of dojo::model::Model { + fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithShortStringNamespace { + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); + + // TODO: Generate method to deserialize from keys / values directly to avoid + // serializing to intermediate array. + let mut serialized = core::array::ArrayTrait::new(); + core::array::serialize_array_helper(keys, ref serialized); + core::array::serialize_array_helper(values, ref serialized); + let mut serialized = core::array::ArrayTrait::span(@serialized); + + let entity = core::serde::Serde::::deserialize(ref serialized); + + if core::option::OptionTrait::::is_none(@entity) { + panic!( + "Model `ModelWithShortStringNamespace`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." + ); + } + + core::option::OptionTrait::::unwrap(entity) } #[inline(always)] fn name() -> ByteArray { - "BadModelNotSupportedVersion" + "ModelWithShortStringNamespace" } #[inline(always)] @@ -1267,23 +2098,38 @@ impl BadModelNotSupportedVersionModel of dojo::model::Model felt252 { - 1024306429832444281478160321067399481685861686361100808176928576017034183663 + 643350075018191729855964658181798951445581630505240307235771395728709379388 } #[inline(always)] - fn instance_selector(self: @BadModelNotSupportedVersion) -> felt252 { + fn instance_selector(self: @ModelWithShortStringNamespace) -> felt252 { Self::selector() } #[inline(always)] - fn keys(self: @BadModelNotSupportedVersion) -> Span { + fn namespace() -> ByteArray { + "my_namespace" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 1685136890688416384941629523783652800960468745356230625531475538826800548713 + } + + #[inline(always)] + fn tag() -> ByteArray { + "my_namespace-ModelWithShortStringNamespace" + } + + #[inline(always)] + fn keys(self: @ModelWithShortStringNamespace) -> Span { let mut serialized = core::array::ArrayTrait::new(); core::array::ArrayTrait::append(ref serialized, *self.id); core::array::ArrayTrait::span(@serialized) } #[inline(always)] - fn values(self: @BadModelNotSupportedVersion) -> Span { + fn values(self: @ModelWithShortStringNamespace) -> Span { let mut serialized = core::array::ArrayTrait::new(); core::serde::Serde::serialize(self.v, ref serialized); core::array::ArrayTrait::span(@serialized) @@ -1291,11 +2137,11 @@ impl BadModelNotSupportedVersionModel of dojo::model::Model dojo::database::introspect::Layout { - dojo::database::introspect::Introspect::::layout() + dojo::database::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @BadModelNotSupportedVersion) -> dojo::database::introspect::Layout { + fn instance_layout(self: @ModelWithShortStringNamespace) -> dojo::database::introspect::Layout { Self::layout() } @@ -1318,14 +2164,14 @@ impl BadModelNotSupportedVersionModel of dojo::model::Model { - fn ensure_abi(self: @T, model: BadModelNotSupportedVersion); +trait Imodel_with_short_string_namespace { + fn ensure_abi(self: @T, model: ModelWithShortStringNamespace); } #[starknet::contract] -mod bad_model_not_supported_version { - use super::BadModelNotSupportedVersion; - use super::Ibad_model_not_supported_version; +mod model_with_short_string_namespace { + use super::ModelWithShortStringNamespace; + use super::Imodel_with_short_string_namespace; #[storage] struct Storage {} @@ -1333,42 +2179,54 @@ mod bad_model_not_supported_version { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() + dojo::model::Model::::selector() } fn name(self: @ContractState) -> ByteArray { - dojo::model::Model::::name() + dojo::model::Model::::name() } fn version(self: @ContractState) -> u8 { - dojo::model::Model::::version() + dojo::model::Model::::version() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { - dojo::database::introspect::Introspect::::size() + dojo::database::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { - dojo::model::Model::::packed_size() + dojo::model::Model::::packed_size() } fn layout(self: @ContractState) -> dojo::database::introspect::Layout { - dojo::model::Model::::layout() + dojo::model::Model::::layout() } fn schema(self: @ContractState) -> dojo::database::introspect::Ty { - dojo::database::introspect::Introspect::::ty() + dojo::database::introspect::Introspect::::ty() } } #[abi(embed_v0)] - impl bad_model_not_supported_versionImpl of Ibad_model_not_supported_version{ - fn ensure_abi(self: @ContractState, model: BadModelNotSupportedVersion) { + impl model_with_short_string_namespaceImpl of Imodel_with_short_string_namespace{ + fn ensure_abi(self: @ContractState, model: ModelWithShortStringNamespace) { } } } -impl Modelv0Introspect<> of dojo::database::introspect::Introspect> { +impl ModelWithStringNamespaceIntrospect<> of dojo::database::introspect::Introspect> { #[inline(always)] fn size() -> Option { dojo::database::introspect::Introspect::::size() @@ -1389,7 +2247,7 @@ impl Modelv0Introspect<> of dojo::database::introspect::Introspect> { fn ty() -> dojo::database::introspect::Ty { dojo::database::introspect::Ty::Struct( dojo::database::introspect::Struct { - name: 'Modelv0', + name: 'ModelWithStringNamespace', attrs: array![].span(), children: array![ dojo::database::introspect::Member { @@ -1409,9 +2267,14 @@ dojo::database::introspect::Member { } } -impl Modelv0Model of dojo::model::Model { - fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> Modelv0 { - let values = dojo::world::IWorldDispatcherTrait::entity(world, "Modelv0", keys, layout); +impl ModelWithStringNamespaceModel of dojo::model::Model { + fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithStringNamespace { + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -1420,46 +2283,61 @@ impl Modelv0Model of dojo::model::Model { core::array::serialize_array_helper(values, ref serialized); let mut serialized = core::array::ArrayTrait::span(@serialized); - let entity = core::serde::Serde::::deserialize(ref serialized); + let entity = core::serde::Serde::::deserialize(ref serialized); - if core::option::OptionTrait::::is_none(@entity) { + if core::option::OptionTrait::::is_none(@entity) { panic!( - "Model `Modelv0`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." + "Model `ModelWithStringNamespace`: deserialization failed. Ensure the length of the keys tuple is matching the number of #[key] fields in the model struct." ); } - core::option::OptionTrait::::unwrap(entity) + core::option::OptionTrait::::unwrap(entity) } #[inline(always)] fn name() -> ByteArray { - "Modelv0" + "ModelWithStringNamespace" } #[inline(always)] fn version() -> u8 { - 0 + 1 } #[inline(always)] fn selector() -> felt252 { - "Modelv0" + 2567055065785696374111447326195815858786390804996225951953791904194802101726 } #[inline(always)] - fn instance_selector(self: @Modelv0) -> felt252 { + fn instance_selector(self: @ModelWithStringNamespace) -> felt252 { Self::selector() } #[inline(always)] - fn keys(self: @Modelv0) -> Span { + fn namespace() -> ByteArray { + "my_namespace" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 1685136890688416384941629523783652800960468745356230625531475538826800548713 + } + + #[inline(always)] + fn tag() -> ByteArray { + "my_namespace-ModelWithStringNamespace" + } + + #[inline(always)] + fn keys(self: @ModelWithStringNamespace) -> Span { let mut serialized = core::array::ArrayTrait::new(); core::array::ArrayTrait::append(ref serialized, *self.id); core::array::ArrayTrait::span(@serialized) } #[inline(always)] - fn values(self: @Modelv0) -> Span { + fn values(self: @ModelWithStringNamespace) -> Span { let mut serialized = core::array::ArrayTrait::new(); core::serde::Serde::serialize(self.v, ref serialized); core::array::ArrayTrait::span(@serialized) @@ -1467,11 +2345,11 @@ impl Modelv0Model of dojo::model::Model { #[inline(always)] fn layout() -> dojo::database::introspect::Layout { - dojo::database::introspect::Introspect::::layout() + dojo::database::introspect::Introspect::::layout() } #[inline(always)] - fn instance_layout(self: @Modelv0) -> dojo::database::introspect::Layout { + fn instance_layout(self: @ModelWithStringNamespace) -> dojo::database::introspect::Layout { Self::layout() } @@ -1494,14 +2372,14 @@ impl Modelv0Model of dojo::model::Model { } #[starknet::interface] -trait Imodelv_0 { - fn ensure_abi(self: @T, model: Modelv0); +trait Imodel_with_string_namespace { + fn ensure_abi(self: @T, model: ModelWithStringNamespace); } #[starknet::contract] -mod modelv_0 { - use super::Modelv0; - use super::Imodelv_0; +mod model_with_string_namespace { + use super::ModelWithStringNamespace; + use super::Imodel_with_string_namespace; #[storage] struct Storage {} @@ -1509,37 +2387,49 @@ mod modelv_0 { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() + dojo::model::Model::::selector() } fn name(self: @ContractState) -> ByteArray { - dojo::model::Model::::name() + dojo::model::Model::::name() } fn version(self: @ContractState) -> u8 { - dojo::model::Model::::version() + dojo::model::Model::::version() + } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { - dojo::database::introspect::Introspect::::size() + dojo::database::introspect::Introspect::::size() } fn packed_size(self: @ContractState) -> Option { - dojo::model::Model::::packed_size() + dojo::model::Model::::packed_size() } fn layout(self: @ContractState) -> dojo::database::introspect::Layout { - dojo::model::Model::::layout() + dojo::model::Model::::layout() } fn schema(self: @ContractState) -> dojo::database::introspect::Ty { - dojo::database::introspect::Introspect::::ty() + dojo::database::introspect::Introspect::::ty() } } #[abi(embed_v0)] - impl modelv_0Impl of Imodelv_0{ - fn ensure_abi(self: @ContractState, model: Modelv0) { + impl model_with_string_namespaceImpl of Imodel_with_string_namespace{ + fn ensure_abi(self: @ContractState, model: ModelWithStringNamespace) { } } } @@ -1587,7 +2477,12 @@ dojo::database::introspect::Member { impl PositionModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> Position { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 71955415935911354973604243446792437686714331401564029050333759332065302780, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -1619,7 +2514,7 @@ impl PositionModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 71955415935911354973604243446792437686714331401564029050333759332065302780 + 2479520712854223096864276571913189358268637670027015185814050381675363770524 } #[inline(always)] @@ -1627,6 +2522,21 @@ impl PositionModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Position" + } + #[inline(always)] fn keys(self: @Position) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -1695,7 +2605,19 @@ mod position { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1763,7 +2685,12 @@ impl RolesIntrospect<> of dojo::database::introspect::Introspect> { impl RolesModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> Roles { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 419336544500304321788712222515554985736095774968511843121228046452992595089, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -1795,7 +2722,7 @@ impl RolesModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 419336544500304321788712222515554985736095774968511843121228046452992595089 + 855657559905271410348750655782338503830053919297069309307754778237415879343 } #[inline(always)] @@ -1803,6 +2730,21 @@ impl RolesModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Roles" + } + #[inline(always)] fn keys(self: @Roles) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -1871,7 +2813,19 @@ mod roles { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1931,7 +2885,12 @@ impl OnlyKeyModelIntrospect<> of dojo::database::introspect::Introspect { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> OnlyKeyModel { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 95348903287879133251404472882179060573633188436503276991594023731017124802, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -1963,7 +2922,7 @@ impl OnlyKeyModelModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 95348903287879133251404472882179060573633188436503276991594023731017124802 + 185833973124429845784881936399707635120594083624714634478397191250435112638 } #[inline(always)] @@ -1971,6 +2930,21 @@ impl OnlyKeyModelModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-OnlyKeyModel" + } + #[inline(always)] fn keys(self: @OnlyKeyModel) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -2039,7 +3013,19 @@ mod only_key_model { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2099,7 +3085,12 @@ impl U256KeyModelIntrospect<> of dojo::database::introspect::Introspect { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> U256KeyModel { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 1012572617804599336461526165833773117831255507291742736404237332578427043161, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -2131,7 +3122,7 @@ impl U256KeyModelModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 1012572617804599336461526165833773117831255507291742736404237332578427043161 + 313949624866121544885414428820758126526635902180652023772135974434319323806 } #[inline(always)] @@ -2139,6 +3130,21 @@ impl U256KeyModelModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-U256KeyModel" + } + #[inline(always)] fn keys(self: @U256KeyModel) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -2207,7 +3213,19 @@ mod u_256_key_model { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2280,7 +3298,12 @@ dojo::database::introspect::Member { impl PlayerModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> Player { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 711011379911436309259372467342761500657237775100998141763491044473508065524, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -2312,7 +3335,7 @@ impl PlayerModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 711011379911436309259372467342761500657237775100998141763491044473508065524 + 3236595220905041720254406300307550499454912078227837571413280031443759061272 } #[inline(always)] @@ -2320,6 +3343,21 @@ impl PlayerModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Player" + } + #[inline(always)] fn keys(self: @Player) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -2388,7 +3426,19 @@ mod player { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2470,7 +3520,12 @@ dojo::database::introspect::Member { impl ModelWithSimpleArrayModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithSimpleArray { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 1666797686724122591687516812540504658474050953055875240069335038116740262482, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -2502,7 +3557,7 @@ impl ModelWithSimpleArrayModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 1666797686724122591687516812540504658474050953055875240069335038116740262482 + 3015573168128997707047545520976347917082964620628387533056114714397499472255 } #[inline(always)] @@ -2510,6 +3565,21 @@ impl ModelWithSimpleArrayModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithSimpleArray" + } + #[inline(always)] fn keys(self: @ModelWithSimpleArray) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -2578,7 +3648,19 @@ mod model_with_simple_array { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2656,7 +3738,12 @@ dojo::database::introspect::Member { impl ModelWithByteArrayModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithByteArray { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 141311514815198970479576122039175676312992855455532566618126930677198428029, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -2688,7 +3775,7 @@ impl ModelWithByteArrayModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 141311514815198970479576122039175676312992855455532566618126930677198428029 + 1495813766814131974177657304275361143893541941399872042870855060582891570868 } #[inline(always)] @@ -2696,6 +3783,21 @@ impl ModelWithByteArrayModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithByteArray" + } + #[inline(always)] fn keys(self: @ModelWithByteArray) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -2764,7 +3866,19 @@ mod model_with_byte_array { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2846,7 +3960,12 @@ dojo::database::introspect::Member { impl ModelWithComplexArrayModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithComplexArray { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 897000934674353152443993618748644314791405506479389733109858158050692281536, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -2878,7 +3997,7 @@ impl ModelWithComplexArrayModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 897000934674353152443993618748644314791405506479389733109858158050692281536 + 36330270687495804813979499325154873801411429162367231362587376627277795482 } #[inline(always)] @@ -2886,6 +4005,21 @@ impl ModelWithComplexArrayModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithComplexArray" + } + #[inline(always)] fn keys(self: @ModelWithComplexArray) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -2954,7 +4088,19 @@ mod model_with_complex_array { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3043,7 +4189,12 @@ dojo::database::introspect::Introspect::::ty() impl ModelWithTupleModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithTuple { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 337716500732518130569836528184281758241439084973964029720107667501574962806, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -3075,7 +4226,7 @@ impl ModelWithTupleModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - 337716500732518130569836528184281758241439084973964029720107667501574962806 + 2968932965114787437968555813812827702683268243780347884633996291362924490633 } #[inline(always)] @@ -3083,6 +4234,21 @@ impl ModelWithTupleModel of dojo::model::Model { Self::selector() } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithTuple" + } + #[inline(always)] fn keys(self: @ModelWithTuple) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -3151,7 +4317,19 @@ mod model_with_tuple { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3249,7 +4427,12 @@ dojo::database::introspect::Introspect::::ty() impl ModelWithTupleNoPrimitivesModel of dojo::model::Model { fn entity(world: dojo::world::IWorldDispatcher, keys: Span, layout: dojo::database::introspect::Layout) -> ModelWithTupleNoPrimitives { - let values = dojo::world::IWorldDispatcherTrait::entity(world, 1607855252168926989989190762728138559179794826576658643328244347189144524311, keys, layout); + let values = dojo::world::IWorldDispatcherTrait::entity( + world, + Self::selector(), + keys, + layout + ); // TODO: Generate method to deserialize from keys / values directly to avoid // serializing to intermediate array. @@ -3281,7 +4464,7 @@ impl ModelWithTupleNoPrimitivesModel of dojo::model::Model felt252 { - 1607855252168926989989190762728138559179794826576658643328244347189144524311 + 1303002480984182254910512996281734914702552284127358821084351389028444664680 } #[inline(always)] @@ -3289,6 +4472,21 @@ impl ModelWithTupleNoPrimitivesModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn namespace_selector() -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithTupleNoPrimitives" + } + #[inline(always)] fn keys(self: @ModelWithTupleNoPrimitives) -> Span { let mut serialized = core::array::ArrayTrait::new(); @@ -3357,7 +4555,19 @@ mod model_with_tuple_no_primitives { fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } + + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + fn namespace_selector(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_selector() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3419,22 +4629,22 @@ error: dojo::model version 2 not supported ^ error: Model must define at least one #[key] attribute - --> test_src/lib.cairo:66:8 + --> test_src/lib.cairo:87:8 struct Roles { ^***^ error: Model must define at least one member that is not a key - --> test_src/lib.cairo:71:8 + --> test_src/lib.cairo:92:8 struct OnlyKeyModel { ^**********^ error: Model must define at least one member that is not a key - --> test_src/lib.cairo:77:8 + --> test_src/lib.cairo:98:8 struct U256KeyModel { ^**********^ error: Key is only supported for core types that are 1 felt long once serialized. `u256` is a struct of 2 u128, hence not supported. - --> test_src/lib.cairo:77:8 + --> test_src/lib.cairo:98:8 struct U256KeyModel { ^**********^ @@ -3475,51 +4685,66 @@ error: Unsupported attribute. error: Unsupported attribute. --> test_src/lib.cairo:58:1 +#[dojo::model(namespace: 'MyNamespace')] +^**************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:65:1 +#[dojo::model(namespace: 'my_namespace')] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:72:1 +#[dojo::model(namespace: "my_namespace")] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:79:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:65:1 + --> test_src/lib.cairo:86:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:70:1 + --> test_src/lib.cairo:91:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:76:1 + --> test_src/lib.cairo:97:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:82:1 + --> test_src/lib.cairo:103:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:94:1 + --> test_src/lib.cairo:115:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:102:1 + --> test_src/lib.cairo:123:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:110:1 + --> test_src/lib.cairo:131:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:118:1 + --> test_src/lib.cairo:139:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:147:1 #[dojo::model] ^************^ @@ -3630,150 +4855,195 @@ error: Unsupported attribute. error: Unsupported attribute. --> test_src/lib.cairo:58:1 +#[dojo::model(namespace: 'MyNamespace')] +^**************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:58:1 +#[dojo::model(namespace: 'MyNamespace')] +^**************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:58:1 +#[dojo::model(namespace: 'MyNamespace')] +^**************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:65:1 +#[dojo::model(namespace: 'my_namespace')] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:65:1 +#[dojo::model(namespace: 'my_namespace')] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:65:1 +#[dojo::model(namespace: 'my_namespace')] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:72:1 +#[dojo::model(namespace: "my_namespace")] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:72:1 +#[dojo::model(namespace: "my_namespace")] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:72:1 +#[dojo::model(namespace: "my_namespace")] +^***************************************^ + +error: Unsupported attribute. + --> test_src/lib.cairo:79:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:58:1 + --> test_src/lib.cairo:79:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:58:1 + --> test_src/lib.cairo:79:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:65:1 + --> test_src/lib.cairo:86:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:65:1 + --> test_src/lib.cairo:86:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:65:1 + --> test_src/lib.cairo:86:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:70:1 + --> test_src/lib.cairo:91:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:70:1 + --> test_src/lib.cairo:91:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:70:1 + --> test_src/lib.cairo:91:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:76:1 + --> test_src/lib.cairo:97:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:76:1 + --> test_src/lib.cairo:97:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:76:1 + --> test_src/lib.cairo:97:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:82:1 + --> test_src/lib.cairo:103:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:82:1 + --> test_src/lib.cairo:103:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:82:1 + --> test_src/lib.cairo:103:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:94:1 + --> test_src/lib.cairo:115:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:94:1 + --> test_src/lib.cairo:115:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:94:1 + --> test_src/lib.cairo:115:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:102:1 + --> test_src/lib.cairo:123:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:102:1 + --> test_src/lib.cairo:123:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:102:1 + --> test_src/lib.cairo:123:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:110:1 + --> test_src/lib.cairo:131:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:110:1 + --> test_src/lib.cairo:131:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:110:1 + --> test_src/lib.cairo:131:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:118:1 + --> test_src/lib.cairo:139:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:118:1 + --> test_src/lib.cairo:139:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:118:1 + --> test_src/lib.cairo:139:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:147:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:147:1 #[dojo::model] ^************^ error: Unsupported attribute. - --> test_src/lib.cairo:126:1 + --> test_src/lib.cairo:147:1 #[dojo::model] ^************^ diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index 1cc4ec33cc..645bb25f34 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -4,7 +4,17 @@ test_expand_plugin //! > cairo_code -#[dojo::contract] +#[dojo::contract(namespace: "My@Namespace")] +mod bad_namespace_format { + use traits::Into; + use dojo::world::Context; + + fn execute(ctx: Context, name: felt252) { + return (); + } +} + +#[dojo::contract(namespace: 'my_namespace')] mod spawn { use traits::Into; use dojo::world::Context; @@ -14,7 +24,7 @@ mod spawn { } } -#[dojo::contract] +#[dojo::contract(namespace: "my_namespace")] mod proxy { fn execute(value: felt252) -> felt252 { value @@ -345,95 +355,95 @@ mod ctxnamed { } //! > expected_diagnostics +error: The contract namespace 'My@Namespace' can only contain characters (a-z/A-Z), numbers (0-9) and underscore (_) + --> test_src/lib.cairo:1:1 +#[dojo::contract(namespace: "My@Namespace")] +^******************************************^ + error: Unsupported attribute. - --> test_src/lib.cairo:42:1 + --> test_src/lib.cairo:52:1 #[starknet::component] ^********************^ error: Unsupported attribute. - --> test_src/lib.cairo:48:1 + --> test_src/lib.cairo:58:1 #[starknet::component] ^********************^ error: Anything other than functions is not supported in a dojo::interface - --> test_src/lib.cairo:80:5 + --> test_src/lib.cairo:90:5 const ONE: u8; ^************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:101:5 + --> test_src/lib.cairo:111:5 fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; ^***********************************************************************************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:102:5 + --> test_src/lib.cairo:112:5 fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; ^*********************************************************************************************^ error: You cannot use `self` and `world` parameters together. - --> test_src/lib.cairo:103:5 + --> test_src/lib.cairo:113:5 fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252; ^***************************************************************************************^ error: You cannot use `self` and `world` parameters together. - --> test_src/lib.cairo:104:5 + --> test_src/lib.cairo:114:5 fn do_with_ref_self_and_world_inv( ^********************************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:111:5 + --> test_src/lib.cairo:121:5 fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252; ^****************************************************************************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:118:9 + --> test_src/lib.cairo:128:9 fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252 { ^************************************************************************************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:122:9 + --> test_src/lib.cairo:132:9 fn do_with_ref_self_and_world( ^****************************^ error: You cannot use `self` and `world` parameters together. - --> test_src/lib.cairo:128:9 + --> test_src/lib.cairo:138:9 fn do_with_self_and_world_inv(world: @IWorldDispatcher, self: @ContractState) -> felt252 { ^****************************************************************************************^ error: You cannot use `self` and `world` parameters together. - --> test_src/lib.cairo:132:9 + --> test_src/lib.cairo:142:9 fn do_with_ref_self_and_world_inv( ^********************************^ error: World parameter must be the first parameter. - --> test_src/lib.cairo:148:9 + --> test_src/lib.cairo:158:9 fn do_with_world_not_first(vec: Vec2, ref world: IWorldDispatcher) -> felt252 { ^*****************************************************************************^ error: You cannot use `world` and `#[generate_trait]` together. Use `self` instead. - --> test_src/lib.cairo:155:9 + --> test_src/lib.cairo:165:9 fn bad_func_using_generate(world: @IWorldDispatcher) -> felt252 { ^***************************************************************^ error: World parameter must be a snapshot if `ref` is not used. - --> test_src/lib.cairo:214:5 + --> test_src/lib.cairo:224:5 fn dojo_init( ^***********^ -error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ - error: Unsupported attribute. --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. --> test_src/lib.cairo:28:1 @@ -441,446 +451,455 @@ error: Unsupported attribute. ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:82:5 - #[my_attr] - ^********^ + --> test_src/lib.cairo:64:1 +#[dojo::contract] +^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:44:5 + --> test_src/lib.cairo:54:5 #[storage] ^********^ error: Unsupported attribute. - --> test_src/lib.cairo:50:5 + --> test_src/lib.cairo:60:5 #[storage] ^********^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:1:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:11:1 -#[dojo::contract] -^***************^ + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:18:1 + --> test_src/lib.cairo:28:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:28:1 + --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:56:5 + --> test_src/lib.cairo:66:5 component!(path: testcomponent1, storage: testcomponent1_storage, event: testcomponent1_event); ^*********************************************************************************************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:57:5 + --> test_src/lib.cairo:67:5 component!(path: testcomponent2, storage: testcomponent2_storage, event: testcomponent2_event); ^*********************************************************************************************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:54:1 + --> test_src/lib.cairo:64:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:116:5 + --> test_src/lib.cairo:126:5 #[abi(embed_v0)] ^**************^ error: Generated trait must have generic args matching the impl's generic params. - --> test_src/lib.cairo:154:29 - impl InternalImplBad of InternalUtils { - ^**************************^ + --> test_src/lib.cairo:163:5 + #[generate_trait] + ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:114:1 + --> test_src/lib.cairo:124:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:168:5 + --> test_src/lib.cairo:178:5 #[abi(embed_v0)] ^**************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:161:1 + --> test_src/lib.cairo:171:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:212:1 + --> test_src/lib.cairo:222:1 #[dojo::contract] ^***************^ error: Unknown inline item macro: 'component'. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ error: Unsupported attribute. - --> test_src/lib.cairo:229:1 + --> test_src/lib.cairo:239:1 #[dojo::contract] ^***************^ //! > expanded_cairo_code +#[dojo::contract(namespace: "My@Namespace")] +mod bad_namespace_format { + use traits::Into; + use dojo::world::Context; + + fn execute(ctx: Context, name: felt252) { + return (); + } +} #[starknet::component] mod testcomponent1 { @@ -900,12 +919,27 @@ mod testcomponent2 { use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'spawn' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "spawn" + } + fn selector(self: @ContractState) -> felt252 { + 2776321589048333240377325502911505147617911439383944762363370901236132332849 + } + + fn namespace(self: @ContractState) -> ByteArray { + "my_namespace" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 1685136890688416384941629523783652800960468745356230625531475538826800548713 + } + + fn tag(self: @ContractState) -> ByteArray { + "my_namespace-spawn" } } @@ -960,12 +994,27 @@ impl EventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'proxy' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "proxy" + } + fn selector(self: @ContractState) -> felt252 { + 379211399603323842291430789821178524592027629543381998047225121027704003915 + } + + fn namespace(self: @ContractState) -> ByteArray { + "my_namespace" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 1685136890688416384941629523783652800960468745356230625531475538826800548713 + } + + fn tag(self: @ContractState) -> ByteArray { + "my_namespace-proxy" } } @@ -1017,12 +1066,27 @@ impl EventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'ctxnamed' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "ctxnamed" + } + fn selector(self: @ContractState) -> felt252 { + 1120614286815912604239420768209466007446460277061516527925636408561239543041 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-ctxnamed" } } @@ -1077,12 +1141,27 @@ impl EventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'withevent' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "withevent" + } + fn selector(self: @ContractState) -> felt252 { + 2196275886623691942883456540767114081898043897719876113518403014973431884540 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-withevent" } } @@ -1138,12 +1217,27 @@ impl TestEventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'withcomponent' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "withcomponent" + } + fn selector(self: @ContractState) -> felt252 { + 999850881662666048155666650426666132968026605763740651763663703103974774091 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-withcomponent" } } @@ -1197,40 +1291,19 @@ impl EventDrop of core::traits::Drop::; #[starknet::interface] trait IFaultyTrait { - - #[my_attr] - fn do_with_attrs(self: @TContractState, p1: u8) -> u16; - + fn do_with_attrs(self: @TContractState, p1: u8) -> u16; } #[starknet::interface] trait INominalTrait { - fn do_no_param(self: @TContractState) -> felt252; - fn do_no_param_but_world(self: @TContractState) -> felt252; - fn do_no_param_but_world_ref(ref self: TContractState) -> felt252; - fn do_params_no_world(self: @TContractState, p1: felt252, p2: u8) -> felt252; - fn do_params_and_world(self: @TContractState, p2: u8) -> felt252; - fn do_params_and_world_ref(ref self: TContractState, p2: u8) -> felt252; - - fn do_with_self(self: @ContractState) -> felt252; - fn do_with_ref_self(ref self: ContractState) -> felt252; - + fn do_no_param(self: @TContractState) -> felt252;fn do_no_param_but_world(self: @TContractState) -> felt252;fn do_no_param_but_world_ref(ref self: TContractState) -> felt252;fn do_params_no_world(self: @TContractState, p1: felt252, p2: u8) -> felt252;fn do_params_and_world(self: @TContractState, p2: u8) -> felt252;fn do_params_and_world_ref(ref self: TContractState, p2: u8) -> felt252;fn do_with_self(self: @ContractState) -> felt252;fn do_with_ref_self(ref self: ContractState) -> felt252; } #[starknet::interface] trait IFaultyTrait { - fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252; - fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252; - fn do_with_self_and_world_inv(self: @TContractState, self: @ContractState) -> felt252; - fn do_with_ref_self_and_world_inv( -ref self: TContractState, ref self: ContractState - ) -> felt252; - fn do_with_several_world_dispatchers( -self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher - ) -> felt252; - fn do_with_world_not_named_world(self: @TContractState, another_world: @IWorldDispatcher) -> felt252; - fn do_with_world_not_first(self: @TContractState, vec: Vec2, ref world: IWorldDispatcher) -> felt252; - + fn do_with_self_and_world(self: @ContractState, world: @IWorldDispatcher) -> felt252;fn do_with_ref_self_and_world(ref self: ContractState, ref world: IWorldDispatcher) -> felt252;fn do_with_self_and_world_inv(self: @TContractState, self: @ContractState) -> felt252;fn do_with_ref_self_and_world_inv(ref self: TContractState, ref self: ContractState +) -> felt252;fn do_with_several_world_dispatchers(self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher +) -> felt252;fn do_with_world_not_named_world(self: @TContractState, another_world: @IWorldDispatcher) -> felt252;fn do_with_world_not_first(self: @TContractState, vec: Vec2, ref world: IWorldDispatcher) -> felt252; } #[starknet::contract] @@ -1239,12 +1312,27 @@ self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'MyFaultyContract' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "MyFaultyContract" + } + fn selector(self: @ContractState) -> felt252 { + 3439743807865759203015037013733809315384408083697880336790137144257764256358 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-MyFaultyContract" } } @@ -1259,52 +1347,19 @@ self: @TContractState, vec: Vec2, ref another_world: IWorldDispatcher impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; #[abi(embed_v0)] - impl TestFaultyImpl of IFaultyTrait { - fn do_with_self_and_world(self: @ContractState) -> felt252 { - 'land' - } - - fn do_with_ref_self_and_world( - ref self: ContractState ) -> felt252 { - 'land' - } - - fn do_with_self_and_world_inv(self: @ContractState, self: @ContractState) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_with_ref_self_and_world_inv( -ref self: ContractState, ref self: ContractState - ) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_with_several_world_dispatchers( -self: @ContractState, vec: Vec2, ref another_world: IWorldDispatcher - ) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_with_world_not_named_world(self: @ContractState, another_world: @IWorldDispatcher) -> felt252 { - 'land' - } - - fn do_with_world_not_first(self: @ContractState, vec: Vec2) -> felt252 { - 'land' - } - } - + impl TestFaultyImpl of IFaultyTrait {fn do_with_self_and_world(self: @ContractState) -> felt252 { 'land' +}fn do_with_ref_self_and_world( ref self: ContractState) -> felt252 { 'land' +}fn do_with_self_and_world_inv(self: @ContractState, self: @ContractState) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_with_ref_self_and_world_inv(ref self: ContractState, ref self: ContractState +) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_with_several_world_dispatchers(self: @ContractState, vec: Vec2, ref another_world: IWorldDispatcher +) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_with_world_not_named_world(self: @ContractState, another_world: @IWorldDispatcher) -> felt252 { 'land' +}fn do_with_world_not_first(self: @ContractState, vec: Vec2) -> felt252 { 'land' +}} #[generate_trait] - impl InternalImplBad of InternalUtils { - fn bad_func_using_generate(self: @ContractState) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - } - + impl InternalImplBad of InternalUtils {fn bad_func_using_generate(self: @ContractState) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}} #[starknet::interface] trait IDojoInit { fn dojo_init(self: @ContractState); @@ -1329,9 +1384,8 @@ let world = self.world_dispatcher.read(); #[substorage(v0)] upgradeable: dojo::components::upgradeable::upgradeable::Storage, } - trait InternalUtils{ - fn bad_func_using_generate(self: @ContractState) -> felt252; - } + trait InternalUtils{fn bad_func_using_generate(self: @ContractState) -> felt252; +} impl EventDrop of core::traits::Drop::; } @@ -1342,12 +1396,27 @@ impl EventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'MyNominalContract' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "MyNominalContract" + } + fn selector(self: @ContractState) -> felt252 { + 1172628497499445169993220559087829230676589931723677494032285307738203070578 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-MyNominalContract" } } @@ -1367,44 +1436,15 @@ impl EventDrop of core::traits::Drop::; } #[abi(embed_v0)] - impl TestNominalImpl of INominalTrait { - fn do_no_param(self: @ContractState) -> felt252 { - 'land' - } - - fn do_no_param_but_world(self: @ContractState) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_no_param_but_world_ref(ref self: ContractState) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_params_no_world(self: @ContractState, p1: felt252, p2: u8) -> felt252 { - 'land' - } - - fn do_params_and_world(self: @ContractState, p2: u8) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_params_and_world_ref(ref self: ContractState, p2: u8) -> felt252 { -let world = self.world_dispatcher.read(); - 'land' - } - - fn do_with_self(self: @ContractState) -> felt252 { - 'land' - } - - fn do_with_ref_self(ref self: ContractState) -> felt252 { - 'land' - } - } - + impl TestNominalImpl of INominalTrait {fn do_no_param(self: @ContractState) -> felt252 { 'land' +}fn do_no_param_but_world(self: @ContractState) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_no_param_but_world_ref(ref self: ContractState) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_params_no_world(self: @ContractState, p1: felt252, p2: u8) -> felt252 { 'land' +}fn do_params_and_world(self: @ContractState, p2: u8) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_params_and_world_ref(ref self: ContractState, p2: u8) -> felt252 {let world = self.world_dispatcher.read(); 'land' +}fn do_with_self(self: @ContractState) -> felt252 { 'land' +}fn do_with_ref_self(ref self: ContractState) -> felt252 { 'land' +}} #[generate_trait] impl ImplInternalNoContractState of InternalNoContractState { fn func1(world: IWorldDispatcher) -> felt252 { @@ -1451,12 +1491,27 @@ impl EventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'init_test' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "init_test" + } + fn selector(self: @ContractState) -> felt252 { + 1673722391095039242574232979635399085098867563460816803458086922970092209409 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-init_test" } } @@ -1470,31 +1525,23 @@ impl EventDrop of core::traits::Drop::; #[abi(embed_v0)] impl UpgradableImpl = dojo::components::upgradeable::upgradeable::UpgradableImpl; - - #[starknet::interface] - trait IDojoInit { - fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 + #[starknet::interface] + trait IDojoInit { + fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 ); - } - - #[abi(embed_v0)] - impl IDojoInitImpl of IDojoInit { - fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 -) { - let world = self.world_dispatcher.read(); - assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); - { - emit!( + } + + #[abi(embed_v0)] + impl IDojoInitImpl of IDojoInit { + fn dojo_init(self: @ContractState, actions_address: ContractAddress, actions_class: ClassHash, value: u8 +) {let world = self.world_dispatcher.read();assert(starknet::get_caller_address() == self.world().contract_address, 'Only world can init'); emit!( world, ContractInitialized { contract_address: actions_address, contract_class: actions_class, value } ); - } - - } - } - +} +} #[event] #[derive(Drop, starknet::Event)] enum Event { @@ -1517,12 +1564,27 @@ impl EventDrop of core::traits::Drop::; use dojo::world::IWorldDispatcher; use dojo::world::IWorldDispatcherTrait; use dojo::world::IWorldProvider; - use dojo::world::IDojoResourceProvider; + use dojo::contract::IContract; #[abi(embed_v0)] - impl DojoResourceProviderImpl of IDojoResourceProvider { - fn dojo_resource(self: @ContractState) -> felt252 { - 'no_init_test' + impl ContractImpl of IContract { + fn contract_name(self: @ContractState) -> ByteArray { + "no_init_test" + } + fn selector(self: @ContractState) -> felt252 { + 2188407785440294979090510634648735461326850740369373015349552249835679156474 + } + + fn namespace(self: @ContractState) -> ByteArray { + "dojo_plugin" + } + + fn namespace_selector(self: @ContractState) -> felt252 { + 3437408695301308226171664635441698996501144546809569617702850025816833723775 + } + + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-no_init_test" } } diff --git a/crates/dojo-lang/src/utils.rs b/crates/dojo-lang/src/utils.rs new file mode 100644 index 0000000000..d46f10a7b7 --- /dev/null +++ b/crates/dojo-lang/src/utils.rs @@ -0,0 +1,47 @@ +use std::fs; + +use cairo_lang_filesystem::ids::Directory; +use cairo_lang_syntax::node::db::SyntaxGroup; +use regex::Regex; +use toml::Table; + +/// Check if the provided name follows the format rules. +pub fn is_name_valid(name: &str) -> bool { + Regex::new(r"^[a-zA-Z0-9_]+$").unwrap().is_match(name) +} + +// parse the configuration file of the first crate to extract +// the main package Id (so the name field of the package section of the Scarb.toml file) +// TODO: Ask to Scarb team to expose this package Id information with the new macro system. +pub fn get_package_id(db: &dyn SyntaxGroup) -> Option { + let crates = db.crates(); + + if crates.is_empty() { + return Option::None; + } + + let configuration = match db.crate_config(crates[0]) { + Option::Some(cfg) => cfg, + Option::None => return Option::None, + }; + + if let Directory::Real(path) = configuration.root { + let config_path = path.parent().unwrap().join("Scarb.toml"); + let config_content = match fs::read_to_string(config_path) { + Ok(x) => x, + Err(_) => return Option::None, + }; + let config = match config_content.parse::() { + Ok(x) => x, + Err(_) => return Option::None, + }; + + if config.contains_key("package") + && config["package"].as_table().unwrap().contains_key("name") + { + return Some(config["package"]["name"].as_str().unwrap().to_string()); + }; + } + + Option::None +} diff --git a/crates/dojo-test-utils/build.rs b/crates/dojo-test-utils/build.rs index 17232238fe..44f01457b9 100644 --- a/crates/dojo-test-utils/build.rs +++ b/crates/dojo-test-utils/build.rs @@ -6,22 +6,27 @@ fn main() { use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; use dojo_lang::scarb_internal::compile_workspace; - use scarb::compiler::CompilerRepository; + use scarb::compiler::{CompilerRepository, Profile}; use scarb::core::{Config, TargetKind}; use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; use scarb_ui::Verbosity; - let project_paths = ["../../examples/spawn-and-move", "../torii/types-test"]; + let project_paths = [ + ("../../examples/spawn-and-move", Profile::DEV), + ("../torii/types-test", Profile::DEV), + ("../../examples/spawn-and-move", Profile::RELEASE), + ]; - project_paths.iter().for_each(|path| compile(path)); + project_paths.iter().for_each(|(path, profile)| compile(path, profile)); println!("cargo:rerun-if-changed=../../examples"); println!("cargo:rerun-if-changed=../torii/types-test"); println!("cargo:rerun-if-changed=../dojo-lang/src"); println!("cargo:rerun-if-changed=../../bin/sozo/src"); - fn compile(path: &str) { - let target_path = Utf8PathBuf::from_path_buf(format!("{}/target", path).into()).unwrap(); + fn compile(path: &str, profile: &Profile) { + let target_path = + Utf8PathBuf::from_path_buf(format!("{}/target/{}", path, profile).into()).unwrap(); if target_path.exists() { return; } @@ -41,6 +46,7 @@ fn main() { .ui_verbosity(Verbosity::Verbose) .log_filter_directive(env::var_os("SCARB_LOG")) .compilers(compilers) + .profile(profile.to_owned()) .cairo_plugins(cairo_plugins.into()) .build() .unwrap(); diff --git a/crates/dojo-test-utils/src/compiler.rs b/crates/dojo-test-utils/src/compiler.rs index a48ef13435..e355673982 100644 --- a/crates/dojo-test-utils/src/compiler.rs +++ b/crates/dojo-test-utils/src/compiler.rs @@ -8,7 +8,7 @@ use camino::{Utf8Path, Utf8PathBuf}; use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; use dojo_lang::scarb_internal::{compile_workspace, CompileInfo}; -use scarb::compiler::{CompilationUnit, CompilerRepository}; +use scarb::compiler::{CompilationUnit, CompilerRepository, Profile}; use scarb::core::{Config, TargetKind}; use scarb::ops; use scarb::ops::{CompileOpts, FeaturesOpts, FeaturesSelector}; @@ -20,7 +20,11 @@ use toml::{Table, Value}; /// # Returns /// /// A [`Config`] object loaded from the spawn-and-moves Scarb.toml file. -pub fn copy_tmp_config(source_project_dir: &Utf8PathBuf, dojo_core_path: &Utf8PathBuf) -> Config { +pub fn copy_tmp_config( + source_project_dir: &Utf8PathBuf, + dojo_core_path: &Utf8PathBuf, + profile: Profile, +) -> Config { let temp_project_dir = Utf8PathBuf::from( assert_fs::TempDir::new().unwrap().to_path_buf().to_string_lossy().to_string(), ); @@ -30,7 +34,8 @@ pub fn copy_tmp_config(source_project_dir: &Utf8PathBuf, dojo_core_path: &Utf8Pa // Copy all the files, including manifests. As we will not re-build, mostly only migrate. copy_project_temp(source_project_dir, &temp_project_dir, dojo_core_path, &[]).unwrap(); - build_test_config(&temp_project_path).unwrap_or_else(|c| panic!("Error loading config: {c:?}")) + build_test_config(&temp_project_path, profile) + .unwrap_or_else(|c| panic!("Error loading config: {c:?}")) } /// Copies a project to a new location, excluding the manifests @@ -48,6 +53,7 @@ pub fn copy_build_project_temp( source_project_path: &str, dojo_core_path: &str, do_build: bool, + profile: Profile, ) -> (Utf8PathBuf, Config, Option) { let source_project_dir = Utf8PathBuf::from(source_project_path).parent().unwrap().to_path_buf(); @@ -64,7 +70,7 @@ pub fn copy_build_project_temp( copy_project_temp(&source_project_dir, &temp_project_dir, &dojo_core_path, &ignore_dirs) .unwrap(); - let config = build_test_config(&temp_project_path).unwrap(); + let config = build_test_config(&temp_project_path, profile).unwrap(); let features_opts = FeaturesOpts { features: FeaturesSelector::AllFeatures, no_default_features: false }; @@ -165,7 +171,7 @@ pub fn copy_project_temp( /// # Arguments /// /// * `path` - The path to the Scarb.toml file to build the config for. -pub fn build_test_config(path: &str) -> anyhow::Result { +pub fn build_test_config(path: &str, profile: Profile) -> anyhow::Result { let mut compilers = CompilerRepository::empty(); compilers.add(Box::new(DojoCompiler)).unwrap(); @@ -180,12 +186,15 @@ pub fn build_test_config(path: &str) -> anyhow::Result { .ui_verbosity(Verbosity::Verbose) .log_filter_directive(env::var_os("SCARB_LOG")) .compilers(compilers) + .profile(profile) .cairo_plugins(cairo_plugins.into()) .build() } pub fn corelib() -> PathBuf { - let config = build_test_config("./src/manifest_test_data/spawn-and-move/Scarb.toml").unwrap(); + let config = + build_test_config("./src/manifest_test_data/spawn-and-move/Scarb.toml", Profile::DEV) + .unwrap(); let ws = ops::read_workspace(config.manifest_path(), &config).unwrap(); let resolve = ops::resolve_workspace(&ws).unwrap(); diff --git a/crates/dojo-test-utils/src/migration.rs b/crates/dojo-test-utils/src/migration.rs index c57f4f75b3..fff72ec87c 100644 --- a/crates/dojo-test-utils/src/migration.rs +++ b/crates/dojo-test-utils/src/migration.rs @@ -11,6 +11,7 @@ pub fn prepare_migration( manifest_dir: Utf8PathBuf, target_dir: Utf8PathBuf, skip_migration: Option>, + default_namespace: &str, ) -> Result { // In testing, profile name is always dev. let profile_name = "dev"; @@ -21,18 +22,18 @@ pub fn prepare_migration( .unwrap(); if let Some(skip_manifests) = skip_migration { - manifest.remove_items(skip_manifests); + manifest.remove_tags(skip_manifests); } - let overlay_manifest = OverlayManifest::load_from_path( - &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), - ) - .unwrap(); + let overlay_dir = manifest_dir.join(OVERLAYS_DIR).join(profile_name); - manifest.merge(overlay_manifest); + if overlay_dir.exists() { + let overlay_manifest = OverlayManifest::load_from_path(&overlay_dir, &manifest).unwrap(); + manifest.merge(overlay_manifest); + } let mut world = WorldDiff::compute(manifest, None); - world.update_order().unwrap(); + world.update_order(default_namespace).unwrap(); let mut strat = prepare_for_migration(None, felt!("0x12345"), &target_dir, world).unwrap(); strat.resolve_variable(strat.world_address().unwrap()).unwrap(); @@ -45,6 +46,7 @@ pub fn prepare_migration_with_world_and_seed( target_dir: Utf8PathBuf, world_address: Option, seed: &str, + default_namespace: &str, ) -> Result { // In testing, profile name is always dev. let profile_name = "dev"; @@ -54,15 +56,14 @@ pub fn prepare_migration_with_world_and_seed( ) .unwrap(); - let overlay_manifest = OverlayManifest::load_from_path( - &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), - ) - .unwrap(); - - manifest.merge(overlay_manifest); + let overlay_dir = manifest_dir.join(OVERLAYS_DIR).join(profile_name); + if overlay_dir.exists() { + let overlay_manifest = OverlayManifest::load_from_path(&overlay_dir, &manifest).unwrap(); + manifest.merge(overlay_manifest); + } let mut world = WorldDiff::compute(manifest, None); - world.update_order().unwrap(); + world.update_order(default_namespace).unwrap(); let seed = cairo_short_string_to_felt(seed).unwrap(); prepare_for_migration(world_address, seed, &target_dir, world) diff --git a/crates/dojo-types/src/lib.rs b/crates/dojo-types/src/lib.rs index 31b65f3332..3ced1a5883 100644 --- a/crates/dojo-types/src/lib.rs +++ b/crates/dojo-types/src/lib.rs @@ -16,12 +16,12 @@ pub mod system; pub struct WorldMetadata { pub world_address: Felt, pub world_class_hash: Felt, - pub models: HashMap, + pub models: HashMap, } impl WorldMetadata { /// Retrieves the metadata of a model. - pub fn model(&self, name: impl AsRef) -> Option<&ModelMetadata> { - self.models.get(name.as_ref()) + pub fn model(&self, model: &Felt) -> Option<&ModelMetadata> { + self.models.get(model) } } diff --git a/crates/dojo-types/src/schema.rs b/crates/dojo-types/src/schema.rs index 162ce295c1..a9a15b5969 100644 --- a/crates/dojo-types/src/schema.rs +++ b/crates/dojo-types/src/schema.rs @@ -27,6 +27,7 @@ impl Member { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ModelMetadata { pub schema: Ty, + pub namespace: String, pub name: String, pub packed_size: u32, pub unpacked_size: u32, diff --git a/crates/dojo-world/Cargo.toml b/crates/dojo-world/Cargo.toml index 3c440ef24d..0dd118523f 100644 --- a/crates/dojo-world/Cargo.toml +++ b/crates/dojo-world/Cargo.toml @@ -35,6 +35,7 @@ scarb = { workspace = true, optional = true } tokio = { version = "1.32.0", features = [ "time" ], default-features = false, optional = true } toml.workspace = true url = { workspace = true, optional = true } +walkdir = "2.5.0" [dev-dependencies] assert_fs.workspace = true @@ -48,6 +49,6 @@ tokio.workspace = true [features] contracts = [ "dep:dojo-types", "dep:http", "dep:num-traits" ] -manifest = [ "contracts", "dep:dojo-types", "dep:url" ] +manifest = [ "contracts", "dep:dojo-types", "dep:url", "dep:scarb" ] metadata = [ "dep:ipfs-api-backend-hyper", "dep:scarb", "dep:url" ] -migration = [ "dep:tokio" ] +migration = [ "dep:tokio", "dep:scarb" ] diff --git a/crates/dojo-world/src/contracts/abi/world.rs b/crates/dojo-world/src/contracts/abi/world.rs index 4f9016025e..f681f1ab97 100644 --- a/crates/dojo-world/src/contracts/abi/world.rs +++ b/crates/dojo-world/src/contracts/abi/world.rs @@ -200,6 +200,18 @@ abigen!( "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -407,7 +419,7 @@ abigen!( "name": "is_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -427,7 +439,7 @@ abigen!( "name": "grant_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -443,7 +455,7 @@ abigen!( "name": "revoke_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -453,6 +465,66 @@ abigen!( ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "can_write_resource", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_model", + "inputs": [ + { + "name": "model_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_namespace", + "inputs": [ + { + "name": "namespace_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" } ] }, @@ -698,6 +770,16 @@ abigen!( "name": "address", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" } ] }, @@ -747,6 +829,23 @@ abigen!( } ] }, + { + "type": "event", + "name": "dojo::world::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world::ModelRegistered", @@ -757,6 +856,11 @@ abigen!( "type": "core::byte_array::ByteArray", "kind": "data" }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", @@ -824,7 +928,7 @@ abigen!( "kind": "struct", "members": [ { - "name": "model", + "name": "resource", "type": "core::felt252", "kind": "data" }, @@ -962,6 +1066,11 @@ abigen!( "type": "dojo::world::world::MetadataUpdate", "kind": "nested" }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world::NamespaceRegistered", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", diff --git a/crates/dojo-world/src/contracts/mod.rs b/crates/dojo-world/src/contracts/mod.rs index 9174da838a..d70cf4fd80 100644 --- a/crates/dojo-world/src/contracts/mod.rs +++ b/crates/dojo-world/src/contracts/mod.rs @@ -1,6 +1,7 @@ pub mod abi; pub mod cairo_utils; pub mod model; +pub mod naming; pub mod world; pub use world::{WorldContract, WorldContractReader}; diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs index 902bf4c558..64182c8dba 100644 --- a/crates/dojo-world/src/contracts/model.rs +++ b/crates/dojo-world/src/contracts/model.rs @@ -8,12 +8,13 @@ use dojo_types::primitive::{Primitive, PrimitiveError}; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use starknet::core::types::Felt; use starknet::core::utils::{ - cairo_short_string_to_felt, get_selector_from_name, parse_cairo_short_string, - CairoShortStringToFeltError, NonAsciiNameError, ParseCairoShortStringError, + cairo_short_string_to_felt, parse_cairo_short_string, CairoShortStringToFeltError, + NonAsciiNameError, ParseCairoShortStringError, }; use starknet::providers::{Provider, ProviderError}; use super::abi::world::Layout; +use super::naming; use crate::contracts::WorldContractReader; #[cfg(test)] @@ -46,15 +47,16 @@ pub enum ModelError { Packing(#[from] PackingError), #[error(transparent)] Cainome(#[from] CainomeError), + #[error("{0}")] + TagError(String), } // TODO: to update to match with new model interface #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] pub trait ModelReader { - // TODO: kept for compatibility but should be removed - // because it returns the model name hash and not the model name itself. - fn name(&self) -> String; + fn namespace(&self) -> &str; + fn name(&self) -> &str; fn selector(&self) -> Felt; fn class_hash(&self) -> Felt; fn contract_address(&self) -> Felt; @@ -65,8 +67,12 @@ pub trait ModelReader { } pub struct ModelRPCReader<'a, P: Provider + Sync + Send> { - /// The name of the model - name: Felt, + /// Namespace of the model + namespace: String, + /// Name of the model + name: String, + /// The selector of the model + selector: Felt, /// The class hash of the model class_hash: Felt, /// The contract address of the model @@ -82,13 +88,14 @@ where P: Provider + Sync + Send, { pub async fn new( + namespace: &str, name: &str, world: &'a WorldContractReader

, ) -> Result, ModelError> { - let name = get_selector_from_name(name)?; + let model_selector = naming::compute_model_selector_from_names(namespace, name); let (class_hash, contract_address) = - world.model(&name).block_id(world.block_id).call().await?; + world.model(&model_selector).block_id(world.block_id).call().await?; // World Cairo contract won't raise an error in case of unknown/unregistered // model so raise an error here in case of zero address. @@ -99,10 +106,12 @@ where let model_reader = ModelContractReader::new(contract_address.into(), world.provider()); Ok(Self { + namespace: namespace.into(), + name: name.into(), world_reader: world, class_hash: class_hash.into(), contract_address: contract_address.into(), - name, + selector: model_selector, model_reader, }) } @@ -137,12 +146,16 @@ impl<'a, P> ModelReader for ModelRPCReader<'a, P> where P: Provider + Sync + Send, { - fn name(&self) -> String { - self.name.to_string() + fn namespace(&self) -> &str { + &self.namespace + } + + fn name(&self) -> &str { + &self.name } fn selector(&self) -> Felt { - self.name + self.selector } fn class_hash(&self) -> Felt { diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 2fd460b729..5fa132f905 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -3,6 +3,7 @@ use dojo_test_utils::compiler; use dojo_types::primitive::Primitive; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use starknet::accounts::ConnectedAccount; use starknet::macros::felt; @@ -20,6 +21,7 @@ async fn test_model() { let config = compiler::copy_tmp_config( &Utf8PathBuf::from("../../examples/spawn-and-move"), &Utf8PathBuf::from("../dojo-core"), + Profile::DEV, ); let manifest_dir = config.manifest_path().parent().unwrap(); @@ -29,12 +31,19 @@ async fn test_model() { let dojo_metadata = dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); - let world_address = - deploy_world(&runner, &manifest_dir.into(), &target_dir, dojo_metadata.skip_migration) - .await; + let default_namespace = ws.current_package().unwrap().id.name.to_string(); + + let world_address = deploy_world( + &runner, + &manifest_dir.into(), + &target_dir, + dojo_metadata.skip_migration, + &default_namespace, + ) + .await; let world = WorldContractReader::new(world_address, provider); - let position = world.model_reader("Position").await.unwrap(); + let position = world.model_reader("dojo_examples", "Position").await.unwrap(); let schema = position.schema().await.unwrap(); assert_eq!( @@ -72,10 +81,10 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x027942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff") + felt!("0x059e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34") ); - let moves = world.model_reader("Moves").await.unwrap(); + let moves = world.model_reader("dojo_examples", "Moves").await.unwrap(); let schema = moves.schema().await.unwrap(); assert_eq!( diff --git a/crates/dojo-world/src/contracts/naming.rs b/crates/dojo-world/src/contracts/naming.rs new file mode 100644 index 0000000000..5f9141a323 --- /dev/null +++ b/crates/dojo-world/src/contracts/naming.rs @@ -0,0 +1,146 @@ +use anyhow::{anyhow, Result}; +use cainome::cairo_serde::{ByteArray, CairoSerde}; +use starknet::core::types::Felt; +use starknet_crypto::poseidon_hash_many; + +pub const CONTRACT_NAME_SEPARATOR: &str = "::"; +pub const TAG_SEPARATOR: char = '-'; +pub const SELECTOR_CHUNK_SIZE: usize = 8; + +pub fn capitalize(s: &str) -> String { + let mut c = s.chars(); + match c.next() { + None => String::new(), + Some(f) => f.to_uppercase().collect::() + c.as_str(), + } +} + +pub fn get_name_from_tag(tag: &str) -> String { + let parts: Vec<&str> = tag.split(TAG_SEPARATOR).collect(); + parts.last().unwrap().to_string() +} + +pub fn get_namespace_from_tag(tag: &str) -> String { + let parts: Vec<&str> = tag.split(TAG_SEPARATOR).collect(); + parts.first().unwrap().to_string() +} + +pub fn get_tag(namespace: &str, name: &str) -> String { + format!("{namespace}{TAG_SEPARATOR}{name}") +} + +/// Get the namespace and the name of a world element from its tag. +pub fn split_tag(tag: &str) -> Result<(String, String)> { + let parts: Vec<&str> = tag.split(TAG_SEPARATOR).collect(); + match parts.len() { + 2 => Ok((parts[0].to_string(), parts[1].to_string())), + _ => Err(anyhow!( + "Unexpected tag. Expected format: {TAG_SEPARATOR} or " + )), + } +} + +pub fn ensure_namespace(tag: &str, default_namespace: &str) -> String { + if tag.contains(TAG_SEPARATOR) { tag.to_string() } else { get_tag(default_namespace, tag) } +} + +pub fn get_filename_from_tag(tag: &str) -> String { + if [format!("dojo{TAG_SEPARATOR}world").as_str(), format!("dojo{TAG_SEPARATOR}base").as_str()] + .contains(&tag) + { + return tag.to_string(); + } + + let mut selector = format!("{:x}", compute_model_selector_from_tag(tag)); + selector.truncate(SELECTOR_CHUNK_SIZE); + + format!("{tag}{TAG_SEPARATOR}{selector}") +} + +pub fn compute_bytearray_hash(namespace: &str) -> Felt { + let ba = ByteArray::from_string(namespace).unwrap(); + poseidon_hash_many(&ByteArray::cairo_serialize(&ba)) +} + +pub fn compute_model_selector_from_tag(tag: &str) -> Felt { + let (namespace, name) = split_tag(tag).unwrap(); + compute_model_selector_from_names(&namespace, &name) +} + +pub fn compute_model_selector_from_names(namespace: &str, model_name: &str) -> Felt { + compute_model_selector_from_hash( + compute_bytearray_hash(namespace), + compute_bytearray_hash(model_name), + ) +} + +pub fn compute_model_selector_from_hash(namespace_hash: Felt, model_hash: Felt) -> Felt { + poseidon_hash_many(&[namespace_hash, model_hash]) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_split_tag_success() { + assert_eq!( + split_tag("namespace-name").unwrap(), + ("namespace".to_string(), "name".to_string()) + ); + } + + #[test] + fn test_split_tag_invalid_chars() { + assert!(split_tag("invalid:namespace").is_err()); + assert!(split_tag("invalid namespace").is_err()); + assert!(split_tag("inv-alid-namespace").is_err()); + } + + #[test] + fn test_ensure_namespace_success() { + assert_eq!(ensure_namespace("namespace-name", "default"), "namespace-name"); + assert_eq!(ensure_namespace("name", "default"), "default-name"); + } + + #[test] + fn test_get_filename_from_tag_success() { + assert_eq!(get_filename_from_tag("dojo-world"), "dojo-world"); + assert_eq!(get_filename_from_tag("dojo-base"), "dojo-base"); + + let tag = "namespace-model"; + let filename = get_filename_from_tag(tag); + assert!(filename.starts_with(tag)); + assert_eq!(filename.split(TAG_SEPARATOR).count(), 3); + } + + #[test] + fn test_compute_bytearray_hash_success() { + let hash = compute_bytearray_hash("test"); + assert_eq!( + hash, + Felt::from_hex("0x2ca96bf6e71766195fa290b97c50f073b218d4e8c6948c899e3b07d754d6760") + .unwrap() + ); + } + + #[test] + fn test_compute_model_selector_from_tag_success() { + let selector = compute_model_selector_from_tag("namespace-model"); + assert_eq!( + selector, + Felt::from_hex("0x6cfe11a346c1bb31de8f454d65880454952e22d9adc2374fe67734196e0cbcb") + .unwrap() + ); + } + + #[test] + fn test_compute_model_selector_from_names_success() { + let selector = compute_model_selector_from_names("namespace", "model"); + assert_eq!( + selector, + Felt::from_hex("0x6cfe11a346c1bb31de8f454d65880454952e22d9adc2374fe67734196e0cbcb") + .unwrap() + ); + } +} diff --git a/crates/dojo-world/src/contracts/world.rs b/crates/dojo-world/src/contracts/world.rs index 8a639c421c..4b017ef5ee 100644 --- a/crates/dojo-world/src/contracts/world.rs +++ b/crates/dojo-world/src/contracts/world.rs @@ -7,6 +7,7 @@ pub use abigen::world::{ use starknet::providers::Provider; use super::model::{ModelError, ModelRPCReader}; +use super::naming; #[cfg(test)] #[path = "world_test.rs"] @@ -22,7 +23,20 @@ impl

WorldContractReader

where P: Provider + Sync + Send, { - pub async fn model_reader(&self, name: &str) -> Result, ModelError> { - ModelRPCReader::new(name, self).await + pub async fn model_reader_with_tag( + &self, + tag: &str, + ) -> Result, ModelError> { + let (namespace, name) = + naming::split_tag(tag).map_err(|e| ModelError::TagError(e.to_string()))?; + ModelRPCReader::new(&namespace, &name, self).await + } + + pub async fn model_reader( + &self, + namespace: &str, + name: &str, + ) -> Result, ModelError> { + ModelRPCReader::new(namespace, name, self).await } } diff --git a/crates/dojo-world/src/contracts/world_test.rs b/crates/dojo-world/src/contracts/world_test.rs index 91ee527423..387ab779f6 100644 --- a/crates/dojo-world/src/contracts/world_test.rs +++ b/crates/dojo-world/src/contracts/world_test.rs @@ -3,6 +3,7 @@ use std::time::Duration; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag, Felt}; @@ -12,6 +13,7 @@ use crate::metadata::dojo_metadata_from_workspace; use crate::migration::strategy::prepare_for_migration; use crate::migration::world::WorldDiff; use crate::migration::{Declarable, Deployable, TxnConfig}; +use crate::utils::TransactionExt; #[tokio::test(flavor = "multi_thread")] async fn test_world_contract_reader() { @@ -19,7 +21,11 @@ async fn test_world_contract_reader() { let config = compiler::copy_tmp_config( &Utf8PathBuf::from("../../examples/spawn-and-move"), &Utf8PathBuf::from("../dojo-core"), + Profile::DEV, ); + let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); + + let default_namespace = ws.current_package().unwrap().id.name.to_string(); let manifest_dir = config.manifest_path().parent().unwrap(); let target_dir = manifest_dir.join("target").join("dev"); @@ -38,6 +44,7 @@ async fn test_world_contract_reader() { &manifest_dir.to_path_buf(), &target_dir.to_path_buf(), dojo_metadata.skip_migration, + &default_namespace, ) .await; @@ -49,6 +56,7 @@ pub async fn deploy_world( manifest_dir: &Utf8PathBuf, target_dir: &Utf8PathBuf, skip_migration: Option>, + default_namespace: &str, ) -> Felt { // Dev profile is used by default for testing: let profile_name = "dev"; @@ -59,18 +67,17 @@ pub async fn deploy_world( .unwrap(); if let Some(skip_manifests) = skip_migration { - manifest.remove_items(skip_manifests); + manifest.remove_tags(skip_manifests); } - let overlay_manifest = OverlayManifest::load_from_path( - &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), - ) - .unwrap(); - - manifest.merge(overlay_manifest); + let overlay_dir = manifest_dir.join(OVERLAYS_DIR).join(profile_name); + if overlay_dir.exists() { + let overlay_manifest = OverlayManifest::load_from_path(&overlay_dir, &manifest).unwrap(); + manifest.merge(overlay_manifest); + } let mut world = WorldDiff::compute(manifest.clone(), None); - world.update_order().unwrap(); + world.update_order(default_namespace).unwrap(); let account = sequencer.account(0); @@ -79,10 +86,7 @@ pub async fn deploy_world( strategy.resolve_variable(strategy.world_address().unwrap()).unwrap(); let base_class_hash = - strategy.base.unwrap().declare(&account, &TxnConfig::default()).await.unwrap().class_hash; - - // wait for the tx to be mined - tokio::time::sleep(Duration::from_millis(250)).await; + strategy.base.unwrap().declare(&account, &TxnConfig::init_wait()).await.unwrap().class_hash; let world_address = strategy .world @@ -91,7 +95,7 @@ pub async fn deploy_world( manifest.clone().world.inner.class_hash, vec![base_class_hash], &account, - &TxnConfig::default(), + &TxnConfig::init_wait(), ) .await .unwrap() @@ -99,24 +103,28 @@ pub async fn deploy_world( let mut declare_output = vec![]; for model in strategy.models { - let res = model.declare(&account, &TxnConfig::default()).await.unwrap(); + let res = model.declare(&account, &TxnConfig::init_wait()).await.unwrap(); declare_output.push(res); } - // wait for the tx to be mined - tokio::time::sleep(Duration::from_millis(250)).await; - let world = WorldContract::new(world_address, &account); + world + .register_namespace(&cainome::cairo_serde::ByteArray::from_string("dojo_examples").unwrap()) + .send_with_cfg(&TxnConfig::init_wait()) + .await + .unwrap(); + + // Wondering why the `init_wait` is not enough and causes a nonce error. + // May be to a delay to create the block as we are in instant mining. + tokio::time::sleep(Duration::from_millis(2000)).await; + let calls = declare_output .iter() .map(|o| world.register_model_getcall(&o.class_hash.into())) .collect::>(); - let _ = account.execute_v1(calls).send().await.unwrap(); - - // wait for the tx to be mined - tokio::time::sleep(Duration::from_millis(250)).await; + let _ = account.execute_v1(calls).send_with_cfg(&TxnConfig::init_wait()).await.unwrap(); for contract in strategy.contracts { let declare_res = contract.declare(&account, &TxnConfig::default()).await.unwrap(); @@ -126,15 +134,12 @@ pub async fn deploy_world( declare_res.class_hash, base_class_hash, &account, - &TxnConfig::default(), + &TxnConfig::init_wait(), &contract.diff.init_calldata, ) .await .unwrap(); } - // wait for the tx to be mined - tokio::time::sleep(Duration::from_millis(250)).await; - world_address } diff --git a/crates/dojo-world/src/manifest/manifest_test.rs b/crates/dojo-world/src/manifest/manifest_test.rs index 67b541796f..a26e60af08 100644 --- a/crates/dojo-world/src/manifest/manifest_test.rs +++ b/crates/dojo-world/src/manifest/manifest_test.rs @@ -5,8 +5,8 @@ use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::rpc::MockJsonRpcTransport; use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use serde_json::json; -use smol_str::SmolStr; use starknet::accounts::ConnectedAccount; use starknet::core::types::contract::AbiEntry; use starknet::core::types::{EmittedEvent, Felt}; @@ -17,6 +17,7 @@ use super::{ parse_contracts_events, AbiFormat, BaseManifest, DojoContract, DojoModel, OverlayDojoContract, OverlayManifest, }; +use crate::contracts::naming::{get_filename_from_tag, get_tag}; use crate::contracts::world::test::deploy_world; use crate::manifest::{ parse_models_events, AbstractManifestError, DeploymentManifest, Manifest, OverlayClass, @@ -55,57 +56,39 @@ async fn manifest_from_remote_throw_error_on_not_deployed() { fn parse_registered_model_events() { let expected_models = vec![ Manifest::new( - DojoModel { class_hash: felt!("0x5555"), ..Default::default() }, - "Model1".into(), + DojoModel { + tag: get_tag("ns", "modelA"), + class_hash: felt!("0x5555"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("ns", "modelA")), ), Manifest::new( - DojoModel { class_hash: felt!("0x6666"), ..Default::default() }, - "Model2".into(), + DojoModel { + tag: get_tag("ns", "modelB"), + class_hash: felt!("0x6666"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("ns", "modelB")), ), ]; - let selector = selector!("ModelRegistered"); - let events = vec![ - EmittedEvent { - data: { - let mut data = - ByteArray::cairo_serialize(&ByteArray::from_string("Model1").unwrap()); - data.extend(vec![felt!("0x5555"), felt!("0xbeef"), felt!("0xa1"), felt!("0")]); - data - }, - keys: vec![selector], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: { - let mut data = - ByteArray::cairo_serialize(&ByteArray::from_string("Model1").unwrap()); - data.extend(vec![felt!("0xbeef"), felt!("0"), felt!("0xa1"), felt!("0xa1")]); - data - }, - keys: vec![selector], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: { - let mut data = - ByteArray::cairo_serialize(&ByteArray::from_string("Model2").unwrap()); - data.extend(vec![felt!("0x6666"), felt!("0"), felt!("0xa3"), felt!("0")]); - data - }, - keys: vec![selector], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, + build_model_registered_event( + vec![felt!("0x5555"), felt!("0xbeef"), felt!("0xa1"), felt!("0")], + "ns", + "modelA", + ), + build_model_registered_event( + vec![felt!("0xbeef"), felt!("0"), felt!("0xa1"), felt!("0xa1")], + "ns", + "modelA", + ), + build_model_registered_event( + vec![felt!("0x6666"), felt!("0"), felt!("0xa3"), felt!("0")], + "ns", + "modelB", + ), ]; let actual_models = parse_models_events(events); @@ -122,53 +105,35 @@ fn parse_deployed_contracts_events_without_upgrade() { DojoContract { class_hash: felt!("0x1"), address: Some(felt!("0x123")), + tag: get_tag("ns1", "c1"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns1", "c1")), ), Manifest::new( DojoContract { class_hash: felt!("0x2"), address: Some(felt!("0x456")), + tag: get_tag("ns2", "c2"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns2", "c2")), ), Manifest::new( DojoContract { class_hash: felt!("0x3"), address: Some(felt!("0x789")), + tag: get_tag("ns3", "c3"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns3", "c3")), ), ]; let events = vec![ - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, + build_deploy_event(vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], "ns1", "c1"), + build_deploy_event(vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], "ns2", "c2"), + build_deploy_event(vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], "ns3", "c3"), ]; let actual_contracts = parse_contracts_events(events, vec![]); @@ -182,53 +147,35 @@ fn parse_deployed_contracts_events_with_upgrade() { DojoContract { class_hash: felt!("0x69"), address: Some(felt!("0x123")), + tag: get_tag("ns1", "c1"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns1", "c1")), ), Manifest::new( DojoContract { class_hash: felt!("0x2"), address: Some(felt!("0x456")), + tag: get_tag("ns2", "c2"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns2", "c2")), ), Manifest::new( DojoContract { class_hash: felt!("0x88"), address: Some(felt!("0x789")), + tag: get_tag("ns3", "c3"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns3", "c3")), ), ]; let deployed_events = vec![ - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, + build_deploy_event(vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], "ns1", "c1"), + build_deploy_event(vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], "ns2", "c2"), + build_deploy_event(vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], "ns3", "c3"), ]; let upgrade_events = vec![ @@ -277,53 +224,35 @@ fn events_without_block_number_arent_parsed() { DojoContract { class_hash: felt!("0x66"), address: Some(felt!("0x123")), + tag: get_tag("ns1", "c1"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns1", "c1")), ), Manifest::new( DojoContract { class_hash: felt!("0x2"), address: Some(felt!("0x456")), + tag: get_tag("ns2", "c2"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns2", "c2")), ), Manifest::new( DojoContract { class_hash: felt!("0x3"), address: Some(felt!("0x789")), + tag: get_tag("ns3", "c3"), ..Default::default() }, - "".into(), + get_filename_from_tag(&get_tag("ns3", "c3")), ), ]; let deployed_events = vec![ - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, - EmittedEvent { - data: vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], - keys: vec![], - block_hash: Default::default(), - from_address: Default::default(), - block_number: Default::default(), - transaction_hash: Default::default(), - }, + build_deploy_event(vec![felt!("0x0"), felt!("0x1"), felt!("0x123")], "ns1", "c1"), + build_deploy_event(vec![felt!("0x0"), felt!("0x2"), felt!("0x456")], "ns2", "c2"), + build_deploy_event(vec![felt!("0x0"), felt!("0x3"), felt!("0x789")], "ns3", "c3"), ]; // only the first upgrade event has a block number and is parsed @@ -381,7 +310,7 @@ fn fetch_remote_manifest() { // Build a completely new project in it's own directory. let (temp_project_dir, config, _) = - compiler::copy_build_project_temp(source_project, dojo_core_path, true); + compiler::copy_build_project_temp(source_project, dojo_core_path, true, Profile::DEV); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); let dojo_metadata = @@ -389,12 +318,15 @@ fn fetch_remote_manifest() { let artifacts_path = temp_project_dir.join(format!("target/{profile_name}")); + let default_namespace = ws.current_package().unwrap().id.name.to_string(); + let world_address = config.tokio_handle().block_on(async { deploy_world( &runner, &temp_project_dir, &artifacts_path, dojo_metadata.skip_migration.clone(), + &default_namespace, ) .await }); @@ -405,15 +337,16 @@ fn fetch_remote_manifest() { .unwrap(); if let Some(skip_manifests) = dojo_metadata.skip_migration { - local_manifest.remove_items(skip_manifests); + local_manifest.remove_tags(skip_manifests); } - let overlay_manifest = OverlayManifest::load_from_path( - &temp_project_dir.join(MANIFESTS_DIR).join(profile_name).join(OVERLAYS_DIR), - ) - .unwrap(); + let overlay_dir = temp_project_dir.join(OVERLAYS_DIR).join(profile_name); + if overlay_dir.exists() { + let overlay_manifest = + OverlayManifest::load_from_path(&overlay_dir, &local_manifest).unwrap(); - local_manifest.merge(overlay_manifest); + local_manifest.merge(overlay_manifest); + } let remote_manifest = config.tokio_handle().block_on(async { DeploymentManifest::load_from_remote(provider, world_address).await.unwrap() @@ -497,46 +430,46 @@ fn test_abi_format_load_abi_string() -> Result<(), Box> { fn overlay_merge_for_contract_and_model_work_as_expected() { let other = OverlayManifest { contracts: vec![ - OverlayDojoContract { name: "othercontract1".into(), ..Default::default() }, - OverlayDojoContract { name: "othercontract2".into(), ..Default::default() }, - OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:othercontract1".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:othercontract2".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:existingcontract".into(), ..Default::default() }, ], models: vec![ - OverlayDojoModel { name: "othermodel1".into(), ..Default::default() }, - OverlayDojoModel { name: "othermodel2".into(), ..Default::default() }, - OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:othermodel1".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:othermodel2".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:existingmodel".into(), ..Default::default() }, ], ..Default::default() }; let mut current = OverlayManifest { contracts: vec![ - OverlayDojoContract { name: "currentcontract1".into(), ..Default::default() }, - OverlayDojoContract { name: "currentcontract2".into(), ..Default::default() }, - OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:currentcontract1".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:currentcontract2".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:existingcontract".into(), ..Default::default() }, ], models: vec![ - OverlayDojoModel { name: "currentmodel1".into(), ..Default::default() }, - OverlayDojoModel { name: "currentmodel2".into(), ..Default::default() }, - OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:currentmodel1".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:currentmodel2".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:existingmodel".into(), ..Default::default() }, ], ..Default::default() }; let expected = OverlayManifest { contracts: vec![ - OverlayDojoContract { name: "currentcontract1".into(), ..Default::default() }, - OverlayDojoContract { name: "currentcontract2".into(), ..Default::default() }, - OverlayDojoContract { name: "existingcontract".into(), ..Default::default() }, - OverlayDojoContract { name: "othercontract1".into(), ..Default::default() }, - OverlayDojoContract { name: "othercontract2".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:currentcontract1".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:currentcontract2".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:existingcontract".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:othercontract1".into(), ..Default::default() }, + OverlayDojoContract { tag: "ns:othercontract2".into(), ..Default::default() }, ], models: vec![ - OverlayDojoModel { name: "currentmodel1".into(), ..Default::default() }, - OverlayDojoModel { name: "currentmodel2".into(), ..Default::default() }, - OverlayDojoModel { name: "existingmodel".into(), ..Default::default() }, - OverlayDojoModel { name: "othermodel1".into(), ..Default::default() }, - OverlayDojoModel { name: "othermodel2".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:currentmodel1".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:currentmodel2".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:existingmodel".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:othermodel1".into(), ..Default::default() }, + OverlayDojoModel { tag: "ns:othermodel2".into(), ..Default::default() }, ], ..Default::default() }; @@ -551,11 +484,11 @@ fn overlay_merge_for_world_work_as_expected() { // when other.world is none and current.world is some let other = OverlayManifest { ..Default::default() }; let mut current = OverlayManifest { - world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:world".to_string(), ..Default::default() }), ..Default::default() }; let expected = OverlayManifest { - world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:world".to_string(), ..Default::default() }), ..Default::default() }; current.merge(other); @@ -564,12 +497,12 @@ fn overlay_merge_for_world_work_as_expected() { // when other.world is some and current.world is none let other = OverlayManifest { - world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:world".to_string(), ..Default::default() }), ..Default::default() }; let mut current = OverlayManifest { ..Default::default() }; let expected = OverlayManifest { - world: Some(OverlayClass { name: "world".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:world".to_string(), ..Default::default() }), ..Default::default() }; @@ -578,15 +511,15 @@ fn overlay_merge_for_world_work_as_expected() { // when other.world is some and current.world is some let other = OverlayManifest { - world: Some(OverlayClass { name: "worldother".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:worldother".to_string(), ..Default::default() }), ..Default::default() }; let mut current = OverlayManifest { - world: Some(OverlayClass { name: "worldcurrent".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:worldcurrent".to_string(), ..Default::default() }), ..Default::default() }; let expected = OverlayManifest { - world: Some(OverlayClass { name: "worldcurrent".into(), ..Default::default() }), + world: Some(OverlayClass { tag: "dojo:worldcurrent".to_string(), ..Default::default() }), ..Default::default() }; @@ -607,11 +540,11 @@ fn overlay_merge_for_base_work_as_expected() { // when other.base is none and current.base is some let other = OverlayManifest { ..Default::default() }; let mut current = OverlayManifest { - base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:base".to_string(), ..Default::default() }), ..Default::default() }; let expected = OverlayManifest { - base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:base".to_string(), ..Default::default() }), ..Default::default() }; current.merge(other); @@ -620,12 +553,12 @@ fn overlay_merge_for_base_work_as_expected() { // when other.base is some and current.base is none let other = OverlayManifest { - base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:base".to_string(), ..Default::default() }), ..Default::default() }; let mut current = OverlayManifest { ..Default::default() }; let expected = OverlayManifest { - base: Some(OverlayClass { name: "base".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:base".to_string(), ..Default::default() }), ..Default::default() }; @@ -634,15 +567,15 @@ fn overlay_merge_for_base_work_as_expected() { // when other.base is some and current.base is some let other = OverlayManifest { - base: Some(OverlayClass { name: "baseother".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:baseother".to_string(), ..Default::default() }), ..Default::default() }; let mut current = OverlayManifest { - base: Some(OverlayClass { name: "basecurrent".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:basecurrent".to_string(), ..Default::default() }), ..Default::default() }; let expected = OverlayManifest { - base: Some(OverlayClass { name: "basecurrent".into(), ..Default::default() }), + base: Some(OverlayClass { tag: "dojo:basecurrent".to_string(), ..Default::default() }), ..Default::default() }; @@ -660,34 +593,75 @@ fn overlay_merge_for_base_work_as_expected() { #[test] fn base_manifest_remove_items_work_as_expected() { - let contracts = ["c1", "c2", "c3"]; - let models = ["m1", "m2", "m3"]; + let contracts = ["ns:c1", "ns:c2", "ns:c3"]; + let models = ["ns:m1", "ns:m2", "ns:m3"]; - let world = Manifest { name: "world".into(), inner: Default::default() }; - let base = Manifest { name: "base".into(), inner: Default::default() }; + let world = Manifest { manifest_name: "world".into(), inner: Default::default() }; + let base = Manifest { manifest_name: "dojo-base".to_string(), inner: Default::default() }; let contracts = contracts .iter() - .map(|c| Manifest { name: SmolStr::from(*c), inner: Default::default() }) + .map(|c| Manifest { + manifest_name: c.to_string(), + inner: DojoContract { tag: c.to_string(), ..Default::default() }, + }) .collect(); let models = models .iter() - .map(|c| Manifest { name: SmolStr::from(*c), inner: Default::default() }) + .map(|c| Manifest { + manifest_name: c.to_string(), + inner: DojoModel { tag: c.to_string(), ..Default::default() }, + }) .collect(); let mut base = BaseManifest { contracts, models, world, base }; - base.remove_items(vec!["c1".to_string(), "c3".to_string(), "m2".to_string()]); + base.remove_tags(vec!["ns:c1".to_string(), "ns:c3".to_string(), "ns:m2".to_string()]); assert_eq!(base.contracts.len(), 1); assert_eq!( - base.contracts.iter().map(|c| c.name.clone().into()).collect::>(), - vec!["c2"] + base.contracts.iter().map(|c| c.manifest_name.clone()).collect::>(), + vec!["ns:c2"] ); assert_eq!(base.models.len(), 2); assert_eq!( - base.models.iter().map(|c| c.name.clone().into()).collect::>(), - vec!["m1", "m3"] + base.models.iter().map(|c| c.manifest_name.clone()).collect::>(), + vec!["ns:m1", "ns:m3"] ); } + +fn serialize_bytearray(s: &str) -> Vec { + let ba = ByteArray::from_string(s).unwrap(); + ByteArray::cairo_serialize(&ba) +} + +fn build_model_registered_event(values: Vec, namespace: &str, model: &str) -> EmittedEvent { + let mut data = ByteArray::cairo_serialize(&ByteArray::from_string(model).unwrap()); + data.extend(ByteArray::cairo_serialize(&ByteArray::from_string(namespace).unwrap())); + data.extend(values); + + EmittedEvent { + data, + keys: vec![selector!("ModelRegistered")], + block_hash: Default::default(), + from_address: Default::default(), + block_number: Default::default(), + transaction_hash: Default::default(), + } +} + +fn build_deploy_event(values: Vec, ns: &str, name: &str) -> EmittedEvent { + let mut data = values.to_vec(); + data.extend(serialize_bytearray(ns).iter()); + data.extend(serialize_bytearray(name).iter()); + + EmittedEvent { + data, + keys: vec![], + block_hash: Default::default(), + from_address: Default::default(), + block_number: Default::default(), + transaction_hash: Default::default(), + } +} diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 1aa721bd6c..876a1f814e 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -1,27 +1,26 @@ use std::collections::HashMap; +use std::path::PathBuf; use std::{fs, io}; use anyhow::Result; -use cainome::cairo_serde::Error as CainomeError; +use cainome::cairo_serde::{ByteArray, CairoSerde, Error as CainomeError}; use camino::Utf8PathBuf; use serde::de::DeserializeOwned; -use smol_str::SmolStr; -use starknet::core::types::{ - BlockId, BlockTag, EmittedEvent, EventFilter, Felt, FunctionCall, StarknetError, -}; +use serde::Serialize; +use starknet::core::types::{BlockId, BlockTag, EmittedEvent, EventFilter, Felt, StarknetError}; use starknet::core::utils::{ - parse_cairo_short_string, starknet_keccak, CairoShortStringToFeltError, - ParseCairoShortStringError, + starknet_keccak, CairoShortStringToFeltError, ParseCairoShortStringError, }; -use starknet::macros::selector; use starknet::providers::{Provider, ProviderError}; use thiserror::Error; use toml; +use toml::Table; use tracing::error; +use walkdir::WalkDir; use crate::contracts::model::ModelError; use crate::contracts::world::WorldEvent; -use crate::contracts::WorldContractReader; +use crate::contracts::{naming, WorldContractReader}; #[cfg(test)] #[path = "manifest_test.rs"] @@ -35,12 +34,14 @@ pub use types::{ OverlayDojoContract, OverlayDojoModel, OverlayManifest, WorldContract, WorldMetadata, }; -pub const WORLD_CONTRACT_NAME: &str = "dojo::world::world"; -pub const BASE_CONTRACT_NAME: &str = "dojo::base::base"; -pub const RESOURCE_METADATA_CONTRACT_NAME: &str = "dojo::resource_metadata::resource_metadata"; -pub const RESOURCE_METADATA_MODEL_NAME: &str = "0x5265736f757263654d65746164617461"; +pub const WORLD_CONTRACT_TAG: &str = "dojo-world"; +pub const BASE_CONTRACT_TAG: &str = "dojo-base"; + +pub const WORLD_QUALIFIED_PATH: &str = "dojo::world::world"; +pub const BASE_QUALIFIED_PATH: &str = "dojo::base::base"; pub const MANIFESTS_DIR: &str = "manifests"; +pub const TARGET_DIR: &str = "target"; pub const BASE_DIR: &str = "base"; pub const OVERLAYS_DIR: &str = "overlays"; pub const DEPLOYMENTS_DIR: &str = "deployments"; @@ -75,6 +76,12 @@ pub enum AbstractManifestError { AbiError(String), #[error(transparent)] Json(#[from] serde_json::Error), + #[error("Duplicated manifest : {0}")] + DuplicatedManifest(String), + #[error("{0}")] + TagError(String), + #[error("{0}")] + UnknownTarget(String), } impl From> for Manifest { @@ -86,7 +93,7 @@ impl From> for Manifest { original_class_hash: value.inner.original_class_hash, ..Default::default() }, - value.name, + value.manifest_name, ) } } @@ -105,44 +112,41 @@ impl From for DeploymentManifest { impl BaseManifest { /// Load the manifest from a file at the given path. pub fn load_from_path(path: &Utf8PathBuf) -> Result { - let contract_dir = path.join(CONTRACTS_DIR); - let model_dir = path.join(MODELS_DIR); - let world: Manifest = toml::from_str(&fs::read_to_string( - path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"), + path.join(naming::get_filename_from_tag(WORLD_CONTRACT_TAG)).with_extension("toml"), )?)?; let base: Manifest = toml::from_str(&fs::read_to_string( - path.join(BASE_CONTRACT_NAME.replace("::", "_")).with_extension("toml"), + path.join(naming::get_filename_from_tag(BASE_CONTRACT_TAG)).with_extension("toml"), )?)?; - let contracts = elements_from_path::(&contract_dir)?; - let models = elements_from_path::(&model_dir)?; + let contracts = elements_from_path::(&path.join(CONTRACTS_DIR))?; + let models = elements_from_path::(&path.join(MODELS_DIR))?; Ok(Self { world, base, contracts, models }) } - /// Given a list of contract or model names, remove those from the manifest. - pub fn remove_items(&mut self, items: Vec) { - self.contracts.retain(|contract| !items.contains(&contract.name.to_string())); - self.models.retain(|model| !items.contains(&model.name.to_string())); + /// Given a list of contract or model tags, remove those from the manifest. + pub fn remove_tags(&mut self, tags: Vec) { + self.contracts.retain(|contract| !tags.contains(&contract.inner.tag)); + self.models.retain(|model| !tags.contains(&model.inner.tag)); } pub fn merge(&mut self, overlay: OverlayManifest) { let mut base_map = HashMap::new(); for contract in self.contracts.iter_mut() { - base_map.insert(contract.name.clone(), contract); + base_map.insert(contract.inner.tag.clone(), contract); } for contract in overlay.contracts { - if let Some(manifest) = base_map.get_mut(&contract.name) { + if let Some(manifest) = base_map.get_mut(&contract.tag) { manifest.inner.merge(contract); } else { error!( "OverlayManifest configured for contract \"{}\", but contract is not present \ in BaseManifest.", - contract.name + contract.tag ); } } @@ -156,40 +160,119 @@ impl BaseManifest { } } -impl OverlayManifest { - pub fn load_from_path(path: &Utf8PathBuf) -> Result { - fs::create_dir_all(path)?; +#[derive(Clone, Debug, Copy)] +enum ManifestKind { + BaseClass, + WorldClass, + Contract, + Model, +} - let mut world: Option = None; +impl OverlayManifest { + fn build_kind_from_tags(base_manifest: &BaseManifest) -> HashMap { + let mut kind_from_tags = HashMap::::new(); - let world_path = path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + kind_from_tags.insert(WORLD_CONTRACT_TAG.to_string(), ManifestKind::WorldClass); + kind_from_tags.insert(BASE_CONTRACT_TAG.to_string(), ManifestKind::BaseClass); - if world_path.exists() { - world = Some(toml::from_str(&fs::read_to_string(world_path)?)?); + for model in base_manifest.models.as_slice() { + kind_from_tags.insert(model.inner.tag.clone(), ManifestKind::Model); } - let mut base: Option = None; - let base_path = path.join(BASE_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); - - if base_path.exists() { - base = Some(toml::from_str(&fs::read_to_string(base_path)?)?); + for contract in base_manifest.contracts.as_slice() { + kind_from_tags.insert(contract.inner.tag.clone(), ManifestKind::Contract); } - let contract_dir = path.join(CONTRACTS_DIR); - let contracts = if contract_dir.exists() { - overlay_elements_from_path::(&contract_dir)? - } else { - vec![] - }; + kind_from_tags + } - let model_dir = path.join(MODELS_DIR); - let models = if model_dir.exists() { - overlay_elements_from_path::(&model_dir)? - } else { - vec![] + fn load_overlay( + path: &PathBuf, + kind: ManifestKind, + overlays: &mut OverlayManifest, + ) -> Result<(), AbstractManifestError> { + match kind { + ManifestKind::BaseClass => { + let overlay: OverlayClass = toml::from_str(&fs::read_to_string(path)?)?; + overlays.base = Some(overlay); + } + ManifestKind::WorldClass => { + let overlay: OverlayClass = toml::from_str(&fs::read_to_string(path)?)?; + overlays.world = Some(overlay); + } + ManifestKind::Model => { + let overlay: OverlayDojoModel = toml::from_str(&fs::read_to_string(path)?)?; + overlays.models.push(overlay); + } + ManifestKind::Contract => { + let overlay: OverlayDojoContract = toml::from_str(&fs::read_to_string(path)?)?; + overlays.contracts.push(overlay); + } }; - Ok(Self { world, base, contracts, models }) + Ok(()) + } + + pub fn load_from_path( + path: &Utf8PathBuf, + base_manifest: &BaseManifest, + ) -> Result { + fs::create_dir_all(path)?; + + let kind_from_tags = Self::build_kind_from_tags(base_manifest); + let mut loaded_tags = HashMap::::new(); + let mut overlays = OverlayManifest::default(); + + for entry in WalkDir::new(path).into_iter() { + let entry = match entry { + Ok(e) => e, + Err(e) => return Err(AbstractManifestError::IO(e.into())), + }; + let file_path = entry.path(); + let file_name = entry.file_name().to_string_lossy().to_string(); + + if !file_name.clone().ends_with(".toml") { + continue; + } + + // an overlay file must contain a 'tag' key. + let toml_data = toml::from_str::

(&fs::read_to_string(file_path)?)?; + if !toml_data.contains_key("tag") { + return Err(AbstractManifestError::TagError(format!( + "The overlay '{file_name}' must contain the 'tag' key." + ))); + } + + // the tag key must be a string + let tag = match toml_data["tag"].as_str() { + Some(x) => x.to_string(), + None => { + return Err(AbstractManifestError::TagError(format!( + "The tag key of the overlay '{file_name}' must be a string." + ))); + } + }; + + // an overlay must target an existing class/model/contract + if !kind_from_tags.contains_key(&tag) { + return Err(AbstractManifestError::UnknownTarget(format!( + "The tag '{tag}' of the overlay '{file_name}' does not target an existing \ + class/model/contract." + ))); + } + + // a same tag cannot be used in multiple overlays. + if loaded_tags.contains_key(&tag) { + return Err(AbstractManifestError::DuplicatedManifest(format!( + "The tag '{tag}' is used in multiple overlays." + ))); + } + + Self::load_overlay(&file_path.to_path_buf(), kind_from_tags[&tag], &mut overlays)?; + loaded_tags.insert(tag, true); + } + + Ok(overlays) } /// Writes `Self` to overlay manifests folder. @@ -202,18 +285,25 @@ impl OverlayManifest { if let Some(ref world) = self.world { let world = toml::to_string(world)?; let file_name = - path.join(WORLD_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + path.join(naming::get_filename_from_tag(WORLD_CONTRACT_TAG)).with_extension("toml"); fs::write(file_name, world)?; } if let Some(ref base) = self.base { let base = toml::to_string(base)?; - let file_name = path.join(BASE_CONTRACT_NAME.replace("::", "_")).with_extension("toml"); + let file_name = + path.join(naming::get_filename_from_tag(BASE_CONTRACT_TAG)).with_extension("toml"); fs::write(file_name, base)?; } - overlay_dojo_contracts_to_path(&path.join(CONTRACTS_DIR), self.contracts.as_slice())?; - overlay_dojo_model_to_path(&path.join(MODELS_DIR), self.models.as_slice())?; + overlay_to_path::( + &path.join(CONTRACTS_DIR), + self.contracts.as_slice(), + |c| c.tag.clone(), + )?; + overlay_to_path::(&path.join(MODELS_DIR), self.models.as_slice(), |m| { + m.tag.clone() + })?; Ok(()) } @@ -229,14 +319,14 @@ impl OverlayManifest { } for other_contract in other.contracts { - let found = self.contracts.iter().find(|c| c.name == other_contract.name); + let found = self.contracts.iter().find(|c| c.tag == other_contract.tag); if found.is_none() { self.contracts.push(other_contract); } } for other_model in other.models { - let found = self.models.iter().find(|m| m.name == other_model.name); + let found = self.models.iter().find(|m| m.tag == other_model.tag); if found.is_none() { self.models.push(other_model); } @@ -257,7 +347,8 @@ impl DeploymentManifest { self.world.inner.seed = previous.world.inner.seed; self.contracts.iter_mut().for_each(|contract| { - let previous_contract = previous.contracts.iter().find(|c| c.name == contract.name); + let previous_contract = + previous.contracts.iter().find(|c| c.manifest_name == contract.manifest_name); if let Some(previous_contract) = previous_contract { if previous_contract.inner.base_class_hash != Felt::ZERO { contract.inner.base_class_hash = previous_contract.inner.base_class_hash; @@ -342,15 +433,16 @@ impl DeploymentManifest { class_hash: world_class_hash, ..Default::default() }, - WORLD_CONTRACT_NAME.into(), + naming::get_filename_from_tag(WORLD_CONTRACT_TAG), ), base: Manifest::new( Class { class_hash: base_class_hash, abi: None, original_class_hash: base_class_hash, + tag: BASE_CONTRACT_TAG.to_string(), }, - BASE_CONTRACT_NAME.into(), + naming::get_filename_from_tag(BASE_CONTRACT_TAG), ), }) } @@ -413,27 +505,8 @@ where let models = parse_models_events(registered_models_events); let mut contracts = parse_contracts_events(contract_deployed_events, contract_upgraded_events); - // fetch contracts name for contract in &mut contracts { - let name = match provider - .call( - FunctionCall { - calldata: vec![], - entry_point_selector: selector!("dojo_resource"), - contract_address: contract.inner.address.expect("qed; missing address"), - }, - BlockId::Tag(BlockTag::Latest), - ) - .await - { - Ok(res) => parse_cairo_short_string(&res[0])?.into(), - - Err(ProviderError::StarknetError(StarknetError::ContractError(_))) => SmolStr::from(""), - - Err(err) => return Err(err.into()), - }; - - contract.name = name; + contract.manifest_name = naming::get_filename_from_tag(&contract.inner.tag); } Ok((models, contracts)) @@ -511,6 +584,18 @@ fn parse_contracts_events( let mut class_hash = data.next().expect("class hash is missing from event"); let address = data.next().expect("addresss is missing from event"); + let str_data = data.as_slice(); + let namespace = + ByteArray::cairo_deserialize(str_data, 0).expect("namespace is missing from event"); + let offset = ByteArray::cairo_serialized_size(&namespace); + let name = + ByteArray::cairo_deserialize(str_data, offset).expect("name is missing from event"); + + let tag = naming::get_tag( + &namespace.to_string().expect("ASCII encoded namespace"), + &name.to_string().expect("ASCII encoded name"), + ); + if let Some(upgrade) = upgradeds.get(&address) { class_hash = *upgrade; } @@ -520,9 +605,10 @@ fn parse_contracts_events( address: Some(address), class_hash, abi: None, + tag: tag.clone(), ..Default::default() }, - Default::default(), + naming::get_filename_from_tag(&tag), ) }) .collect() @@ -543,23 +629,25 @@ fn parse_models_events(events: Vec) -> Vec> { } }; - // TODO: Safely unwrap? - let model_name = model_event.name.to_string().unwrap(); - if let Some(current_class_hash) = models.get_mut(&model_name) { + let model_name = model_event.name.to_string().expect("ASCII encoded name"); + let namespace = model_event.namespace.to_string().expect("ASCII encoded namespace"); + let model_tag = naming::get_tag(&namespace, &model_name); + + if let Some(current_class_hash) = models.get_mut(&model_tag) { if current_class_hash == &model_event.prev_class_hash.into() { *current_class_hash = model_event.class_hash.into(); } } else { - models.insert(model_name, model_event.class_hash.into()); + models.insert(model_tag, model_event.class_hash.into()); } } // TODO: include address of the model in the manifest. models .into_iter() - .map(|(name, class_hash)| Manifest:: { - inner: DojoModel { class_hash, abi: None, ..Default::default() }, - name: name.into(), + .map(|(tag, class_hash)| Manifest:: { + inner: DojoModel { tag: tag.clone(), class_hash, abi: None, ..Default::default() }, + manifest_name: naming::get_filename_from_tag(&tag), }) .collect() } @@ -591,48 +679,20 @@ where Ok(elements) } -fn overlay_elements_from_path(path: &Utf8PathBuf) -> Result, AbstractManifestError> +fn overlay_to_path( + path: &Utf8PathBuf, + elements: &[T], + get_tag: fn(&T) -> String, +) -> Result<(), AbstractManifestError> where - T: DeserializeOwned, + T: Serialize, { - let mut elements = vec![]; - - for entry in path.read_dir()? { - let entry = entry?; - let path = entry.path(); - if path.is_file() { - let manifest: T = toml::from_str(&fs::read_to_string(path)?)?; - elements.push(manifest); - } else { - continue; - } - } - - Ok(elements) -} - -fn overlay_dojo_contracts_to_path( - path: &Utf8PathBuf, - elements: &[OverlayDojoContract], -) -> Result<(), AbstractManifestError> { fs::create_dir_all(path)?; for element in elements { - let path = path.join(element.name.replace("::", "_")).with_extension("toml"); - fs::write(path, toml::to_string(&element)?)?; - } - Ok(()) -} - -fn overlay_dojo_model_to_path( - path: &Utf8PathBuf, - elements: &[OverlayDojoModel], -) -> Result<(), AbstractManifestError> { - fs::create_dir_all(path)?; - - for element in elements { - let path = path.join(element.name.replace("::", "_")).with_extension("toml"); - fs::write(path, toml::to_string(&element)?)?; + let filename = naming::get_filename_from_tag(&get_tag(element)); + let path = path.join(filename).with_extension("toml"); + fs::write(path, toml::to_string(element)?)?; } Ok(()) } @@ -661,6 +721,8 @@ impl ManifestMethods for DojoContract { } fn merge(&mut self, old: Self::OverlayType) { + // ignore name and namespace + if let Some(class_hash) = old.original_class_hash { self.original_class_hash = class_hash; } diff --git a/crates/dojo-world/src/manifest/types.rs b/crates/dojo-world/src/manifest/types.rs index b576c6e557..f9d51b8326 100644 --- a/crates/dojo-world/src/manifest/types.rs +++ b/crates/dojo-world/src/manifest/types.rs @@ -45,7 +45,7 @@ pub struct OverlayManifest { pub models: Vec, } -#[derive(Clone, Serialize, Deserialize, Debug)] +#[derive(Clone, Serialize, Default, Deserialize, Debug)] #[cfg_attr(test, derive(PartialEq))] pub struct Manifest where @@ -53,7 +53,9 @@ where { #[serde(flatten)] pub inner: T, - pub name: SmolStr, + + // name of the manifest which is used as filename + pub manifest_name: String, } // Utility methods thats needs to be implemented by manifest types @@ -75,8 +77,8 @@ impl Manifest where T: ManifestMethods, { - pub fn new(inner: T, name: SmolStr) -> Self { - Self { inner, name } + pub fn new(inner: T, manifest_name: String) -> Self { + Self { inner, manifest_name } } } @@ -103,6 +105,7 @@ pub struct DojoContract { pub computed: Vec, #[serde(default)] pub init_calldata: Vec, + pub tag: String, } /// Represents a declaration of a model. @@ -117,6 +120,7 @@ pub struct DojoModel { #[serde_as(as = "UfeHex")] pub original_class_hash: Felt, pub abi: Option, + pub tag: String, } #[serde_as] @@ -148,13 +152,14 @@ pub struct Class { #[serde_as(as = "UfeHex")] pub original_class_hash: Felt, pub abi: Option, + pub tag: String, } #[serde_as] #[derive(Clone, Default, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] pub struct OverlayDojoContract { - pub name: SmolStr, + pub tag: String, pub original_class_hash: Option, pub reads: Option>, pub writes: Option>, @@ -165,7 +170,7 @@ pub struct OverlayDojoContract { #[derive(Clone, Default, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] pub struct OverlayDojoModel { - pub name: SmolStr, + pub tag: String, pub original_class_hash: Option, } @@ -181,7 +186,7 @@ pub struct OverlayContract { #[derive(Clone, Default, Debug, Serialize, Deserialize)] #[cfg_attr(test, derive(PartialEq))] pub struct OverlayClass { - pub name: SmolStr, + pub tag: String, pub original_class_hash: Option, } @@ -206,7 +211,7 @@ pub struct ComputedValueEntrypoint { // Name of entrypoint to get computed value pub entrypoint: SmolStr, // Component to compute for - pub model: Option, + pub tag: Option, } impl From for Member { diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index d778476a2f..31774c5a3e 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::io::Cursor; use std::path::PathBuf; -use anyhow::Result; +use anyhow::{anyhow, Context, Result}; use camino::Utf8PathBuf; use ipfs_api_backend_hyper::{IpfsApi, IpfsClient, TryFromUri}; use scarb::core::{ManifestMetadata, Workspace}; @@ -10,7 +10,8 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_json::json; use url::Url; -use crate::manifest::{BaseManifest, WORLD_CONTRACT_NAME}; +use crate::contracts::naming; +use crate::manifest::{BaseManifest, CONTRACTS_DIR, MODELS_DIR, WORLD_CONTRACT_TAG}; #[cfg(test)] #[path = "metadata_test.rs"] @@ -23,17 +24,15 @@ pub const IPFS_PASSWORD: &str = "12290b883db9138a8ae3363b6739d220"; // copy constants from dojo-lang to avoid circular dependency pub const MANIFESTS_DIR: &str = "manifests"; pub const ABIS_DIR: &str = "abis"; -pub const SOURCES_DIR: &str = "src"; pub const BASE_DIR: &str = "base"; -fn build_artifact_from_name( - source_dir: &Utf8PathBuf, +fn build_artifact_from_filename( abi_dir: &Utf8PathBuf, - element_name: &str, + source_dir: &Utf8PathBuf, + filename: &str, ) -> ArtifactMetadata { - let sanitized_name = element_name.replace("::", "_"); - let abi_file = abi_dir.join(format!("{sanitized_name}.json")); - let src_file = source_dir.join(format!("{sanitized_name}.cairo")); + let abi_file = abi_dir.join(format!("{filename}.json")); + let src_file = source_dir.join(format!("{filename}.cairo")); ArtifactMetadata { abi: if abi_file.exists() { Some(Uri::File(abi_file.into_std_path_buf())) } else { None }, @@ -45,6 +44,21 @@ fn build_artifact_from_name( } } +/// Get the default namespace from the workspace. +/// +/// # Arguments +/// +/// * `ws`: the workspace. +/// +/// # Returns +/// +/// A [`String`] object containing the namespace. +pub fn get_default_namespace_from_ws(ws: &Workspace<'_>) -> String { + let metadata = dojo_metadata_from_workspace(ws) + .expect("Namespace key is already checked by the parsing of the Scarb.toml file."); + metadata.world.namespace +} + /// Build world metadata with data read from the project configuration. /// /// # Arguments @@ -54,27 +68,17 @@ fn build_artifact_from_name( /// # Returns /// /// A [`WorldMetadata`] object initialized with project metadata. -pub fn project_to_world_metadata(project_metadata: Option) -> WorldMetadata { - if let Some(m) = project_metadata { - WorldMetadata { - name: m.name, - description: m.description, - cover_uri: m.cover_uri, - icon_uri: m.icon_uri, - website: m.website, - socials: m.socials, - ..Default::default() - } - } else { - WorldMetadata { - name: None, - description: None, - cover_uri: None, - icon_uri: None, - website: None, - socials: None, - ..Default::default() - } +pub fn project_to_world_metadata(m: ProjectWorldMetadata) -> WorldMetadata { + WorldMetadata { + name: m.name, + description: m.description, + cover_uri: m.cover_uri, + icon_uri: m.icon_uri, + website: m.website, + socials: m.socials, + seed: m.seed, + namespace: m.namespace, + ..Default::default() } } @@ -85,21 +89,24 @@ pub fn project_to_world_metadata(project_metadata: Option) /// /// # Returns /// A [`DojoMetadata`] object containing all Dojo metadata. -pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Option { +pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Result { let profile = ws.config().profile(); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); let manifest_dir = manifest_dir.join(MANIFESTS_DIR).join(profile.as_str()); - let target_dir = ws.target_dir().path_existent().unwrap(); - let sources_dir = target_dir.join(profile.as_str()).join(SOURCES_DIR); - let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); + let abi_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); + let source_dir = ws.target_dir().path_existent().unwrap(); + let source_dir = source_dir.join(profile.as_str()); let project_metadata = if let Ok(current_package) = ws.current_package() { - current_package.manifest.metadata.dojo() + current_package.manifest.metadata.dojo()? } else { // On workspaces, dojo metadata are not accessible because if no current package is defined // (being the only package or using --package). - return None; + return Err(anyhow!( + "No current package with dojo metadata found, this subcommand is not yet support for \ + workspaces." + )); }; let mut dojo_metadata = DojoMetadata { @@ -108,7 +115,11 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Option ..Default::default() }; - let world_artifact = build_artifact_from_name(&sources_dir, &abis_dir, WORLD_CONTRACT_NAME); + let world_artifact = build_artifact_from_filename( + &abi_dir, + &source_dir, + &naming::get_filename_from_tag(WORLD_CONTRACT_TAG), + ); // inialize Dojo world metadata with world metadata coming from project configuration dojo_metadata.world = project_to_world_metadata(project_metadata.world); @@ -118,30 +129,34 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Option if manifest_dir.join(BASE_DIR).exists() { if let Ok(manifest) = BaseManifest::load_from_path(&manifest_dir.join(BASE_DIR)) { for model in manifest.models { - let name = model.name.to_string(); + let tag = model.inner.tag.clone(); + let abi_model_dir = abi_dir.join(MODELS_DIR); + let source_model_dir = source_dir.join(MODELS_DIR); dojo_metadata.resources_artifacts.insert( - name.clone(), + tag.clone(), ResourceMetadata { - name: name.clone(), - artifacts: build_artifact_from_name( - &sources_dir, - &abis_dir.join("models"), - &name, + name: tag.clone(), + artifacts: build_artifact_from_filename( + &abi_model_dir, + &source_model_dir, + &naming::get_filename_from_tag(&tag), ), }, ); } for contract in manifest.contracts { - let name = contract.name.to_string(); + let tag = contract.inner.tag.clone(); + let abi_contract_dir = abi_dir.join(CONTRACTS_DIR); + let source_contract_dir = source_dir.join(CONTRACTS_DIR); dojo_metadata.resources_artifacts.insert( - name.clone(), + tag.clone(), ResourceMetadata { - name: name.clone(), - artifacts: build_artifact_from_name( - &sources_dir, - &abis_dir.join("contracts"), - &name, + name: tag.clone(), + artifacts: build_artifact_from_filename( + &abi_contract_dir, + &source_contract_dir, + &naming::get_filename_from_tag(&tag), ), }, ); @@ -149,13 +164,13 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Option } } - Some(dojo_metadata) + Ok(dojo_metadata) } /// Metadata coming from project configuration (Scarb.toml) #[derive(Default, Deserialize, Debug, Clone)] pub struct ProjectMetadata { - pub world: Option, + pub world: ProjectWorldMetadata, pub env: Option, pub skip_migration: Option>, } @@ -233,6 +248,8 @@ impl Uri { #[derive(Default, Serialize, Deserialize, Debug, Clone)] pub struct ProjectWorldMetadata { pub name: Option, + pub seed: String, + pub namespace: String, pub description: Option, pub cover_uri: Option, pub icon_uri: Option, @@ -244,6 +261,8 @@ pub struct ProjectWorldMetadata { #[derive(Default, Serialize, Deserialize, Debug, Clone)] pub struct WorldMetadata { pub name: Option, + pub seed: String, + pub namespace: String, pub description: Option, pub cover_uri: Option, pub icon_uri: Option, @@ -410,16 +429,23 @@ impl DojoMetadata { } trait MetadataExt { - fn dojo(&self) -> ProjectMetadata; + fn dojo(&self) -> Result; } impl MetadataExt for ManifestMetadata { - fn dojo(&self) -> ProjectMetadata { - self.tool_metadata + fn dojo(&self) -> Result { + let metadata = self + .tool_metadata .as_ref() .and_then(|e| e.get("dojo")) - .cloned() - .map(|v| v.try_into::().unwrap_or_default()) - .unwrap_or_default() + // TODO: see if we can make error more descriptive + .ok_or_else(|| anyhow!("Some of the fields in [tool.dojo] are required."))? + .clone(); + + let project_metadata: ProjectMetadata = metadata + .try_into() + .with_context(|| "Project metadata (i.e. [tool.dojo]) is not properly configured.")?; + + Ok(project_metadata) } } diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index b8f430072e..adf9156617 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -3,12 +3,15 @@ use std::fs; use camino::Utf8PathBuf; use dojo_test_utils::compiler; +use scarb::compiler::Profile; use scarb::ops; use url::Url; +use crate::contracts::naming::{get_filename_from_tag, TAG_SEPARATOR}; +use crate::manifest::{CONTRACTS_DIR, MODELS_DIR, WORLD_CONTRACT_TAG}; use crate::metadata::{ dojo_metadata_from_workspace, ArtifactMetadata, ProjectMetadata, Uri, WorldMetadata, ABIS_DIR, - BASE_DIR, MANIFESTS_DIR, SOURCES_DIR, + BASE_DIR, MANIFESTS_DIR, }; #[test] @@ -30,6 +33,8 @@ cover_uri = "file://example_cover.png" icon_uri = "file://example_icon.png" website = "https://dojoengine.org" socials.x = "https://x.com/dojostarknet" +seed = "dojo_examples" +namespace = "dojo_examples" "#, ) .unwrap(); @@ -53,8 +58,7 @@ socials.x = "https://x.com/dojostarknet" Some("0x0248cacaeac64c45be0c19ee8727e0bb86623ca7fa3f0d431a6c55e200697e5a") ); - assert!(metadata.world.is_some()); - let world = metadata.world.unwrap(); + let world = metadata.world; assert_eq!(world.name(), Some("example")); assert_eq!(world.description(), Some("example world")); @@ -62,12 +66,16 @@ socials.x = "https://x.com/dojostarknet" assert_eq!(world.icon_uri, Some(Uri::File("example_icon.png".into()))); assert_eq!(world.website, Some(Url::parse("https://dojoengine.org").unwrap())); assert_eq!(world.socials.unwrap().get("x"), Some(&"https://x.com/dojostarknet".to_string())); + assert_eq!(world.seed, String::from("dojo_examples")); + assert_eq!(world.namespace, String::from("dojo_examples")); } #[tokio::test] async fn world_metadata_hash_and_upload() { let meta = WorldMetadata { + namespace: "dojo_examples".to_string(), name: Some("Test World".to_string()), + seed: String::from("dojo_examples"), description: Some("A world used for testing".to_string()), cover_uri: Some(Uri::File("src/metadata_test_data/cover.png".into())), icon_uri: Some(Uri::File("src/metadata_test_data/cover.png".into())), @@ -97,6 +105,8 @@ world_address = "0x0248cacaeac64c45be0c19ee8727e0bb86623ca7fa3f0d431a6c55e200697 [world] name = "example" description = "example world" +seed = "dojo_examples" +namespace = "dojo_examples" cover_uri = "file://example_cover.png" icon_uri = "file://example_icon.png" website = "https://dojoengine.org" @@ -105,12 +115,14 @@ website = "https://dojoengine.org" ) .unwrap(); - assert!(metadata.world.is_some()); + assert!(metadata.world.socials.is_none()); } #[tokio::test] async fn get_full_dojo_metadata_from_workspace() { - let config = compiler::build_test_config("../../examples/spawn-and-move/Scarb.toml").unwrap(); + let config = + compiler::build_test_config("../../examples/spawn-and-move/Scarb.toml", Profile::DEV) + .unwrap(); let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); @@ -118,7 +130,7 @@ async fn get_full_dojo_metadata_from_workspace() { let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); let manifest_dir = manifest_dir.join(MANIFESTS_DIR).join(profile.as_str()); let target_dir = ws.target_dir().path_existent().unwrap(); - let sources_dir = target_dir.join(profile.as_str()).join(SOURCES_DIR); + let target_dir = target_dir.join(profile.as_str()); let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); let dojo_metadata = @@ -144,10 +156,6 @@ async fn get_full_dojo_metadata_from_workspace() { ); assert!(env.world_address.is_some()); - assert_eq!( - env.world_address.unwrap(), - "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" - ); assert!(env.keystore_path.is_none()); assert!(env.keystore_password.is_none()); @@ -164,86 +172,81 @@ async fn get_full_dojo_metadata_from_workspace() { assert!(dojo_metadata.world.website.is_none()); assert!(dojo_metadata.world.socials.is_none()); - check_artifact( - dojo_metadata.world.artifacts, - "dojo_world_world".to_string(), - &abis_dir, - &sources_dir, + let world_filename = get_filename_from_tag(WORLD_CONTRACT_TAG); + assert!(dojo_metadata.world.artifacts.abi.is_some(), "No abi for {world_filename}"); + let abi = dojo_metadata.world.artifacts.abi.unwrap(); + assert_eq!( + abi, + Uri::File(abis_dir.join(format!("{world_filename}.json")).into()), + "Bad abi for {world_filename}", ); let artifacts = get_artifacts_from_manifest(&manifest_dir); - for (abi_subdir, name) in artifacts { - let resource = dojo_metadata.resources_artifacts.get(&name); - assert!(resource.is_some(), "bad resource metadata for {}", name); - let resource = resource.unwrap(); + for (subdir, filename) in artifacts { + let tag = get_tag_from_filename(&filename); + let resource = dojo_metadata.resources_artifacts.get(&tag); - let sanitized_name = name.replace("::", "_"); + assert!(resource.is_some(), "bad resource metadata for {}", tag); + let resource = resource.unwrap(); check_artifact( resource.artifacts.clone(), - sanitized_name, - &abis_dir.join(abi_subdir), - &sources_dir, + filename, + &abis_dir.join(subdir), + &target_dir.join(subdir), ); } } fn check_artifact( artifact: ArtifactMetadata, - name: String, + basename: String, abis_dir: &Utf8PathBuf, - sources_dir: &Utf8PathBuf, + source_dir: &Utf8PathBuf, ) { - assert!(artifact.abi.is_some()); + assert!(artifact.abi.is_some(), "No abi for {}", basename); let abi = artifact.abi.unwrap(); assert_eq!( abi, - Uri::File(abis_dir.join(format!("{name}.json")).into()), + Uri::File(abis_dir.join(format!("{basename}.json")).into()), "Bad abi for {}", - name + basename ); - assert!(artifact.source.is_some()); + assert!(artifact.source.is_some(), "No source for {}", basename); let source = artifact.source.unwrap(); assert_eq!( source, - Uri::File(sources_dir.join(format!("{name}.cairo")).into()), + Uri::File(source_dir.join(format!("{basename}.cairo")).into()), "Bad source for {}", - name + basename ); } -fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(String, String)> { - let contracts_dir = manifest_dir.join(BASE_DIR).join("contracts"); - let models_dir = manifest_dir.join(BASE_DIR).join("models"); +fn get_artifacts_from_manifest(manifest_dir: &Utf8PathBuf) -> Vec<(&str, String)> { + let contracts_dir = manifest_dir.join(BASE_DIR).join(CONTRACTS_DIR); + let models_dir = manifest_dir.join(BASE_DIR).join(MODELS_DIR); let mut artifacts = vec![]; // models for entry in fs::read_dir(models_dir).unwrap().flatten() { - let name = entry.path().file_stem().unwrap().to_string_lossy().to_string(); - let name = name.replace("_models_", "::models::"); - // Some models are inside actions, we need a better way to gather those. - let name = name.replace("_actions_", "::actions::"); - let name = name.replace("::actions_", "::actions::"); - - let name = name.replace("_others_", "::others::"); - let name = name.replace("::others_", "::others::"); - - let name = name.replace("_mock_token_", "::mock_token::"); - let name = name.replace("::mock_token_", "::mock_token::"); - artifacts.push(("models".to_string(), name)); + let filename = entry.path().file_stem().unwrap().to_string_lossy().to_string(); + artifacts.push((MODELS_DIR, filename)); } // contracts for entry in fs::read_dir(contracts_dir).unwrap().flatten() { - let name = entry.path().file_stem().unwrap().to_string_lossy().to_string(); - let name = name.replace("_actions_", "::actions::"); - let name = name.replace("_others_", "::others::"); - let name = name.replace("_mock_token_", "::mock_token::"); - artifacts.push(("contracts".to_string(), name)); + let filename = entry.path().file_stem().unwrap().to_string_lossy().to_string(); + artifacts.push((CONTRACTS_DIR, filename)); } artifacts } + +fn get_tag_from_filename(filename: &str) -> String { + let parts = filename.split(TAG_SEPARATOR).collect::>(); + assert!(parts.len() >= 2); + format!("{}{TAG_SEPARATOR}{}", parts[0], parts[1]) +} diff --git a/crates/dojo-world/src/migration/class.rs b/crates/dojo-world/src/migration/class.rs index a342e6eb01..d49561a2d2 100644 --- a/crates/dojo-world/src/migration/class.rs +++ b/crates/dojo-world/src/migration/class.rs @@ -9,7 +9,8 @@ use super::{Declarable, MigrationType, StateDiff}; /// Represents differences between a local and remote class. #[derive(Debug, Default, Clone)] pub struct ClassDiff { - pub name: String, + // The tag is used to identify the corresponding artifact produced by the compiler. + pub tag: String, pub local_class_hash: Felt, pub original_class_hash: Felt, pub remote_class_hash: Option, @@ -27,7 +28,7 @@ impl StateDiff for ClassDiff { impl Display for ClassDiff { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "{}:", self.name)?; + writeln!(f, "{}:", self.tag)?; writeln!(f, " Local: {:#x}", self.local_class_hash)?; if let Some(remote) = self.remote_class_hash { diff --git a/crates/dojo-world/src/migration/contract.rs b/crates/dojo-world/src/migration/contract.rs index 6a0bb9ce35..2339454f1a 100644 --- a/crates/dojo-world/src/migration/contract.rs +++ b/crates/dojo-world/src/migration/contract.rs @@ -11,7 +11,8 @@ pub type DeclareOutput = DeclareTransactionResult; /// Represents differences between a local and remote contract. #[derive(Debug, Default, Clone)] pub struct ContractDiff { - pub name: String, + // The tag is used to identify the corresponding artifact produced by the compiler. + pub tag: String, pub local_class_hash: Felt, pub original_class_hash: Felt, pub base_class_hash: Felt, @@ -31,7 +32,7 @@ impl StateDiff for ContractDiff { impl Display for ContractDiff { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "{}:", self.name)?; + writeln!(f, "{}:", self.tag)?; writeln!(f, " Local Class Hash: {:#x}", self.local_class_hash)?; writeln!(f, " Original Class Hash: {:#x}", self.original_class_hash)?; writeln!(f, " Base Class Hash: {:#x}", self.base_class_hash)?; diff --git a/crates/dojo-world/src/migration/mod.rs b/crates/dojo-world/src/migration/mod.rs index e67dbafc32..f63349e62c 100644 --- a/crates/dojo-world/src/migration/mod.rs +++ b/crates/dojo-world/src/migration/mod.rs @@ -36,7 +36,7 @@ pub struct DeployOutput { // base class hash at time of deployment pub base_class_hash: Felt, pub was_upgraded: bool, - pub name: Option, + pub tag: Option, } #[derive(Clone, Debug)] @@ -51,7 +51,7 @@ pub struct UpgradeOutput { pub struct RegisterOutput { pub transaction_hash: Felt, pub declare_output: Vec, - pub registered_model_names: Vec, + pub registered_models: Vec, } #[derive(Debug, Error)] @@ -241,7 +241,7 @@ pub trait Deployable: Declarable + Sync { declare, base_class_hash, was_upgraded, - name: None, + tag: None, }) } @@ -306,7 +306,7 @@ pub trait Deployable: Declarable + Sync { declare, base_class_hash: Felt::default(), was_upgraded: false, - name: None, + tag: None, }) } diff --git a/crates/dojo-world/src/migration/strategy.rs b/crates/dojo-world/src/migration/strategy.rs index f0e79d8867..3e221d27ba 100644 --- a/crates/dojo-world/src/migration/strategy.rs +++ b/crates/dojo-world/src/migration/strategy.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::fs; use std::path::PathBuf; -use anyhow::{anyhow, bail, Context, Result}; +use anyhow::{anyhow, Context, Result}; use camino::Utf8PathBuf; use starknet::core::types::Felt; use starknet::core::utils::{cairo_short_string_to_felt, get_contract_address}; @@ -12,6 +12,8 @@ use super::class::{ClassDiff, ClassMigration}; use super::contract::{ContractDiff, ContractMigration}; use super::world::WorldDiff; use super::MigrationType; +use crate::contracts::naming; +use crate::manifest::{CONTRACTS_DIR, MODELS_DIR}; #[derive(Debug, Clone)] pub enum MigrationMetadata { @@ -75,7 +77,7 @@ impl MigrationStrategy { match dependency_contract { MigrationMetadata::Contract(c) => { let contract_address = get_contract_address( - generate_salt(&c.name), + generate_salt(&naming::get_name_from_tag(&c.tag)), c.base_class_hash, &[], world_address, @@ -107,26 +109,11 @@ pub fn prepare_for_migration( diff: WorldDiff, ) -> Result { let mut metadata = HashMap::new(); - let entries = fs::read_dir(target_dir).with_context(|| { - format!( - "Failed trying to read target directory ({target_dir})\nNOTE: build files are profile \ - specified so make sure to run build command with correct profile. For e.g. `sozo -P \ - my_profile build`" - ) - })?; - let mut artifact_paths = HashMap::new(); - for entry in entries.flatten() { - let file_name = entry.file_name(); - let file_name_str = file_name.to_string_lossy(); - if file_name_str == "manifest.json" || !file_name_str.ends_with(".json") { - continue; - } - - let name = file_name_str.trim_end_matches(".json").to_string(); - artifact_paths.insert(name, entry.path()); - } + read_artifact_paths(target_dir, &mut artifact_paths)?; + read_artifact_paths(&target_dir.join(MODELS_DIR), &mut artifact_paths)?; + read_artifact_paths(&target_dir.join(CONTRACTS_DIR), &mut artifact_paths)?; // We don't need to care if a contract has already been declared or not, because // the migration strategy will take care of that. @@ -155,16 +142,6 @@ pub fn prepare_for_migration( Felt::ZERO, ); - if let Some(world_address) = world_address { - if world_address != generated_world_address { - println!("generated_world_address: {:?}", generated_world_address); - bail!( - "Calculated world address doesn't match provided world address.\nIf you are \ - deploying with custom seed make sure `world_address` is correctly configured \ - (or not set) `Scarb.toml`" - ) - } - } world.contract_address = generated_world_address; } @@ -199,7 +176,8 @@ fn evaluate_class_to_migrate( Ok(None) } _ => { - let path = find_artifact_path(class.name.as_str(), artifact_paths)?; + let path = + find_artifact_path(&naming::get_filename_from_tag(&class.tag), artifact_paths)?; Ok(Some(ClassMigration { diff: class.clone(), artifact_path: path.clone() })) } } @@ -214,17 +192,18 @@ fn evaluate_contracts_to_migrate( let mut comps_to_migrate = vec![]; for c in contracts { - metadata.insert(c.name.clone(), MigrationMetadata::Contract(c.clone())); + metadata.insert(c.tag.clone(), MigrationMetadata::Contract(c.clone())); match c.remote_class_hash { Some(remote) if remote == c.local_class_hash && !world_contract_will_migrate => { continue; } _ => { - let path = find_artifact_path(c.name.as_str(), artifact_paths)?; + let path = + find_artifact_path(&naming::get_filename_from_tag(&c.tag), artifact_paths)?; comps_to_migrate.push(ContractMigration { diff: c.clone(), artifact_path: path.clone(), - salt: generate_salt(&c.name), + salt: generate_salt(&naming::get_name_from_tag(&c.tag)), ..Default::default() }); } @@ -243,7 +222,8 @@ fn evaluate_contract_to_migrate( || contract.remote_class_hash.is_none() || matches!(contract.remote_class_hash, Some(remote_hash) if remote_hash != contract.local_class_hash) { - let path = find_artifact_path(&contract.name, artifact_paths)?; + let path = + find_artifact_path(&naming::get_filename_from_tag(&contract.tag), artifact_paths)?; Ok(Some(ContractMigration { diff: contract.clone(), @@ -256,12 +236,12 @@ fn evaluate_contract_to_migrate( } fn find_artifact_path<'a>( - contract_name: &str, + artifact_name: &str, artifact_paths: &'a HashMap, ) -> Result<&'a PathBuf> { artifact_paths - .get(contract_name) - .with_context(|| anyhow!("missing contract artifact for `{}` contract", contract_name)) + .get(artifact_name) + .with_context(|| anyhow!("missing contract artifact for `{}` contract", artifact_name)) } pub fn generate_salt(value: &str) -> Felt { @@ -277,3 +257,29 @@ pub fn generate_salt(value: &str) -> Felt { .collect::>(), ) } + +fn read_artifact_paths( + input_dir: &Utf8PathBuf, + artifact_paths: &mut HashMap, +) -> Result<()> { + let entries = fs::read_dir(input_dir).with_context(|| { + format!( + "Failed trying to read target directory ({input_dir})\nNOTE: build files are profile \ + specified so make sure to run build command with correct profile. For e.g. `sozo -P \ + my_profile build`" + ) + })?; + + for entry in entries.flatten() { + let file_name = entry.file_name(); + let file_name_str = file_name.to_string_lossy(); + if file_name_str == "manifest.json" || !file_name_str.ends_with(".json") { + continue; + } + + let artifact_name = file_name_str.trim_end_matches(".json").to_string(); + artifact_paths.insert(artifact_name, entry.path()); + } + + Ok(()) +} diff --git a/crates/dojo-world/src/migration/world.rs b/crates/dojo-world/src/migration/world.rs index a19a7084a4..9a703f1338 100644 --- a/crates/dojo-world/src/migration/world.rs +++ b/crates/dojo-world/src/migration/world.rs @@ -3,15 +3,15 @@ use std::mem; use std::str::FromStr; use anyhow::{bail, Result}; -use convert_case::{Case, Casing}; -use starknet::core::types::Felt; +use starknet_crypto::Felt; use topological_sort::TopologicalSort; use super::class::ClassDiff; use super::contract::ContractDiff; use super::StateDiff; +use crate::contracts::naming; use crate::manifest::{ - BaseManifest, DeploymentManifest, ManifestMethods, BASE_CONTRACT_NAME, WORLD_CONTRACT_NAME, + BaseManifest, DeploymentManifest, ManifestMethods, BASE_CONTRACT_TAG, WORLD_CONTRACT_TAG, }; #[cfg(test)] @@ -33,23 +33,14 @@ impl WorldDiff { .models .iter() .map(|model| ClassDiff { - name: model.name.to_string(), + tag: model.inner.tag.to_string(), local_class_hash: *model.inner.class_hash(), original_class_hash: *model.inner.original_class_hash(), remote_class_hash: remote.as_ref().and_then(|m| { - // Remote models are detected from events, where only the struct - // name (pascal case) is emitted. - // Local models uses the fully qualified name of the model, - // always in snake_case from cairo compiler. - let model_name = model - .name - .split("::") - .last() - .unwrap_or(&model.name) - .from_case(Case::Snake) - .to_case(Case::Pascal); - - m.models.iter().find(|e| e.name == model_name).map(|s| *s.inner.class_hash()) + m.models + .iter() + .find(|e| e.manifest_name == model.manifest_name) + .map(|s| *s.inner.class_hash()) }), }) .collect::>(); @@ -68,7 +59,7 @@ impl WorldDiff { }; ContractDiff { - name: contract.name.to_string(), + tag: contract.inner.tag.to_string(), local_class_hash: *contract.inner.class_hash(), original_class_hash: *contract.inner.original_class_hash(), base_class_hash, @@ -84,14 +75,14 @@ impl WorldDiff { .collect::>(); let base = ClassDiff { - name: BASE_CONTRACT_NAME.into(), + tag: BASE_CONTRACT_TAG.to_string(), local_class_hash: *local.base.inner.class_hash(), original_class_hash: *local.base.inner.original_class_hash(), remote_class_hash: remote.as_ref().map(|m| *m.base.inner.class_hash()), }; let world = ContractDiff { - name: WORLD_CONTRACT_NAME.into(), + tag: WORLD_CONTRACT_TAG.to_string(), local_class_hash: *local.world.inner.class_hash(), original_class_hash: *local.world.inner.original_class_hash(), base_class_hash: *local.base.inner.class_hash(), @@ -114,19 +105,24 @@ impl WorldDiff { count } - pub fn update_order(&mut self) -> Result<()> { - let mut ts = TopologicalSort::<&str>::new(); + pub fn update_order(&mut self, default_namespace: &str) -> Result<()> { + let mut ts = TopologicalSort::::new(); // make the dependency graph by reading the constructor_calldata for contract in self.contracts.iter() { - let curr_name: &str = &contract.name; - ts.insert(curr_name); + ts.insert(contract.tag.clone()); for field in &contract.init_calldata { if let Some(dependency) = field.strip_prefix("$contract_address:") { - ts.add_dependency(dependency, curr_name); + ts.add_dependency( + naming::ensure_namespace(dependency, default_namespace), + contract.tag.clone(), + ); } else if let Some(dependency) = field.strip_prefix("$class_hash:") { - ts.add_dependency(dependency, curr_name); + ts.add_dependency( + naming::ensure_namespace(dependency, default_namespace), + contract.tag.clone(), + ); } else { // verify its a field element match Felt::from_str(field) { @@ -157,8 +153,8 @@ impl WorldDiff { let mut new_contracts = vec![]; - for c_name in calculated_order { - let contract = match self.contracts.iter().find(|c| c.name == c_name) { + for tag in calculated_order { + let contract = match self.contracts.iter().find(|c| c.tag == tag) { Some(c) => c, None => bail!("Unidentified contract found in `init_calldata`"), }; diff --git a/crates/dojo-world/src/migration/world_test.rs b/crates/dojo-world/src/migration/world_test.rs index e84e1b2cec..94c85a51ef 100644 --- a/crates/dojo-world/src/migration/world_test.rs +++ b/crates/dojo-world/src/migration/world_test.rs @@ -1,28 +1,29 @@ use starknet::macros::felt; use super::*; +use crate::contracts::naming::{get_filename_from_tag, get_tag}; use crate::manifest::{BaseManifest, Class, DojoContract, DojoModel, Manifest}; #[test] fn no_diff_when_local_and_remote_are_equal() { let world_contract = Manifest::new( Class { class_hash: 66_u32.into(), ..Default::default() }, - WORLD_CONTRACT_NAME.into(), + get_filename_from_tag(WORLD_CONTRACT_TAG), ); let base_contract = Manifest::new( Class { class_hash: 77_u32.into(), ..Default::default() }, - BASE_CONTRACT_NAME.into(), + get_filename_from_tag(BASE_CONTRACT_TAG), ); let models = vec![Manifest::new( DojoModel { members: vec![], class_hash: 11_u32.into(), ..Default::default() }, - "dojo_mock::models::model".into(), + "dojo_mock-model".into(), )]; let remote_models = vec![Manifest::new( DojoModel { members: vec![], class_hash: 11_u32.into(), ..Default::default() }, - "Model".into(), + "dojo_mock-model".into(), )]; let local = @@ -33,8 +34,6 @@ fn no_diff_when_local_and_remote_are_equal() { let diff = WorldDiff::compute(local, Some(remote)); - println!("{:?}", diff); - assert_eq!(diff.count_diffs(), 0); } @@ -42,52 +41,75 @@ fn no_diff_when_local_and_remote_are_equal() { fn diff_when_local_and_remote_are_different() { let world_contract = Manifest::new( Class { class_hash: 66_u32.into(), ..Default::default() }, - WORLD_CONTRACT_NAME.into(), + get_filename_from_tag(WORLD_CONTRACT_TAG), ); let base_contract = Manifest::new( Class { class_hash: 77_u32.into(), ..Default::default() }, - BASE_CONTRACT_NAME.into(), + get_filename_from_tag(BASE_CONTRACT_TAG), ); let models = vec![ Manifest::new( - DojoModel { members: vec![], class_hash: felt!("0x11"), ..Default::default() }, - "dojo_mock::models::model".into(), + DojoModel { + tag: get_tag("dojo_mock", "model"), + members: vec![], + class_hash: felt!("0x11"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("dojo_mock", "model")), ), Manifest::new( - DojoModel { members: vec![], class_hash: felt!("0x22"), ..Default::default() }, - "dojo_mock::models::model_2".into(), + DojoModel { + tag: get_tag("dojo_mock", "model2"), + members: vec![], + class_hash: felt!("0x22"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("dojo_mock", "model2")), ), ]; let remote_models = vec![ Manifest::new( - DojoModel { members: vec![], class_hash: felt!("0x11"), ..Default::default() }, - "Model".into(), + DojoModel { + tag: get_tag("dojo_mock", "model"), + members: vec![], + class_hash: felt!("0x11"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("dojo_mock", "model")), ), Manifest::new( - DojoModel { members: vec![], class_hash: felt!("0x33"), ..Default::default() }, - "Model2".into(), + DojoModel { + tag: get_tag("dojo_mock", "model2"), + + members: vec![], + class_hash: felt!("0x33"), + ..Default::default() + }, + get_filename_from_tag(&get_tag("dojo_mock", "model2")), ), ]; let contracts = vec![ Manifest::new( DojoContract { + tag: get_tag("dojo_mock", "my_contract"), class_hash: felt!("0x1111"), address: Some(felt!("0x2222")), ..DojoContract::default() }, - "dojo_mock::contracts::my_contract".into(), + get_filename_from_tag(&get_tag("dojo_mock", "my_contract")), ), Manifest::new( DojoContract { + tag: get_tag("dojo_mock", "my_contract2"), class_hash: felt!("0x3333"), address: Some(felt!("4444")), ..DojoContract::default() }, - "dojo_mock::contracts::my_contract_2".into(), + get_filename_from_tag(&get_tag("dojo_mock", "my_contract2")), ), ]; @@ -102,27 +124,27 @@ fn diff_when_local_and_remote_are_different() { let diff = WorldDiff::compute(local, Some(remote)); assert_eq!(diff.count_diffs(), 3); - assert!(diff.models.iter().any(|m| m.name == "dojo_mock::models::model_2")); - assert!(diff.contracts.iter().any(|c| c.name == "dojo_mock::contracts::my_contract")); + assert!(diff.models.iter().any(|m| m.tag == get_tag("dojo_mock", "model2"))); + assert!(diff.contracts.iter().any(|c| c.tag == get_tag("dojo_mock", "my_contract"))); } #[test] fn updating_order_as_expected() { let init_calldata = vec![ - ("c4", vec!["$contract_address:c1", "0x0"]), - ("c3", vec!["0x0"]), - ("c5", vec!["$contract_address:c4", "0x0"]), - ("c7", vec!["$contract_address:c4", "0x0"]), - ("c2", vec!["0x0"]), - ("c6", vec!["$contract_address:c4", "$contract_address:c3", "0x0"]), - ("c1", vec!["0x0"]), + ("ns", "c4", vec!["$contract_address:ns-c1", "0x0"]), + ("ns", "c3", vec!["0x0"]), + ("ns", "c5", vec!["$contract_address:ns-c4", "0x0"]), + ("ns", "c7", vec!["$contract_address:ns-c4", "0x0"]), + ("ns", "c2", vec!["0x0"]), + ("ns", "c6", vec!["$contract_address:ns-c4", "$contract_address:ns-c3", "0x0"]), + ("ns", "c1", vec!["0x0"]), ]; let mut contracts = vec![]; for calldata in init_calldata { contracts.push(ContractDiff { - init_calldata: calldata.1.iter().map(|c| c.to_string()).collect(), - name: calldata.0.to_string(), + init_calldata: calldata.2.iter().map(|c| c.to_string()).collect(), + tag: get_tag(calldata.0, calldata.1), ..Default::default() }); } @@ -134,31 +156,31 @@ fn updating_order_as_expected() { models: vec![], }; - diff.update_order().unwrap(); + diff.update_order("ns").unwrap(); - let expected_order = ["c1", "c2", "c3", "c4", "c5", "c6", "c7"]; + let expected_order = ["ns-c1", "ns-c2", "ns-c3", "ns-c4", "ns-c5", "ns-c6", "ns-c7"]; for (i, contract) in diff.contracts.iter().enumerate() { - assert_eq!(contract.name, expected_order[i]); + assert_eq!(contract.tag, expected_order[i]); } } #[test] fn updating_order_when_cyclic_dependency_fail() { let init_calldata = vec![ - ("c4", vec!["$contract_address:c1", "$contract_address:c6", "0x0"]), - ("c3", vec!["0x0"]), - ("c5", vec!["$contract_address:c4", "0x0"]), - ("c7", vec!["$contract_address:c4", "0x0"]), - ("c2", vec!["0x0"]), - ("c6", vec!["$contract_address:c4", "$contract_address:c3", "0x0"]), - ("c1", vec!["0x0"]), + ("ns", "c4", vec!["$contract_address:ns-c1", "$contract_address:ns-c6", "0x0"]), + ("ns", "c3", vec!["0x0"]), + ("ns", "c5", vec!["$contract_address:ns-c4", "0x0"]), + ("ns", "c7", vec!["$contract_address:ns-c4", "0x0"]), + ("ns", "c2", vec!["0x0"]), + ("ns", "c6", vec!["$contract_address:ns-c4", "$contract_address:ns-c3", "0x0"]), + ("ns", "c1", vec!["0x0"]), ]; let mut contracts = vec![]; for calldata in init_calldata { contracts.push(ContractDiff { - init_calldata: calldata.1.iter().map(|c| c.to_string()).collect(), - name: calldata.0.to_string(), + init_calldata: calldata.2.iter().map(|c| c.to_string()).collect(), + tag: get_tag(calldata.0, calldata.1), ..Default::default() }); } @@ -170,5 +192,5 @@ fn updating_order_when_cyclic_dependency_fail() { models: vec![], }; - assert!(diff.update_order().is_err_and(|e| e.to_string().contains("Cyclic"))); + assert!(diff.update_order("ns").is_err_and(|e| e.to_string().contains("Cyclic"))); } diff --git a/crates/dojo-world/src/utils.rs b/crates/dojo-world/src/utils.rs index 16c7d59a64..4fd2c47800 100644 --- a/crates/dojo-world/src/utils.rs +++ b/crates/dojo-world/src/utils.rs @@ -3,6 +3,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use std::time::Duration; +use anyhow::Result; use futures::FutureExt; use starknet::accounts::{ AccountDeploymentV1, AccountError, AccountFactory, AccountFactoryError, ConnectedAccount, diff --git a/crates/katana/core/tests/sequencer.rs b/crates/katana/core/tests/sequencer.rs index 4d3ffb1494..a50047eb47 100644 --- a/crates/katana/core/tests/sequencer.rs +++ b/crates/katana/core/tests/sequencer.rs @@ -103,7 +103,14 @@ async fn test_increase_next_block_timestamp() { let block2_timestamp = BlockProvider::block(provider, block2.into()).unwrap().unwrap().header.timestamp; - assert_eq!(block2_timestamp, block1_timestamp + 1000, "timestamp should be updated"); + // Depending on the current time and the machine we run on, we may have 1 sec difference + // between the expected and actual timestamp. + // We take this possible delay in account to have the test more robust for now, + // but it may due to how the timestamp is updated in the sequencer. + assert!( + block2_timestamp == block1_timestamp + 1000 || block2_timestamp == block1_timestamp + 1001, + "timestamp should be updated" + ); } // #[tokio::test] diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index 1d70e1d491..f88f3c6f04 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -30,6 +30,7 @@ dojo-lang.workspace = true dojo-types.workspace = true dojo-world = { workspace = true, features = [ "contracts", "metadata", "migration" ] } futures.workspace = true +itertools.workspace = true num-bigint = "0.4.6" num-traits.workspace = true rpassword.workspace = true @@ -53,3 +54,4 @@ assert_fs.workspace = true dojo-test-utils = { workspace = true, features = [ "build-examples" ] } ipfs-api-backend-hyper = { git = "https://github.com/ferristseng/rust-ipfs-api", rev = "af2c17f7b19ef5b9898f458d97a90055c3605633", features = [ "with-hyper-rustls" ] } katana-runner.workspace = true +tee = "0.1.0" \ No newline at end of file diff --git a/crates/sozo/ops/src/auth.rs b/crates/sozo/ops/src/auth.rs index 5abdaec4a2..f9a1942aeb 100644 --- a/crates/sozo/ops/src/auth.rs +++ b/crates/sozo/ops/src/auth.rs @@ -2,96 +2,108 @@ use std::str::FromStr; use anyhow::{Context, Result}; use dojo_world::contracts::model::ModelError; +use dojo_world::contracts::naming::{ + compute_bytearray_hash, compute_model_selector_from_tag, ensure_namespace, +}; use dojo_world::contracts::world::WorldContract; -use dojo_world::contracts::{cairo_utils, WorldContractReader}; +use dojo_world::contracts::WorldContractReader; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionExt; use scarb_ui::Ui; use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag, Felt}; -use starknet::core::utils::{get_selector_from_name, parse_cairo_short_string}; use crate::utils; #[derive(Debug, Clone, PartialEq)] pub enum ResourceType { Contract(String), - Model(Felt), + Namespace(String), + Model(String), +} + +impl FromStr for ResourceType { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result { + let parts = s.split_once(':'); + let resource = match parts { + Some(("contract", name)) | Some(("c", name)) => { + ResourceType::Contract(name.to_string()) + } + Some(("model", name)) | Some(("m", name)) => ResourceType::Model(name.to_string()), + Some(("namespace", name)) | Some(("ns", name)) => { + ResourceType::Namespace(name.to_string()) + } + _ => anyhow::bail!( + "Resource is expected to be in the format `resource_type:resource_name`: `sozo \ + auth grant owner resource_type:resource_name,0x1234`" + ), + }; + Ok(resource) + } } #[derive(Debug, Clone, PartialEq)] -pub struct ModelContract { - pub model: Felt, - pub contract: String, +pub struct ResourceWriter { + pub resource: ResourceType, + pub tag_or_address: String, } -impl FromStr for ModelContract { +impl FromStr for ResourceWriter { type Err = anyhow::Error; fn from_str(s: &str) -> Result { let parts: Vec<&str> = s.split(',').collect(); - let (model, contract) = match parts.as_slice() { - [model, contract] => (model, contract), + let (resource, tag_or_address) = match parts.as_slice() { + [resource, tag_or_address] => (resource, tag_or_address.to_string()), _ => anyhow::bail!( - "Model and contract address are expected to be comma separated: `sozo auth grant \ - writer model_name,0x1234`" + "Resource and contract are expected to be comma separated: `sozo auth grant \ + writer model:model_name,0x1234`" ), }; - let model = cairo_utils::str_to_felt(model) - .map_err(|_| anyhow::anyhow!("Invalid model name: {}", model))?; - - Ok(ModelContract { model, contract: contract.to_string() }) + let resource = ResourceType::from_str(resource)?; + Ok(ResourceWriter { resource, tag_or_address }) } } #[derive(Debug, Clone, PartialEq)] -pub struct OwnerResource { +pub struct ResourceOwner { pub resource: ResourceType, pub owner: Felt, } -impl FromStr for OwnerResource { +impl FromStr for ResourceOwner { type Err = anyhow::Error; fn from_str(s: &str) -> Result { let parts: Vec<&str> = s.split(',').collect(); - let (resource_part, owner_part) = match parts.as_slice() { - [resource, owner] => (*resource, *owner), + let (resource, owner) = match parts.as_slice() { + [resource, owner] => (resource, owner), _ => anyhow::bail!( - "Owner and resource are expected to be comma separated: `sozo auth grant owner \ + "Resource and owner are expected to be comma separated: `sozo auth grant owner \ resource_type:resource_name,0x1234`" ), }; - let owner = Felt::from_hex(owner_part) - .map_err(|_| anyhow::anyhow!("Invalid owner address: {}", owner_part))?; + let owner = Felt::from_hex(owner) + .map_err(|_| anyhow::anyhow!("Invalid owner address: {}", owner))?; - let resource_parts = resource_part.split_once(':'); - let resource = match resource_parts { - Some(("contract", name)) => ResourceType::Contract(name.to_string()), - Some(("model", name)) => { - let model = cairo_utils::str_to_felt(name) - .map_err(|_| anyhow::anyhow!("Invalid model name: {}", name))?; - ResourceType::Model(model) - } - _ => anyhow::bail!( - "Resource is expected to be in the format `resource_type:resource_name`: `sozo \ - auth grant owner resource_type:resource_name,0x1234`" - ), - }; + let resource = ResourceType::from_str(resource)?; - Ok(OwnerResource { owner, resource }) + Ok(ResourceOwner { owner, resource }) } } pub async fn grant_writer<'a, A>( ui: &'a Ui, world: &WorldContract, - models_contracts: Vec, + new_writers: Vec, txn_config: TxnConfig, + default_namespace: &str, ) -> Result<()> where A: ConnectedAccount + Sync + Send, @@ -99,30 +111,12 @@ where { let mut calls = Vec::new(); - let world_reader = WorldContractReader::new(world.address, world.account.provider()) - .with_block(BlockId::Tag(BlockTag::Pending)); - - // TODO: Is some models have version 0 (using the name of the struct instead of the selector), - // we're not able to distinguish that. - // Should we add the version into the `ModelContract` struct? Can we always know that? - for mc in models_contracts { - let model_name = parse_cairo_short_string(&mc.model)?; - let model_selector = get_selector_from_name(&model_name)?; - - match world_reader.model_reader(&model_name).await { - Ok(_) => { - let contract = utils::get_contract_address(world, mc.contract).await?; - calls.push(world.grant_writer_getcall(&model_selector, &contract.into())); - } - - Err(ModelError::ModelNotFound) => { - ui.print(format!("Unknown model '{}' => IGNORED", model_name)); - } - - Err(err) => { - return Err(err.into()); - } - } + for new_writer in new_writers { + let resource_selector = + get_resource_selector(ui, world, &new_writer.resource, default_namespace).await?; + let contract_address = + utils::get_contract_address(world, new_writer.tag_or_address).await?; + calls.push(world.grant_writer_getcall(&resource_selector, &contract_address.into())); } if !calls.is_empty() { @@ -149,30 +143,19 @@ where pub async fn grant_owner( ui: &Ui, world: &WorldContract, - owners_resources: Vec, + new_owners: Vec, txn_config: TxnConfig, + default_namespace: &str, ) -> Result<()> where A: ConnectedAccount + Sync + Send + 'static, { let mut calls = Vec::new(); - for or in owners_resources { - let resource = match &or.resource { - ResourceType::Model(name) => { - // TODO: Is some models have version 0 (using the name of the struct instead of the - // selector), we're not able to distinguish that. - // Should we add the version into the `ModelContract` struct? Can we always know - // that? - let model_name = parse_cairo_short_string(name)?; - get_selector_from_name(&model_name)? - } - ResourceType::Contract(name_or_address) => { - utils::get_contract_address(world, name_or_address.clone()).await? - } - }; - - calls.push(world.grant_owner_getcall(&or.owner.into(), &resource)); + for new_owner in new_owners { + let resource_selector = + get_resource_selector(ui, world, &new_owner.resource, default_namespace).await?; + calls.push(world.grant_owner_getcall(&new_owner.owner.into(), &resource_selector)); } let res = world @@ -197,38 +180,21 @@ where pub async fn revoke_writer( ui: &Ui, world: &WorldContract, - models_contracts: Vec, + new_writers: Vec, txn_config: TxnConfig, + default_namespace: &str, ) -> Result<()> where A: ConnectedAccount + Sync + Send + 'static, { let mut calls = Vec::new(); - let mut world_reader = WorldContractReader::new(world.address, world.account.provider()); - world_reader.set_block(BlockId::Tag(BlockTag::Pending)); - - for mc in models_contracts { - // TODO: Is some models have version 0 (using the name of the struct instead of the - // selector), we're not able to distinguish that. - // Should we add the version into the `ModelContract` struct? Can we always know that? - let model_name = parse_cairo_short_string(&mc.model)?; - let model_selector = get_selector_from_name(&model_name)?; - - match world_reader.model_reader(&model_name).await { - Ok(_) => { - let contract = utils::get_contract_address(world, mc.contract).await?; - calls.push(world.revoke_writer_getcall(&model_selector, &contract.into())); - } - - Err(ModelError::ModelNotFound) => { - ui.print(format!("Unknown model '{}' => IGNORED", model_name)); - } - - Err(err) => { - return Err(err.into()); - } - } + for new_writer in new_writers { + let resource_selector = + get_resource_selector(ui, world, &new_writer.resource, default_namespace).await?; + let contract_address = + utils::get_contract_address(world, new_writer.tag_or_address).await?; + calls.push(world.revoke_writer_getcall(&resource_selector, &contract_address.into())); } if !calls.is_empty() { @@ -255,30 +221,19 @@ where pub async fn revoke_owner( ui: &Ui, world: &WorldContract, - owners_resources: Vec, + new_owners: Vec, txn_config: TxnConfig, + default_namespace: &str, ) -> Result<()> where A: ConnectedAccount + Sync + Send + 'static, { let mut calls = Vec::new(); - for or in owners_resources { - let resource = match &or.resource { - ResourceType::Model(name) => { - // TODO: Is some models have version 0 (using the name of the struct instead of the - // selector), we're not able to distinguish that. - // Should we add the version into the `ModelContract` struct? Can we always know - // that? - let model_name = parse_cairo_short_string(name)?; - get_selector_from_name(&model_name)? - } - ResourceType::Contract(name_or_address) => { - utils::get_contract_address(world, name_or_address.clone()).await? - } - }; - - calls.push(world.revoke_owner_getcall(&or.owner.into(), &resource)); + for new_owner in new_owners { + let resource_selector = + get_resource_selector(ui, world, &new_owner.resource, default_namespace).await?; + calls.push(world.revoke_owner_getcall(&new_owner.owner.into(), &resource_selector)); } let res = world @@ -299,3 +254,50 @@ where Ok(()) } + +async fn get_resource_selector( + ui: &Ui, + world: &WorldContract, + resource: &ResourceType, + default_namespace: &str, +) -> Result +where + A: ConnectedAccount + Sync + Send, + ::SignError: 'static, +{ + let world_reader = WorldContractReader::new(world.address, world.account.provider()) + .with_block(BlockId::Tag(BlockTag::Pending)); + + let resource_selector = match resource { + ResourceType::Contract(tag_or_address) => { + let tag_or_address = if tag_or_address.starts_with("0x") { + tag_or_address.to_string() + } else { + ensure_namespace(tag_or_address, default_namespace) + }; + utils::get_contract_address(world, tag_or_address).await? + } + ResourceType::Model(tag_or_name) => { + // TODO: Is some models have version 0 (using the name of the struct instead of the + // selector), we're not able to distinguish that. + // Should we add the version into the `ModelContract` struct? Can we always know that? + let tag = ensure_namespace(tag_or_name, default_namespace); + + // be sure that the model exists + match world_reader.model_reader_with_tag(&tag).await { + Err(ModelError::ModelNotFound) => { + ui.print(format!("Unknown model '{}' => IGNORED", tag)); + } + Err(err) => { + return Err(err.into()); + } + _ => {} + }; + + compute_model_selector_from_tag(&tag) + } + ResourceType::Namespace(name) => compute_bytearray_hash(name), + }; + + Ok(resource_selector) +} diff --git a/crates/sozo/ops/src/call.rs b/crates/sozo/ops/src/call.rs index 3f3a125f40..251cc07819 100644 --- a/crates/sozo/ops/src/call.rs +++ b/crates/sozo/ops/src/call.rs @@ -8,12 +8,12 @@ use crate::utils::{get_contract_address_from_reader, parse_block_id}; pub async fn call( world_reader: WorldContractReader

, - contract: String, + tag_or_address: String, entrypoint: String, calldata: Vec, block_id: Option, ) -> Result<()> { - let contract_address = get_contract_address_from_reader(&world_reader, contract).await?; + let contract_address = get_contract_address_from_reader(&world_reader, tag_or_address).await?; let block_id = if let Some(block_id) = block_id { parse_block_id(block_id)? } else { diff --git a/crates/sozo/ops/src/events.rs b/crates/sozo/ops/src/events.rs index 4c7073929a..4092613eb0 100644 --- a/crates/sozo/ops/src/events.rs +++ b/crates/sozo/ops/src/events.rs @@ -2,10 +2,15 @@ use std::collections::{HashMap, VecDeque}; use std::fs; use anyhow::{anyhow, Result}; +use cainome::cairo_serde::{ByteArray, CairoSerde}; use cainome::parser::tokens::{CompositeInner, CompositeInnerKind, CoreBasic, Token}; use cainome::parser::AbiParser; use camino::Utf8PathBuf; -use dojo_world::manifest::{AbiFormat, DeploymentManifest, ManifestMethods, MANIFESTS_DIR}; +use dojo_world::contracts::naming::get_filename_from_tag; +use dojo_world::manifest::{ + AbiFormat, DeploymentManifest, ManifestMethods, BASE_CONTRACT_TAG, MANIFESTS_DIR, TARGET_DIR, + WORLD_CONTRACT_TAG, +}; use starknet::core::types::{BlockId, EventFilter, Felt}; use starknet::core::utils::{parse_cairo_short_string, starknet_keccak}; use starknet::providers::jsonrpc::HttpTransport; @@ -33,15 +38,13 @@ pub async fn parse( continuation_token: Option, event_filter: EventFilter, json: bool, - manifest_dir: &Utf8PathBuf, + project_dir: &Utf8PathBuf, profile_name: &str, ) -> Result<()> { let events_map = if !json { - let deployed_manifest = manifest_dir - .join(MANIFESTS_DIR) - .join(profile_name) - .join("manifest") - .with_extension("toml"); + let manifest_dir = project_dir.join(MANIFESTS_DIR).join(profile_name); + let target_dir = project_dir.join(TARGET_DIR).join(profile_name); + let deployed_manifest = manifest_dir.join("manifest").with_extension("toml"); if !deployed_manifest.exists() { return Err(anyhow!("Run scarb migrate before running this command")); @@ -49,7 +52,8 @@ pub async fn parse( Some(extract_events( &DeploymentManifest::load_from_path(&deployed_manifest)?, - manifest_dir, + &manifest_dir, + &target_dir, )?) } else { None @@ -74,7 +78,8 @@ fn is_event(token: &Token) -> bool { fn extract_events( manifest: &DeploymentManifest, - manifest_dir: &Utf8PathBuf, + project_dir: &Utf8PathBuf, + target_dir: &Utf8PathBuf, ) -> Result>> { fn process_abi( events: &mut HashMap>, @@ -102,24 +107,26 @@ fn extract_events( for contract in &manifest.contracts { if let Some(AbiFormat::Path(abi_path)) = contract.inner.abi() { - let full_abi_path = manifest_dir.join(abi_path); + let full_abi_path = project_dir.join(abi_path); process_abi(&mut events_map, &full_abi_path)?; } } for model in &manifest.models { if let Some(AbiFormat::Path(abi_path)) = model.inner.abi() { - let full_abi_path = manifest_dir.join(abi_path); + let full_abi_path = project_dir.join(abi_path); process_abi(&mut events_map, &full_abi_path)?; } } // Read the world and base ABI from scarb artifacts as the // manifest does not include them (at least base is not included). - let world_abi_path = manifest_dir.join("target/dev/dojo::world::world.json"); + let world_abi_path = + target_dir.join(format!("{}.json", get_filename_from_tag(WORLD_CONTRACT_TAG))); process_abi(&mut events_map, &world_abi_path)?; - let base_abi_path = manifest_dir.join("target/dev/dojo::base::base.json"); + let base_abi_path = + target_dir.join(format!("{}.json", get_filename_from_tag(BASE_CONTRACT_TAG))); process_abi(&mut events_map, &base_abi_path)?; Ok(events_map) @@ -208,6 +215,16 @@ fn process_inners( let formatted_value = match &inner.token { Token::CoreBasic(ref cb) => parse_core_basic(cb, &value, true)?, + Token::Composite(c) => { + if c.type_path.eq("core::byte_array::ByteArray") { + data.push_front(value); + let bytearray = ByteArray::cairo_deserialize(data.as_mut_slices().0, 0)?; + data.drain(0..ByteArray::cairo_serialized_size(&bytearray)); + ByteArray::to_string(&bytearray)? + } else { + return Err(anyhow!("Unhandled Composite token")); + } + } Token::Array(ref array) => { let length = value .to_string() @@ -244,7 +261,7 @@ fn process_inners( mod tests { use cainome::parser::tokens::{Array, Composite, CompositeInner, CompositeType}; use camino::Utf8Path; - use dojo_world::manifest::{BaseManifest, BASE_DIR}; + use dojo_world::manifest::{BaseManifest, BASE_DIR, WORLD_QUALIFIED_PATH}; use starknet::core::types::EmittedEvent; use super::*; @@ -252,22 +269,23 @@ mod tests { #[test] fn extract_events_work_as_expected() { let profile_name = "dev"; - let manifest_dir = Utf8Path::new("../../../examples/spawn-and-move").to_path_buf(); - let manifest = BaseManifest::load_from_path( - &manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), - ) - .unwrap() - .into(); - let result = extract_events(&manifest, &manifest_dir).unwrap(); + let project_dir = Utf8Path::new("../../../examples/spawn-and-move").to_path_buf(); + let manifest_dir = project_dir.join(MANIFESTS_DIR).join(profile_name); + println!("manifest_dir {:?}", manifest_dir); + let target_dir = project_dir.join(TARGET_DIR).join(profile_name); + println!("target dir {:?}", target_dir); + let manifest = BaseManifest::load_from_path(&manifest_dir.join(BASE_DIR)).unwrap().into(); + + let result = extract_events(&manifest, &project_dir, &target_dir).unwrap(); // we are just collecting all events from manifest file so just verifying count should work - assert_eq!(result.len(), 15); + assert_eq!(result.len(), 16); } #[test] fn test_core_basic() { let composite = Composite { - type_path: "dojo::world::world::TestEvent".to_string(), + type_path: format!("{WORLD_QUALIFIED_PATH}::TestEvent"), inners: vec![ CompositeInner { index: 0, @@ -375,10 +393,11 @@ mod tests { transaction_hash: Felt::from_hex("0x789").unwrap(), }; - let expected_output = "Event name: dojo::world::world::TestEvent\nfelt252: 0x5465737431 \ - \"Test1\"\nbool: true\nu8: 1\nu16: 2\nu32: 3\nu64: 4\nu128: \ - 5\nusize: 6\nclass_hash: 0x54657374\ncontract_address: 0x54657374\n" - .to_string(); + let expected_output = format!( + "Event name: {WORLD_QUALIFIED_PATH}::TestEvent\nfelt252: 0x5465737431 \ + \"Test1\"\nbool: true\nu8: 1\nu16: 2\nu32: 3\nu64: 4\nu128: 5\nusize: 6\nclass_hash: \ + 0x54657374\ncontract_address: 0x54657374\n" + ); let actual_output_option = parse_event(event, &events_map).expect("Failed to parse event"); @@ -391,7 +410,7 @@ mod tests { #[test] fn test_array() { let composite = Composite { - type_path: "dojo::world::world::StoreDelRecord".to_string(), + type_path: format!("{WORLD_QUALIFIED_PATH}::StoreDelRecord"), inners: vec![ CompositeInner { index: 0, @@ -440,9 +459,10 @@ mod tests { transaction_hash: Felt::from_hex("0x789").unwrap(), }; - let expected_output = "Event name: dojo::world::world::StoreDelRecord\ntable: 0x54657374 \ - \"Test\"\nkeys: [0x5465737431, 0x5465737432, 0x5465737433]\n" - .to_string(); + let expected_output = format!( + "Event name: {WORLD_QUALIFIED_PATH}::StoreDelRecord\ntable: 0x54657374 \ + \"Test\"\nkeys: [0x5465737431, 0x5465737432, 0x5465737433]\n" + ); let actual_output_option = parse_event(event, &events_map).expect("Failed to parse event"); @@ -455,7 +475,7 @@ mod tests { #[test] fn test_custom_event() { let composite = Composite { - type_path: "dojo::world::world::CustomEvent".to_string(), + type_path: format!("{WORLD_QUALIFIED_PATH}::CustomEvent"), inners: vec![ CompositeInner { index: 0, @@ -514,9 +534,10 @@ mod tests { transaction_hash: Felt::from_hex("0x789").unwrap(), }; - let expected_output = "Event name: dojo::world::world::CustomEvent\nkey_1: 3\nkey_2: \ - 0x5465737431 \"Test1\"\ndata_1: 1\ndata_2: 2\n" - .to_string(); + let expected_output = format!( + "Event name: {WORLD_QUALIFIED_PATH}::CustomEvent\nkey_1: 3\nkey_2: 0x5465737431 \ + \"Test1\"\ndata_1: 1\ndata_2: 2\n" + ); let actual_output_option = parse_event(event, &events_map).expect("Failed to parse event"); @@ -529,7 +550,7 @@ mod tests { #[test] fn test_zero_felt() { let composite = Composite { - type_path: "dojo::world::world::StoreDelRecord".to_string(), + type_path: format!("{WORLD_QUALIFIED_PATH}::StoreDelRecord"), inners: vec![ CompositeInner { index: 0, @@ -578,9 +599,10 @@ mod tests { transaction_hash: Felt::from_hex("0x789").unwrap(), }; - let expected_output = "Event name: dojo::world::world::StoreDelRecord\ntable: 0x0\nkeys: \ - [0x0, 0x1, 0x2]\n" - .to_string(); + let expected_output = format!( + "Event name: {WORLD_QUALIFIED_PATH}::StoreDelRecord\ntable: 0x0\nkeys: [0x0, 0x1, \ + 0x2]\n" + ); let actual_output_option = parse_event(event, &events_map).expect("Failed to parse event"); diff --git a/crates/sozo/ops/src/execute.rs b/crates/sozo/ops/src/execute.rs index 5fc69a9727..24dd6c6ee2 100644 --- a/crates/sozo/ops/src/execute.rs +++ b/crates/sozo/ops/src/execute.rs @@ -11,7 +11,7 @@ use crate::utils; pub async fn execute( ui: &Ui, - contract: String, + tag_or_address: String, entrypoint: String, calldata: Vec, world: &WorldContract, @@ -20,7 +20,7 @@ pub async fn execute( where A: ConnectedAccount + Sync + Send + 'static, { - let contract_address = utils::get_contract_address(world, contract).await?; + let contract_address = utils::get_contract_address(world, tag_or_address).await?; let res = world .account .execute_v1(vec![Call { diff --git a/crates/sozo/ops/src/migration/auto_auth.rs b/crates/sozo/ops/src/migration/auto_auth.rs index df213e144c..5e040f8ea5 100644 --- a/crates/sozo/ops/src/migration/auto_auth.rs +++ b/crates/sozo/ops/src/migration/auto_auth.rs @@ -1,5 +1,7 @@ +use std::str::FromStr; + use anyhow::Result; -use dojo_world::contracts::{cairo_utils, WorldContract}; +use dojo_world::contracts::WorldContract; use dojo_world::manifest::BaseManifest; use dojo_world::migration::TxnConfig; use scarb::core::Workspace; @@ -8,7 +10,7 @@ use starknet::accounts::ConnectedAccount; use super::ui::MigrationUi; use super::MigrationOutput; -use crate::auth::{grant_writer, ModelContract}; +use crate::auth::{grant_writer, ResourceType, ResourceWriter}; pub async fn auto_authorize( ws: &Workspace<'_>, @@ -16,6 +18,7 @@ pub async fn auto_authorize( txn_config: &TxnConfig, local_manifest: &BaseManifest, migration_output: &MigrationOutput, + default_namespace: &str, ) -> Result<()> where A: ConnectedAccount + Sync + Send, @@ -26,15 +29,15 @@ where ui.print(" "); ui.print_step(6, "🖋️", "Authorizing Models to Systems (based on overlay)..."); ui.print(" "); - let models_contracts = compute_models_contracts(&ui, local_manifest, migration_output)?; - grant_writer(&ui, world, models_contracts, *txn_config).await + let new_writers = compute_writers(&ui, local_manifest, migration_output)?; + grant_writer(&ui, world, new_writers, *txn_config, default_namespace).await } -pub fn compute_models_contracts( +pub fn compute_writers( ui: &Ui, local_manifest: &BaseManifest, migration_output: &MigrationOutput, -) -> Result> { +) -> Result> { let mut res = vec![]; let local_contracts = &local_manifest.contracts; @@ -43,21 +46,21 @@ pub fn compute_models_contracts( // Find that contract from local_manifest based on its name. let contract = local_contracts .iter() - .find(|c| migrated_contract.name == c.name) + .find(|c| migrated_contract.tag == c.inner.tag) .expect("we know this contract exists"); ui.print_sub(format!( "Authorizing {} for Models: {:?}", - contract.name, contract.inner.writes + contract.inner.tag, contract.inner.writes )); - // Read all the models that its supposed to write and collect them in a Vec + // Read all the models that its supposed to write and collect them in a Vec // so we can call `grant_writer` on all of them. - for model in &contract.inner.writes { - let model = cairo_utils::str_to_felt(model)?; - let contract_addr_str = format!("{:#x}", migrated_contract.contract_address); + for model_tag in &contract.inner.writes { + let resource = ResourceType::from_str(format!("model:{model_tag}").as_str())?; + let tag_or_address = format!("{:#x}", migrated_contract.contract_address); - res.push(ModelContract { model, contract: contract_addr_str }); + res.push(ResourceWriter { resource, tag_or_address }); } } diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index d948f9305c..e2fcfcecbc 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -1,8 +1,12 @@ use std::path::Path; use anyhow::{anyhow, bail, Context, Result}; +use cainome::cairo_serde::ByteArray; use camino::Utf8PathBuf; use dojo_world::contracts::abi::world; +use dojo_world::contracts::naming::{ + compute_model_selector_from_tag, get_name_from_tag, get_namespace_from_tag, +}; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, @@ -19,6 +23,7 @@ use dojo_world::migration::{ }; use dojo_world::utils::{TransactionExt, TransactionWaiter}; use futures::future; +use itertools::Itertools; use scarb::core::Workspace; use scarb_ui::Ui; use starknet::accounts::ConnectedAccount; @@ -213,11 +218,21 @@ where let world_address = strategy.world_address()?; + // register namespaces + let mut namespaces = + strategy.models.iter().map(|m| get_namespace_from_tag(&m.diff.tag)).collect::>(); + namespaces.extend( + strategy.contracts.iter().map(|c| get_namespace_from_tag(&c.diff.tag)).collect::>(), + ); + namespaces = namespaces.into_iter().unique().collect::>(); + + register_namespaces(&namespaces, world_address, &migrator, &ui, &txn_config).await?; + // Once Torii supports indexing arrays, we should declare and register the // ResourceMetadata model. match register_dojo_models(&strategy.models, world_address, &migrator, &ui, &txn_config).await { Ok(output) => { - migration_output.models = output.registered_model_names; + migration_output.models = output.registered_models; } Err(e) => { ui.anyhow(&e); @@ -305,11 +320,7 @@ where ui.print_step(7, "🌐", "Uploading metadata..."); ui.print(" "); - let dojo_metadata = if let Some(metadata) = dojo_metadata_from_workspace(ws) { - metadata - } else { - return Err(anyhow!("No current package with dojo metadata found.")); - }; + let dojo_metadata = dojo_metadata_from_workspace(ws)?; let mut ipfs = vec![]; let mut resources = vec![]; @@ -329,11 +340,11 @@ where // models if !migration_output.models.is_empty() { - for model_name in migration_output.models { - if let Some(m) = dojo_metadata.resources_artifacts.get(&model_name) { + for model_tag in migration_output.models { + if let Some(m) = dojo_metadata.resources_artifacts.get(&model_tag) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, - get_selector_from_name(&model_name).expect("ASCII model name"), + compute_model_selector_from_tag(&model_tag), m.clone(), )); } @@ -345,7 +356,7 @@ where if !migrated_contracts.is_empty() { for contract in migrated_contracts { - if let Some(m) = dojo_metadata.resources_artifacts.get(&contract.name) { + if let Some(m) = dojo_metadata.resources_artifacts.get(&contract.tag) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, contract.contract_address, @@ -388,10 +399,46 @@ where Ok(()) } +async fn register_namespaces( + namespaces: &[String], + world_address: Felt, + migrator: &A, + ui: &Ui, + txn_config: &TxnConfig, +) -> Result<()> +where + A: ConnectedAccount + Send + Sync, + ::Provider: Send, +{ + ui.print_header(format!("# Namespaces ({})", namespaces.len())); + + let world = WorldContract::new(world_address, migrator); + + let calls = namespaces + .iter() + .map(|ns| { + ui.print(italic_message(&ns).to_string()); + world.register_namespace_getcall(&ByteArray::from_string(ns).unwrap()) + }) + .collect::>(); + + let InvokeTransactionResult { transaction_hash } = + world.account.execute_v1(calls).send_with_cfg(txn_config).await.map_err(|e| { + ui.verbose(format!("{e:?}")); + anyhow!("Failed to register namespace to World: {e}") + })?; + + TransactionWaiter::new(transaction_hash, migrator.provider()).await?; + + ui.print(format!("All namespaces are registered at: {transaction_hash:#x}\n")); + + Ok(()) +} + async fn register_dojo_models( models: &[ClassMigration], world_address: Felt, - migrator: A, + migrator: &A, ui: &Ui, txn_config: &TxnConfig, ) -> Result @@ -403,17 +450,17 @@ where return Ok(RegisterOutput { transaction_hash: Felt::ZERO, declare_output: vec![], - registered_model_names: vec![], + registered_models: vec![], }); } ui.print_header(format!("# Models ({})", models.len())); let mut declare_output = vec![]; - let mut registered_model_names = vec![]; + let mut registered_models = vec![]; for c in models.iter() { - ui.print(italic_message(&c.diff.name).to_string()); + ui.print(italic_message(&c.diff.tag).to_string()); let res = c.declare(&migrator, txn_config).await; match res { @@ -433,7 +480,7 @@ where } Err(e) => { ui.verbose(format!("{e:?}")); - bail!("Failed to declare model {}: {e}", c.diff.name) + bail!("Failed to declare model {}: {e}", c.diff.tag) } } @@ -445,7 +492,7 @@ where let calls = models .iter() .map(|c| { - registered_model_names.push(c.diff.name.clone()); + registered_models.push(c.diff.tag.clone()); world.register_model_getcall(&c.diff.local_class_hash.into()) }) .collect::>(); @@ -458,9 +505,9 @@ where TransactionWaiter::new(transaction_hash, migrator.provider()).await?; - ui.print(format!("All models are registered at: {transaction_hash:#x}")); + ui.print(format!("All models are registered at: {transaction_hash:#x}\n")); - Ok(RegisterOutput { transaction_hash, declare_output, registered_model_names }) + Ok(RegisterOutput { transaction_hash, declare_output, registered_models }) } async fn register_dojo_contracts( @@ -483,8 +530,9 @@ where let mut deploy_output = vec![]; for contract in contracts { - let name = &contract.diff.name; - ui.print(italic_message(name).to_string()); + let tag = &contract.diff.tag; + ui.print(italic_message(tag).to_string()); + match contract .deploy_dojo_contract( world_address, @@ -526,7 +574,7 @@ where ui.print_sub(format!("Contract address: {:#x}", output.contract_address)); } deploy_output.push(Some(ContractMigrationOutput { - name: name.to_string(), + tag: tag.clone(), contract_address: output.contract_address, base_class_hash: output.base_class_hash, })); @@ -541,7 +589,7 @@ where Err(e) => { ui.verbose(format!("{e:?}")); return Err(anyhow!( - "Failed to migrate {name}: {e}. Please also verify init calldata is valid, if \ + "Failed to migrate {tag}: {e}. Please also verify init calldata is valid, if \ any." )); } @@ -577,7 +625,7 @@ where ui.print_hidden_sub(format!("Deploy transaction: {:#x}", val.transaction_hash)); - val.name = Some(contract.diff.name.clone()); + val.tag = Some(contract.diff.tag.clone()); Ok(ContractDeploymentOutput::Output(val)) } Err(MigrationError::ContractAlreadyDeployed(contract_address)) => { @@ -677,17 +725,17 @@ where .await { Ok(current_class_hash) if current_class_hash != contract.diff.local_class_hash => { - return format!("{}: Upgrade", contract.diff.name); + return format!("{}: Upgrade", contract.diff.tag); } Err(ProviderError::StarknetError(StarknetError::ContractNotFound)) => { - return format!("{}: Deploy", contract.diff.name); + return format!("{}: Deploy", contract.diff.tag); } Ok(_) => return "Already Deployed".to_string(), - Err(_) => return format!("{}: Deploy", contract.diff.name), + Err(_) => return format!("{}: Deploy", contract.diff.tag), } } } - format!("deploy {}", contract.diff.name) + format!("deploy {}", contract.diff.tag) } pub async fn print_strategy

( @@ -721,7 +769,7 @@ pub async fn print_strategy

( if !&strategy.models.is_empty() { ui.print_header(format!("# Models ({})", &strategy.models.len())); for m in &strategy.models { - ui.print(m.diff.name.to_string()); + ui.print(m.diff.tag.to_string()); ui.print_sub(format!("Class hash: {:#x}", m.diff.local_class_hash)); } } @@ -735,7 +783,7 @@ pub async fn print_strategy

( ui.print(op_name); ui.print_sub(format!("Class hash: {:#x}", c.diff.local_class_hash)); - let salt = generate_salt(&c.diff.name); + let salt = generate_salt(&get_name_from_tag(&c.diff.tag)); let contract_address = get_contract_address(salt, c.diff.base_class_hash, &[], world_address); ui.print_sub(format!("Contract address: {:#x}", contract_address)); @@ -759,10 +807,8 @@ pub async fn update_manifests_and_abis( let ui = ws.config().ui(); ui.print_step(5, "✨", "Updating manifests..."); - let deployed_path = - manifest_dir.join(MANIFESTS_DIR).join(profile_name).join("manifest").with_extension("toml"); - let deployed_path_json = - manifest_dir.join(MANIFESTS_DIR).join(profile_name).join("manifest").with_extension("json"); + let deployed_path = manifest_dir.join("manifest").with_extension("toml"); + let deployed_path_json = manifest_dir.join("manifest").with_extension("json"); let mut local_manifest: DeploymentManifest = local_manifest.into(); @@ -796,7 +842,7 @@ pub async fn update_manifests_and_abis( let local = local_manifest .contracts .iter_mut() - .find(|c| c.name == output.name) + .find(|c| c.inner.tag == output.tag) .expect("contract got migrated, means it should be present here"); local.inner.base_class_hash = output.base_class_hash; @@ -806,7 +852,7 @@ pub async fn update_manifests_and_abis( local_manifest.contracts.iter_mut().for_each(|contract| { if contract.inner.base_class_hash != Felt::ZERO { - let salt = generate_salt(&contract.name); + let salt = generate_salt(&get_name_from_tag(&contract.inner.tag)); contract.inner.address = Some(get_contract_address( salt, contract.inner.base_class_hash, @@ -832,11 +878,7 @@ async fn update_manifest_abis( manifest_dir: &Utf8PathBuf, profile_name: &str, ) { - fs::create_dir_all( - manifest_dir.join(MANIFESTS_DIR).join(profile_name).join(ABIS_DIR).join(DEPLOYMENTS_DIR), - ) - .await - .expect("Failed to create folder"); + fs::create_dir_all(manifest_dir).await.expect("Failed to create folder"); async fn inner_helper( manifest_dir: &Utf8PathBuf, @@ -845,37 +887,25 @@ async fn update_manifest_abis( ) where T: ManifestMethods, { - // for example: - // from: manifests/dev/abis/base/contract/dojo_world_world.json - // to: manifests/dev/abis/deployments/contract/dojo_world_world.json - // - // Unwraps in call to abi is safe because we always write abis for DojoContracts as relative - // path. - // In this relative path, we only what the root from - // ABI directory. - - // manifests/dev/abis/base/contract/dojo_world_world.json + // manifests/dev/abis/base/contract/dojo-world.json -> abis/base/contract/dojo-world.json let base_relative_path = manifest.inner.abi().unwrap().to_path().unwrap(); + let base_relative_path = base_relative_path + .strip_prefix(Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name)) + .unwrap(); - // contract/dojo_world_world.json + // abis/base/dojo-world.json -> dojo-world.json let stripped_path = base_relative_path - .strip_prefix( - Utf8PathBuf::new() - .join(MANIFESTS_DIR) - .join(profile_name) - .join(ABIS_DIR) - .join(BASE_DIR), - ) + .strip_prefix(Utf8PathBuf::new().join(ABIS_DIR).join(BASE_DIR)) .unwrap(); - let deployed_relative_path = Utf8PathBuf::new() - .join(MANIFESTS_DIR) - .join(profile_name) - .join(ABIS_DIR) - .join(DEPLOYMENTS_DIR) - .join(stripped_path); + // abis/deployments/dojo-world.json + let deployed_relative_path = + Utf8PathBuf::new().join(ABIS_DIR).join(DEPLOYMENTS_DIR).join(stripped_path); + // /abis/base/dojo-world.json let full_base_path = manifest_dir.join(base_relative_path); + + // /abis/deployments/dojo-world.json let full_deployed_path = manifest_dir.join(deployed_relative_path.clone()); fs::create_dir_all(full_deployed_path.parent().unwrap()) diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index e234759dff..281bffc1f4 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -1,19 +1,20 @@ +use std::fs; use std::sync::Arc; -use std::{fs, io}; -use anyhow::{anyhow, Context, Result}; -use camino::Utf8PathBuf; +use anyhow::{anyhow, bail, Context, Result}; use dojo_world::contracts::WorldContract; use dojo_world::manifest::{ - DojoContract, DojoModel, Manifest, OverlayClass, OverlayDojoContract, OverlayDojoModel, - OverlayManifest, BASE_CONTRACT_NAME, BASE_DIR, CONTRACTS_DIR, MANIFESTS_DIR, MODELS_DIR, - OVERLAYS_DIR, WORLD_CONTRACT_NAME, + BaseManifest, OverlayClass, OverlayDojoContract, OverlayDojoModel, OverlayManifest, + BASE_CONTRACT_TAG, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, WORLD_CONTRACT_TAG, }; +use dojo_world::metadata::get_default_namespace_from_ws; use dojo_world::migration::world::WorldDiff; use dojo_world::migration::{DeployOutput, TxnConfig, UpgradeOutput}; use scarb::core::Workspace; use starknet::accounts::ConnectedAccount; use starknet::core::types::Felt; +use starknet::core::utils::{cairo_short_string_to_felt, get_contract_address}; +use starknet_crypto::poseidon_hash_single; mod auto_auth; mod migrate; @@ -42,7 +43,7 @@ pub struct MigrationOutput { #[derive(Debug, Default, Clone)] pub struct ContractMigrationOutput { - pub name: String, + pub tag: String, pub contract_address: Felt, pub base_class_hash: Felt, } @@ -66,31 +67,53 @@ where let ui = ws.config().ui(); // its path to a file so `parent` should never return `None` - let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + let root_dir = ws.manifest_path().parent().unwrap().to_path_buf(); let profile_name = ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); - let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(&profile_name); + let manifest_dir = root_dir.join(MANIFESTS_DIR).join(&profile_name); + let manifest_base_dir = manifest_dir.join(BASE_DIR); + let overlay_dir = root_dir.join(OVERLAYS_DIR).join(&profile_name); let target_dir = ws.target_dir().path_existent().unwrap(); let target_dir = target_dir.join(ws.config().profile().as_str()); + let default_namespace = get_default_namespace_from_ws(ws); + // Load local and remote World manifests. - let (local_manifest, remote_manifest) = - utils::load_world_manifests(&profile_dir, &account, world_address, &ui, skip_manifests) - .await - .map_err(|e| { - ui.error(e.to_string()); - anyhow!( - "\n Use `sozo clean` to clean your project.\nThen, rebuild your project with \ - `sozo build`.", - ) - })?; + let (local_manifest, remote_manifest) = utils::load_world_manifests( + &manifest_base_dir, + &overlay_dir, + &account, + world_address, + &ui, + skip_manifests, + ) + .await + .map_err(|e| { + ui.error(e.to_string()); + anyhow!( + "\n Use `sozo clean` to clean your project.\nThen, rebuild your project with `sozo \ + build`.", + ) + })?; + + let generated_world_address = get_world_address(&local_manifest, name)?; + if let Some(world_address) = world_address { + if world_address != generated_world_address { + bail!(format!( + "Calculated world address ({:#x}) doesn't match provided world address. If you \ + are deploying with custom seed make sure `world_address` is correctly configured \ + (or not set) `Scarb.toml`", + generated_world_address + )) + } + } // Calculate diff between local and remote World manifests. ui.print_step(2, "🧰", "Evaluating Worlds diff..."); let mut diff = WorldDiff::compute(local_manifest.clone(), remote_manifest.clone()); - diff.update_order()?; + diff.update_order(&default_namespace)?; let total_diffs = diff.count_diffs(); ui.print_sub(format!("Total diffs found: {total_diffs}")); @@ -153,7 +176,15 @@ where let account = Arc::new(account); let world = WorldContract::new(world_address, account.clone()); if let Some(migration_output) = migration_output { - match auto_authorize(ws, &world, &txn_config, &local_manifest, &migration_output).await + match auto_authorize( + ws, + &world, + &txn_config, + &local_manifest, + &migration_output, + &default_namespace, + ) + .await { Ok(()) => { ui.print_sub("Auto authorize completed successfully"); @@ -163,6 +194,7 @@ where } }; + // if !ws.config().offline() { upload_metadata(ws, &account, migration_output.clone(), txn_config).await?; } @@ -172,6 +204,23 @@ where Ok(()) } +fn get_world_address( + local_manifest: &dojo_world::manifest::BaseManifest, + name: &str, +) -> Result { + let name = cairo_short_string_to_felt(name)?; + let salt = poseidon_hash_single(name); + + let generated_world_address = get_contract_address( + salt, + local_manifest.world.inner.original_class_hash, + &[local_manifest.base.inner.class_hash], + Felt::ZERO, + ); + + Ok(generated_world_address) +} + #[allow(dead_code)] enum ContractDeploymentOutput { AlreadyDeployed(Felt), @@ -188,81 +237,53 @@ pub fn generate_overlays(ws: &Workspace<'_>) -> Result<()> { ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); // its path to a file so `parent` should never return `None` - let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); - let profile_dir = manifest_dir.join(MANIFESTS_DIR).join(profile_name); - - let base_manifests = profile_dir.join(BASE_DIR); - - let world = OverlayClass { name: WORLD_CONTRACT_NAME.into(), original_class_hash: None }; - let base = OverlayClass { name: BASE_CONTRACT_NAME.into(), original_class_hash: None }; - - // generate default OverlayManifest from base manifests - let contracts = overlay_dojo_contracts_from_path(&base_manifests.join(CONTRACTS_DIR)) - .with_context(|| "Failed to build default DojoContract Overlays from path.")?; - let models = overlay_model_from_path(&base_manifests.join(MODELS_DIR)) - .with_context(|| "Failed to build default DojoModel Overlays from path.")?; - - let default_overlay = - OverlayManifest { world: Some(world), base: Some(base), contracts, models }; - - let overlay_path = profile_dir.join(OVERLAYS_DIR); - - // read existing OverlayManifest from path - let mut overlay_manifest = OverlayManifest::load_from_path(&overlay_path) - .with_context(|| "Failed to load OverlayManifest from path.")?; - - // merge them to get OverlayManifest which contains all the contracts and models from base - // manifests - overlay_manifest.merge(default_overlay); - - overlay_manifest - .write_to_path_nested(&overlay_path) - .with_context(|| "Failed to write OverlayManifest to path.")?; - - Ok(()) -} - -fn overlay_dojo_contracts_from_path(path: &Utf8PathBuf) -> Result> { - let mut elements = vec![]; - - let entries = path - .read_dir()? - .map(|entry| entry.map(|e| e.path())) - .collect::, io::Error>>()?; - - for path in entries { - if path.is_file() { - let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; - - let overlay_manifest = - OverlayDojoContract { name: manifest.name, ..Default::default() }; - elements.push(overlay_manifest); - } else { - continue; - } - } - - Ok(elements) -} + let root_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + let manifest_base_dir = root_dir.join(MANIFESTS_DIR).join(&profile_name).join(BASE_DIR); + let overlay_dir = root_dir.join(OVERLAYS_DIR).join(&profile_name); + + let base_manifest = BaseManifest::load_from_path(&manifest_base_dir)?; + + let default_overlay = OverlayManifest { + world: Some(OverlayClass { + tag: WORLD_CONTRACT_TAG.to_string(), + original_class_hash: None, + }), + base: Some(OverlayClass { tag: BASE_CONTRACT_TAG.to_string(), original_class_hash: None }), + contracts: base_manifest + .contracts + .iter() + .map(|c| OverlayDojoContract { tag: c.inner.tag.clone(), ..Default::default() }) + .collect::>(), + models: base_manifest + .models + .iter() + .map(|m| OverlayDojoModel { tag: m.inner.tag.clone(), ..Default::default() }) + .collect::>(), + }; -fn overlay_model_from_path(path: &Utf8PathBuf) -> Result> { - let mut elements = vec![]; + if overlay_dir.exists() { + // read existing OverlayManifest from path + let mut overlay_manifest = OverlayManifest::load_from_path(&overlay_dir, &base_manifest) + .with_context(|| "Failed to load OverlayManifest from path.")?; - let entries = path - .read_dir()? - .map(|entry| entry.map(|e| e.path())) - .collect::, io::Error>>()?; + // merge them to get OverlayManifest which contains all the contracts and models from base + // manifests + overlay_manifest.merge(default_overlay); - for path in entries { - if path.is_file() { - let manifest: Manifest = toml::from_str(&fs::read_to_string(path)?)?; + // to avoid duplicated overlay manifests, existing overlays must be removed before being + // rewritten by `overlay_manifest.write_to_path_nested()` + fs::remove_dir_all(&overlay_dir)?; + fs::create_dir_all(&overlay_dir)?; - let overlay_manifest = OverlayDojoModel { name: manifest.name, ..Default::default() }; - elements.push(overlay_manifest); - } else { - continue; - } + overlay_manifest + .write_to_path_nested(&overlay_dir) + .with_context(|| "Failed to write OverlayManifest to path.")?; + } else { + fs::create_dir_all(&overlay_dir)?; + default_overlay + .write_to_path_nested(&overlay_dir) + .with_context(|| "Failed to write OverlayManifest to path.")?; } - Ok(elements) + Ok(()) } diff --git a/crates/sozo/ops/src/migration/utils.rs b/crates/sozo/ops/src/migration/utils.rs index 88a52a8e13..dc91f26c1f 100644 --- a/crates/sozo/ops/src/migration/utils.rs +++ b/crates/sozo/ops/src/migration/utils.rs @@ -1,8 +1,7 @@ use anyhow::{anyhow, Result}; use camino::Utf8PathBuf; use dojo_world::manifest::{ - AbstractManifestError, BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, - OVERLAYS_DIR, + AbstractManifestError, BaseManifest, DeploymentManifest, OverlayManifest, }; use scarb_ui::Ui; use starknet::accounts::ConnectedAccount; @@ -12,9 +11,10 @@ use super::ui::MigrationUi; /// Loads: /// - `BaseManifest` from filesystem -/// - `DeployedManifest` from onchain dataa if `world_address` is `Some` +/// - `DeployedManifest` from onchain data if `world_address` is `Some` pub(super) async fn load_world_manifests( - profile_dir: &Utf8PathBuf, + manifest_dir: &Utf8PathBuf, + overlay_dir: &Utf8PathBuf, account: A, world_address: Option, ui: &Ui, @@ -26,16 +26,15 @@ where { ui.print_step(1, "🌎", "Building World state..."); - let mut local_manifest = BaseManifest::load_from_path(&profile_dir.join(BASE_DIR)) + let mut local_manifest = BaseManifest::load_from_path(manifest_dir) .map_err(|e| anyhow!("Fail to load local manifest file: {e}."))?; if let Some(skip_manifests) = skip_migration { - local_manifest.remove_items(skip_manifests); + local_manifest.remove_tags(skip_manifests); } - let overlay_path = profile_dir.join(OVERLAYS_DIR); - if overlay_path.exists() { - let overlay_manifest = OverlayManifest::load_from_path(&profile_dir.join(OVERLAYS_DIR)) + if overlay_dir.exists() { + let overlay_manifest = OverlayManifest::load_from_path(overlay_dir, &local_manifest) .map_err(|e| anyhow!("Fail to load overlay manifest file: {e}."))?; // merge user defined changes to base manifest diff --git a/crates/sozo/ops/src/model.rs b/crates/sozo/ops/src/model.rs index 8bf245c3ea..ed3a235234 100644 --- a/crates/sozo/ops/src/model.rs +++ b/crates/sozo/ops/src/model.rs @@ -12,14 +12,14 @@ use starknet::providers::JsonRpcClient; const INDENT: &str = " "; pub async fn model_class_hash( - name: String, + tag: String, world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); - let model = world_reader.model_reader(&name).await?; + let model = world_reader.model_reader_with_tag(&tag).await?; println!("{:#x}", model.class_hash()); @@ -27,14 +27,14 @@ pub async fn model_class_hash( } pub async fn model_contract_address( - name: String, + tag: String, world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); - let model = world_reader.model_reader(&name).await?; + let model = world_reader.model_reader_with_tag(&tag).await?; println!("{:#x}", model.contract_address()); @@ -42,14 +42,14 @@ pub async fn model_contract_address( } pub async fn model_layout( - name: String, + tag: String, world_address: Felt, provider: JsonRpcClient, ) -> Result<()> { let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); - let model = world_reader.model_reader(&name).await?; + let model = world_reader.model_reader_with_tag(&tag).await?; let layout = match model.layout().await { Ok(x) => x, Err(_) => anyhow::bail!( @@ -59,13 +59,13 @@ pub async fn model_layout( }; let schema = model.schema().await?; - deep_print_layout(&name, &layout, &schema); + deep_print_layout(&tag, &layout, &schema); Ok(()) } pub async fn model_schema( - name: String, + tag: String, world_address: Felt, provider: JsonRpcClient, to_json: bool, @@ -73,7 +73,7 @@ pub async fn model_schema( let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); - let model = world_reader.model_reader(&name).await?; + let model = world_reader.model_reader_with_tag(&tag).await?; let schema = model.schema().await?; if to_json { @@ -86,7 +86,7 @@ pub async fn model_schema( } pub async fn model_get( - name: String, + tag: String, keys: Vec, world_address: Felt, provider: JsonRpcClient, @@ -98,7 +98,7 @@ pub async fn model_get( let mut world_reader = WorldContractReader::new(world_address, &provider); world_reader.set_block(BlockId::Tag(BlockTag::Pending)); - let model = world_reader.model_reader(&name).await?; + let model = world_reader.model_reader_with_tag(&tag).await?; let schema = model.schema().await?; let values = model.entity_storage(&keys).await?; diff --git a/crates/sozo/ops/src/register.rs b/crates/sozo/ops/src/register.rs index 8a094d47e8..e6ca81436d 100644 --- a/crates/sozo/ops/src/register.rs +++ b/crates/sozo/ops/src/register.rs @@ -34,20 +34,20 @@ where } }; - let registered_models_names = manifest.models.iter().map(|m| m.name.as_str()); + let registered_models = manifest.models.iter().map(|m| m.inner.tag.clone()); let mut model_class_hashes = HashMap::new(); - for model_name in registered_models_names { - let read_model = world_reader.model_reader(model_name).await?; + for model_tag in registered_models { + let read_model = world_reader.model_reader_with_tag(&model_tag).await?; let class_hash = read_model.class_hash(); - model_class_hashes.insert(class_hash, model_name); + model_class_hashes.insert(class_hash, model_tag); } let mut models_to_register = Vec::new(); for input_model in models { - if let Some(model_name) = model_class_hashes.get(&input_model) { + if let Some(model_tag) = model_class_hashes.get(&input_model) { config.ui().print(format!( "\"{}\" model already registered with the class hash \"{:#x}\"", - model_name, input_model + model_tag, input_model )); } else { models_to_register.push(input_model); diff --git a/crates/sozo/ops/src/tests/auth.rs b/crates/sozo/ops/src/tests/auth.rs index 80df7be990..ef467cdf05 100644 --- a/crates/sozo/ops/src/tests/auth.rs +++ b/crates/sozo/ops/src/tests/auth.rs @@ -1,16 +1,18 @@ +use std::str::FromStr; + use dojo_world::contracts::world::WorldContract; use dojo_world::migration::TxnConfig; use katana_runner::KatanaRunner; use scarb_ui::{OutputFormat, Ui, Verbosity}; use starknet::accounts::{Account, ConnectedAccount}; use starknet::core::types::{BlockId, BlockTag}; -use starknet::core::utils::cairo_short_string_to_felt; use super::setup; -use crate::auth::{self, ModelContract, OwnerResource, ResourceType}; +use crate::auth::{self, ResourceOwner, ResourceType, ResourceWriter}; use crate::execute; -const ACTION_CONTRACT_NAME: &str = "dojo_examples::actions::actions"; +const ACTION_CONTRACT_NAME: &str = "dojo_examples-actions"; +const DEFAULT_NAMESPACE: &str = "dojo_examples"; #[tokio::test(flavor = "multi_thread")] async fn auth_grant_writer_ok() { @@ -29,14 +31,14 @@ async fn auth_grant_writer_ok() { // Account2 does not have the permission to write, but granting // writer to the actions contract allows the execution of it's systems by // any account. - let moves_mc = ModelContract { - model: cairo_short_string_to_felt("Moves").unwrap(), - contract: ACTION_CONTRACT_NAME.to_string(), + let moves_mc = ResourceWriter { + resource: ResourceType::from_str("model:Moves").unwrap(), + tag_or_address: ACTION_CONTRACT_NAME.to_string(), }; - let position_mc = ModelContract { - model: cairo_short_string_to_felt("Position").unwrap(), - contract: ACTION_CONTRACT_NAME.to_string(), + let position_mc = ResourceWriter { + resource: ResourceType::from_str("model:Position").unwrap(), + tag_or_address: ACTION_CONTRACT_NAME.to_string(), }; auth::grant_writer( @@ -44,6 +46,7 @@ async fn auth_grant_writer_ok() { &world, vec![moves_mc, position_mc], TxnConfig { wait: true, ..Default::default() }, + DEFAULT_NAMESPACE, ) .await .unwrap(); @@ -69,14 +72,14 @@ async fn auth_revoke_writer_ok() { // Account2 does not have the permission to write, but granting // writer to the actions contract allows the execution of it's systems by // any account. - let moves_mc = ModelContract { - model: cairo_short_string_to_felt("Moves").unwrap(), - contract: ACTION_CONTRACT_NAME.to_string(), + let moves_mc = ResourceWriter { + resource: ResourceType::from_str("model:Moves").unwrap(), + tag_or_address: ACTION_CONTRACT_NAME.to_string(), }; - let position_mc = ModelContract { - model: cairo_short_string_to_felt("Position").unwrap(), - contract: ACTION_CONTRACT_NAME.to_string(), + let position_mc = ResourceWriter { + resource: ResourceType::from_str("model:Position").unwrap(), + tag_or_address: ACTION_CONTRACT_NAME.to_string(), }; // Here we are granting the permission to write @@ -85,6 +88,7 @@ async fn auth_revoke_writer_ok() { &world, vec![moves_mc.clone(), position_mc.clone()], TxnConfig { wait: true, ..Default::default() }, + DEFAULT_NAMESPACE, ) .await .unwrap(); @@ -98,6 +102,7 @@ async fn auth_revoke_writer_ok() { &world, vec![moves_mc, position_mc], TxnConfig { wait: true, ..Default::default() }, + DEFAULT_NAMESPACE, ) .await .unwrap(); @@ -123,13 +128,13 @@ async fn auth_grant_owner_ok() { // Account2 does not have the permission to write, let's give this account // ownership of both models. - let moves = OwnerResource { - resource: ResourceType::Model(cairo_short_string_to_felt("Moves").unwrap()), + let moves = ResourceOwner { + resource: ResourceType::from_str("model:Moves").unwrap(), owner: account_2_addr, }; - let position = OwnerResource { - resource: ResourceType::Model(cairo_short_string_to_felt("Position").unwrap()), + let position = ResourceOwner { + resource: ResourceType::from_str("model:Position").unwrap(), owner: account_2_addr, }; @@ -138,6 +143,7 @@ async fn auth_grant_owner_ok() { &world, vec![moves, position], TxnConfig { wait: true, ..Default::default() }, + DEFAULT_NAMESPACE, ) .await .unwrap(); @@ -162,13 +168,13 @@ async fn auth_revoke_owner_ok() { // Account2 does not have the permission to write, let's give this account // ownership of both models. - let moves = OwnerResource { - resource: ResourceType::Model(cairo_short_string_to_felt("Moves").unwrap()), + let moves = ResourceOwner { + resource: ResourceType::from_str("model:Moves").unwrap(), owner: account_2_addr, }; - let position = OwnerResource { - resource: ResourceType::Model(cairo_short_string_to_felt("Position").unwrap()), + let position = ResourceOwner { + resource: ResourceType::from_str("model:Position").unwrap(), owner: account_2_addr, }; @@ -177,6 +183,7 @@ async fn auth_revoke_owner_ok() { &world, vec![moves.clone(), position.clone()], TxnConfig { wait: true, ..Default::default() }, + DEFAULT_NAMESPACE, ) .await .unwrap(); @@ -188,6 +195,7 @@ async fn auth_revoke_owner_ok() { &world, vec![moves, position], TxnConfig { wait: true, ..Default::default() }, + DEFAULT_NAMESPACE, ) .await .unwrap(); diff --git a/crates/sozo/ops/src/tests/call.rs b/crates/sozo/ops/src/tests/call.rs index 26c0f3802e..8265a04d42 100644 --- a/crates/sozo/ops/src/tests/call.rs +++ b/crates/sozo/ops/src/tests/call.rs @@ -9,8 +9,11 @@ use starknet::signers::LocalWallet; use super::setup; use crate::{call, utils}; -const CONTRACT_NAME: &str = "dojo_examples::actions::actions"; -const ENTRYPOINT: &str = "tile_terrain"; +const CONTRACT_TAG: &str = "dojo_examples-actions"; +const ENTRYPOINT: &str = "get_player_position"; + +// TODO: we should work on a lazy static init for the runner for all the call tests, +// as the state will not change, we only read and check the result. #[tokio::test] async fn call_with_bad_address() { @@ -65,7 +68,7 @@ async fn call_with_bad_entrypoint() { assert!( call::call( world_reader, - CONTRACT_NAME.to_string(), + CONTRACT_TAG.to_string(), "BadEntryPoint".to_string(), vec![Felt::ZERO, Felt::ZERO], None @@ -84,9 +87,15 @@ async fn call_with_bad_calldata() { let world_reader = WorldContractReader::new(world.address, provider); assert!( - call::call(world_reader, CONTRACT_NAME.to_string(), ENTRYPOINT.to_string(), vec![], None) - .await - .is_err() + call::call( + world_reader, + CONTRACT_TAG.to_string(), + ENTRYPOINT.to_string(), + vec![Felt::ZERO], + None + ) + .await + .is_err() ); } @@ -98,17 +107,11 @@ async fn call_with_contract_name() { let provider = sequencer.provider(); let world_reader = WorldContractReader::new(world.address, provider); - assert!( - call::call( - world_reader, - CONTRACT_NAME.to_string(), - ENTRYPOINT.to_string(), - vec![Felt::ZERO, Felt::ZERO], - None, - ) - .await - .is_ok() - ); + let r = + call::call(world_reader, CONTRACT_TAG.to_string(), ENTRYPOINT.to_string(), vec![], None) + .await; + + assert!(r.is_ok()); } #[tokio::test] @@ -121,7 +124,7 @@ async fn call_with_contract_address() { let contract_address = utils::get_contract_address::< SingleOwnerAccount, LocalWallet>, - >(&world, CONTRACT_NAME.to_string()) + >(&world, CONTRACT_TAG.to_string()) .await .unwrap(); @@ -130,7 +133,7 @@ async fn call_with_contract_address() { world_reader, format!("{:#x}", contract_address), ENTRYPOINT.to_string(), - vec![Felt::ZERO, Felt::ZERO], + vec![], None, ) .await diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 16fd117229..50f07a04b3 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -1,16 +1,18 @@ +#![allow(dead_code)] use std::str; use cainome::cairo_serde::ContractAddress; use camino::Utf8Path; use dojo_test_utils::migration::prepare_migration_with_world_and_seed; +use dojo_world::contracts::naming::compute_model_selector_from_tag; use dojo_world::contracts::{WorldContract, WorldContractReader}; use dojo_world::manifest::{ BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, - WORLD_CONTRACT_NAME, + WORLD_CONTRACT_TAG, }; use dojo_world::metadata::{ - dojo_metadata_from_workspace, ArtifactMetadata, DojoMetadata, Uri, WorldMetadata, - IPFS_CLIENT_URL, IPFS_PASSWORD, IPFS_USERNAME, + dojo_metadata_from_workspace, get_default_namespace_from_ws, ArtifactMetadata, DojoMetadata, + Uri, WorldMetadata, IPFS_CLIENT_URL, IPFS_PASSWORD, IPFS_USERNAME, }; use dojo_world::migration::strategy::{prepare_for_migration, MigrationMetadata}; use dojo_world::migration::world::WorldDiff; @@ -19,7 +21,6 @@ use futures::TryStreamExt; use ipfs_api_backend_hyper::{HyperBackend, IpfsApi, IpfsClient, TryFromUri}; use katana_runner::{KatanaRunner, KatanaRunnerConfig}; use starknet::core::types::{BlockId, BlockTag, Felt}; -use starknet::core::utils::get_selector_from_name; use starknet::macros::felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; @@ -28,6 +29,30 @@ use super::setup; use crate::migration::{auto_authorize, execute_strategy, upload_metadata}; use crate::utils::get_contract_address_from_reader; +#[tokio::test(flavor = "multi_thread")] +async fn default_migrate_no_dry_run() { + let config = setup::load_config(); + let ws = setup::setup_ws(&config); + + let sequencer = KatanaRunner::new().expect("Fail to start runner"); + + let mut account = sequencer.account(0); + account.set_block_id(BlockId::Tag(BlockTag::Pending)); + + let _ = crate::migration::migrate( + &ws, + None, + sequencer.url().to_string(), + account, + "dojo_examples", + false, + TxnConfig::init_wait(), + None, + ) + .await + .is_ok(); +} + #[tokio::test(flavor = "multi_thread")] async fn migrate_with_auto_mine() { let config = setup::load_config(); @@ -101,15 +126,15 @@ async fn metadata_calculated_properly() { let profile_name = ws.current_profile().unwrap().to_string(); let mut manifest = BaseManifest::load_from_path( - &base.to_path_buf().join(MANIFESTS_DIR).join(profile_name).join(BASE_DIR), + &base.to_path_buf().join(MANIFESTS_DIR).join(&profile_name).join(BASE_DIR), ) .unwrap(); - let overlay_manifest = - OverlayManifest::load_from_path(&base.join(MANIFESTS_DIR).join("dev").join(OVERLAYS_DIR)) - .unwrap(); - - manifest.merge(overlay_manifest); + let overlay_dir = base.join(OVERLAYS_DIR).join(&profile_name); + if overlay_dir.exists() { + let overlay_manifest = OverlayManifest::load_from_path(&overlay_dir, &manifest).unwrap(); + manifest.merge(overlay_manifest); + } let world = WorldDiff::compute(manifest, None); @@ -125,7 +150,7 @@ async fn metadata_calculated_properly() { for (key, value) in migration.metadata.iter() { match value { MigrationMetadata::Contract(c) => { - assert_eq!(key, &c.name); + assert_eq!(key, &c.tag); } } } @@ -172,16 +197,18 @@ async fn migration_with_correct_calldata_second_time_work_as_expected() { .await .expect("Failed to load remote manifest"); - let overlay = OverlayManifest::load_from_path( - &base.join(MANIFESTS_DIR).join(&profile_name).join(OVERLAYS_DIR), - ) - .expect("Failed to load overlay"); + let overlay_dir = base.join(OVERLAYS_DIR).join(profile_name); + if overlay_dir.exists() { + let overlay = OverlayManifest::load_from_path(&overlay_dir, &manifest) + .expect("Failed to load overlay"); - // adding correct calldata - manifest.merge(overlay); + // adding correct calldata + manifest.merge(overlay); + } + let default_namespace = get_default_namespace_from_ws(&ws); let mut world = WorldDiff::compute(manifest, Some(remote_manifest)); - world.update_order().expect("Failed to update order"); + world.update_order(&default_namespace).expect("Failed to update order"); let mut migration = prepare_for_migration( Some(world_address), @@ -244,8 +271,6 @@ async fn migration_from_remote() { assert_eq!(local_manifest.models.len(), remote_manifest.models.len()); } -// TODO: remove ignore once IPFS node is running. -#[ignore] #[tokio::test(flavor = "multi_thread")] async fn migrate_with_metadata() { let config = setup::load_config(); @@ -275,7 +300,7 @@ async fn migrate_with_metadata() { // check world metadata let resource = world_reader.metadata(&Felt::ZERO).call().await.unwrap(); - let element_name = WORLD_CONTRACT_NAME.to_string(); + let element_name = WORLD_CONTRACT_TAG.to_string(); let full_uri = resource.metadata_uri.to_string().unwrap(); let resource_bytes = get_ipfs_resource_data(&client, &element_name, &full_uri).await; @@ -289,34 +314,34 @@ async fn migrate_with_metadata() { assert_eq!(metadata.website, dojo_metadata.world.website, ""); assert_eq!(metadata.socials, dojo_metadata.world.socials, ""); - check_artifact_fields( - &client, - &metadata.artifacts, - &dojo_metadata.world.artifacts, - &element_name, - ) - .await; - + // TODO: uncomment when https://github.com/dojoengine/dojo/issues/2137 is fixed. + // check_artifact_fields( + // &client, + // &metadata.artifacts, + // &dojo_metadata.world.artifacts, + // &element_name, + // ) + // .await; // check model metadata - for m in migration.models { - let selector = get_selector_from_name(&m.diff.name).unwrap(); - check_artifact_metadata(&client, &world_reader, selector, &m.diff.name, &dojo_metadata) - .await; - } - + // for m in migration.models { + // let selector = compute_model_selector_from_tag(&m.diff.tag); + // check_artifact_metadata(&client, &world_reader, selector, &m.diff.tag, &dojo_metadata) + // .await; + // } // check contract metadata - for c in migration.contracts { - let contract_address = - get_contract_address_from_reader(&world_reader, c.diff.name.clone()).await.unwrap(); - check_artifact_metadata( - &client, - &world_reader, - contract_address, - &c.diff.name, - &dojo_metadata, - ) - .await; - } + // for c in migration.contracts { + // let contract_address = + // get_contract_address_from_reader(&world_reader, c.diff.tag.clone()).await.unwrap(); + // + // check_artifact_metadata( + // &client, + // &world_reader, + // contract_address, + // &c.diff.tag, + // &dojo_metadata, + // ) + // .await; + // } } #[tokio::test(flavor = "multi_thread")] @@ -332,12 +357,11 @@ async fn migrate_with_auto_authorize() { BaseManifest::load_from_path(&manifest_base.join(MANIFESTS_DIR).join("dev").join(BASE_DIR)) .unwrap(); - let overlay_manifest = OverlayManifest::load_from_path( - &manifest_base.join(MANIFESTS_DIR).join("dev").join(OVERLAYS_DIR), - ) - .unwrap(); - - manifest.merge(overlay_manifest); + let overlay_dir = manifest_base.join(OVERLAYS_DIR).join("dev"); + if overlay_dir.exists() { + let overlay_manifest = OverlayManifest::load_from_path(&overlay_dir, &manifest).unwrap(); + manifest.merge(overlay_manifest); + } let sequencer = KatanaRunner::new().expect("Fail to start runner"); @@ -351,7 +375,9 @@ async fn migrate_with_auto_authorize() { let world_address = migration.world_address().expect("must be present"); let world = WorldContract::new(world_address, account); - let res = auto_authorize(&ws, &world, &txn_config, &manifest, &output).await; + let default_namespace = get_default_namespace_from_ws(&ws); + let res = + auto_authorize(&ws, &world, &txn_config, &manifest, &output, &default_namespace).await; assert!(res.is_ok()); let provider = sequencer.provider(); @@ -360,12 +386,12 @@ async fn migrate_with_auto_authorize() { // check contract metadata for c in migration.contracts { let contract_address = - get_contract_address_from_reader(&world_reader, c.diff.name.clone()).await.unwrap(); + get_contract_address_from_reader(&world_reader, c.diff.tag.clone()).await.unwrap(); - let contract = manifest.contracts.iter().find(|a| a.name == c.diff.name).unwrap(); + let contract = manifest.contracts.iter().find(|a| a.inner.tag == c.diff.tag).unwrap(); for model in &contract.inner.writes { - let model_selector = get_selector_from_name(model).unwrap(); + let model_selector = compute_model_selector_from_tag(model); let contract_address = ContractAddress(contract_address); let is_writer = world_reader.is_writer(&model_selector, &contract_address).call().await.unwrap(); @@ -377,27 +403,25 @@ async fn migrate_with_auto_authorize() { #[tokio::test(flavor = "multi_thread")] async fn migration_with_mismatching_world_address_and_seed() { let config = setup::load_config(); + let ws = setup::setup_ws(&config); let base_dir = config.manifest_path().parent().unwrap().to_path_buf(); let target_dir = base_dir.join("target").join("dev"); - let result = prepare_migration_with_world_and_seed( + let default_namespace = get_default_namespace_from_ws(&ws); + + let strategy = prepare_migration_with_world_and_seed( base_dir, target_dir, - Some(felt!("0x1")), + Some(Felt::ONE), "sozo_test", - ); - - assert!(result.is_err()); - - let error_message = result.unwrap_err().to_string(); + &default_namespace, + ) + .unwrap(); - assert_eq!( - error_message, - "Calculated world address doesn't match provided world address.\nIf you are deploying \ - with custom seed make sure `world_address` is correctly configured (or not set) \ - `Scarb.toml`" - ); + // The strategy.world has it's address set with the seed directly, and not + // from the world address provided by the user. + assert_ne!(strategy.world_address.unwrap(), strategy.world.unwrap().contract_address); } /// Get the hash from a IPFS URI @@ -428,44 +452,34 @@ fn get_hash_from_uri(uri: &str) -> String { /// * `uri` - the IPFS URI of the abi field. /// * `expected_uri` - the URI of the expected file. /// * `field_name` - the field name. -/// * `element_name` - the fully qualified name of the element linked to this field. +/// * `tag` - the tag of the element linked to this field. async fn check_file_field( client: &HyperBackend, uri: &Uri, expected_uri: &Uri, field_name: String, - element_name: &String, + tag: &String, ) { if let Uri::Ipfs(uri) = uri { - let resource_data = get_ipfs_resource_data(client, element_name, uri).await; - assert!( - !resource_data.is_empty(), - "{field_name} IPFS artifact for {} is empty", - element_name - ); + let resource_data = get_ipfs_resource_data(client, tag, uri).await; + assert!(!resource_data.is_empty(), "{field_name} IPFS artifact for {} is empty", tag); if let Uri::File(f) = expected_uri { let file_content = std::fs::read_to_string(f).unwrap(); let resource_content = std::str::from_utf8(&resource_data).unwrap_or_else(|_| { - panic!( - "Unable to stringify resource data for field '{}' of {}", - field_name, element_name - ) + panic!("Unable to stringify resource data for field '{}' of {}", field_name, tag) }); assert!( file_content.eq(&resource_content), "local '{field_name}' content differs from the one uploaded on IPFS for {}", - element_name + tag ); } else { - panic!( - "The field '{field_name}' of {} is not a file (Should never happen !)", - element_name - ); + panic!("The field '{field_name}' of {} is not a file (Should never happen !)", tag); } } else { - panic!("The '{field_name}' field is not an IPFS artifact for {}", element_name); + panic!("The '{field_name}' field is not an IPFS artifact for {}", tag); } } @@ -474,16 +488,16 @@ async fn check_file_field( /// # Arguments /// /// * `raw_data` - resource data as bytes. -/// * `element_name` - name of the element linked to this resource. +/// * `tag` - tag of the element linked to this resource. /// /// # Returns /// /// A [`ArtifactMetadata`] object. -fn resource_bytes_to_metadata(raw_data: &[u8], element_name: &String) -> ArtifactMetadata { +fn resource_bytes_to_metadata(raw_data: &[u8], tag: &String) -> ArtifactMetadata { let data = std::str::from_utf8(raw_data) - .unwrap_or_else(|_| panic!("Unable to stringify raw metadata for {}", element_name)); + .unwrap_or_else(|_| panic!("Unable to stringify raw metadata for {}", tag)); serde_json::from_str(data) - .unwrap_or_else(|_| panic!("Unable to deserialize metadata for {}", element_name)) + .unwrap_or_else(|_| panic!("Unable to deserialize metadata for {}", tag)) } /// Convert resource bytes to a WorldMetadata object. @@ -508,21 +522,17 @@ fn resource_bytes_to_world_metadata(raw_data: &[u8], element_name: &String) -> W /// # Arguments /// /// * `client` - a IPFS client. -/// * `element_name` - the name of the element (model or contract) linked to this artifact. +/// * `tag` - the tag of the element (model or contract) linked to this artifact. /// * `uri` - the IPFS resource URI. /// /// # Returns /// /// A [`Vec`] containing the resource content as bytes. -async fn get_ipfs_resource_data( - client: &HyperBackend, - element_name: &String, - uri: &String, -) -> Vec { +async fn get_ipfs_resource_data(client: &HyperBackend, tag: &String, uri: &String) -> Vec { let hash = get_hash_from_uri(uri); let res = client.cat(&hash).map_ok(|chunk| chunk.to_vec()).try_concat().await; - assert!(res.is_ok(), "Unable to read the IPFS artifact {} for {}", uri, element_name); + assert!(res.is_ok(), "Unable to read the IPFS artifact {} for {}", uri, tag); res.unwrap() } @@ -534,22 +544,26 @@ async fn get_ipfs_resource_data( /// * `client` - a IPFS client. /// * `metadata` - the metadata to check. /// * `expected_metadata` - the metadata values coming from local Dojo metadata. -/// * `element_name` - the name of the element linked to this metadata. +/// * `tag` - the tag of the element linked to this metadata. async fn check_artifact_fields( client: &HyperBackend, metadata: &ArtifactMetadata, expected_metadata: &ArtifactMetadata, - element_name: &String, + tag: &String, ) { - assert!(metadata.abi.is_some(), "'abi' field not set for {}", element_name); + println!("metadata {:?}", metadata); + println!("expected_metadata {:?}", expected_metadata); + + assert!(metadata.abi.is_some(), "'abi' field not set for {}", tag); let abi = metadata.abi.as_ref().unwrap(); let expected_abi = expected_metadata.abi.as_ref().unwrap(); - check_file_field(client, abi, expected_abi, "abi".to_string(), element_name).await; + check_file_field(client, abi, expected_abi, "abi".to_string(), tag).await; - assert!(metadata.source.is_some(), "'source' field not set for {}", element_name); - let source = metadata.source.as_ref().unwrap(); - let expected_source = expected_metadata.source.as_ref().unwrap(); - check_file_field(client, source, expected_source, "source".to_string(), element_name).await; + // For now source are not expended, uncomment when https://github.com/dojoengine/dojo/issues/2137 is fixed. + // assert!(metadata.source.is_some(), "'source' field not set for {}", tag); + // let source = metadata.source.as_ref().unwrap(); + // let expected_source = expected_metadata.source.as_ref().unwrap(); + // check_file_field(client, source, expected_source, "source".to_string(), tag).await; } /// Check the validity of a IPFS artifact metadata. @@ -557,19 +571,19 @@ async fn check_artifact_fields( /// # Arguments /// /// * `client` - a IPFS client. -/// * `element_name` - the fully qualified name of the element linked to the artifact. +/// * `tag` - the tag of the element linked to the artifact. /// * `uri` - the full metadata URI. /// * `expected_metadata` - the expected metadata values coming from local Dojo metadata. async fn check_ipfs_metadata( client: &HyperBackend, - element_name: &String, + tag: &String, uri: &String, expected_metadata: &ArtifactMetadata, ) { - let resource_bytes = get_ipfs_resource_data(client, element_name, uri).await; - let metadata = resource_bytes_to_metadata(&resource_bytes, element_name); + let resource_bytes = get_ipfs_resource_data(client, tag, uri).await; + let metadata = resource_bytes_to_metadata(&resource_bytes, tag); - check_artifact_fields(client, &metadata, expected_metadata, element_name).await; + check_artifact_fields(client, &metadata, expected_metadata, tag).await; } /// Check an artifact metadata read from the resource registry against its value @@ -580,28 +594,24 @@ async fn check_ipfs_metadata( /// * `client` - a IPFS client. /// * `world_reader` - a world reader object. /// * `resource_id` - the resource ID in the resource registry. -/// * `element_name` - the fully qualified name of the element linked to this metadata. +/// * `tag` - the tag of the element linked to this metadata. /// * `dojo_metadata` - local Dojo metadata. async fn check_artifact_metadata( client: &HyperBackend, world_reader: &WorldContractReader

, resource_id: Felt, - element_name: &String, + tag: &String, dojo_metadata: &DojoMetadata, ) { let resource = world_reader.metadata(&resource_id).call().await.unwrap(); - let expected_resource = dojo_metadata.resources_artifacts.get(element_name); - assert!( - expected_resource.is_some(), - "Unable to find local artifact metadata for {}", - element_name - ); + let expected_resource = dojo_metadata.resources_artifacts.get(tag); + assert!(expected_resource.is_some(), "Unable to find local artifact metadata for {}", tag); let expected_resource = expected_resource.unwrap(); check_ipfs_metadata( client, - element_name, + tag, &resource.metadata_uri.to_string().unwrap(), &expected_resource.artifacts, ) diff --git a/crates/sozo/ops/src/tests/setup.rs b/crates/sozo/ops/src/tests/setup.rs index 0606ca74a0..4ddb0f1459 100644 --- a/crates/sozo/ops/src/tests/setup.rs +++ b/crates/sozo/ops/src/tests/setup.rs @@ -3,9 +3,11 @@ use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration_with_world_and_seed; use dojo_world::contracts::world::WorldContract; +use dojo_world::metadata::get_default_namespace_from_ws; use dojo_world::migration::strategy::MigrationStrategy; use dojo_world::migration::TxnConfig; use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use scarb::core::{Config, Workspace}; use scarb::ops; use starknet::accounts::SingleOwnerAccount; @@ -31,7 +33,7 @@ pub fn load_config() -> Config { let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); - compiler::copy_tmp_config(&source_project_dir, &dojo_core_path) + compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV) } /// Setups the workspace for the spawn-and-moves project. @@ -53,11 +55,21 @@ pub fn setup_ws(config: &Config) -> Workspace<'_> { /// /// A [`MigrationStrategy`] to execute to migrate the full spawn-and-moves project. pub fn setup_migration(config: &Config) -> Result { + let ws = setup_ws(config); + let manifest_path = config.manifest_path(); let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - prepare_migration_with_world_and_seed(base_dir.into(), target_dir.into(), None, "sozo_test") + let default_namespace = get_default_namespace_from_ws(&ws); + + prepare_migration_with_world_and_seed( + base_dir.into(), + target_dir.into(), + None, + "sozo_test", + &default_namespace, + ) } /// Setups the project by migrating the full spawn-and-moves project. @@ -76,7 +88,9 @@ pub async fn setup( let config = load_config(); let ws = setup_ws(&config); - let migration = setup_migration(&config)?; + let mut migration = setup_migration(&config)?; + let _ = + migration.resolve_variable(migration.world_address().expect("world address must exist")); let mut account = sequencer.account(0); account.set_block_id(BlockId::Tag(BlockTag::Pending)); diff --git a/crates/sozo/ops/src/tests/utils.rs b/crates/sozo/ops/src/tests/utils.rs index 70cb3e03c4..24585a9616 100644 --- a/crates/sozo/ops/src/tests/utils.rs +++ b/crates/sozo/ops/src/tests/utils.rs @@ -7,7 +7,7 @@ use starknet::core::types::{BlockId, BlockTag, Felt}; use super::setup; use crate::utils; -const ACTION_CONTRACT_NAME: &str = "dojo_examples::actions::actions"; +const ACTION_CONTRACT_TAG: &str = "dojo_examples-actions"; #[tokio::test(flavor = "multi_thread")] async fn get_contract_address_from_world() { @@ -16,7 +16,7 @@ async fn get_contract_address_from_world() { let world = setup::setup(&sequencer).await.unwrap(); let contract_address = - utils::get_contract_address(&world, ACTION_CONTRACT_NAME.to_string()).await.unwrap(); + utils::get_contract_address(&world, ACTION_CONTRACT_TAG.to_string()).await.unwrap(); assert!(contract_address != Felt::ZERO); } @@ -43,7 +43,7 @@ async fn get_contract_address_from_world_with_world_reader() { let world_reader = WorldContractReader::new(world.address, provider); let contract_address = - utils::get_contract_address_from_reader(&world_reader, ACTION_CONTRACT_NAME.to_string()) + utils::get_contract_address_from_reader(&world_reader, ACTION_CONTRACT_TAG.to_string()) .await .unwrap(); diff --git a/crates/sozo/ops/src/utils.rs b/crates/sozo/ops/src/utils.rs index aeb5407959..0b6cdd70c4 100644 --- a/crates/sozo/ops/src/utils.rs +++ b/crates/sozo/ops/src/utils.rs @@ -1,6 +1,7 @@ use anyhow::{anyhow, Result}; use bigdecimal::BigDecimal; -use dojo_world::contracts::{WorldContract, WorldContractReader}; +use dojo_world::contracts::naming::get_name_from_tag; +use dojo_world::contracts::world::{WorldContract, WorldContractReader}; use dojo_world::migration::strategy::generate_salt; use dojo_world::utils::{execution_status_from_receipt, TransactionWaiter}; use scarb_ui::Ui; @@ -15,21 +16,21 @@ use starknet::providers::Provider; /// # Arguments /// /// * `world` - The world's contract connector. -/// * `name_or_address` - A string with a contract name or a hexadecimal address. +/// * `tag_or_address` - A string with a contract tag or a hexadecimal address. /// /// # Returns /// /// A [`Felt`] with the address of the contract on success. pub async fn get_contract_address( world: &WorldContract, - name_or_address: String, + tag_or_address: String, ) -> Result { - if name_or_address.starts_with("0x") { - Felt::from_hex(&name_or_address).map_err(anyhow::Error::from) + if tag_or_address.starts_with("0x") { + Felt::from_hex(&tag_or_address).map_err(anyhow::Error::from) } else { let contract_class_hash = world.base().call().await?; Ok(starknet::core::utils::get_contract_address( - generate_salt(&name_or_address), + generate_salt(&get_name_from_tag(&tag_or_address)), contract_class_hash.into(), &[], world.address, @@ -44,21 +45,21 @@ pub async fn get_contract_address( /// # Arguments /// /// * `world_reader` - The world contract reader. -/// * `name_or_address` - A string with a contract name or a hexadecimal address. +/// * `tag_or_address` - A string with a contract tag or a hexadecimal address. /// /// # Returns /// /// A [`Felt`] with the address of the contract on success. pub async fn get_contract_address_from_reader( world_reader: &WorldContractReader

, - name_or_address: String, + tag_or_address: String, ) -> Result { - if name_or_address.starts_with("0x") { - Felt::from_hex(&name_or_address).map_err(anyhow::Error::from) + if tag_or_address.starts_with("0x") { + Felt::from_hex(&tag_or_address).map_err(anyhow::Error::from) } else { let contract_class_hash = world_reader.base().call().await?; Ok(starknet::core::utils::get_contract_address( - generate_salt(&name_or_address), + generate_salt(&get_name_from_tag(&tag_or_address)), contract_class_hash.into(), &[], world_reader.address, diff --git a/crates/torii/client/src/client/error.rs b/crates/torii/client/src/client/error.rs index 3d163da185..5a036e19cd 100644 --- a/crates/torii/client/src/client/error.rs +++ b/crates/torii/client/src/client/error.rs @@ -1,4 +1,5 @@ use dojo_world::contracts::model::ModelError; +use starknet::core::types::Felt; use starknet::core::utils::{CairoShortStringToFeltError, ParseCairoShortStringError}; use torii_grpc::types::schema::SchemaError; @@ -6,8 +7,10 @@ use torii_grpc::types::schema::SchemaError; pub enum Error { #[error("Subscription service uninitialized")] SubscriptionUninitialized, + #[error("Invalid model name: {0}. Expected format is \"namespace-model\"")] + InvalidModelName(String), #[error("Unknown model: {0}")] - UnknownModel(String), + UnknownModel(Felt), #[error("Parsing error: {0}")] Parse(#[from] ParseError), #[error(transparent)] diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index d68b73e199..2b5eb88962 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -9,11 +9,10 @@ use std::sync::Arc; use dojo_types::packing::unpack; use dojo_types::schema::Ty; use dojo_types::WorldMetadata; -use dojo_world::contracts::WorldContractReader; +use dojo_world::contracts::{naming, WorldContractReader}; use futures::lock::Mutex; use parking_lot::{RwLock, RwLockReadGuard}; use starknet::core::types::Felt; -use starknet::core::utils::cairo_short_string_to_felt; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use tokio::sync::RwLock as AsyncRwLock; @@ -175,27 +174,28 @@ impl Client { /// If the requested model is not among the synced models, it will attempt to fetch it from /// the RPC. pub async fn model(&self, keys: &ModelKeysClause) -> Result, Error> { - let Some(mut schema) = self.metadata.read().model(&keys.model).map(|m| m.schema.clone()) + let (namespace, model) = keys.model.split_once('-').unwrap(); + let model_selector = naming::compute_model_selector_from_names(namespace, model); + let Some(mut schema) = + self.metadata.read().model(&model_selector).map(|m| m.schema.clone()) else { return Ok(None); }; if !self.subscribed_models.is_synced(keys) { - let model = self.world_reader.model_reader(&keys.model).await?; + let model = self.world_reader.model_reader(namespace, model).await?; return Ok(Some(model.entity(&keys.keys).await?)); } - let Ok(Some(raw_values)) = self.storage.get_model_storage( - cairo_short_string_to_felt(&keys.model).map_err(ParseError::CairoShortStringToFelt)?, - &keys.keys, - ) else { + let Ok(Some(raw_values)) = self.storage.get_model_storage(model_selector, &keys.keys) + else { return Ok(Some(schema)); }; let layout = self .metadata .read() - .model(&keys.model) + .model(&model_selector) .map(|m| m.layout.clone()) .expect("qed; layout should exist"); @@ -230,7 +230,8 @@ impl Client { /// NOTE: This will establish a new subscription stream with the server. pub async fn add_models_to_sync(&self, models_keys: Vec) -> Result<(), Error> { for keys in &models_keys { - self.initiate_model(&keys.model, keys.keys.clone()).await?; + let (namespace, model) = keys.model.split_once('-').unwrap(); + self.initiate_model(namespace, model, keys.keys.clone()).await?; } self.subscribed_models.add_models(models_keys)?; @@ -279,11 +280,16 @@ impl Client { Ok(stream) } - async fn initiate_model(&self, model: &str, keys: Vec) -> Result<(), Error> { - let model_reader = self.world_reader.model_reader(model).await?; + async fn initiate_model( + &self, + namespace: &str, + model: &str, + keys: Vec, + ) -> Result<(), Error> { + let model_reader = self.world_reader.model_reader(namespace, model).await?; let values = model_reader.entity_storage(&keys).await?; self.storage.set_model_storage( - cairo_short_string_to_felt(model).map_err(ParseError::CairoShortStringToFelt)?, + naming::compute_model_selector_from_names(namespace, model), keys, values, )?; diff --git a/crates/torii/client/src/client/storage.rs b/crates/torii/client/src/client/storage.rs index 7b13f2b180..772b838a93 100644 --- a/crates/torii/client/src/client/storage.rs +++ b/crates/torii/client/src/client/storage.rs @@ -5,9 +5,8 @@ use dojo_types::WorldMetadata; use futures::channel::mpsc::{channel, Receiver, Sender}; use parking_lot::{Mutex, RwLock}; use starknet::core::types::Felt; -use starknet::core::utils::parse_cairo_short_string; -use super::error::{Error, ParseError}; +use super::error::Error; use crate::utils::compute_all_storage_addresses; pub type EntityKeys = Vec; @@ -118,15 +117,12 @@ impl ModelStorage { model: Felt, raw_keys: &[Felt], ) -> Result, Error> { - let model_name = - parse_cairo_short_string(&model).map_err(ParseError::ParseCairoShortString)?; - let model_packed_size = self .metadata .read() - .model(&model_name) + .model(&model) .map(|c| c.packed_size) - .ok_or(Error::UnknownModel(model_name))?; + .ok_or(Error::UnknownModel(model))?; Ok(compute_all_storage_addresses(model, raw_keys, model_packed_size)) } @@ -143,16 +139,17 @@ mod tests { use dojo_types::schema::Ty; use dojo_types::WorldMetadata; + use dojo_world::contracts::naming::compute_model_selector_from_names; use parking_lot::RwLock; - use starknet::core::utils::cairo_short_string_to_felt; use starknet::macros::felt; use crate::utils::compute_all_storage_addresses; fn create_dummy_metadata() -> WorldMetadata { let models = HashMap::from([( - "Position".into(), + compute_model_selector_from_names("Test", "Position"), dojo_types::schema::ModelMetadata { + namespace: "Test".into(), name: "Position".into(), class_hash: felt!("1"), contract_address: felt!("2"), @@ -178,22 +175,20 @@ mod tests { assert!(storage.storage.read().is_empty(), "storage must be empty initially"); - let model = storage.metadata.read().model("Position").cloned().unwrap(); - let expected_storage_addresses = compute_all_storage_addresses( - cairo_short_string_to_felt(&model.name).unwrap(), - &keys, - model.packed_size, - ); + let model_selector = compute_model_selector_from_names("Test", "Position"); + + let model = storage.metadata.read().model(&model_selector).cloned().unwrap(); + let expected_storage_addresses = + compute_all_storage_addresses(model_selector, &keys, model.packed_size); let expected_values = vec![felt!("1"), felt!("2"), felt!("3"), felt!("4")]; - let model_name_in_felt = cairo_short_string_to_felt("Position").unwrap(); storage - .set_model_storage(model_name_in_felt, keys.clone(), expected_values.clone()) + .set_model_storage(model_selector, keys.clone(), expected_values.clone()) .expect("set storage values"); - let actual_values = storage - .get_model_storage(model_name_in_felt, &keys) + let actual_values: Vec = storage + .get_model_storage(model_selector, &keys) .expect("model exist") .expect("values are set"); @@ -201,7 +196,7 @@ mod tests { storage.storage.read().clone().into_keys().collect::>(); assert!( - storage.model_index.read().get(&model_name_in_felt).is_some_and(|e| e.contains(&keys)), + storage.model_index.read().get(&model_selector).is_some_and(|e| e.contains(&keys)), "model keys must be indexed" ); assert!(actual_values == expected_values); diff --git a/crates/torii/client/src/client/subscription.rs b/crates/torii/client/src/client/subscription.rs index 0a02cc67c1..c2a35ef532 100644 --- a/crates/torii/client/src/client/subscription.rs +++ b/crates/torii/client/src/client/subscription.rs @@ -5,15 +5,15 @@ use std::sync::Arc; use std::task::Poll; use dojo_types::WorldMetadata; +use dojo_world::contracts::naming; use futures::channel::mpsc::{self, Receiver, Sender}; use futures_util::StreamExt; use parking_lot::{Mutex, RwLock}; use starknet::core::types::{Felt, StateDiff, StateUpdate}; -use starknet::core::utils::cairo_short_string_to_felt; use torii_grpc::client::ModelDiffsStreaming; use torii_grpc::types::ModelKeysClause; -use crate::client::error::{Error, ParseError}; +use crate::client::error::Error; use crate::client::storage::ModelStorage; use crate::utils::compute_all_storage_addresses; @@ -60,19 +60,20 @@ impl SubscribedModels { return Ok(()); } + let (namespace, model) = + keys.model.split_once('-').ok_or(Error::InvalidModelName(keys.model.clone()))?; + let selector = naming::compute_model_selector_from_names(namespace, model); + let model_packed_size = self .metadata .read() .models - .get(&keys.model) + .get(&selector) .map(|c| c.packed_size) - .ok_or(Error::UnknownModel(keys.model.clone()))?; + .ok_or(Error::UnknownModel(selector))?; - let storage_addresses = compute_all_storage_addresses( - cairo_short_string_to_felt(&keys.model).map_err(ParseError::CairoShortStringToFelt)?, - &keys.keys, - model_packed_size, - ); + let storage_addresses = + compute_all_storage_addresses(selector, &keys.keys, model_packed_size); let storage_lock = &mut self.subscribed_storage_addresses.write(); storage_addresses.into_iter().for_each(|address| { @@ -87,19 +88,20 @@ impl SubscribedModels { return Ok(()); } + let (namespace, model) = + keys.model.split_once('-').ok_or(Error::InvalidModelName(keys.model.clone()))?; + let selector = naming::compute_model_selector_from_names(namespace, model); + let model_packed_size = self .metadata .read() .models - .get(&keys.model) + .get(&selector) .map(|c| c.packed_size) - .ok_or(Error::UnknownModel(keys.model.clone()))?; + .ok_or(Error::UnknownModel(selector))?; - let storage_addresses = compute_all_storage_addresses( - cairo_short_string_to_felt(&keys.model).map_err(ParseError::CairoShortStringToFelt)?, - &keys.keys, - model_packed_size, - ); + let storage_addresses = + compute_all_storage_addresses(selector, &keys.keys, model_packed_size); let storage_lock = &mut self.subscribed_storage_addresses.write(); storage_addresses.iter().for_each(|address| { @@ -243,8 +245,8 @@ mod tests { use dojo_types::schema::Ty; use dojo_types::WorldMetadata; + use dojo_world::contracts::naming::compute_model_selector_from_names; use parking_lot::RwLock; - use starknet::core::utils::cairo_short_string_to_felt; use starknet::macros::felt; use torii_grpc::types::ModelKeysClause; @@ -252,8 +254,9 @@ mod tests { fn create_dummy_metadata() -> WorldMetadata { let components = HashMap::from([( - "Position".into(), + compute_model_selector_from_names("Test", "Position"), dojo_types::schema::ModelMetadata { + namespace: "Test".into(), name: "Position".into(), class_hash: felt!("1"), contract_address: felt!("2"), @@ -269,12 +272,12 @@ mod tests { #[test] fn add_and_remove_subscribed_model() { - let model_name = String::from("Position"); + let model_name = String::from("Test-Position"); let keys = vec![felt!("0x12345")]; let packed_size: u32 = 1; let mut expected_storage_addresses = compute_all_storage_addresses( - cairo_short_string_to_felt(&model_name).unwrap(), + compute_model_selector_from_names("Test", "Position"), &keys, packed_size, ) diff --git a/crates/torii/core/src/cache.rs b/crates/torii/core/src/cache.rs index b795a6f1bf..9afbf0c5e8 100644 --- a/crates/torii/core/src/cache.rs +++ b/crates/torii/core/src/cache.rs @@ -2,16 +2,15 @@ use std::collections::HashMap; use dojo_types::schema::Ty; use sqlx::SqlitePool; +use starknet_crypto::Felt; use tokio::sync::RwLock; use crate::error::{Error, QueryError}; use crate::model::{parse_sql_model_members, SqlModelMember}; -type ModelName = String; - pub struct ModelCache { pool: SqlitePool, - cache: RwLock>, + cache: RwLock>, } impl ModelCache { @@ -19,48 +18,51 @@ impl ModelCache { Self { pool, cache: RwLock::new(HashMap::new()) } } - pub async fn schemas(&self, models: Vec<&str>) -> Result, Error> { - let mut schemas = Vec::with_capacity(models.len()); - for model in models { - schemas.push(self.schema(model).await?); + pub async fn schemas(&self, selectors: &[Felt]) -> Result, Error> { + let mut schemas = Vec::with_capacity(selectors.len()); + for selector in selectors { + schemas.push(self.schema(selector).await?); } Ok(schemas) } - pub async fn schema(&self, model: &str) -> Result { + pub async fn schema(&self, selector: &Felt) -> Result { { let cache = self.cache.read().await; - if let Some(schema) = cache.get(model) { - return Ok(schema.clone()); + if let Some(model) = cache.get(selector).cloned() { + return Ok(model); } } - self.update_schema(model).await + self.update_schema(selector).await } - async fn update_schema(&self, model: &str) -> Result { - let model_name: String = sqlx::query_scalar("SELECT name FROM models WHERE id = ?") - .bind(model) - .fetch_one(&self.pool) - .await?; + async fn update_schema(&self, selector: &Felt) -> Result { + let formatted_selector = format!("{:#x}", selector); + + let (namespace, name): (String, String) = + sqlx::query_as("SELECT namespace, name FROM models WHERE id = ?") + .bind(formatted_selector.clone()) + .fetch_one(&self.pool) + .await?; let model_members: Vec = sqlx::query_as( "SELECT id, model_idx, member_idx, name, type, type_enum, enum_options, key FROM \ model_members WHERE model_id = ? ORDER BY model_idx ASC, member_idx ASC", ) - .bind(model) + .bind(formatted_selector) .fetch_all(&self.pool) .await?; if model_members.is_empty() { - return Err(QueryError::ModelNotFound(model.into()).into()); + return Err(QueryError::ModelNotFound(name.clone()).into()); } - let ty = parse_sql_model_members(&model_name, &model_members); + let schema = parse_sql_model_members(&namespace, &name, &model_members); let mut cache = self.cache.write().await; - cache.insert(model.into(), ty.clone()); + cache.insert(*selector, schema.clone()); - Ok(ty) + Ok(schema) } pub async fn clear(&self) { diff --git a/crates/torii/core/src/error.rs b/crates/torii/core/src/error.rs index 5006d83ded..d86b9c1be3 100644 --- a/crates/torii/core/src/error.rs +++ b/crates/torii/core/src/error.rs @@ -45,4 +45,6 @@ pub enum QueryError { ModelNotFound(String), #[error("exceeds sqlite `JOIN` limit (64)")] SqliteJoinLimit, + #[error("invalid namespaced model: {0}")] + InvalidNamespacedModel(String), } diff --git a/crates/torii/core/src/model.rs b/crates/torii/core/src/model.rs index e9d21749fd..cc449674d6 100644 --- a/crates/torii/core/src/model.rs +++ b/crates/torii/core/src/model.rs @@ -10,14 +10,17 @@ use dojo_world::contracts::model::ModelReader; use sqlx::sqlite::SqliteRow; use sqlx::{Pool, Row, Sqlite}; use starknet::core::types::Felt; -use starknet::core::utils::get_selector_from_name; use super::error::{self, Error}; use crate::error::{ParseError, QueryError}; pub struct ModelSQLReader { + /// Namespace of the model + namespace: String, /// The name of the model name: String, + /// The selector of the model + selector: Felt, /// The class hash of the model class_hash: Felt, /// The contract address of the model @@ -29,8 +32,9 @@ pub struct ModelSQLReader { } impl ModelSQLReader { - pub async fn new(name: &str, pool: Pool) -> Result { - let (name, class_hash, contract_address, packed_size, unpacked_size, layout): ( + pub async fn new(selector: Felt, pool: Pool) -> Result { + let (namespace, name, class_hash, contract_address, packed_size, unpacked_size, layout): ( + String, String, String, String, @@ -38,10 +42,10 @@ impl ModelSQLReader { u32, String, ) = sqlx::query_as( - "SELECT name, class_hash, contract_address, packed_size, unpacked_size, layout FROM \ - models WHERE id = ?", + "SELECT namespace, name, class_hash, contract_address, packed_size, unpacked_size, \ + layout FROM models WHERE id = ?", ) - .bind(name) + .bind(format!("{:#x}", selector)) .fetch_one(&pool) .await?; @@ -51,20 +55,33 @@ impl ModelSQLReader { let layout = serde_json::from_str(&layout).map_err(error::ParseError::FromJsonStr)?; - Ok(Self { name, class_hash, contract_address, pool, packed_size, unpacked_size, layout }) + Ok(Self { + namespace, + name, + selector, + class_hash, + contract_address, + pool, + packed_size, + unpacked_size, + layout, + }) } } #[cfg_attr(not(target_arch = "wasm32"), async_trait)] #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] impl ModelReader for ModelSQLReader { - fn name(&self) -> String { - self.name.to_string() + fn namespace(&self) -> &str { + &self.namespace + } + + fn name(&self) -> &str { + &self.name } fn selector(&self) -> Felt { - // this should never fail - get_selector_from_name(&self.name).unwrap() + self.selector } fn class_hash(&self) -> Felt { @@ -76,19 +93,15 @@ impl ModelReader for ModelSQLReader { } async fn schema(&self) -> Result { - // this is temporary until the hash for the model name is precomputed - let model_selector = - get_selector_from_name(&self.name).map_err(error::ParseError::NonAsciiName)?; - let model_members: Vec = sqlx::query_as( "SELECT id, model_idx, member_idx, name, type, type_enum, enum_options, key FROM \ model_members WHERE model_id = ? ORDER BY model_idx ASC, member_idx ASC", ) - .bind(format!("{:#x}", model_selector)) + .bind(format!("{:#x}", self.selector)) .fetch_all(&self.pool) .await?; - Ok(parse_sql_model_members(&self.name, &model_members)) + Ok(parse_sql_model_members(&self.namespace, &self.name, &model_members)) } async fn packed_size(&self) -> Result { @@ -120,7 +133,11 @@ pub struct SqlModelMember { // assume that the model members are sorted by model_idx and member_idx // `id` is the type id of the model member /// A helper function to parse the model members from sql table to `Ty` -pub fn parse_sql_model_members(model: &str, model_members_all: &[SqlModelMember]) -> Ty { +pub fn parse_sql_model_members( + namespace: &str, + model: &str, + model_members_all: &[SqlModelMember], +) -> Ty { fn parse_sql_member(member: &SqlModelMember, model_members_all: &[SqlModelMember]) -> Ty { match member.type_enum.as_str() { "Primitive" => Ty::Primitive(member.r#type.parse().unwrap()), @@ -192,10 +209,10 @@ pub fn parse_sql_model_members(model: &str, model_members_all: &[SqlModelMember] } Ty::Struct(Struct { - name: model.into(), + name: format!("{}-{}", namespace, model), children: model_members_all .iter() - .filter(|m| m.id == model) + .filter(|m| m.id == format!("{}-{}", namespace, model)) .map(|m| Member { key: m.key, name: m.name.to_owned(), @@ -208,7 +225,7 @@ pub fn parse_sql_model_members(model: &str, model_members_all: &[SqlModelMember] /// Creates a query that fetches all models and their nested data. pub fn build_sql_query( - model_schemas: &Vec, + schemas: &Vec, entities_table: &str, entity_relation_column: &str, where_clause: Option<&str>, @@ -227,7 +244,7 @@ pub fn build_sql_query( // struct can be the main entrypoint to our model schema // so we dont format the table name if the path is empty let table_name = - if path.is_empty() { s.name.clone() } else { format!("{}${}", path, name) }; + if path.is_empty() { name.to_string() } else { format!("{}${}", path, name) }; for child in &s.children { parse_ty( @@ -296,14 +313,14 @@ pub fn build_sql_query( is_typed = true; } - selections.push(format!("{}.external_{} AS \"{}.{}\"", path, name, path, name)); + selections.push(format!("[{path}].external_{name} AS \"{path}.{name}\"")); if is_typed { tables.push(table_name); } } _ => { // alias selected columns to avoid conflicts in `JOIN` - selections.push(format!("{}.external_{} AS \"{}.{}\"", path, name, path, name)); + selections.push(format!("[{path}].external_{name} AS \"{path}.{name}\"")); } } } @@ -311,14 +328,13 @@ pub fn build_sql_query( let mut global_selections = Vec::new(); let mut global_tables = Vec::new(); - let mut arrays_queries = HashMap::new(); + let mut arrays_queries: HashMap, Vec)> = HashMap::new(); - for ty in model_schemas { - let schema = ty.as_struct().expect("schema should be struct"); + for model in schemas { parse_ty( "", - &schema.name, - ty, + &model.name(), + model, &mut global_selections, &mut global_tables, &mut arrays_queries, @@ -334,7 +350,7 @@ pub fn build_sql_query( let join_clause = global_tables .into_iter() .map(|table| { - format!(" JOIN {table} ON {entities_table}.id = {table}.{entity_relation_column}") + format!(" JOIN [{table}] ON {entities_table}.id = [{table}].{entity_relation_column}") }) .collect::>() .join(" "); @@ -353,12 +369,13 @@ pub fn build_sql_query( .map(|(idx, table)| { if idx == 0 { format!( - " JOIN {table} ON {entities_table}.id = \ - {table}.{entity_relation_column}" + " JOIN [{table}] ON {entities_table}.id = \ + [{table}].{entity_relation_column}" ) } else { format!( - " JOIN {table} ON {table}.full_array_id = {prev_table}.full_array_id", + " JOIN [{table}] ON [{table}].full_array_id = \ + [{prev_table}].full_array_id", prev_table = tables[idx - 1] ) } @@ -535,7 +552,7 @@ mod tests { fn parse_simple_model_members_to_ty() { let model_members = vec![ SqlModelMember { - id: "Position".into(), + id: "Test-Position".into(), name: "x".into(), r#type: "u256".into(), key: false, @@ -545,7 +562,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "Position".into(), + id: "Test-Position".into(), name: "y".into(), r#type: "u256".into(), key: false, @@ -555,7 +572,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig".into(), + id: "Test-PlayerConfig".into(), name: "name".into(), r#type: "ByteArray".into(), key: false, @@ -567,7 +584,7 @@ mod tests { ]; let expected_position = Ty::Struct(Struct { - name: "Position".into(), + name: "Test-Position".into(), children: vec![ dojo_types::schema::Member { name: "x".into(), @@ -583,7 +600,7 @@ mod tests { }); let expected_player_config = Ty::Struct(Struct { - name: "PlayerConfig".into(), + name: "Test-PlayerConfig".into(), children: vec![dojo_types::schema::Member { name: "name".into(), key: false, @@ -591,15 +608,18 @@ mod tests { }], }); - assert_eq!(parse_sql_model_members("Position", &model_members), expected_position); - assert_eq!(parse_sql_model_members("PlayerConfig", &model_members), expected_player_config); + assert_eq!(parse_sql_model_members("Test", "Position", &model_members), expected_position); + assert_eq!( + parse_sql_model_members("Test", "PlayerConfig", &model_members), + expected_player_config + ); } #[test] fn parse_complex_model_members_to_ty() { let model_members = vec![ SqlModelMember { - id: "Position".into(), + id: "Test-Position".into(), name: "name".into(), r#type: "felt252".into(), key: false, @@ -609,7 +629,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "Position".into(), + id: "Test-Position".into(), name: "age".into(), r#type: "u8".into(), key: false, @@ -619,7 +639,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "Position".into(), + id: "Test-Position".into(), name: "vec".into(), r#type: "Vec2".into(), key: false, @@ -629,7 +649,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "Position$vec".into(), + id: "Test-Position$vec".into(), name: "x".into(), r#type: "u256".into(), key: false, @@ -639,7 +659,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "Position$vec".into(), + id: "Test-Position$vec".into(), name: "y".into(), r#type: "u256".into(), key: false, @@ -649,7 +669,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig".into(), + id: "Test-PlayerConfig".into(), name: "favorite_item".into(), r#type: "Option".into(), key: false, @@ -659,7 +679,7 @@ mod tests { enum_options: Some("None,Some".into()), }, SqlModelMember { - id: "PlayerConfig".into(), + id: "Test-PlayerConfig".into(), name: "items".into(), r#type: "Array".into(), key: false, @@ -669,7 +689,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig$items".into(), + id: "Test-PlayerConfig$items".into(), name: "data".into(), r#type: "PlayerItem".into(), key: false, @@ -679,7 +699,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig$items$data".into(), + id: "Test-PlayerConfig$items$data".into(), name: "item_id".into(), r#type: "u32".into(), key: false, @@ -689,7 +709,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig$items$data".into(), + id: "Test-PlayerConfig$items$data".into(), name: "quantity".into(), r#type: "u32".into(), key: false, @@ -699,7 +719,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig$favorite_item".into(), + id: "Test-PlayerConfig$favorite_item".into(), name: "Some".into(), r#type: "u32".into(), key: false, @@ -709,7 +729,7 @@ mod tests { enum_options: None, }, SqlModelMember { - id: "PlayerConfig$favorite_item".into(), + id: "Test-PlayerConfig$favorite_item".into(), name: "option".into(), r#type: "Option".into(), key: false, @@ -721,7 +741,7 @@ mod tests { ]; let expected_position = Ty::Struct(Struct { - name: "Position".into(), + name: "Test-Position".into(), children: vec![ dojo_types::schema::Member { name: "name".into(), @@ -756,7 +776,7 @@ mod tests { }); let expected_player_config = Ty::Struct(Struct { - name: "PlayerConfig".into(), + name: "Test-PlayerConfig".into(), children: vec![ dojo_types::schema::Member { name: "favorite_item".into(), @@ -795,14 +815,17 @@ mod tests { ], }); - assert_eq!(parse_sql_model_members("Position", &model_members), expected_position); - assert_eq!(parse_sql_model_members("PlayerConfig", &model_members), expected_player_config); + assert_eq!(parse_sql_model_members("Test", "Position", &model_members), expected_position); + assert_eq!( + parse_sql_model_members("Test", "PlayerConfig", &model_members), + expected_player_config + ); } #[test] fn parse_model_members_with_enum_to_ty() { let model_members = vec![SqlModelMember { - id: "Moves".into(), + id: "Test-Moves".into(), name: "direction".into(), r#type: "Direction".into(), key: false, @@ -813,7 +836,7 @@ mod tests { }]; let expected_ty = Ty::Struct(Struct { - name: "Moves".into(), + name: "Test-Moves".into(), children: vec![dojo_types::schema::Member { name: "direction".into(), key: false, @@ -830,13 +853,13 @@ mod tests { }], }); - assert_eq!(parse_sql_model_members("Moves", &model_members), expected_ty); + assert_eq!(parse_sql_model_members("Test", "Moves", &model_members), expected_ty); } #[test] fn struct_ty_to_query() { let position = Ty::Struct(Struct { - name: "Position".into(), + name: "Test-Position".into(), children: vec![ dojo_types::schema::Member { name: "player".into(), @@ -898,7 +921,7 @@ mod tests { }); let player_config = Ty::Struct(Struct { - name: "PlayerConfig".into(), + name: "Test-PlayerConfig".into(), children: vec![ dojo_types::schema::Member { name: "favorite_item".into(), @@ -942,14 +965,16 @@ mod tests { .unwrap(); let expected_query = - "SELECT entities.id, entities.keys, Position.external_player AS \"Position.player\", \ - Position$vec.external_x AS \"Position$vec.x\", Position$vec.external_y AS \ - \"Position$vec.y\", PlayerConfig$favorite_item.external_Some AS \ - \"PlayerConfig$favorite_item.Some\", PlayerConfig.external_favorite_item AS \ - \"PlayerConfig.favorite_item\" FROM entities JOIN Position$vec ON entities.id = \ - Position$vec.entity_id JOIN Position ON entities.id = Position.entity_id JOIN \ - PlayerConfig$favorite_item ON entities.id = PlayerConfig$favorite_item.entity_id \ - JOIN PlayerConfig ON entities.id = PlayerConfig.entity_id"; + "SELECT entities.id, entities.keys, [Test-Position].external_player AS \ + \"Test-Position.player\", [Test-Position$vec].external_x AS \"Test-Position$vec.x\", \ + [Test-Position$vec].external_y AS \"Test-Position$vec.y\", \ + [Test-PlayerConfig$favorite_item].external_Some AS \ + \"Test-PlayerConfig$favorite_item.Some\", [Test-PlayerConfig].external_favorite_item \ + AS \"Test-PlayerConfig.favorite_item\" FROM entities JOIN [Test-Position$vec] ON \ + entities.id = [Test-Position$vec].entity_id JOIN [Test-Position] ON entities.id = \ + [Test-Position].entity_id JOIN [Test-PlayerConfig$favorite_item] ON entities.id = \ + [Test-PlayerConfig$favorite_item].entity_id JOIN [Test-PlayerConfig] ON entities.id \ + = [Test-PlayerConfig].entity_id"; // todo: completely tests arrays assert_eq!(query.0, expected_query); } diff --git a/crates/torii/core/src/processors/event_message.rs b/crates/torii/core/src/processors/event_message.rs index cb8e7a1971..ff36452817 100644 --- a/crates/torii/core/src/processors/event_message.rs +++ b/crates/torii/core/src/processors/event_message.rs @@ -47,7 +47,7 @@ where event: &Event, ) -> Result<(), Error> { // silently ignore if the model is not found - let model = match db.model(&format!("{:#x}", event.keys[MODEL_INDEX])).await { + let model = match db.model(event.keys[MODEL_INDEX]).await { Ok(model) => model, Err(_) => return Ok(()), }; diff --git a/crates/torii/core/src/processors/register_model.rs b/crates/torii/core/src/processors/register_model.rs index c57896e303..e7d36f494f 100644 --- a/crates/torii/core/src/processors/register_model.rs +++ b/crates/torii/core/src/processors/register_model.rs @@ -48,17 +48,24 @@ where event: &Event, ) -> Result<(), Error> { let name = ByteArray::cairo_deserialize(&event.data, 0)?; + let mut offset = ByteArray::cairo_serialized_size(&name); + let namespace = ByteArray::cairo_deserialize(&event.data, offset)?; + offset += ByteArray::cairo_serialized_size(&namespace); + let name = name.to_string()?; + let namespace = namespace.to_string()?; - let model = world.model_reader(&name).await?; + let model = world.model_reader(&namespace, &name).await?; let schema = model.schema().await?; let layout = model.layout().await?; let unpacked_size: u32 = model.unpacked_size().await?; let packed_size: u32 = model.packed_size().await?; - let class_hash = event.data[1]; - let contract_address = event.data[3]; + let class_hash = event.data[offset]; + // NOTE: offset + 1 is the prev_class_hash, as denoted in + // the ModelRegistered event. so contract address is at offset + 2 + let contract_address = event.data[offset + 2]; info!( target: LOG_TARGET, @@ -78,6 +85,7 @@ where ); db.register_model( + &namespace, schema, layout, class_hash, diff --git a/crates/torii/core/src/processors/store_del_record.rs b/crates/torii/core/src/processors/store_del_record.rs index bc53f5d98f..69439a7754 100644 --- a/crates/torii/core/src/processors/store_del_record.rs +++ b/crates/torii/core/src/processors/store_del_record.rs @@ -49,7 +49,7 @@ where ) -> Result<(), Error> { let selector = event.data[MODEL_INDEX]; - let model = db.model(&format!("{:#x}", selector)).await?; + let model = db.model(selector).await?; info!( target: LOG_TARGET, diff --git a/crates/torii/core/src/processors/store_set_record.rs b/crates/torii/core/src/processors/store_set_record.rs index 548fe49fbe..30b63302d4 100644 --- a/crates/torii/core/src/processors/store_set_record.rs +++ b/crates/torii/core/src/processors/store_set_record.rs @@ -50,7 +50,7 @@ where ) -> Result<(), Error> { let selector = event.data[MODEL_INDEX]; - let model = db.model(&format!("{:#x}", selector)).await?; + let model = db.model(selector).await?; info!( target: LOG_TARGET, diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index eaafa3a92a..6b530e602e 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -6,11 +6,11 @@ use chrono::Utc; use dojo_types::primitive::Primitive; use dojo_types::schema::{EnumOption, Member, Ty}; use dojo_world::contracts::abi::model::Layout; +use dojo_world::contracts::naming::compute_model_selector_from_names; use dojo_world::metadata::WorldMetadata; use sqlx::pool::PoolConnection; use sqlx::{Pool, Sqlite}; use starknet::core::types::{Event, Felt, InvokeTransaction, Transaction}; -use starknet::core::utils::get_selector_from_name; use starknet_crypto::poseidon_hash_many; use super::World; @@ -96,6 +96,7 @@ impl Sql { #[allow(clippy::too_many_arguments)] pub async fn register_model( &mut self, + namespace: &str, model: Ty, layout: Layout, class_hash: Felt, @@ -104,16 +105,19 @@ impl Sql { unpacked_size: u32, block_timestamp: u64, ) -> Result<()> { + let selector = compute_model_selector_from_names(namespace, &model.name()); + let insert_models = - "INSERT INTO models (id, name, class_hash, contract_address, layout, packed_size, \ - unpacked_size, executed_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO \ - UPDATE SET contract_address=EXCLUDED.contract_address, \ + "INSERT INTO models (id, namespace, name, class_hash, contract_address, layout, \ + packed_size, unpacked_size, executed_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) ON \ + CONFLICT(id) DO UPDATE SET contract_address=EXCLUDED.contract_address, \ class_hash=EXCLUDED.class_hash, layout=EXCLUDED.layout, \ packed_size=EXCLUDED.packed_size, unpacked_size=EXCLUDED.unpacked_size, \ executed_at=EXCLUDED.executed_at RETURNING *"; let model_registered: ModelRegistered = sqlx::query_as(insert_models) // this is temporary until the model hash is precomputed - .bind(&format!("{:#x}", &get_selector_from_name(&model.name())?)) + .bind(&format!("{:#x}", selector)) + .bind(namespace) .bind(model.name()) .bind(format!("{class_hash:#x}")) .bind(format!("{contract_address:#x}")) @@ -126,8 +130,9 @@ impl Sql { let mut model_idx = 0_i64; self.build_register_queries_recursive( + selector, &model, - vec![model.name()], + vec![format!("{}-{}", namespace, model.name())], &mut model_idx, block_timestamp, &mut 0, @@ -156,14 +161,17 @@ impl Sql { return Err(anyhow!("Entity is not a struct")); }; + let namespaced_name = entity.name(); + let (model_namespace, model_name) = namespaced_name.split_once('-').unwrap(); + let entity_id = format!("{:#x}", poseidon_hash_many(&keys)); + let model_id = + format!("{:#x}", compute_model_selector_from_names(model_namespace, model_name)); + self.query_queue.enqueue( "INSERT INTO entity_model (entity_id, model_id) VALUES (?, ?) ON CONFLICT(entity_id, \ model_id) DO NOTHING", - vec![ - Argument::String(entity_id.clone()), - Argument::String(format!("{:#x}", get_selector_from_name(&entity.name())?)), - ], + vec![Argument::String(entity_id.clone()), Argument::String(model_id.clone())], ); let keys_str = felts_sql_string(&keys); @@ -181,7 +189,7 @@ impl Sql { entity_updated.updated_model = Some(entity.clone()); - let path = vec![entity.name()]; + let path = vec![namespaced_name]; self.build_set_entity_queries_recursive( path, event_id, @@ -213,14 +221,17 @@ impl Sql { return Err(anyhow!("Entity is not a struct")); }; + let namespaced_name = entity.name(); + let (model_namespace, model_name) = namespaced_name.split_once('-').unwrap(); + let entity_id = format!("{:#x}", poseidon_hash_many(&keys)); + let model_id = + format!("{:#x}", compute_model_selector_from_names(model_namespace, model_name)); + self.query_queue.enqueue( "INSERT INTO event_model (entity_id, model_id) VALUES (?, ?) ON CONFLICT(entity_id, \ model_id) DO NOTHING", - vec![ - Argument::String(entity_id.clone()), - Argument::String(format!("{:#x}", get_selector_from_name(&entity.name())?)), - ], + vec![Argument::String(entity_id.clone()), Argument::String(model_id.clone())], ); let keys_str = felts_sql_string(&keys); @@ -238,7 +249,7 @@ impl Sql { event_message_updated.updated_model = Some(entity.clone()); - let path = vec![entity.name()]; + let path = vec![namespaced_name]; self.build_set_entity_queries_recursive( path, event_id, @@ -317,10 +328,12 @@ impl Sql { Ok(()) } - pub async fn model(&self, model: &str) -> Result { - match ModelSQLReader::new(model, self.pool.clone()).await { + pub async fn model(&self, selector: Felt) -> Result { + match ModelSQLReader::new(selector, self.pool.clone()).await { Ok(reader) => Ok(reader), - Err(e) => Err(anyhow::anyhow!("Failed to get model from db for selector {model}: {e}")), + Err(e) => { + Err(anyhow::anyhow!("Failed to get model from db for selector {selector:#x}: {e}")) + } } } @@ -423,8 +436,10 @@ impl Sql { }); } + #[allow(clippy::too_many_arguments)] fn build_register_queries_recursive( &mut self, + selector: Felt, model: &Ty, path: Vec, model_idx: &mut i64, @@ -440,6 +455,7 @@ impl Sql { } self.build_model_query( + selector, path.clone(), model, *model_idx, @@ -459,6 +475,7 @@ impl Sql { path_clone.push(pathname.to_string()); self.build_register_queries_recursive( + selector, member, path_clone, &mut (*model_idx + 1), @@ -770,8 +787,10 @@ impl Sql { } } + #[allow(clippy::too_many_arguments)] fn build_model_query( &mut self, + selector: Felt, path: Vec, model: &Ty, model_idx: i64, @@ -802,7 +821,7 @@ impl Sql { create_table_query .push_str(&format!("external_{name} {}, ", cairo_type.to_sql_type())); indices.push(format!( - "CREATE INDEX IF NOT EXISTS idx_{table_id}_{name} ON [{table_id}] \ + "CREATE INDEX IF NOT EXISTS [idx_{table_id}_{name}] ON [{table_id}] \ (external_{name});" )); } else if let Ty::Enum(e) = &ty { @@ -821,7 +840,7 @@ impl Sql { create_table_query.push_str(if array_idx > 0 { ", " } else { "NOT NULL, " }); indices.push(format!( - "CREATE INDEX IF NOT EXISTS idx_{table_id}_{name} ON [{table_id}] \ + "CREATE INDEX IF NOT EXISTS [idx_{table_id}_{name}] ON [{table_id}] \ (external_{name});" )); @@ -836,7 +855,7 @@ impl Sql { } else if let Ty::ByteArray(_) = &ty { create_table_query.push_str(&format!("external_{name} TEXT, ")); indices.push(format!( - "CREATE INDEX IF NOT EXISTS idx_{table_id}_{name} ON [{table_id}] \ + "CREATE INDEX IF NOT EXISTS [idx_{table_id}_{name}] ON [{table_id}] \ (external_{name});" )); } @@ -859,10 +878,7 @@ impl Sql { let arguments = vec![ Argument::String(table_id.clone()), // TEMP: this is temporary until the model hash is precomputed - Argument::String(format!( - "{:#x}", - get_selector_from_name(&path[0].clone()).unwrap() - )), + Argument::String(format!("{:#x}", selector)), Argument::Int(model_idx), Argument::Int(member_idx as i64), Argument::String(name), @@ -888,10 +904,7 @@ impl Sql { let arguments = vec![ Argument::String(table_id.clone()), // TEMP: this is temporary until the model hash is precomputed - Argument::String(format!( - "{:#x}", - get_selector_from_name(&path[0].clone()).unwrap() - )), + Argument::String(format!("{:#x}", selector)), Argument::Int(model_idx), Argument::Int(idx as i64), Argument::String(format!("_{}", idx)), @@ -918,10 +931,7 @@ impl Sql { let arguments = vec![ Argument::String(table_id.clone()), // TEMP: this is temporary until the model hash is precomputed - Argument::String(format!( - "{:#x}", - get_selector_from_name(&path[0].clone()).unwrap() - )), + Argument::String(format!("{:#x}", selector)), Argument::Int(model_idx), Argument::Int(0), Argument::String("data".to_string()), @@ -960,10 +970,7 @@ impl Sql { let arguments = vec![ Argument::String(table_id.clone()), // TEMP: this is temporary until the model hash is precomputed - Argument::String(format!( - "{:#x}", - get_selector_from_name(&path[0].clone()).unwrap() - )), + Argument::String(format!("{:#x}", selector)), Argument::Int(model_idx), Argument::Int(idx as i64), Argument::String(child.name.clone()), diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 9edc00a56b..8477470734 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -3,11 +3,13 @@ use std::str::FromStr; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; +use dojo_world::contracts::naming::compute_model_selector_from_names; use dojo_world::contracts::world::WorldContractReader; -use dojo_world::metadata::dojo_metadata_from_workspace; +use dojo_world::metadata::{dojo_metadata_from_workspace, get_default_namespace_from_ws}; use dojo_world::migration::TxnConfig; use dojo_world::utils::{TransactionExt, TransactionWaiter}; use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use scarb::ops; use sozo_ops::migration::execute_strategy; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; @@ -66,7 +68,7 @@ async fn test_load_from_remote() { let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); - let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); let dojo_metadata = dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); @@ -75,9 +77,15 @@ async fn test_load_from_remote() { let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let mut migration = - prepare_migration(base_dir.into(), target_dir.into(), dojo_metadata.skip_migration) - .unwrap(); + let default_namespace = get_default_namespace_from_ws(&ws); + + let mut migration = prepare_migration( + base_dir.into(), + target_dir.into(), + dojo_metadata.skip_migration, + &default_namespace, + ) + .unwrap(); migration.resolve_variable(migration.world_address().unwrap()).unwrap(); let sequencer = KatanaRunner::new().expect("Failed to start runner."); @@ -125,39 +133,54 @@ async fn test_load_from_remote() { let models = sqlx::query("SELECT * FROM models").fetch_all(&pool).await.unwrap(); assert_eq!(models.len(), 8); - let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( - "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'Position'", - ) - .fetch_one(&pool) - .await - .unwrap(); + let (id, name, namespace, packed_size, unpacked_size): (String, String, String, u8, u8) = + sqlx::query_as( + "SELECT id, name, namespace, packed_size, unpacked_size FROM models WHERE name = \ + 'Position'", + ) + .fetch_one(&pool) + .await + .unwrap(); - assert_eq!(id, format!("{:#x}", get_selector_from_name("Position").unwrap())); + assert_eq!( + id, + format!("{:#x}", compute_model_selector_from_names("dojo_examples", "Position")) + ); assert_eq!(name, "Position"); + assert_eq!(namespace, "dojo_examples"); assert_eq!(packed_size, 1); assert_eq!(unpacked_size, 2); - let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( - "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'Moves'", - ) - .fetch_one(&pool) - .await - .unwrap(); + let (id, name, namespace, packed_size, unpacked_size): (String, String, String, u8, u8) = + sqlx::query_as( + "SELECT id, name, namespace, packed_size, unpacked_size FROM models WHERE name = \ + 'Moves'", + ) + .fetch_one(&pool) + .await + .unwrap(); - assert_eq!(id, format!("{:#x}", get_selector_from_name("Moves").unwrap())); + assert_eq!(id, format!("{:#x}", compute_model_selector_from_names("dojo_examples", "Moves"))); assert_eq!(name, "Moves"); + assert_eq!(namespace, "dojo_examples"); assert_eq!(packed_size, 0); assert_eq!(unpacked_size, 2); - let (id, name, packed_size, unpacked_size): (String, String, u8, u8) = sqlx::query_as( - "SELECT id, name, packed_size, unpacked_size FROM models WHERE name = 'PlayerConfig'", - ) - .fetch_one(&pool) - .await - .unwrap(); + let (id, name, namespace, packed_size, unpacked_size): (String, String, String, u8, u8) = + sqlx::query_as( + "SELECT id, name, namespace, packed_size, unpacked_size FROM models WHERE name = \ + 'PlayerConfig'", + ) + .fetch_one(&pool) + .await + .unwrap(); - assert_eq!(id, format!("{:#x}", get_selector_from_name("PlayerConfig").unwrap())); + assert_eq!( + id, + format!("{:#x}", compute_model_selector_from_names("dojo_examples", "PlayerConfig")) + ); assert_eq!(name, "PlayerConfig"); + assert_eq!(namespace, "dojo_examples"); assert_eq!(packed_size, 0); assert_eq!(unpacked_size, 0); @@ -190,7 +213,7 @@ async fn test_load_from_remote_del() { let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); - let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); let ws = scarb::ops::read_workspace(config.manifest_path(), &config).unwrap(); let dojo_metadata = dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); @@ -199,9 +222,16 @@ async fn test_load_from_remote_del() { let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let mut migration = - prepare_migration(base_dir.into(), target_dir.into(), dojo_metadata.skip_migration) - .unwrap(); + let default_namespace = get_default_namespace_from_ws(&ws); + + let mut migration = prepare_migration( + base_dir.into(), + target_dir.into(), + dojo_metadata.skip_migration, + &default_namespace, + ) + .unwrap(); + migration.resolve_variable(migration.world_address().unwrap()).unwrap(); let sequencer = KatanaRunner::new().expect("Failed to start runner."); @@ -283,9 +313,9 @@ async fn test_load_from_remote_del() { let mut db = Sql::new(pool.clone(), world_address).await.unwrap(); let _ = bootstrap_engine(world, db.clone(), &provider).await; - assert_eq!(count_table("PlayerConfig", &pool).await, 0); - assert_eq!(count_table("PlayerConfig$favorite_item", &pool).await, 0); - assert_eq!(count_table("PlayerConfig$items", &pool).await, 0); + assert_eq!(count_table("dojo_examples-PlayerConfig", &pool).await, 0); + assert_eq!(count_table("dojo_examples-PlayerConfig$favorite_item", &pool).await, 0); + assert_eq!(count_table("dojo_examples-PlayerConfig$items", &pool).await, 0); // TODO: check how we can have a test that is more chronological with Torii re-syncing // to ensure we can test intermediate states. @@ -302,7 +332,7 @@ async fn test_load_from_remote_del() { /// # Returns /// The number of rows in the table. async fn count_table(table_name: &str, pool: &sqlx::Pool) -> i64 { - let count_query = format!("SELECT COUNT(*) FROM {}", table_name); + let count_query = format!("SELECT COUNT(*) FROM [{}]", table_name); let count: (i64,) = sqlx::query_as(&count_query).fetch_one(pool).await.unwrap(); count.0 diff --git a/crates/torii/core/src/types.rs b/crates/torii/core/src/types.rs index b92f9e2364..2eec61cbcb 100644 --- a/crates/torii/core/src/types.rs +++ b/crates/torii/core/src/types.rs @@ -62,6 +62,7 @@ pub struct EventMessage { #[serde(rename_all = "camelCase")] pub struct Model { pub id: String, + pub namespace: String, pub name: String, pub class_hash: String, pub contract_address: String, diff --git a/crates/torii/graphql/Cargo.toml b/crates/torii/graphql/Cargo.toml index ae43a05ba6..192a4cfcb7 100644 --- a/crates/torii/graphql/Cargo.toml +++ b/crates/torii/graphql/Cargo.toml @@ -41,6 +41,7 @@ warp.workspace = true camino.workspace = true dojo-test-utils = { path = "../../dojo-test-utils", features = [ "build-examples" ] } dojo-world = { path = "../../dojo-world" } +katana-runner.workspace = true scarb.workspace = true serial_test = "2.0.0" starknet-crypto.workspace = true diff --git a/crates/torii/graphql/src/object/entity.rs b/crates/torii/graphql/src/object/entity.rs index 75013b4032..f37873c16b 100644 --- a/crates/torii/graphql/src/object/entity.rs +++ b/crates/torii/graphql/src/object/entity.rs @@ -19,7 +19,7 @@ use crate::mapping::ENTITY_TYPE_MAPPING; use crate::object::{resolve_many, resolve_one}; use crate::query::{type_mapping_query, value_mapping_from_row}; use crate::types::TypeData; -use crate::utils::extract; +use crate::utils; pub struct EntityObject; impl BasicObject for EntityObject { @@ -117,11 +117,11 @@ fn model_union_field() -> Field { Value::Object(indexmap) => { let mut conn = ctx.data::>()?.acquire().await?; - let entity_id = extract::(indexmap, "id")?; + let entity_id = utils::extract::(indexmap, "id")?; // fetch name from the models table // using the model id (hashed model name) - let model_ids: Vec<(String, String)> = sqlx::query_as( - "SELECT id, name + let model_ids: Vec<(String, String, String)> = sqlx::query_as( + "SELECT id, namespace, name FROM models WHERE id IN ( SELECT model_id @@ -134,14 +134,14 @@ fn model_union_field() -> Field { .await?; let mut results: Vec> = Vec::new(); - for (id, name) in model_ids { + for (id, namespace, name) in model_ids { // the model id in the model mmeebrs table is the hashed model name (id) let type_mapping = type_mapping_query(&mut conn, &id).await?; // but the table name for the model data is the unhashed model name let data: ValueMapping = match model_data_recursive_query( &mut conn, - vec![name.clone()], + vec![format!("{namespace}-{name}")], &entity_id, &[], &type_mapping, @@ -153,7 +153,10 @@ fn model_union_field() -> Field { _ => unreachable!(), }; - results.push(FieldValue::with_type(FieldValue::owned_any(data), name)); + results.push(FieldValue::with_type( + FieldValue::owned_any(data), + utils::type_name_from_names(&namespace, &name), + )) } Ok(Some(FieldValue::list(results))) @@ -177,7 +180,7 @@ pub async fn model_data_recursive_query( // For nested types, we need to remove prefix in path array let namespace = format!("{}_", path_array[0]); let table_name = &path_array.join("$").replace(&namespace, ""); - let mut query = format!("SELECT * FROM {} WHERE entity_id = '{}' ", table_name, entity_id); + let mut query = format!("SELECT * FROM [{}] WHERE entity_id = '{}' ", table_name, entity_id); for (column_idx, index) in indexes.iter().enumerate() { query.push_str(&format!("AND idx_{} = {} ", column_idx, index)); } diff --git a/crates/torii/graphql/src/object/model.rs b/crates/torii/graphql/src/object/model.rs index a9ecb13607..78428d2f67 100644 --- a/crates/torii/graphql/src/object/model.rs +++ b/crates/torii/graphql/src/object/model.rs @@ -105,6 +105,7 @@ impl ModelObject { IndexMap::from([ (Name::new("id"), Value::from(model.id)), (Name::new("name"), Value::from(model.name)), + (Name::new("namespace"), Value::from(model.namespace)), (Name::new("classHash"), Value::from(model.class_hash)), (Name::new("contractAddress"), Value::from(model.contract_address)), (Name::new("transactionHash"), Value::from(model.transaction_hash)), diff --git a/crates/torii/graphql/src/object/model_data.rs b/crates/torii/graphql/src/object/model_data.rs index 4b221f9146..8a5c555652 100644 --- a/crates/torii/graphql/src/object/model_data.rs +++ b/crates/torii/graphql/src/object/model_data.rs @@ -16,7 +16,7 @@ use crate::mapping::ENTITY_TYPE_MAPPING; use crate::query::data::{count_rows, fetch_multiple_rows, fetch_single_row}; use crate::query::value_mapping_from_row; use crate::types::TypeData; -use crate::utils::extract; +use crate::utils; #[derive(FromRow, Deserialize, PartialEq, Eq, Debug)] pub struct ModelMember { @@ -64,9 +64,13 @@ impl BasicObject for ModelDataObject { } fn objects(&self) -> Vec { + let mut parts = self.type_name().split('_').collect::>(); + let model = parts.pop().unwrap(); + let namespace = parts.join("_"); + let type_name = utils::struct_name_from_names(&namespace, model); let mut objects = data_objects_recursion( &TypeData::Nested((TypeRef::named(self.type_name()), self.type_mapping.clone())), - &vec![self.type_name().to_string()], + &vec![type_name], ); // root object requires entity_field association @@ -96,7 +100,10 @@ impl ResolvableObject for ModelDataObject { let mut field = Field::new(self.name().1, TypeRef::named(field_type), move |ctx| { let type_mapping = type_mapping.clone(); let where_mapping = where_mapping.clone(); - let type_name = type_name.clone(); + let mut parts = type_name.split('_').collect::>(); + let model = parts.pop().unwrap(); + let namespace = parts.join("_"); + let type_name = utils::struct_name_from_names(&namespace, model); FieldFuture::new(async move { let mut conn = ctx.data::>()?.acquire().await?; @@ -188,7 +195,7 @@ pub fn object(type_name: &str, type_mapping: &TypeMapping, path_array: Vec { let mut conn = ctx.data::>()?.acquire().await?; let entity_id = - extract::(indexmap, INTERNAL_ENTITY_ID_KEY)?; + utils::extract::(indexmap, INTERNAL_ENTITY_ID_KEY)?; // if we already fetched our model data, return it if let Some(data) = indexmap.get(&field_name) { @@ -242,7 +249,7 @@ fn entity_field() -> Field { match ctx.parent_value.try_to_value()? { Value::Object(indexmap) => { let mut conn = ctx.data::>()?.acquire().await?; - let entity_id = extract::(indexmap, INTERNAL_ENTITY_ID_KEY)?; + let entity_id = utils::extract::(indexmap, INTERNAL_ENTITY_ID_KEY)?; let data = fetch_single_row(&mut conn, ENTITY_TABLE, ID_COLUMN, &entity_id).await?; let entity = value_mapping_from_row(&data, &ENTITY_TYPE_MAPPING, false)?; diff --git a/crates/torii/graphql/src/query/data.rs b/crates/torii/graphql/src/query/data.rs index b81ae3b8b4..20d68debca 100644 --- a/crates/torii/graphql/src/query/data.rs +++ b/crates/torii/graphql/src/query/data.rs @@ -13,7 +13,7 @@ pub async fn count_rows( keys: &Option>, filters: &Option>, ) -> Result { - let mut query = format!("SELECT COUNT(*) FROM {}", table_name); + let mut query = format!("SELECT COUNT(*) FROM [{}]", table_name); let conditions = build_conditions(keys, filters); if !conditions.is_empty() { @@ -36,7 +36,7 @@ pub async fn fetch_single_row( id_column: &str, id: &str, ) -> sqlx::Result { - let query = format!("SELECT * FROM {} WHERE {} = '{}'", table_name, id_column, id); + let query = format!("SELECT * FROM [{}] WHERE {} = '{}'", table_name, id_column, id); sqlx::query(&query).fetch_one(conn).await } @@ -63,7 +63,7 @@ pub async fn fetch_multiple_rows( conditions.push(handle_cursor(before_cursor, order, CursorDirection::Before, id_column)?); } - let mut query = format!("SELECT * FROM {}", table_name); + let mut query = format!("SELECT * FROM [{}]", table_name); if !conditions.is_empty() { query.push_str(&format!(" WHERE {}", conditions.join(" AND "))); } diff --git a/crates/torii/graphql/src/query/mod.rs b/crates/torii/graphql/src/query/mod.rs index b66c37b8fd..46a1558517 100644 --- a/crates/torii/graphql/src/query/mod.rs +++ b/crates/torii/graphql/src/query/mod.rs @@ -145,9 +145,10 @@ fn parse_nested_type(member: &ModelMember, nested_members: &[&ModelMember]) -> T // sanitizes the member type string // for eg. Position_Array -> Position_ArrayVec2 // Position_(u8, Vec2) -> Position_u8Vec2 - let re = Regex::new(r"[, ()<>]").unwrap(); - let member_type_name = re.replace_all(&member.ty, ""); - let namespaced = format!("{}_{}", model_name, member_type_name); + let re = Regex::new(r"[, ()<>-]").unwrap(); + let sanitized_model_name = model_name.replace('-', "_"); + let sanitized_member_type_name = re.replace_all(&member.ty, ""); + let namespaced = format!("{}_{}", sanitized_model_name, sanitized_member_type_name); TypeData::Nested((TypeRef::named(namespaced), nested_mapping)) } diff --git a/crates/torii/graphql/src/schema.rs b/crates/torii/graphql/src/schema.rs index c2b9dc1787..48a915345b 100644 --- a/crates/torii/graphql/src/schema.rs +++ b/crates/torii/graphql/src/schema.rs @@ -1,6 +1,5 @@ use anyhow::Result; use async_graphql::dynamic::{Object, Scalar, Schema, Subscription, Union}; -use convert_case::{Case, Casing}; use sqlx::SqlitePool; use torii_core::types::Model; @@ -9,6 +8,7 @@ use super::object::entity::EntityObject; use super::object::event::EventObject; use super::object::model_data::ModelDataObject; use super::types::ScalarType; +use super::utils; use crate::constants::{QUERY_TYPE_NAME, SUBSCRIPTION_TYPE_NAME}; use crate::object::event_message::EventMessageObject; use crate::object::metadata::content::ContentObject; @@ -127,8 +127,9 @@ async fn build_objects(pool: &SqlitePool) -> Result<(Vec, Vec Result<(Vec, Vec Result { let source_project_dir = Utf8PathBuf::from("../types-test"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); - let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); @@ -291,33 +290,40 @@ pub async fn spinup_types_test() -> Result { dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); - let migration = - prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); - let config = build_test_config("../types-test/Scarb.toml").unwrap(); + + let default_namespace = get_default_namespace_from_ws(&ws); + + let mut migration = prepare_migration( + source_project_dir, + target_path, + dojo_metadata.skip_migration, + &default_namespace, + ) + .unwrap(); + + migration.resolve_variable(migration.world.clone().unwrap().contract_address).unwrap(); + let db = Sql::new(pool.clone(), migration.world_address().unwrap()).await.unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; + let sequencer = KatanaRunner::new().expect("Failed to start runner."); - let mut account = sequencer.account(); - account.set_block_id(BlockId::Tag(BlockTag::Pending)); + let account = sequencer.account(0); let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); - let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); - let ws = ops::read_workspace(config.manifest_path(), &config) - .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); - execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); + let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); - let manifest = - DeploymentManifest::load_from_remote(&provider, migration.world_address().unwrap()) - .await - .unwrap(); + let output = execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); // Execute `create` and insert 11 records into storage - let records_contract = - manifest.contracts.iter().find(|contract| contract.name.eq("records")).unwrap(); - let record_contract_address = records_contract.inner.address.unwrap(); + let records_contract = output + .contracts + .iter() + .find(|contract| contract.as_ref().unwrap().tag.eq("types_test-records")) + .unwrap(); + + let record_contract_address = records_contract.as_ref().unwrap().contract_address; + let InvokeTransactionResult { transaction_hash } = account .execute_v1(vec![Call { calldata: vec![Felt::from_str("0xa").unwrap()], diff --git a/crates/torii/graphql/src/tests/models_test.rs b/crates/torii/graphql/src/tests/models_test.rs index 99cd71ffcb..66bda6902b 100644 --- a/crates/torii/graphql/src/tests/models_test.rs +++ b/crates/torii/graphql/src/tests/models_test.rs @@ -16,7 +16,7 @@ mod tests { let query = format!( r#" {{ - recordSiblingModels {} {{ + typesTestRecordSiblingModels {} {{ totalCount edges {{ cursor @@ -39,14 +39,18 @@ mod tests { ); let result = run_graphql_query(schema, &query).await; - result.get("recordSiblingModels").ok_or("recordSiblingModels not found").unwrap().clone() + result + .get("typesTestRecordSiblingModels") + .ok_or("typesTestRecordSiblingModels not found") + .unwrap() + .clone() } async fn subrecord_model_query(schema: &Schema, arg: &str) -> Value { let query = format!( r#" {{ - subrecordModels {} {{ + typesTestSubrecordModels {} {{ totalCount edges {{ cursor @@ -71,14 +75,18 @@ mod tests { ); let result = run_graphql_query(schema, &query).await; - result.get("subrecordModels").ok_or("subrecordModels not found").unwrap().clone() + result + .get("typesTestSubrecordModels") + .ok_or("typesTestSubrecordModels not found") + .unwrap() + .clone() } async fn records_model_query(schema: &Schema, arg: &str) -> Value { let query = format!( r#" {{ - recordModels {} {{ + typesTestRecordModels {} {{ totalCount edges {{ cursor @@ -146,7 +154,11 @@ mod tests { ); let result = run_graphql_query(schema, &query).await; - result.get("recordModels").ok_or("recordModels not found").unwrap().clone() + result + .get("typesTestRecordModels") + .ok_or("typesTestRecordModels not found") + .unwrap() + .clone() } // End to end test spins up a test sequencer and deploys types-test project, this takes a while @@ -169,7 +181,7 @@ mod tests { let nested_two = record.node.type_nested_two.as_ref().unwrap(); assert_eq!(connection.total_count, 10); assert_eq!(connection.edges.len(), 10); - assert_eq!(&record.node.__typename, "Record"); + assert_eq!(&record.node.__typename, "types_test_Record"); assert_eq!(entity.keys.clone().unwrap(), vec!["0x0"]); assert_eq!(record.node.depth, "Zero"); assert_eq!(deeply_nested.depth, "One"); diff --git a/crates/torii/graphql/src/tests/subscription_test.rs b/crates/torii/graphql/src/tests/subscription_test.rs index 09b84c40cd..1bc74b6e98 100644 --- a/crates/torii/graphql/src/tests/subscription_test.rs +++ b/crates/torii/graphql/src/tests/subscription_test.rs @@ -7,15 +7,16 @@ mod tests { use dojo_types::primitive::Primitive; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use dojo_world::contracts::abi::model::Layout; + use dojo_world::contracts::naming::compute_model_selector_from_names; use serial_test::serial; use sqlx::SqlitePool; use starknet::core::types::{Event, Felt}; - use starknet::core::utils::get_selector_from_name; use starknet_crypto::poseidon_hash_many; use tokio::sync::mpsc; use torii_core::sql::Sql; use crate::tests::{model_fixtures, run_graphql_subscription}; + use crate::utils; #[sqlx::test(migrations = "../migrations")] #[serial] @@ -24,17 +25,20 @@ mod tests { model_fixtures(&mut db).await; // 0. Preprocess expected entity value + let namespace = "types_test".to_string(); let model_name = "Record".to_string(); let key = vec![Felt::ONE]; let entity_id = format!("{:#x}", poseidon_hash_many(&key)); let keys_str = key.iter().map(|k| format!("{:#x}", k)).collect::>().join(","); let block_timestamp = 1710754478_u64; + let type_name = utils::type_name_from_names(&namespace, &model_name); + let expected_value: async_graphql::Value = value!({ "entityUpdated": { "id": entity_id, "keys":vec![keys_str], "models" : [{ - "__typename": model_name, + "__typename": type_name, "depth": "Zero", "record_id": 0, "typeU16": 1, @@ -54,7 +58,7 @@ mod tests { // Set entity with one Record model db.set_entity( Ty::Struct(Struct { - name: model_name, + name: utils::struct_name_from_names(&namespace, &model_name), children: vec![ Member { name: "depth".to_string(), @@ -120,7 +124,7 @@ mod tests { keys models { __typename - ... on Record { + ... on types_test_Record { depth record_id typeU16 @@ -147,17 +151,20 @@ mod tests { model_fixtures(&mut db).await; // 0. Preprocess expected entity value + let namespace = "types_test".to_string(); let model_name = "Record".to_string(); let key = vec![Felt::ONE]; let entity_id = format!("{:#x}", poseidon_hash_many(&key)); let block_timestamp = 1710754478_u64; let keys_str = key.iter().map(|k| format!("{:#x}", k)).collect::>().join(","); + let type_name = utils::type_name_from_names(&namespace, &model_name); + let expected_value: async_graphql::Value = value!({ "entityUpdated": { "id": entity_id, "keys":vec![keys_str], "models" : [{ - "__typename": model_name, + "__typename": type_name, "depth": "Zero", "record_id": 0, "type_felt": format!("{:#x}", Felt::from(1u128)), @@ -174,7 +181,7 @@ mod tests { // Set entity with one Record model db.set_entity( Ty::Struct(Struct { - name: model_name, + name: utils::struct_name_from_names(&namespace, &model_name), children: vec![ Member { name: "depth".to_string(), @@ -225,7 +232,7 @@ mod tests { keys models { __typename - ... on Record { + ... on types_test_Record { depth record_id type_felt @@ -247,14 +254,16 @@ mod tests { async fn test_model_subscription(pool: SqlitePool) { let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); // 0. Preprocess model value + let namespace = "types_test".to_string(); let model_name = "Subrecord".to_string(); - let model_id = format!("{:#x}", get_selector_from_name(&model_name).unwrap()); + let model_id = format!("{:#x}", compute_model_selector_from_names(&namespace, &model_name)); let class_hash = Felt::TWO; let contract_address = Felt::THREE; let block_timestamp: u64 = 1710754478_u64; let expected_value: async_graphql::Value = value!({ - "modelRegistered": { "id": model_id, "name":model_name } + "modelRegistered": { "id": model_id, "name": model_name } }); + let (tx, mut rx) = mpsc::channel(7); tokio::spawn(async move { @@ -270,6 +279,7 @@ mod tests { }], }); db.register_model( + &namespace, model, Layout::Fixed(vec![]), class_hash, @@ -308,13 +318,14 @@ mod tests { async fn test_model_subscription_with_id(pool: SqlitePool) { let mut db = Sql::new(pool.clone(), Felt::ZERO).await.unwrap(); // 0. Preprocess model value + let namespace = "types_test".to_string(); let model_name = "Subrecord".to_string(); - let model_id = format!("{:#x}", get_selector_from_name(&model_name).unwrap()); + let model_id = format!("{:#x}", compute_model_selector_from_names(&namespace, &model_name)); let class_hash = Felt::TWO; let contract_address = Felt::THREE; let block_timestamp: u64 = 1710754478_u64; let expected_value: async_graphql::Value = value!({ - "modelRegistered": { "id": model_id, "name":model_name } + "modelRegistered": { "id": model_id, "name": model_name } }); let (tx, mut rx) = mpsc::channel(7); @@ -331,6 +342,7 @@ mod tests { }], }); db.register_model( + &namespace, model, Layout::Fixed(vec![]), class_hash, diff --git a/crates/torii/graphql/src/utils.rs b/crates/torii/graphql/src/utils.rs index a8353e04bb..8f49990d4a 100644 --- a/crates/torii/graphql/src/utils.rs +++ b/crates/torii/graphql/src/utils.rs @@ -1,4 +1,5 @@ use async_graphql::{Result, Value}; +use convert_case::{Case, Casing}; use crate::error::ExtractError; use crate::types::ValueMapping; @@ -45,3 +46,15 @@ pub fn extract( ) -> Result { T::extract(values, key) } + +pub fn field_name_from_names(namespace: &str, model_name: &str) -> String { + format!("{}{}", namespace.to_case(Case::Camel), model_name.to_case(Case::Pascal)) +} + +pub fn type_name_from_names(namespace: &str, model_name: &str) -> String { + format!("{}_{}", namespace, model_name) +} + +pub fn struct_name_from_names(namespace: &str, model_name: &str) -> String { + format!("{}-{}", namespace, model_name) +} diff --git a/crates/torii/grpc/Cargo.toml b/crates/torii/grpc/Cargo.toml index 73ade208de..7582eaf5ee 100644 --- a/crates/torii/grpc/Cargo.toml +++ b/crates/torii/grpc/Cargo.toml @@ -30,13 +30,14 @@ rand.workspace = true serde_json.workspace = true tower.workspace = true tracing.workspace = true +dojo-world = { path = "../../dojo-world", features = [ "contracts" ] } [dev-dependencies] camino.workspace = true dojo-test-utils.workspace = true -dojo-world = { path = "../../dojo-world", features = [ "contracts" ] } scarb.workspace = true sozo-ops.workspace = true +katana-runner.workspace = true [target.'cfg(target_arch = "wasm32")'.dependencies] tonic-web-wasm-client.workspace = true diff --git a/crates/torii/grpc/proto/types.proto b/crates/torii/grpc/proto/types.proto index 9575820858..fdb49a1f92 100644 --- a/crates/torii/grpc/proto/types.proto +++ b/crates/torii/grpc/proto/types.proto @@ -17,32 +17,29 @@ message WorldMetadata { } message ModelMetadata { + // Model namespace + string namespace = 1; // Model name - string name = 1; + string name = 2; // Model size when it is packed for storage - uint32 packed_size = 2; + uint32 packed_size = 3; // Model size when it is unpacked - uint32 unpacked_size = 3; + uint32 unpacked_size = 4; // hex-encoded class hash of the component - string class_hash = 4; + string class_hash = 5; // The layout of the component in bytes - bytes layout = 5; + bytes layout = 6; // The schema of the component serialized in bytes (for simplicity sake) - bytes schema = 6; + bytes schema = 7; // hex-encoded contract address of the component - string contract_address = 7; -} - -message Model { - string name = 1; - repeated Member members = 2; + string contract_address = 8; } message Entity { // The entity's hashed keys bytes hashed_keys = 1; // Models of the entity - repeated Model models = 2; + repeated Struct models = 2; } message Event { @@ -100,8 +97,8 @@ message Clause { } message ModelKeysClause { - string model = 1; - repeated bytes keys = 2; + string model = 2; + repeated bytes keys = 3; } message EntityKeysClause { @@ -112,9 +109,9 @@ message EntityKeysClause { } message KeysClause { - repeated bytes keys = 1; - PatternMatching pattern_matching = 2; - repeated string models = 3; + repeated bytes keys = 2; + PatternMatching pattern_matching = 3; + repeated string models = 4; } message HashedKeysClause { @@ -122,16 +119,15 @@ message HashedKeysClause { } message MemberClause { - string model = 1; - string member = 2; - ComparisonOperator operator = 3; - Value value = 4; + string model = 2; + string member = 3; + ComparisonOperator operator = 4; + Value value = 5; } message CompositeClause { - string model = 1; - LogicalOperator operator = 2; - repeated Clause clauses = 3; + LogicalOperator operator = 3; + repeated Clause clauses = 4; } enum PatternMatching { diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index 9cd741ec89..55d7092865 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -13,15 +13,16 @@ use std::str::FromStr; use std::sync::Arc; use dojo_types::schema::Ty; +use dojo_world::contracts::naming::compute_model_selector_from_names; use futures::Stream; use proto::world::{ MetadataRequest, MetadataResponse, RetrieveEntitiesRequest, RetrieveEntitiesResponse, RetrieveEventsRequest, RetrieveEventsResponse, SubscribeModelsRequest, SubscribeModelsResponse, }; +use sqlx::prelude::FromRow; use sqlx::sqlite::SqliteRow; use sqlx::{Pool, Row, Sqlite}; use starknet::core::types::Felt; -use starknet::core::utils::{cairo_short_string_to_felt, get_selector_from_name}; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; use subscriptions::event::EventManager; @@ -125,23 +126,39 @@ impl DojoWorld { .fetch_one(&self.pool) .await?; - let models: Vec<(String, String, String, String, u32, u32, String)> = sqlx::query_as( - "SELECT id, name, class_hash, contract_address, packed_size, unpacked_size, layout \ - FROM models", + #[derive(FromRow)] + struct ModelDb { + id: String, + namespace: String, + name: String, + class_hash: String, + contract_address: String, + packed_size: u32, + unpacked_size: u32, + layout: String, + } + + let models: Vec = sqlx::query_as( + "SELECT id, namespace, name, class_hash, contract_address, packed_size, \ + unpacked_size, layout FROM models", ) .fetch_all(&self.pool) .await?; let mut models_metadata = Vec::with_capacity(models.len()); for model in models { - let schema = self.model_cache.schema(&model.0).await?; + let schema = self + .model_cache + .schema(&Felt::from_str(&model.id).map_err(ParseError::FromStr)?) + .await?; models_metadata.push(proto::types::ModelMetadata { - name: model.1, - class_hash: model.2, - contract_address: model.3, - packed_size: model.4, - unpacked_size: model.5, - layout: model.6.as_bytes().to_vec(), + namespace: model.namespace, + name: model.name, + class_hash: model.class_hash, + contract_address: model.contract_address, + packed_size: model.packed_size, + unpacked_size: model.unpacked_size, + layout: model.layout.as_bytes().to_vec(), schema: serde_json::to_vec(&schema).unwrap(), }); } @@ -263,9 +280,13 @@ impl DojoWorld { sqlx::query_as(&query).bind(limit).bind(offset).fetch_all(&self.pool).await?; let mut entities = Vec::with_capacity(db_entities.len()); - for (entity_id, models_str) in &db_entities { - let model_ids: Vec<&str> = models_str.split(',').collect(); - let schemas = self.model_cache.schemas(model_ids).await?; + for (entity_id, models_str) in db_entities { + let model_ids: Vec = models_str + .split(',') + .map(Felt::from_str) + .collect::>() + .map_err(ParseError::FromStr)?; + let schemas = self.model_cache.schemas(&model_ids).await?; let (entity_query, arrays_queries) = build_sql_query( &schemas, @@ -275,14 +296,16 @@ impl DojoWorld { Some(&format!("{table}.id = ?")), )?; - let row = sqlx::query(&entity_query).bind(entity_id).fetch_one(&self.pool).await?; + let row = + sqlx::query(&entity_query).bind(entity_id.clone()).fetch_one(&self.pool).await?; let mut arrays_rows = HashMap::new(); for (name, query) in arrays_queries { - let rows = sqlx::query(&query).bind(entity_id).fetch_all(&self.pool).await?; + let rows = + sqlx::query(&query).bind(entity_id.clone()).fetch_all(&self.pool).await?; arrays_rows.insert(name, rows); } - entities.push(map_row_to_entity(&row, &arrays_rows, &schemas)?); + entities.push(map_row_to_entity(&row, &arrays_rows, schemas.clone())?); } Ok((entities, total_count)) @@ -307,13 +330,24 @@ impl DojoWorld { {} "#, if !keys_clause.models.is_empty() { + // split the model names to namespace and model let model_ids = keys_clause .models .iter() - .map(|model| get_selector_from_name(model).map_err(ParseError::NonAsciiName)) + .map(|model| { + model + .split_once('-') + .ok_or(QueryError::InvalidNamespacedModel(model.clone())) + }) .collect::, _>>()?; - let model_ids_str = - model_ids.iter().map(|id| format!("'{:#x}'", id)).collect::>().join(","); + // get the model selector from namespace and model and format + let model_ids_str = model_ids + .iter() + .map(|(namespace, model)| { + format!("'{:#x}'", compute_model_selector_from_names(namespace, model)) + }) + .collect::>() + .join(","); format!( r#" JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id @@ -356,8 +390,10 @@ impl DojoWorld { .models .iter() .map(|model| { - let model_id = - get_selector_from_name(model).map_err(ParseError::NonAsciiName)?; + let (namespace, name) = model + .split_once('-') + .ok_or(QueryError::InvalidNamespacedModel(model.clone()))?; + let model_id = compute_model_selector_from_names(namespace, name); Ok(format!("INSTR(model_ids, '{:#x}') > 0", model_id)) }) .collect::, Error>>()? @@ -384,8 +420,12 @@ impl DojoWorld { let mut entities = Vec::with_capacity(db_entities.len()); for (entity_id, models_strs) in &db_entities { - let model_ids: Vec<&str> = models_strs.split(',').collect(); - let schemas = self.model_cache.schemas(model_ids).await?; + let model_ids: Vec = models_strs + .split(',') + .map(Felt::from_str) + .collect::>() + .map_err(ParseError::FromStr)?; + let schemas = self.model_cache.schemas(&model_ids).await?; let (entity_query, arrays_queries) = build_sql_query( &schemas, @@ -402,7 +442,7 @@ impl DojoWorld { arrays_rows.insert(name, rows); } - entities.push(map_row_to_entity(&row, &arrays_rows, &schemas)?); + entities.push(map_row_to_entity(&row, &arrays_rows, schemas.clone())?); } Ok((entities, total_count)) @@ -455,6 +495,11 @@ impl DojoWorld { let comparison_value = value_to_string(&value_type)?; + let (namespace, model) = member_clause + .model + .split_once('-') + .ok_or(QueryError::InvalidNamespacedModel(member_clause.model.clone()))?; + let models_query = format!( r#" SELECT group_concat({model_relation_table}.model_id) as model_ids @@ -464,12 +509,16 @@ impl DojoWorld { HAVING INSTR(model_ids, '{:#x}') > 0 LIMIT 1 "#, - get_selector_from_name(&member_clause.model).map_err(ParseError::NonAsciiName)? + compute_model_selector_from_names(namespace, model) ); let (models_str,): (String,) = sqlx::query_as(&models_query).fetch_one(&self.pool).await?; - let model_ids = models_str.split(',').collect::>(); - let schemas = self.model_cache.schemas(model_ids).await?; + let model_ids = models_str + .split(',') + .map(Felt::from_str) + .collect::, _>>() + .map_err(ParseError::FromStr)?; + let schemas = self.model_cache.schemas(&model_ids).await?; let table_name = member_clause.model; let column_name = format!("external_{}", member_clause.member); @@ -499,7 +548,7 @@ impl DojoWorld { let entities_collection = db_entities .iter() - .map(|row| map_row_to_entity(row, &arrays_rows, &schemas)) + .map(|row| map_row_to_entity(row, &arrays_rows, schemas.clone())) .collect::, Error>>()?; // Since there is not limit and offset, total_count is same as number of entities let total_count = entities_collection.len() as u32; @@ -555,8 +604,11 @@ impl DojoWorld { comparison_value, )); - let model_id = - get_selector_from_name(&member.model).map_err(ParseError::NonAsciiName)?; + let (namespace, model) = member + .model + .split_once('-') + .ok_or(QueryError::InvalidNamespacedModel(member.model.clone()))?; + let model_id: Felt = compute_model_selector_from_names(namespace, model); having_clauses.push(format!("INSTR(model_ids, '{:#x}') > 0", model_id)); } _ => return Err(QueryError::UnsupportedQuery.into()), @@ -569,13 +621,13 @@ impl DojoWorld { .into_iter() .map(|(column, op, value)| { bind_values.push(value); - format!("{}.{} {} ?", model, column, op) + format!("[{}].{} {} ?", model, column, op) }) .collect::>() .join(" AND "); join_clauses.push(format!( - "JOIN {} ON {}.id = {}.entity_id AND ({})", + "JOIN [{}] ON [{}].id = [{}].entity_id AND ({})", model, table, model, model_conditions )); } @@ -594,8 +646,8 @@ impl DojoWorld { let count_query = format!( r#" - SELECT COUNT(DISTINCT {table}.id) - FROM {table} + SELECT COUNT(DISTINCT [{table}].id) + FROM [{table}] {join_clause} {where_clause} "# @@ -614,14 +666,14 @@ impl DojoWorld { let query = format!( r#" - SELECT {table}.id, group_concat({model_relation_table}.model_id) as model_ids - FROM {table} - JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id + SELECT [{table}].id, group_concat({model_relation_table}.model_id) as model_ids + FROM [{table}] + JOIN {model_relation_table} ON [{table}].id = {model_relation_table}.entity_id {join_clause} {where_clause} - GROUP BY {table}.id + GROUP BY [{table}].id {having_clause} - ORDER BY {table}.event_id DESC + ORDER BY [{table}].event_id DESC LIMIT ? OFFSET ? "# ); @@ -636,15 +688,19 @@ impl DojoWorld { let mut entities = Vec::with_capacity(db_entities.len()); for (entity_id, models_str) in &db_entities { - let model_ids: Vec<&str> = models_str.split(',').collect(); - let schemas = self.model_cache.schemas(model_ids).await?; + let model_ids: Vec = models_str + .split(',') + .map(Felt::from_str) + .collect::>() + .map_err(ParseError::FromStr)?; + let schemas = self.model_cache.schemas(&model_ids).await?; let (entity_query, arrays_queries) = build_sql_query( &schemas, table, entity_relation_column, - Some(&format!("{table}.id = ?")), - Some(&format!("{table}.id = ?")), + Some(&format!("[{table}].id = ?")), + Some(&format!("[{table}].id = ?")), )?; let row = sqlx::query(&entity_query).bind(entity_id).fetch_one(&self.pool).await?; @@ -654,16 +710,19 @@ impl DojoWorld { arrays_rows.insert(name, rows); } - entities.push(map_row_to_entity(&row, &arrays_rows, &schemas)?); + entities.push(map_row_to_entity(&row, &arrays_rows, schemas.clone())?); } Ok((entities, total_count)) } - pub async fn model_metadata(&self, model: &str) -> Result { + pub async fn model_metadata( + &self, + namespace: &str, + name: &str, + ) -> Result { // selector - let model = - format!("{:#x}", get_selector_from_name(model).map_err(ParseError::NonAsciiName)?); + let model = compute_model_selector_from_names(namespace, name); let (name, class_hash, contract_address, packed_size, unpacked_size, layout): ( String, @@ -673,10 +732,10 @@ impl DojoWorld { u32, String, ) = sqlx::query_as( - "SELECT name, class_hash, contract_address, packed_size, unpacked_size, layout FROM \ - models WHERE id = ?", + "SELECT namespace, name, class_hash, contract_address, packed_size, unpacked_size, \ + layout FROM models WHERE id = ?", ) - .bind(&model) + .bind(format!("{:#x}", model)) .fetch_one(&self.pool) .await?; @@ -684,6 +743,7 @@ impl DojoWorld { let layout = layout.as_bytes().to_vec(); Ok(proto::types::ModelMetadata { + namespace: namespace.to_string(), name, layout, class_hash, @@ -700,16 +760,20 @@ impl DojoWorld { ) -> Result>, Error> { let mut subs = Vec::with_capacity(models_keys.len()); for keys in models_keys { - let model = cairo_short_string_to_felt(&keys.model) - .map_err(ParseError::CairoShortStringToFelt)?; + let (namespace, model) = keys + .model + .split_once('-') + .ok_or(QueryError::InvalidNamespacedModel(keys.model.clone()))?; + + let selector = compute_model_selector_from_names(namespace, model); let proto::types::ModelMetadata { packed_size, .. } = - self.model_metadata(&keys.model).await?; + self.model_metadata(namespace, model).await?; subs.push(ModelDiffRequest { keys, model: subscriptions::model_diff::ModelMetadata { - name: model, + selector, packed_size: packed_size as usize, }, }); @@ -911,15 +975,14 @@ fn map_row_to_event(row: &(String, String, String)) -> Result>, - schemas: &[Ty], + mut schemas: Vec, ) -> Result { let hashed_keys = Felt::from_str(&row.get::("id")).map_err(ParseError::FromStr)?; let models = schemas - .iter() + .iter_mut() .map(|schema| { - let mut schema = schema.to_owned(); - map_row_to_ty("", &schema.name(), &mut schema, row, arrays_rows)?; - Ok(schema.as_struct().expect("schema should be struct").to_owned().try_into().unwrap()) + map_row_to_ty("", &schema.name(), schema, row, arrays_rows)?; + Ok(schema.as_struct().unwrap().clone().into()) }) .collect::, Error>>()?; diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index 8f00cbdd5d..79666a170a 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -117,8 +117,25 @@ impl Service { // if we have a model clause, then we need to check that the entity // has an updated model and that the model name matches the clause if let Some(updated_model) = &entity.updated_model { + let name = updated_model.name(); + let (namespace, name) = name.split_once('-').unwrap(); + if !clause.models.is_empty() - && !clause.models.contains(&updated_model.name()) + && !clause.models.iter().any(|clause_model| { + let (clause_namespace, clause_model) = + clause_model.split_once('-').unwrap(); + // if both namespace and model are empty, we should match all. + // if namespace is specified and model is empty or * we should match + // all models in the namespace + // if namespace and model are specified, we should match the + // specific model + (clause_namespace.is_empty() + || clause_namespace == namespace + || clause_namespace == "*") + && (clause_model.is_empty() + || clause_model == name + || clause_model == "*") + }) { continue; } @@ -179,8 +196,12 @@ impl Service { "#; let (model_ids,): (String,) = sqlx::query_as(models_query).bind(&entity.id).fetch_one(&pool).await?; - let model_ids: Vec<&str> = model_ids.split(',').collect(); - let schemas = cache.schemas(model_ids).await?; + let model_ids: Vec = model_ids + .split(',') + .map(Felt::from_str) + .collect::>() + .map_err(ParseError::FromStr)?; + let schemas = cache.schemas(&model_ids).await?; let (entity_query, arrays_queries) = build_sql_query( &schemas, @@ -198,7 +219,7 @@ impl Service { } let resp = proto::world::SubscribeEntityResponse { - entity: Some(map_row_to_entity(&row, &arrays_rows, &schemas)?), + entity: Some(map_row_to_entity(&row, &arrays_rows, schemas.clone())?), }; if sub.sender.send(Ok(resp)).await.is_err() { diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 568ea85e6e..5e6c249129 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -116,8 +116,25 @@ impl Service { // if we have a model clause, then we need to check that the entity // has an updated model and that the model name matches the clause if let Some(updated_model) = &entity.updated_model { + let name = updated_model.name(); + let (namespace, name) = name.split_once('-').unwrap(); + if !clause.models.is_empty() - && !clause.models.contains(&updated_model.name()) + && !clause.models.iter().any(|clause_model| { + let (clause_namespace, clause_model) = + clause_model.split_once('-').unwrap(); + // if both namespace and model are empty, we should match all. + // if namespace is specified and model is empty or * we should match + // all models in the namespace + // if namespace and model are specified, we should match the + // specific model + (clause_namespace.is_empty() + || clause_namespace == namespace + || clause_namespace == "*") + && (clause_model.is_empty() + || clause_model == name + || clause_model == "*") + }) { continue; } @@ -164,8 +181,12 @@ impl Service { "#; let (model_ids,): (String,) = sqlx::query_as(models_query).bind(&entity.id).fetch_one(&pool).await?; - let model_ids: Vec<&str> = model_ids.split(',').collect(); - let schemas = cache.schemas(model_ids).await?; + let model_ids: Vec = model_ids + .split(',') + .map(Felt::from_str) + .collect::>() + .map_err(ParseError::FromStr)?; + let schemas = cache.schemas(&model_ids).await?; let (entity_query, arrays_queries) = build_sql_query( &schemas, @@ -183,7 +204,7 @@ impl Service { } let resp = proto::world::SubscribeEntityResponse { - entity: Some(map_row_to_entity(&row, &arrays_rows, &schemas)?), + entity: Some(map_row_to_entity(&row, &arrays_rows, schemas.clone())?), }; if sub.sender.send(Ok(resp)).await.is_err() { diff --git a/crates/torii/grpc/src/server/subscriptions/model_diff.rs b/crates/torii/grpc/src/server/subscriptions/model_diff.rs index f5088f072d..7438525f72 100644 --- a/crates/torii/grpc/src/server/subscriptions/model_diff.rs +++ b/crates/torii/grpc/src/server/subscriptions/model_diff.rs @@ -27,7 +27,7 @@ use crate::types::ModelKeysClause; pub(crate) const LOG_TARGET: &str = "torii::grpc::server::subscriptions::model_diff"; pub struct ModelMetadata { - pub name: Felt, + pub selector: Felt, pub packed_size: usize, } @@ -67,7 +67,7 @@ impl StateDiffManager { let base = poseidon_hash_many(&[ short_string!("dojo_storage"), - req.model.name, + req.model.selector, poseidon_hash_many(&keys.keys), ]); diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index c32076e496..8aeb9a0756 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -2,20 +2,18 @@ use std::str::FromStr; use std::sync::Arc; use camino::Utf8PathBuf; -use dojo_test_utils::compiler::{self, build_test_config}; +use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_test_utils::sequencer::{ - get_default_test_starknet_config, SequencerConfig, TestSequencer, -}; use dojo_world::contracts::WorldContractReader; -use dojo_world::metadata::dojo_metadata_from_workspace; +use dojo_world::metadata::{dojo_metadata_from_workspace, get_default_namespace_from_ws}; use dojo_world::migration::TxnConfig; use dojo_world::utils::TransactionWaiter; +use katana_runner::KatanaRunner; +use scarb::compiler::Profile; use scarb::ops; use sozo_ops::migration::execute_strategy; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use starknet::accounts::{Account, Call}; -use starknet::core::types::{BlockId, BlockTag}; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::JsonRpcClient; @@ -42,7 +40,8 @@ async fn test_entities_queries() { let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); - let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path); + let config = compiler::copy_tmp_config(&source_project_dir, &dojo_core_path, Profile::DEV); + println!("config path {:?}", config.manifest_path()); let ws = ops::read_workspace(config.manifest_path(), &config) .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); @@ -51,26 +50,32 @@ async fn test_entities_queries() { let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); - let mut migration = - prepare_migration(source_project_dir, target_path, dojo_metadata.skip_migration).unwrap(); + let default_namespace = get_default_namespace_from_ws(&ws); + + let mut migration = prepare_migration( + config.manifest_path().parent().unwrap().into(), + target_path, + dojo_metadata.skip_migration, + &default_namespace, + ) + .unwrap(); migration.resolve_variable(migration.world_address().unwrap()).unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()).await; + let sequencer = KatanaRunner::new().expect("Fail to start runner"); + let provider = Arc::new(JsonRpcClient::new(HttpTransport::new(sequencer.url()))); + let world = WorldContractReader::new(migration.world_address().unwrap(), &provider); - let mut account = sequencer.account(); - account.set_block_id(BlockId::Tag(BlockTag::Pending)); + let account = sequencer.account(0); - let config = build_test_config("../../../examples/spawn-and-move/Scarb.toml").unwrap(); - let ws = ops::read_workspace(config.manifest_path(), &config) - .unwrap_or_else(|op| panic!("Error building workspace: {op:?}")); let migration_output = - execute_strategy(&ws, &migration, &account, TxnConfig::default()).await.unwrap(); + execute_strategy(&ws, &migration, &account, TxnConfig::init_wait()).await.unwrap(); let world_address = migration_output.world_address; + println!("output {:?}", migration_output); + // spawn let tx = account .execute_v1(vec![Call { @@ -131,7 +136,7 @@ async fn test_entities_queries() { assert_eq!(entities.len(), 1); let entity: Entity = entities.first().unwrap().clone().try_into().unwrap(); - assert_eq!(entity.models.first().unwrap().name, "Position"); - assert_eq!(entity.models.get(1).unwrap().name, "Moves"); + assert_eq!(entity.models.first().unwrap().name, "dojo_examples-Position"); + assert_eq!(entity.models.get(1).unwrap().name, "dojo_examples-Moves"); assert_eq!(entity.hashed_keys, poseidon_hash_many(&[account.address()])); } diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index 0666e382f9..dd576b6ebb 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -4,6 +4,7 @@ use std::str::FromStr; use dojo_types::primitive::Primitive; use dojo_types::schema::Ty; +use dojo_world::contracts::naming; use serde::{Deserialize, Serialize}; use starknet::core::types::{ ContractStorageDiffItem, Felt, FromStrError, StateDiff, StateUpdate, StorageEntry, @@ -63,7 +64,6 @@ pub struct MemberClause { #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct CompositeClause { - pub model: String, pub operator: LogicalOperator, pub clauses: Vec, } @@ -140,6 +140,7 @@ impl TryFrom for dojo_types::schema::ModelMetadata schema, layout, name: value.name, + namespace: value.namespace, packed_size: value.packed_size, unpacked_size: value.unpacked_size, class_hash: Felt::from_str(&value.class_hash)?, @@ -154,7 +155,15 @@ impl TryFrom for dojo_types::WorldMetadata { let models = value .models .into_iter() - .map(|component| Ok((component.name.clone(), component.try_into()?))) + .map(|component| { + Ok(( + naming::compute_model_selector_from_names( + &component.namespace, + &component.name, + ), + component.try_into()?, + )) + }) .collect::, _>>()?; Ok(dojo_types::WorldMetadata { @@ -287,7 +296,6 @@ impl From for proto::types::MemberClause { impl From for proto::types::CompositeClause { fn from(value: CompositeClause) -> Self { Self { - model: value.model, operator: value.operator as i32, clauses: value.clauses.into_iter().map(|clause| clause.into()).collect(), } diff --git a/crates/torii/grpc/src/types/schema.rs b/crates/torii/grpc/src/types/schema.rs index 728a5da5f6..086fbdf530 100644 --- a/crates/torii/grpc/src/types/schema.rs +++ b/crates/torii/grpc/src/types/schema.rs @@ -17,13 +17,7 @@ pub enum SchemaError { #[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] pub struct Entity { pub hashed_keys: Felt, - pub models: Vec, -} - -#[derive(Debug, Serialize, Deserialize, PartialEq, Hash, Eq, Clone)] -pub struct Model { - pub name: String, - pub members: Vec, + pub models: Vec, } impl TryFrom for Entity { @@ -40,45 +34,22 @@ impl TryFrom for Entity { } } -impl TryFrom for Model { - type Error = SchemaError; - fn try_from(model: proto::types::Model) -> Result { - Ok(Self { - name: model.name, - members: model - .members - .into_iter() - .map(TryInto::try_into) - .collect::, _>>()?, - }) - } -} - -impl TryFrom for proto::types::Ty { - type Error = SchemaError; - fn try_from(ty: Ty) -> Result { +impl From for proto::types::Ty { + fn from(ty: Ty) -> Self { let ty_type = match ty { - Ty::Primitive(primitive) => { - Some(proto::types::ty::TyType::Primitive(primitive.try_into()?)) - } - Ty::Enum(r#enum) => Some(proto::types::ty::TyType::Enum(r#enum.try_into()?)), - Ty::Struct(r#struct) => Some(proto::types::ty::TyType::Struct(r#struct.try_into()?)), + Ty::Primitive(primitive) => Some(proto::types::ty::TyType::Primitive(primitive.into())), + Ty::Enum(r#enum) => Some(proto::types::ty::TyType::Enum(r#enum.into())), + Ty::Struct(r#struct) => Some(proto::types::ty::TyType::Struct(r#struct.into())), Ty::Tuple(tuple) => Some(proto::types::ty::TyType::Tuple(proto::types::Array { - children: tuple - .into_iter() - .map(TryInto::try_into) - .collect::, _>>()?, + children: tuple.into_iter().map(Into::into).collect::>(), })), Ty::Array(array) => Some(proto::types::ty::TyType::Array(proto::types::Array { - children: array - .into_iter() - .map(TryInto::try_into) - .collect::, _>>()?, + children: array.into_iter().map(Into::into).collect::>(), })), Ty::ByteArray(string) => Some(proto::types::ty::TyType::Bytearray(string)), }; - Ok(proto::types::Ty { ty_type }) + proto::types::Ty { ty_type } } } @@ -93,14 +64,9 @@ impl TryFrom for Member { } } -impl TryFrom for proto::types::Member { - type Error = SchemaError; - fn try_from(member: Member) -> Result { - Ok(proto::types::Member { - name: member.name, - ty: Some(member.ty.try_into()?), - key: member.key, - }) +impl From for proto::types::Member { + fn from(member: Member) -> Self { + proto::types::Member { name: member.name, ty: Some(member.ty.into()), key: member.key } } } @@ -114,10 +80,9 @@ impl TryFrom for EnumOption { } } -impl TryFrom for proto::types::EnumOption { - type Error = SchemaError; - fn try_from(option: EnumOption) -> Result { - Ok(proto::types::EnumOption { name: option.name, ty: Some(option.ty.try_into()?) }) +impl From for proto::types::EnumOption { + fn from(option: EnumOption) -> Self { + proto::types::EnumOption { name: option.name, ty: Some(option.ty.into()) } } } @@ -136,18 +101,13 @@ impl TryFrom for Enum { } } -impl TryFrom for proto::types::Enum { - type Error = SchemaError; - fn try_from(r#enum: Enum) -> Result { - Ok(proto::types::Enum { +impl From for proto::types::Enum { + fn from(r#enum: Enum) -> Self { + proto::types::Enum { name: r#enum.name, option: r#enum.option.expect("option value") as u32, - options: r#enum - .options - .into_iter() - .map(TryInto::try_into) - .collect::, _>>()?, - }) + options: r#enum.options.into_iter().map(Into::into).collect::>(), + } } } @@ -165,32 +125,12 @@ impl TryFrom for Struct { } } -impl TryFrom for proto::types::Struct { - type Error = SchemaError; - fn try_from(r#struct: Struct) -> Result { - Ok(proto::types::Struct { +impl From for proto::types::Struct { + fn from(r#struct: Struct) -> Self { + proto::types::Struct { name: r#struct.name, - children: r#struct - .children - .into_iter() - .map(TryInto::try_into) - .collect::, _>>()?, - }) - } -} - -impl TryFrom for proto::types::Model { - type Error = SchemaError; - fn try_from(r#struct: Struct) -> Result { - let r#struct: proto::types::Struct = r#struct.try_into()?; - - Ok(r#struct.into()) - } -} - -impl From for proto::types::Model { - fn from(r#struct: proto::types::Struct) -> Self { - Self { name: r#struct.name, members: r#struct.children } + children: r#struct.children.into_iter().map(Into::into).collect::>(), + } } } @@ -244,9 +184,8 @@ impl TryFrom for Primitive { } } -impl TryFrom for proto::types::Primitive { - type Error = SchemaError; - fn try_from(primitive: Primitive) -> Result { +impl From for proto::types::Primitive { + fn from(primitive: Primitive) -> Self { use proto::types::value::ValueType; let value_type = match primitive { @@ -274,10 +213,10 @@ impl TryFrom for proto::types::Primitive { } .expect("value expected"); - Ok(proto::types::Primitive { + proto::types::Primitive { value: Some(proto::types::Value { value_type: Some(value_type) }), r#type: primitive.to_numeric() as i32, - }) + } } } diff --git a/crates/torii/libp2p/Cargo.toml b/crates/torii/libp2p/Cargo.toml index e6cf3466f9..df2b2eb526 100644 --- a/crates/torii/libp2p/Cargo.toml +++ b/crates/torii/libp2p/Cargo.toml @@ -30,6 +30,7 @@ tracing.workspace = true [dev-dependencies] dojo-test-utils.workspace = true +katana-runner.workspace = true tempfile.workspace = true [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index 2e4bec0c91..4a64043dab 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -10,6 +10,7 @@ use chrono::Utc; use crypto_bigint::U256; use dojo_types::primitive::Primitive; use dojo_types::schema::Ty; +use dojo_world::contracts::naming::compute_model_selector_from_names; use futures::StreamExt; use indexmap::IndexMap; use libp2p::core::multiaddr::Protocol; @@ -225,8 +226,10 @@ impl Relay

{ }; // select only identity field, if doesn't exist, empty string - let query = - format!("SELECT external_identity FROM {} WHERE id = ?", ty.name()); + let query = format!( + "SELECT external_identity FROM [{}] WHERE id = ?", + ty.name() + ); let entity_identity: Option = match sqlx::query_scalar(&query) .bind(format!("{:#x}", poseidon_hash_many(&keys))) .fetch_optional(&mut *pool) @@ -620,33 +623,33 @@ async fn validate_message( db: &Sql, message: &IndexMap, ) -> Result { - let model_name = if let Some(model_name) = message.get("model") { + let (selector, model) = if let Some(model_name) = message.get("model") { if let PrimitiveType::String(model_name) = model_name { - model_name + let (namespace, name) = model_name.split_once('-').ok_or_else(|| { + Error::InvalidMessageError( + "Model name is not in the format namespace-model".to_string(), + ) + })?; + + (compute_model_selector_from_names(namespace, name), model_name) } else { return Err(Error::InvalidMessageError("Model name is not a string".to_string())); } } else { return Err(Error::InvalidMessageError("Model name is missing".to_string())); }; - let model_selector = get_selector_from_name(model_name).map_err(|e| { - Error::InvalidMessageError(format!("Failed to get selector from model name: {}", e)) - })?; let mut ty = db - .model(&format!("{:#x}", model_selector)) + .model(selector) .await - .map_err(|e| Error::InvalidMessageError(format!("Model {} not found: {}", model_name, e)))? + .map_err(|e| Error::InvalidMessageError(format!("Model {} not found: {}", model, e)))? .schema() .await .map_err(|e| { - Error::InvalidMessageError(format!( - "Failed to get schema for model {}: {}", - model_name, e - )) + Error::InvalidMessageError(format!("Failed to get schema for model {}: {}", model, e)) })?; - if let Some(object) = message.get(model_name) { + if let Some(object) = message.get(model) { parse_value_to_ty(object, &mut ty)?; } else { return Err(Error::InvalidMessageError("Model is missing".to_string())); diff --git a/crates/torii/libp2p/src/tests.rs b/crates/torii/libp2p/src/tests.rs index 9d61f02cc0..2ae78be058 100644 --- a/crates/torii/libp2p/src/tests.rs +++ b/crates/torii/libp2p/src/tests.rs @@ -11,6 +11,7 @@ mod test { use crypto_bigint::U256; use dojo_types::primitive::Primitive; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; + use katana_runner::KatanaRunner; use serde_json::Number; use starknet::core::types::Felt; #[cfg(target_arch = "wasm32")] @@ -270,9 +271,6 @@ mod test { async fn test_client_messaging() -> Result<(), Box> { use std::time::Duration; - use dojo_test_utils::sequencer::{ - get_default_test_starknet_config, SequencerConfig, TestSequencer, - }; use dojo_types::schema::{Member, Struct, Ty}; use dojo_world::contracts::abi::model::Layout; use indexmap::IndexMap; @@ -300,17 +298,17 @@ mod test { let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let sequencer = - TestSequencer::start(SequencerConfig::default(), get_default_test_starknet_config()) - .await; + let sequencer = KatanaRunner::new().expect("Failed to create Katana sequencer"); + let provider = JsonRpcClient::new(HttpTransport::new(sequencer.url())); - let account = sequencer.raw_account(); + let account = sequencer.account_data(0); let mut db = Sql::new(pool.clone(), Felt::from_bytes_be(&[0; 32])).await?; // Register the model of our Message db.register_model( + "types_test", Ty::Struct(Struct { name: "Message".to_string(), children: vec![ @@ -358,7 +356,7 @@ mod test { r#type: "shortstring".to_string(), }), Field::SimpleType(SimpleField { - name: "Message".to_string(), + name: "types_test-Message".to_string(), r#type: "Model".to_string(), }), ], @@ -399,23 +397,21 @@ mod test { ), ]), "OffchainMessage", - Domain::new("Message", "1", "0x0", Some("1")), + Domain::new("types_test-Message", "1", "0x0", Some("1")), IndexMap::new(), ); typed_data.message.insert( "model".to_string(), - crate::typed_data::PrimitiveType::String("Message".to_string()), + crate::typed_data::PrimitiveType::String("types_test-Message".to_string()), ); typed_data.message.insert( - "Message".to_string(), + "types_test-Message".to_string(), crate::typed_data::PrimitiveType::Object( vec![ ( "identity".to_string(), - crate::typed_data::PrimitiveType::String( - account.account_address.to_string(), - ), + crate::typed_data::PrimitiveType::String(account.address.to_string()), ), ( "message".to_string(), @@ -427,9 +423,11 @@ mod test { ), ); - let message_hash = typed_data.encode(account.account_address).unwrap(); + let message_hash = typed_data.encode(account.address).unwrap(); let signature = - SigningKey::from_secret_scalar(account.private_key).sign(&message_hash).unwrap(); + SigningKey::from_secret_scalar(account.private_key.clone().unwrap().secret_scalar()) + .sign(&message_hash) + .unwrap(); client .command_sender diff --git a/crates/torii/migrations/20240702140704_model_namespace.sql b/crates/torii/migrations/20240702140704_model_namespace.sql new file mode 100644 index 0000000000..c5800ea162 --- /dev/null +++ b/crates/torii/migrations/20240702140704_model_namespace.sql @@ -0,0 +1,3 @@ +-- Models have now a namespace. +ALTER TABLE models +ADD COLUMN namespace TEXT NOT NULL; diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 686b66e17c..2f24b842f6 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,5 +1,5 @@ [package] -cairo-version = "2.4.0" +cairo-version = "2.6.3" name = "types_test" version = "0.7.3" @@ -12,9 +12,11 @@ dojo = { path = "../../dojo-core" } [[target.dojo]] build-external-contracts = [ ] -#[tool.dojo.world] -#name = "types-test" -#description = "Graphql types testing" +[tool.dojo.world] +namespace = "types_test" +seed = "types_test" +name = "types test" +description = "Graphql types testing" # icon_uri = "file://assets/icon.png" # cover_uri = "file://assets/cover.png" # website = "https://dojoengine.org" diff --git a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml b/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml deleted file mode 100644 index 2555ec3eda..0000000000 --- a/crates/torii/types-test/manifests/dev/base/dojo_world_world.toml +++ /dev/null @@ -1,5 +0,0 @@ -kind = "Class" -class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -abi = "manifests/dev/abis/base/dojo_world_world.json" -name = "dojo::world::world" diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 784a0233db..dfcf6791ad 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -20,6 +20,8 @@ build-external-contracts = [ ] [tool.dojo.world] description = "example world" name = "example" +seed = "dojo_examples" +namespace = "dojo_examples" [tool.dojo.env] rpc_url = "http://localhost:5050/" @@ -27,7 +29,7 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" +world_address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" # `release` profile # @@ -38,6 +40,8 @@ world_address = "0x07efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03e [profile.release.tool.dojo.world] description = "example world" name = "example" +seed = "dojo_examples" +namespace = "dojo_examples" [profile.release.tool.dojo.env] rpc_url = "http://localhost:5050/" diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json similarity index 85% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json rename to examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json index 574aa89668..310e06be9e 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json @@ -1,16 +1,67 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -18,6 +69,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -155,24 +217,6 @@ } ] }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, { "type": "interface", "name": "dojo_examples::actions::IActions", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json similarity index 61% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json rename to examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json index 36d8c3ef78..17da9b2135 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json @@ -1,16 +1,67 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -18,6 +69,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -56,29 +118,16 @@ { "type": "impl", "name": "IDojoInitImpl", - "interface_name": "dojo_examples::others::others::IDojoInit" + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" }, { "type": "interface", - "name": "dojo_examples::others::others::IDojoInit", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", "items": [ { "type": "function", "name": "dojo_init", - "inputs": [ - { - "name": "actions_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "actions_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ], + "inputs": [], "outputs": [], "state_mutability": "view" } @@ -133,7 +182,7 @@ }, { "type": "event", - "name": "dojo_examples::others::others::Event", + "name": "dojo_examples::mock_token::mock_token::Event", "kind": "enum", "variants": [ { diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json similarity index 67% rename from examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json rename to examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json index 36d8c3ef78..2e0c485d8b 100644 --- a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_others_others.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json @@ -1,16 +1,67 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -18,6 +69,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json similarity index 67% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json rename to examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json index f4bde33e6d..ee9ceaac66 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json @@ -1,26 +1,4 @@ [ - { - "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" - }, - { - "type": "interface", - "name": "dojo::world::IDojoResourceProvider", - "items": [ - { - "type": "function", - "name": "dojo_resource", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, { "type": "impl", "name": "WorldProviderImpl", @@ -53,24 +31,6 @@ } ] }, - { - "type": "impl", - "name": "IDojoInitImpl", - "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" - }, - { - "type": "interface", - "name": "dojo_examples::mock_token::mock_token::IDojoInit", - "items": [ - { - "type": "function", - "name": "dojo_init", - "inputs": [], - "outputs": [], - "state_mutability": "view" - } - ] - }, { "type": "impl", "name": "UpgradableImpl", @@ -94,6 +54,11 @@ } ] }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, { "type": "event", "name": "dojo::components::upgradeable::upgradeable::Upgraded", @@ -120,13 +85,13 @@ }, { "type": "event", - "name": "dojo_examples::mock_token::mock_token::Event", + "name": "dojo::base::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" + "kind": "flat" } ] } diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json similarity index 89% rename from examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json rename to examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json index c1a2447839..0e5e96210e 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json @@ -194,6 +194,18 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -401,7 +413,7 @@ "name": "is_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -421,7 +433,7 @@ "name": "grant_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -437,7 +449,7 @@ "name": "revoke_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -447,6 +459,66 @@ ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "can_write_resource", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_model", + "inputs": [ + { + "name": "model_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_namespace", + "inputs": [ + { + "name": "namespace_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" } ] }, @@ -692,6 +764,16 @@ "name": "address", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" } ] }, @@ -741,6 +823,23 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world::ModelRegistered", @@ -751,6 +850,11 @@ "type": "core::byte_array::ByteArray", "kind": "data" }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", @@ -818,7 +922,7 @@ "kind": "struct", "members": [ { - "name": "model", + "name": "resource", "type": "core::felt252", "kind": "data" }, @@ -956,6 +1060,11 @@ "type": "dojo::world::world::MetadataUpdate", "kind": "nested" }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world::NamespaceRegistered", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json index 1dbbd313d8..a46919adf4 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json similarity index 91% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json index ec760c99fb..8e8af178cf 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_message.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json similarity index 91% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json index b2c1c340fa..b02c79f885 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json index 89abdcfec5..5138063ef3 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_moves.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json index ee2cf17b26..c5404bf877 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_moves.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json index 8c33ebabc4..a70cb0881d 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json index bceec42587..cb815337ec 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_position.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 91% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json rename to examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json index 9b523d5d2b..31f5457868 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json +++ b/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json similarity index 85% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json index 574aa89668..310e06be9e 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json @@ -1,16 +1,67 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -18,6 +69,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -155,24 +217,6 @@ } ] }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, { "type": "interface", "name": "dojo_examples::actions::IActions", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json new file mode 100644 index 0000000000..17da9b2135 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json @@ -0,0 +1,195 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json similarity index 67% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json index 36d8c3ef78..2e0c485d8b 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_others_others.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json @@ -1,16 +1,67 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -18,6 +69,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json similarity index 89% rename from examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json index c1a2447839..0e5e96210e 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json @@ -194,6 +194,18 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -401,7 +413,7 @@ "name": "is_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -421,7 +433,7 @@ "name": "grant_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -437,7 +449,7 @@ "name": "revoke_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -447,6 +459,66 @@ ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "can_write_resource", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_model", + "inputs": [ + { + "name": "model_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_namespace", + "inputs": [ + { + "name": "namespace_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" } ] }, @@ -692,6 +764,16 @@ "name": "address", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" } ] }, @@ -741,6 +823,23 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world::ModelRegistered", @@ -751,6 +850,11 @@ "type": "core::byte_array::ByteArray", "kind": "data" }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", @@ -818,7 +922,7 @@ "kind": "struct", "members": [ { - "name": "model", + "name": "resource", "type": "core::felt252", "kind": "data" }, @@ -956,6 +1060,11 @@ "type": "dojo::world::world::MetadataUpdate", "kind": "nested" }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world::NamespaceRegistered", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json index 1dbbd313d8..a46919adf4 100644 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json similarity index 91% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json index ec760c99fb..8e8af178cf 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_message.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json similarity index 91% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json index b2c1c340fa..b02c79f885 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_mock_token.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json index 89abdcfec5..5138063ef3 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json index ee2cf17b26..c5404bf877 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_moves.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json index 8c33ebabc4..a70cb0881d 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples_models_player_config.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_position.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json index bceec42587..cb815337ec 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_position.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 91% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json rename to examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json index 9b523d5d2b..31f5457868 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_server_profile.json +++ b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_moves.json deleted file mode 100644 index ee2cf17b26..0000000000 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_models_moves.json +++ /dev/null @@ -1,393 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movesImpl", - "interface_name": "dojo_examples::models::Imoves" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Moves", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "remaining", - "type": "core::integer::u8" - }, - { - "name": "last_direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Imoves", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::Moves" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::moves::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json deleted file mode 100644 index 1dbbd313d8..0000000000 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json +++ /dev/null @@ -1,367 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" - }, - { - "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::others::others::contract_initialized::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml new file mode 100644 index 0000000000..34d9543e28 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml @@ -0,0 +1,11 @@ +kind = "DojoContract" +class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +tag = "dojo_examples-actions" +manifest_name = "dojo_examples-actions-40b6994c" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml new file mode 100644 index 0000000000..1a2a64dea4 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -0,0 +1,11 @@ +kind = "DojoContract" +class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +tag = "dojo_examples-mock_token" +manifest_name = "dojo_examples-mock_token-31599eb2" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml new file mode 100644 index 0000000000..31438c1f0f --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml @@ -0,0 +1,11 @@ +kind = "DojoContract" +class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +base_class_hash = "0x0" +abi = "manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +tag = "dojo_examples-others" +manifest_name = "dojo_examples-others-61de2c18" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml deleted file mode 100644 index 3e9c232447..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_actions_actions.toml +++ /dev/null @@ -1,10 +0,0 @@ -kind = "DojoContract" -class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" -original_class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" -base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples_actions_actions.json" -reads = [] -writes = [] -computed = [] -init_calldata = [] -name = "dojo_examples::actions::actions" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml deleted file mode 100644 index 572af4068e..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_mock_token_mock_token.toml +++ /dev/null @@ -1,10 +0,0 @@ -kind = "DojoContract" -class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" -original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" -base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples_mock_token_mock_token.json" -reads = [] -writes = [] -computed = [] -init_calldata = [] -name = "dojo_examples::mock_token::mock_token" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml deleted file mode 100644 index 0526bc5473..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples_others_others.toml +++ /dev/null @@ -1,10 +0,0 @@ -kind = "DojoContract" -class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples_others_others.json" -reads = [] -writes = [] -computed = [] -init_calldata = [] -name = "dojo_examples::others::others" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_base_base.toml b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml similarity index 66% rename from examples/spawn-and-move/manifests/dev/base/dojo_base_base.toml rename to examples/spawn-and-move/manifests/dev/base/dojo-base.toml index 6c4b5de67e..4e2fc2e0bb 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo_base_base.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml @@ -1,4 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -name = "dojo::base::base" +abi = "manifests/dev/abis/base/dojo-base.json" +tag = "dojo-base" +manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml new file mode 100644 index 0000000000..94821ba3f7 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml @@ -0,0 +1,6 @@ +kind = "Class" +class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +abi = "manifests/dev/abis/base/dojo-world.json" +tag = "dojo-world" +manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml deleted file mode 100644 index 2555ec3eda..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/dojo_world_world.toml +++ /dev/null @@ -1,5 +0,0 @@ -kind = "Class" -class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -abi = "manifests/dev/abis/base/dojo_world_world.json" -name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml new file mode 100644 index 0000000000..0aacc170a4 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -0,0 +1,21 @@ +kind = "DojoModel" +class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +abi = "manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json" +tag = "dojo_examples-ContractInitialized" +manifest_name = "dojo_examples-ContractInitialized-376b7bd6" + +[[members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml new file mode 100644 index 0000000000..698d0a8f0e --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml @@ -0,0 +1,26 @@ +kind = "DojoModel" +class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +abi = "manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json" +tag = "dojo_examples-Message" +manifest_name = "dojo_examples-Message-1bb1d226" + +[[members]] +name = "identity" +type = "ContractAddress" +key = true + +[[members]] +name = "channel" +type = "felt252" +key = true + +[[members]] +name = "message" +type = "ByteArray" +key = false + +[[members]] +name = "salt" +type = "felt252" +key = true diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml new file mode 100644 index 0000000000..b607d23d57 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml @@ -0,0 +1,16 @@ +kind = "DojoModel" +class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +abi = "manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json" +tag = "dojo_examples-MockToken" +manifest_name = "dojo_examples-MockToken-38903c7c" + +[[members]] +name = "account" +type = "ContractAddress" +key = true + +[[members]] +name = "amount" +type = "u128" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml new file mode 100644 index 0000000000..c8e044bd5a --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml @@ -0,0 +1,16 @@ +kind = "DojoModel" +class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +abi = "manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json" +tag = "dojo_examples-Moved" +manifest_name = "dojo_examples-Moved-318ae40d" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml new file mode 100644 index 0000000000..0a661e61c7 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml @@ -0,0 +1,21 @@ +kind = "DojoModel" +class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +abi = "manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json" +tag = "dojo_examples-Moves" +manifest_name = "dojo_examples-Moves-2e2accba" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "remaining" +type = "u8" +key = false + +[[members]] +name = "last_direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml new file mode 100644 index 0000000000..a83db11151 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -0,0 +1,26 @@ +kind = "DojoModel" +class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +abi = "manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json" +tag = "dojo_examples-PlayerConfig" +manifest_name = "dojo_examples-PlayerConfig-3adad785" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false + +[[members]] +name = "items" +type = "Array" +key = false + +[[members]] +name = "favorite_item" +type = "Option" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml new file mode 100644 index 0000000000..6eea086fef --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml @@ -0,0 +1,16 @@ +kind = "DojoModel" +class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +abi = "manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json" +tag = "dojo_examples-Position" +manifest_name = "dojo_examples-Position-1e145e26" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "vec" +type = "Vec2" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml new file mode 100644 index 0000000000..4b77f78c88 --- /dev/null +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -0,0 +1,21 @@ +kind = "DojoModel" +class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +abi = "manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json" +tag = "dojo_examples-ServerProfile" +manifest_name = "dojo_examples-ServerProfile-4caad1e6" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "server_id" +type = "u32" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml deleted file mode 100644 index 8b79f5c317..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_actions_actions_moved.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -abi = "manifests/dev/abis/base/models/dojo_examples_actions_actions_moved.json" -name = "dojo_examples::actions::actions::moved" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "direction" -type = "Direction" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml deleted file mode 100644 index 15ad89aace..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_message.toml +++ /dev/null @@ -1,25 +0,0 @@ -kind = "DojoModel" -class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -abi = "manifests/dev/abis/base/models/dojo_examples_models_message.json" -name = "dojo_examples::models::message" - -[[members]] -name = "identity" -type = "ContractAddress" -key = true - -[[members]] -name = "channel" -type = "felt252" -key = true - -[[members]] -name = "message" -type = "ByteArray" -key = false - -[[members]] -name = "salt" -type = "felt252" -key = true diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml deleted file mode 100644 index 1bf036168c..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_mock_token.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" -original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" -abi = "manifests/dev/abis/base/models/dojo_examples_models_mock_token.json" -name = "dojo_examples::models::mock_token" - -[[members]] -name = "account" -type = "ContractAddress" -key = true - -[[members]] -name = "amount" -type = "u128" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml deleted file mode 100644 index 6241643aa4..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_moves.toml +++ /dev/null @@ -1,20 +0,0 @@ -kind = "DojoModel" -class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -abi = "manifests/dev/abis/base/models/dojo_examples_models_moves.json" -name = "dojo_examples::models::moves" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "remaining" -type = "u8" -key = false - -[[members]] -name = "last_direction" -type = "Direction" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml deleted file mode 100644 index 459eb9ebdb..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_player_config.toml +++ /dev/null @@ -1,25 +0,0 @@ -kind = "DojoModel" -class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -abi = "manifests/dev/abis/base/models/dojo_examples_models_player_config.json" -name = "dojo_examples::models::player_config" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "name" -type = "ByteArray" -key = false - -[[members]] -name = "items" -type = "Array" -key = false - -[[members]] -name = "favorite_item" -type = "Option" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml deleted file mode 100644 index d29abaa4e0..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_position.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -abi = "manifests/dev/abis/base/models/dojo_examples_models_position.json" -name = "dojo_examples::models::position" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "vec" -type = "Vec2" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml deleted file mode 100644 index e2774133c8..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_models_server_profile.toml +++ /dev/null @@ -1,20 +0,0 @@ -kind = "DojoModel" -class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" -original_class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" -abi = "manifests/dev/abis/base/models/dojo_examples_models_server_profile.json" -name = "dojo_examples::models::server_profile" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "server_id" -type = "u32" -key = true - -[[members]] -name = "name" -type = "ByteArray" -key = false diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml deleted file mode 100644 index e4b4f0fdc3..0000000000 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples_others_others_contract_initialized.toml +++ /dev/null @@ -1,20 +0,0 @@ -kind = "DojoModel" -class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -abi = "manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json" -name = "dojo_examples::others::others::contract_initialized" - -[[members]] -name = "contract_address" -type = "ContractAddress" -key = true - -[[members]] -name = "contract_class" -type = "ClassHash" -key = false - -[[members]] -name = "value" -type = "u8" -key = false diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/manifest.json index 928d7596e1..162816500f 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", - "original_class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", + "class_hash": "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2", + "original_class_hash": "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2", "abi": [ { "type": "impl", @@ -199,6 +199,18 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -406,7 +418,7 @@ "name": "is_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -426,7 +438,7 @@ "name": "grant_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -442,7 +454,7 @@ "name": "revoke_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -452,6 +464,66 @@ ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "can_write_resource", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_model", + "inputs": [ + { + "name": "model_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_namespace", + "inputs": [ + { + "name": "namespace_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" } ] }, @@ -697,6 +769,16 @@ "name": "address", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" } ] }, @@ -746,6 +828,23 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world::ModelRegistered", @@ -756,6 +855,11 @@ "type": "core::byte_array::ByteArray", "kind": "data" }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", @@ -823,7 +927,7 @@ "kind": "struct", "members": [ { - "name": "model", + "name": "resource", "type": "core::felt252", "kind": "data" }, @@ -961,6 +1065,11 @@ "type": "dojo::world::world::MetadataUpdate", "kind": "nested" }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world::NamespaceRegistered", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", @@ -999,43 +1108,95 @@ ] } ], - "address": "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30", - "transaction_hash": "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d", + "address": "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb", + "transaction_hash": "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287", "block_number": 3, "seed": "dojo_examples", "metadata": { "profile_name": "dev", "rpc_url": "http://localhost:5050/" }, - "name": "dojo::world::world" + "manifest_name": "dojo-world" }, "base": { "kind": "Class", "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": null, - "name": "dojo::base::base" + "abi": "manifests/dev/abis/base/dojo-base.json", + "tag": "dojo-base", + "manifest_name": "dojo-base" }, "contracts": [ { "kind": "DojoContract", - "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", - "class_hash": "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f", - "original_class_hash": "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f", + "address": "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623", + "class_hash": "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75", + "original_class_hash": "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -1043,6 +1204,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -1180,24 +1352,6 @@ } ] }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, { "type": "interface", "name": "dojo_examples::actions::IActions", @@ -1349,32 +1503,84 @@ ], "reads": [], "writes": [ - "Moves", - "Position" + "dojo_examples-Moves", + "dojo_examples-Position" ], "computed": [], "init_calldata": [], - "name": "dojo_examples::actions::actions" + "tag": "dojo_examples-actions", + "manifest_name": "dojo_examples-actions-40b6994c" }, { "kind": "DojoContract", - "address": "0x75961b2027c52948ecebfd347aa427436ea308d41997fa9b3c98380f7011d53", - "class_hash": "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2", - "original_class_hash": "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2", + "address": "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2", + "class_hash": "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2", + "original_class_hash": "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -1382,6 +1588,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -1499,27 +1716,79 @@ "writes": [], "computed": [], "init_calldata": [], - "name": "dojo_examples::mock_token::mock_token" + "tag": "dojo_examples-mock_token", + "manifest_name": "dojo_examples-mock_token-31599eb2" }, { "kind": "DojoContract", - "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", - "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", - "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", + "address": "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344", + "class_hash": "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9", + "original_class_hash": "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9", "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "abi": [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -1527,6 +1796,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -1657,11 +1937,12 @@ "writes": [], "computed": [], "init_calldata": [ - "$contract_address:dojo_examples::actions::actions", - "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples-actions", + "$class_hash:dojo_examples-actions", "10" ], - "name": "dojo_examples::others::others" + "tag": "dojo_examples-others", + "manifest_name": "dojo_examples-others-61de2c18" } ], "models": [ @@ -1669,18 +1950,23 @@ "kind": "DojoModel", "members": [ { - "name": "player", + "name": "contract_address", "type": "ContractAddress", "key": true }, { - "name": "direction", - "type": "Direction", + "name": "contract_class", + "type": "ClassHash", + "key": false + }, + { + "name": "value", + "type": "u8", "key": false } ], - "class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", - "original_class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", + "class_hash": "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a", + "original_class_hash": "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a", "abi": [ { "type": "impl", @@ -1954,6 +2240,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -2002,52 +2321,30 @@ }, { "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] + "name": "contract_initializedImpl", + "interface_name": "dojo_examples::others::others::Icontract_initialized" }, { "type": "struct", - "name": "dojo_examples::actions::actions::Moved", + "name": "dojo_examples::others::others::ContractInitialized", "members": [ { - "name": "player", + "name": "contract_address", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "direction", - "type": "dojo_examples::models::Direction" + "name": "contract_class", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "value", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", + "name": "dojo_examples::others::others::Icontract_initialized", "items": [ { "type": "function", @@ -2055,7 +2352,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::actions::actions::Moved" + "type": "dojo_examples::others::others::ContractInitialized" } ], "outputs": [], @@ -2065,12 +2362,13 @@ }, { "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", + "name": "dojo_examples::others::others::contract_initialized::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::actions::actions::moved" + "tag": "dojo_examples-ContractInitialized", + "manifest_name": "dojo_examples-ContractInitialized-376b7bd6" }, { "kind": "DojoModel", @@ -2096,8 +2394,8 @@ "key": true } ], - "class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", - "original_class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", + "class_hash": "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b", + "original_class_hash": "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b", "abi": [ { "type": "impl", @@ -2371,6 +2669,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -2469,7 +2800,8 @@ "variants": [] } ], - "name": "dojo_examples::models::message" + "tag": "dojo_examples-Message", + "manifest_name": "dojo_examples-Message-1bb1d226" }, { "kind": "DojoModel", @@ -2485,8 +2817,8 @@ "key": false } ], - "class_hash": "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d", - "original_class_hash": "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d", + "class_hash": "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519", + "original_class_hash": "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519", "abi": [ { "type": "impl", @@ -2760,6 +3092,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -2850,7 +3215,8 @@ "variants": [] } ], - "name": "dojo_examples::models::mock_token" + "tag": "dojo_examples-MockToken", + "manifest_name": "dojo_examples-MockToken-38903c7c" }, { "kind": "DojoModel", @@ -2861,18 +3227,13 @@ "key": true }, { - "name": "remaining", - "type": "u8", - "key": false - }, - { - "name": "last_direction", + "name": "direction", "type": "Direction", "key": false } ], - "class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", - "original_class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", + "class_hash": "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4", + "original_class_hash": "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4", "abi": [ { "type": "impl", @@ -3146,6 +3507,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -3194,8 +3588,8 @@ }, { "type": "impl", - "name": "movesImpl", - "interface_name": "dojo_examples::models::Imoves" + "name": "movedImpl", + "interface_name": "dojo_examples::actions::actions::Imoved" }, { "type": "enum", @@ -3225,25 +3619,21 @@ }, { "type": "struct", - "name": "dojo_examples::models::Moves", + "name": "dojo_examples::actions::actions::Moved", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "remaining", - "type": "core::integer::u8" - }, - { - "name": "last_direction", + "name": "direction", "type": "dojo_examples::models::Direction" } ] }, { "type": "interface", - "name": "dojo_examples::models::Imoves", + "name": "dojo_examples::actions::actions::Imoved", "items": [ { "type": "function", @@ -3251,7 +3641,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Moves" + "type": "dojo_examples::actions::actions::Moved" } ], "outputs": [], @@ -3261,12 +3651,13 @@ }, { "type": "event", - "name": "dojo_examples::models::moves::Event", + "name": "dojo_examples::actions::actions::moved::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::moves" + "tag": "dojo_examples-Moved", + "manifest_name": "dojo_examples-Moved-318ae40d" }, { "kind": "DojoModel", @@ -3277,23 +3668,18 @@ "key": true }, { - "name": "name", - "type": "ByteArray", + "name": "remaining", + "type": "u8", "key": false }, { - "name": "items", - "type": "Array", - "key": false - }, - { - "name": "favorite_item", - "type": "Option", + "name": "last_direction", + "type": "Direction", "key": false } ], - "class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", - "original_class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", + "class_hash": "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609", + "original_class_hash": "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609", "abi": [ { "type": "impl", @@ -3567,6 +3953,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -3615,48 +4034,56 @@ }, { "type": "impl", - "name": "player_configImpl", - "interface_name": "dojo_examples::models::Iplayer_config" + "name": "movesImpl", + "interface_name": "dojo_examples::models::Imoves" }, { - "type": "struct", - "name": "dojo_examples::models::PlayerItem", - "members": [ + "type": "enum", + "name": "dojo_examples::models::Direction", + "variants": [ { - "name": "item_id", - "type": "core::integer::u32" + "name": "None", + "type": "()" }, { - "name": "quantity", - "type": "core::integer::u32" + "name": "Left", + "type": "()" + }, + { + "name": "Right", + "type": "()" + }, + { + "name": "Up", + "type": "()" + }, + { + "name": "Down", + "type": "()" } ] }, { "type": "struct", - "name": "dojo_examples::models::PlayerConfig", + "name": "dojo_examples::models::Moves", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "name", - "type": "core::byte_array::ByteArray" - }, - { - "name": "items", - "type": "core::array::Array::" + "name": "remaining", + "type": "core::integer::u8" }, { - "name": "favorite_item", - "type": "core::option::Option::" + "name": "last_direction", + "type": "dojo_examples::models::Direction" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iplayer_config", + "name": "dojo_examples::models::Imoves", "items": [ { "type": "function", @@ -3664,7 +4091,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::PlayerConfig" + "type": "dojo_examples::models::Moves" } ], "outputs": [], @@ -3674,12 +4101,13 @@ }, { "type": "event", - "name": "dojo_examples::models::player_config::Event", + "name": "dojo_examples::models::moves::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::player_config" + "tag": "dojo_examples-Moves", + "manifest_name": "dojo_examples-Moves-2e2accba" }, { "kind": "DojoModel", @@ -3690,13 +4118,23 @@ "key": true }, { - "name": "vec", - "type": "Vec2", + "name": "name", + "type": "ByteArray", + "key": false + }, + { + "name": "items", + "type": "Array", + "key": false + }, + { + "name": "favorite_item", + "type": "Option", "key": false } ], - "class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", - "original_class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", + "class_hash": "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca", + "original_class_hash": "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca", "abi": [ { "type": "impl", @@ -3970,6 +4408,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -4018,40 +4489,48 @@ }, { "type": "impl", - "name": "positionImpl", - "interface_name": "dojo_examples::models::Iposition" + "name": "player_configImpl", + "interface_name": "dojo_examples::models::Iplayer_config" }, { "type": "struct", - "name": "dojo_examples::models::Vec2", + "name": "dojo_examples::models::PlayerItem", "members": [ { - "name": "x", + "name": "item_id", "type": "core::integer::u32" }, { - "name": "y", + "name": "quantity", "type": "core::integer::u32" } ] }, { "type": "struct", - "name": "dojo_examples::models::Position", + "name": "dojo_examples::models::PlayerConfig", "members": [ { "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "vec", - "type": "dojo_examples::models::Vec2" + "name": "name", + "type": "core::byte_array::ByteArray" + }, + { + "name": "items", + "type": "core::array::Array::" + }, + { + "name": "favorite_item", + "type": "core::option::Option::" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iposition", + "name": "dojo_examples::models::Iplayer_config", "items": [ { "type": "function", @@ -4059,7 +4538,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::Position" + "type": "dojo_examples::models::PlayerConfig" } ], "outputs": [], @@ -4069,12 +4548,13 @@ }, { "type": "event", - "name": "dojo_examples::models::position::Event", + "name": "dojo_examples::models::player_config::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::position" + "tag": "dojo_examples-PlayerConfig", + "manifest_name": "dojo_examples-PlayerConfig-3adad785" }, { "kind": "DojoModel", @@ -4085,18 +4565,13 @@ "key": true }, { - "name": "server_id", - "type": "u32", - "key": true - }, - { - "name": "name", - "type": "ByteArray", + "name": "vec", + "type": "Vec2", "key": false } ], - "class_hash": "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab", - "original_class_hash": "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab", + "class_hash": "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34", + "original_class_hash": "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34", "abi": [ { "type": "impl", @@ -4370,6 +4845,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -4418,30 +4926,40 @@ }, { "type": "impl", - "name": "server_profileImpl", - "interface_name": "dojo_examples::models::Iserver_profile" + "name": "positionImpl", + "interface_name": "dojo_examples::models::Iposition" }, { "type": "struct", - "name": "dojo_examples::models::ServerProfile", + "name": "dojo_examples::models::Vec2", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "x", + "type": "core::integer::u32" }, { - "name": "server_id", + "name": "y", "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "dojo_examples::models::Position", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "name", - "type": "core::byte_array::ByteArray" + "name": "vec", + "type": "dojo_examples::models::Vec2" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iserver_profile", + "name": "dojo_examples::models::Iposition", "items": [ { "type": "function", @@ -4449,7 +4967,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::ServerProfile" + "type": "dojo_examples::models::Position" } ], "outputs": [], @@ -4459,34 +4977,35 @@ }, { "type": "event", - "name": "dojo_examples::models::server_profile::Event", + "name": "dojo_examples::models::position::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::models::server_profile" + "tag": "dojo_examples-Position", + "manifest_name": "dojo_examples-Position-1e145e26" }, { "kind": "DojoModel", "members": [ { - "name": "contract_address", + "name": "player", "type": "ContractAddress", "key": true }, { - "name": "contract_class", - "type": "ClassHash", - "key": false + "name": "server_id", + "type": "u32", + "key": true }, { - "name": "value", - "type": "u8", + "name": "name", + "type": "ByteArray", "key": false } ], - "class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", - "original_class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", + "class_hash": "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b", + "original_class_hash": "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b", "abi": [ { "type": "impl", @@ -4760,6 +5279,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -4808,30 +5360,30 @@ }, { "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" + "name": "server_profileImpl", + "interface_name": "dojo_examples::models::Iserver_profile" }, { "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", + "name": "dojo_examples::models::ServerProfile", "members": [ { - "name": "contract_address", + "name": "player", "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" + "name": "server_id", + "type": "core::integer::u32" }, { - "name": "value", - "type": "core::integer::u8" + "name": "name", + "type": "core::byte_array::ByteArray" } ] }, { "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", + "name": "dojo_examples::models::Iserver_profile", "items": [ { "type": "function", @@ -4839,7 +5391,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" + "type": "dojo_examples::models::ServerProfile" } ], "outputs": [], @@ -4849,12 +5401,13 @@ }, { "type": "event", - "name": "dojo_examples::others::others::contract_initialized::Event", + "name": "dojo_examples::models::server_profile::Event", "kind": "enum", "variants": [] } ], - "name": "dojo_examples::others::others::contract_initialized" + "tag": "dojo_examples-ServerProfile", + "manifest_name": "dojo_examples-ServerProfile-4caad1e6" } ] } \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/manifest.toml index fd58cefd55..ad80716ce8 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/manifest.toml @@ -1,13 +1,13 @@ [world] kind = "WorldContract" -class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -abi = "manifests/dev/abis/deployments/dojo_world_world.json" -address = "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" -transaction_hash = "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d" +class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +abi = "abis/deployments/dojo-world.json" +address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" +transaction_hash = "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287" block_number = 3 seed = "dojo_examples" -name = "dojo::world::world" +manifest_name = "dojo-world" [world.metadata] profile_name = "dev" @@ -17,77 +17,89 @@ rpc_url = "http://localhost:5050/" kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -name = "dojo::base::base" +abi = "manifests/dev/abis/base/dojo-base.json" +tag = "dojo-base" +manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" -class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" -original_class_hash = "0x7d70dda5cb8dcb697ccc2c129254c554e8994f1b231527f7641a14706af016f" +address = "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623" +class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/deployments/contracts/dojo_examples_actions_actions.json" +abi = "abis/deployments/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [ - "Moves", - "Position", + "dojo_examples-Moves", + "dojo_examples-Position", ] computed = [] init_calldata = [] -name = "dojo_examples::actions::actions" +tag = "dojo_examples-actions" +manifest_name = "dojo_examples-actions-40b6994c" [[contracts]] kind = "DojoContract" -address = "0x75961b2027c52948ecebfd347aa427436ea308d41997fa9b3c98380f7011d53" -class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" -original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" +address = "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2" +class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json" +abi = "abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] init_calldata = [] -name = "dojo_examples::mock_token::mock_token" +tag = "dojo_examples-mock_token" +manifest_name = "dojo_examples-mock_token-31599eb2" [[contracts]] kind = "DojoContract" -address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" -class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" +address = "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344" +class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/deployments/contracts/dojo_examples_others_others.json" +abi = "abis/deployments/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] init_calldata = [ - "$contract_address:dojo_examples::actions::actions", - "$class_hash:dojo_examples::actions::actions", + "$contract_address:dojo_examples-actions", + "$class_hash:dojo_examples-actions", "10", ] -name = "dojo_examples::others::others" +tag = "dojo_examples-others" +manifest_name = "dojo_examples-others-61de2c18" [[models]] kind = "DojoModel" -class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -abi = "manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json" -name = "dojo_examples::actions::actions::moved" +class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +abi = "abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json" +tag = "dojo_examples-ContractInitialized" +manifest_name = "dojo_examples-ContractInitialized-376b7bd6" [[models.members]] -name = "player" +name = "contract_address" type = "ContractAddress" key = true [[models.members]] -name = "direction" -type = "Direction" +name = "contract_class" +type = "ClassHash" +key = false + +[[models.members]] +name = "value" +type = "u8" key = false [[models]] kind = "DojoModel" -class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_message.json" -name = "dojo_examples::models::message" +class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +abi = "abis/deployments/models/dojo_examples-Message-1bb1d226.json" +tag = "dojo_examples-Message" +manifest_name = "dojo_examples-Message-1bb1d226" [[models.members]] name = "identity" @@ -111,10 +123,11 @@ key = true [[models]] kind = "DojoModel" -class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" -original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_mock_token.json" -name = "dojo_examples::models::mock_token" +class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +abi = "abis/deployments/models/dojo_examples-MockToken-38903c7c.json" +tag = "dojo_examples-MockToken" +manifest_name = "dojo_examples-MockToken-38903c7c" [[models.members]] name = "account" @@ -128,10 +141,29 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_moves.json" -name = "dojo_examples::models::moves" +class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +abi = "abis/deployments/models/dojo_examples-Moved-318ae40d.json" +tag = "dojo_examples-Moved" +manifest_name = "dojo_examples-Moved-318ae40d" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "direction" +type = "Direction" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +abi = "abis/deployments/models/dojo_examples-Moves-2e2accba.json" +tag = "dojo_examples-Moves" +manifest_name = "dojo_examples-Moves-2e2accba" [[models.members]] name = "player" @@ -150,10 +182,11 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_player_config.json" -name = "dojo_examples::models::player_config" +class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +abi = "abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json" +tag = "dojo_examples-PlayerConfig" +manifest_name = "dojo_examples-PlayerConfig-3adad785" [[models.members]] name = "player" @@ -177,10 +210,11 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_position.json" -name = "dojo_examples::models::position" +class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +abi = "abis/deployments/models/dojo_examples-Position-1e145e26.json" +tag = "dojo_examples-Position" +manifest_name = "dojo_examples-Position-1e145e26" [[models.members]] name = "player" @@ -194,10 +228,11 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" -original_class_hash = "0x6dc51a232ffcfaa02646636daf1b8acab8121fa69458258da8df1620aff07ab" -abi = "manifests/dev/abis/deployments/models/dojo_examples_models_server_profile.json" -name = "dojo_examples::models::server_profile" +class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +abi = "abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json" +tag = "dojo_examples-ServerProfile" +manifest_name = "dojo_examples-ServerProfile-4caad1e6" [[models.members]] name = "player" @@ -213,25 +248,3 @@ key = true name = "name" type = "ByteArray" key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -abi = "manifests/dev/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" -name = "dojo_examples::others::others::contract_initialized" - -[[models.members]] -name = "contract_address" -type = "ContractAddress" -key = true - -[[models.members]] -name = "contract_class" -type = "ClassHash" -key = false - -[[models.members]] -name = "value" -type = "u8" -key = false diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml deleted file mode 100644 index b21fc1adec..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_actions_actions.toml +++ /dev/null @@ -1,4 +0,0 @@ -name = "dojo_examples::actions::actions" -reads = [] -writes = ["Moves", "Position"] -init_calldata = [] diff --git a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml deleted file mode 100644 index 129f942bd8..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/contracts/dojo_examples_others_others.toml +++ /dev/null @@ -1,4 +0,0 @@ -name = "dojo_examples::others::others" -reads = [] -writes = [] -init_calldata = ["$contract_address:dojo_examples::actions::actions", "$class_hash:dojo_examples::actions::actions", "10"] diff --git a/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml b/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml deleted file mode 100644 index f706470d45..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/dojo_base_base.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml b/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml deleted file mode 100644 index a3e686e3ef..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/dojo_world_world.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml deleted file mode 100644 index 4958a7a15c..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_actions_actions_moved.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml deleted file mode 100644 index d60162cc72..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_emote_message.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::emote_message" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml deleted file mode 100644 index dc8784e746..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_moves.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml deleted file mode 100644 index 6af8240b36..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_player_config.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml deleted file mode 100644 index df38e71c32..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_models_position.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml deleted file mode 100644 index f8f3053fe5..0000000000 --- a/examples/spawn-and-move/manifests/dev/overlays/models/dojo_examples_others_others_contract_initialized.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::others::others::contract_initialized" diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json similarity index 75% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json rename to examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json index 21aed968a7..310e06be9e 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples_actions_actions.json +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json @@ -1,16 +1,45 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", "inputs": [], "outputs": [ { @@ -18,6 +47,39 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, @@ -155,24 +217,6 @@ } ] }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, { "type": "interface", "name": "dojo_examples::actions::IActions", @@ -182,7 +226,7 @@ "name": "spawn", "inputs": [], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -194,7 +238,7 @@ } ], "outputs": [], - "state_mutability": "view" + "state_mutability": "external" }, { "type": "function", @@ -206,7 +250,41 @@ } ], "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_player_position", + "inputs": [], + "outputs": [ + { + "type": "dojo_examples::models::Position" + } + ], "state_mutability": "view" + }, + { + "type": "function", + "name": "reset_player_config", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_player_server_profile", + "inputs": [ + { + "name": "server_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json new file mode 100644 index 0000000000..17da9b2135 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json @@ -0,0 +1,195 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" + }, + { + "type": "interface", + "name": "dojo_examples::mock_token::mock_token::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo_examples::mock_token::mock_token::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json similarity index 67% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json rename to examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json index 36d8c3ef78..2e0c485d8b 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples_others_others.json +++ b/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json @@ -1,16 +1,67 @@ [ { "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" + "name": "ContractImpl", + "interface_name": "dojo::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "dojo::world::IDojoResourceProvider", + "name": "dojo::contract::IContract", "items": [ { "type": "function", - "name": "dojo_resource", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", "inputs": [], "outputs": [ { @@ -18,6 +69,17 @@ } ], "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" } ] }, diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json b/examples/spawn-and-move/manifests/release/abis/base/dojo-base.json similarity index 67% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json rename to examples/spawn-and-move/manifests/release/abis/base/dojo-base.json index f4bde33e6d..ee9ceaac66 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples_mock_token_mock_token.json +++ b/examples/spawn-and-move/manifests/release/abis/base/dojo-base.json @@ -1,26 +1,4 @@ [ - { - "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" - }, - { - "type": "interface", - "name": "dojo::world::IDojoResourceProvider", - "items": [ - { - "type": "function", - "name": "dojo_resource", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, { "type": "impl", "name": "WorldProviderImpl", @@ -53,24 +31,6 @@ } ] }, - { - "type": "impl", - "name": "IDojoInitImpl", - "interface_name": "dojo_examples::mock_token::mock_token::IDojoInit" - }, - { - "type": "interface", - "name": "dojo_examples::mock_token::mock_token::IDojoInit", - "items": [ - { - "type": "function", - "name": "dojo_init", - "inputs": [], - "outputs": [], - "state_mutability": "view" - } - ] - }, { "type": "impl", "name": "UpgradableImpl", @@ -94,6 +54,11 @@ } ] }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, { "type": "event", "name": "dojo::components::upgradeable::upgradeable::Upgraded", @@ -120,13 +85,13 @@ }, { "type": "event", - "name": "dojo_examples::mock_token::mock_token::Event", + "name": "dojo::base::base::Event", "kind": "enum", "variants": [ { "name": "UpgradeableEvent", "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" + "kind": "flat" } ] } diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json b/examples/spawn-and-move/manifests/release/abis/base/dojo-world.json similarity index 89% rename from examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json rename to examples/spawn-and-move/manifests/release/abis/base/dojo-world.json index c1a2447839..0e5e96210e 100644 --- a/examples/spawn-and-move/manifests/release/abis/base/dojo_world_world.json +++ b/examples/spawn-and-move/manifests/release/abis/base/dojo-world.json @@ -194,6 +194,18 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "register_namespace", + "inputs": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "deploy_contract", @@ -401,7 +413,7 @@ "name": "is_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -421,7 +433,7 @@ "name": "grant_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -437,7 +449,7 @@ "name": "revoke_writer", "inputs": [ { - "name": "model", + "name": "resource", "type": "core::felt252" }, { @@ -447,6 +459,66 @@ ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "can_write_resource", + "inputs": [ + { + "name": "resource_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_model", + "inputs": [ + { + "name": "model_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "can_write_namespace", + "inputs": [ + { + "name": "namespace_id", + "type": "core::felt252" + }, + { + "name": "contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" } ] }, @@ -692,6 +764,16 @@ "name": "address", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "name", + "type": "core::byte_array::ByteArray", + "kind": "data" } ] }, @@ -741,6 +823,23 @@ } ] }, + { + "type": "event", + "name": "dojo::world::world::NamespaceRegistered", + "kind": "struct", + "members": [ + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, + { + "name": "hash", + "type": "core::felt252", + "kind": "data" + } + ] + }, { "type": "event", "name": "dojo::world::world::ModelRegistered", @@ -751,6 +850,11 @@ "type": "core::byte_array::ByteArray", "kind": "data" }, + { + "name": "namespace", + "type": "core::byte_array::ByteArray", + "kind": "data" + }, { "name": "class_hash", "type": "core::starknet::class_hash::ClassHash", @@ -818,7 +922,7 @@ "kind": "struct", "members": [ { - "name": "model", + "name": "resource", "type": "core::felt252", "kind": "data" }, @@ -956,6 +1060,11 @@ "type": "dojo::world::world::MetadataUpdate", "kind": "nested" }, + { + "name": "NamespaceRegistered", + "type": "dojo::world::world::NamespaceRegistered", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json index 1dbbd313d8..a46919adf4 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_others_others_contract_initialized.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json similarity index 91% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json index ec760c99fb..8e8af178cf 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_message.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json similarity index 91% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json index b2c1c340fa..b02c79f885 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_mock_token.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json index 89abdcfec5..5138063ef3 100644 --- a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples_actions_actions_moved.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json index ee2cf17b26..c5404bf877 100644 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_moves.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json similarity index 92% rename from examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json index 8c33ebabc4..a70cb0881d 100644 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_player_config.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json similarity index 92% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_position.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json index bceec42587..cb815337ec 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_position.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_player_config.json b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 88% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_player_config.json rename to examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json index 8c33ebabc4..31f5457868 100644 --- a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples_models_player_config.json +++ b/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json @@ -271,6 +271,39 @@ ], "state_mutability": "view" }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, { "type": "function", "name": "unpacked_size", @@ -319,48 +352,30 @@ }, { "type": "impl", - "name": "player_configImpl", - "interface_name": "dojo_examples::models::Iplayer_config" + "name": "server_profileImpl", + "interface_name": "dojo_examples::models::Iserver_profile" }, { "type": "struct", - "name": "dojo_examples::models::PlayerItem", + "name": "dojo_examples::models::ServerProfile", "members": [ { - "name": "item_id", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "quantity", + "name": "server_id", "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::PlayerConfig", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" }, { "name": "name", "type": "core::byte_array::ByteArray" - }, - { - "name": "items", - "type": "core::array::Array::" - }, - { - "name": "favorite_item", - "type": "core::option::Option::" } ] }, { "type": "interface", - "name": "dojo_examples::models::Iplayer_config", + "name": "dojo_examples::models::Iserver_profile", "items": [ { "type": "function", @@ -368,7 +383,7 @@ "inputs": [ { "name": "model", - "type": "dojo_examples::models::PlayerConfig" + "type": "dojo_examples::models::ServerProfile" } ], "outputs": [], @@ -378,7 +393,7 @@ }, { "type": "event", - "name": "dojo_examples::models::player_config::Event", + "name": "dojo_examples::models::server_profile::Event", "kind": "enum", "variants": [] } diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json b/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json deleted file mode 100644 index 21aed968a7..0000000000 --- a/examples/spawn-and-move/manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json +++ /dev/null @@ -1,290 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" - }, - { - "type": "interface", - "name": "dojo::world::IDojoResourceProvider", - "items": [ - { - "type": "function", - "name": "dojo_resource", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" - }, - { - "type": "struct", - "name": "dojo::world::IWorldDispatcher", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "type": "interface", - "name": "dojo::world::IWorldProvider", - "items": [ - { - "type": "function", - "name": "world", - "inputs": [], - "outputs": [ - { - "type": "dojo::world::IWorldDispatcher" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "ActionsComputedImpl", - "interface_name": "dojo_examples::actions::IActionsComputed" - }, - { - "type": "struct", - "name": "dojo_examples::models::Vec2", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Position", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "vec", - "type": "dojo_examples::models::Vec2" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::IActionsComputed", - "items": [ - { - "type": "function", - "name": "tile_terrain", - "inputs": [ - { - "name": "vec", - "type": "dojo_examples::models::Vec2" - } - ], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "quadrant", - "inputs": [ - { - "name": "pos", - "type": "dojo_examples::models::Position" - } - ], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "ActionsImpl", - "interface_name": "dojo_examples::actions::IActions" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::IActions", - "items": [ - { - "type": "function", - "name": "spawn", - "inputs": [], - "outputs": [], - "state_mutability": "view" - }, - { - "type": "function", - "name": "move", - "inputs": [ - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ], - "outputs": [], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_player_config", - "inputs": [ - { - "name": "name", - "type": "core::byte_array::ByteArray" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "IDojoInitImpl", - "interface_name": "dojo_examples::actions::actions::IDojoInit" - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::IDojoInit", - "items": [ - { - "type": "function", - "name": "dojo_init", - "inputs": [], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" - }, - { - "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", - "items": [ - { - "type": "function", - "name": "upgrade", - "inputs": [ - { - "name": "new_class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", - "kind": "enum", - "variants": [ - { - "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "nested" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::actions::actions::Event", - "kind": "enum", - "variants": [ - { - "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" - } - ] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json b/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json deleted file mode 100644 index c1a2447839..0000000000 --- a/examples/spawn-and-move/manifests/release/abis/deployments/dojo_world_world.json +++ /dev/null @@ -1,996 +0,0 @@ -[ - { - "type": "impl", - "name": "World", - "interface_name": "dojo::world::IWorld" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", - "members": [ - { - "name": "resource_id", - "type": "core::felt252" - }, - { - "name": "metadata_uri", - "type": "core::byte_array::ByteArray" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::world::IWorld", - "items": [ - { - "type": "function", - "name": "metadata", - "inputs": [ - { - "name": "resource_id", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "dojo::resource_metadata::ResourceMetadata" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_metadata", - "inputs": [ - { - "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "model", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "register_model", - "inputs": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "deploy_contract", - "inputs": [ - { - "name": "salt", - "type": "core::felt252" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "init_calldata", - "type": "core::array::Span::" - } - ], - "outputs": [ - { - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "state_mutability": "external" - }, - { - "type": "function", - "name": "upgrade_contract", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [ - { - "type": "core::starknet::class_hash::ClassHash" - } - ], - "state_mutability": "external" - }, - { - "type": "function", - "name": "uuid", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u32" - } - ], - "state_mutability": "external" - }, - { - "type": "function", - "name": "emit", - "inputs": [ - { - "name": "keys", - "type": "core::array::Array::" - }, - { - "name": "values", - "type": "core::array::Span::" - } - ], - "outputs": [], - "state_mutability": "view" - }, - { - "type": "function", - "name": "entity", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "keys", - "type": "core::array::Span::" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ], - "outputs": [ - { - "type": "core::array::Span::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_entity", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "keys", - "type": "core::array::Span::" - }, - { - "name": "values", - "type": "core::array::Span::" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "delete_entity", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "keys", - "type": "core::array::Span::" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "base", - "inputs": [], - "outputs": [ - { - "type": "core::starknet::class_hash::ClassHash" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "is_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "grant_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "revoke_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "is_writer", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "grant_writer", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "revoke_writer", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" - }, - { - "type": "interface", - "name": "dojo::world::IUpgradeableWorld", - "items": [ - { - "type": "function", - "name": "upgrade", - "inputs": [ - { - "name": "new_class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" - }, - { - "type": "struct", - "name": "dojo::interfaces::StorageUpdate", - "members": [ - { - "name": "key", - "type": "core::felt252" - }, - { - "name": "value", - "type": "core::felt252" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::interfaces::ProgramOutput", - "members": [ - { - "name": "prev_state_root", - "type": "core::felt252" - }, - { - "name": "new_state_root", - "type": "core::felt252" - }, - { - "name": "block_number", - "type": "core::felt252" - }, - { - "name": "block_hash", - "type": "core::felt252" - }, - { - "name": "config_hash", - "type": "core::felt252" - }, - { - "name": "world_da_hash", - "type": "core::felt252" - }, - { - "name": "message_to_starknet_segment", - "type": "core::array::Span::" - }, - { - "name": "message_to_appchain_segment", - "type": "core::array::Span::" - } - ] - }, - { - "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", - "items": [ - { - "type": "function", - "name": "upgrade_state", - "inputs": [ - { - "name": "new_state", - "type": "core::array::Span::" - }, - { - "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" - }, - { - "name": "program_hash", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" - }, - { - "type": "interface", - "name": "dojo::config::interface::IConfig", - "items": [ - { - "type": "function", - "name": "set_differ_program_hash", - "inputs": [ - { - "name": "program_hash", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "set_merger_program_hash", - "inputs": [ - { - "name": "program_hash", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "get_differ_program_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "get_merger_program_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_facts_registry", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "get_facts_registry", - "inputs": [], - "outputs": [ - { - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "constructor", - "name": "constructor", - "inputs": [ - { - "name": "contract_base", - "type": "core::starknet::class_hash::ClassHash" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::WorldSpawned", - "kind": "struct", - "members": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "creator", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::ContractDeployed", - "kind": "struct", - "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::ContractUpgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::WorldUpgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::MetadataUpdate", - "kind": "struct", - "members": [ - { - "name": "resource", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "uri", - "type": "core::byte_array::ByteArray", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::ModelRegistered", - "kind": "struct", - "members": [ - { - "name": "name", - "type": "core::byte_array::ByteArray", - "kind": "data" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "prev_class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "prev_address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::StoreSetRecord", - "kind": "struct", - "members": [ - { - "name": "table", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "keys", - "type": "core::array::Span::", - "kind": "data" - }, - { - "name": "values", - "type": "core::array::Span::", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::StoreDelRecord", - "kind": "struct", - "members": [ - { - "name": "table", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "keys", - "type": "core::array::Span::", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::WriterUpdated", - "kind": "struct", - "members": [ - { - "name": "model", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "value", - "type": "core::bool", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::OwnerUpdated", - "kind": "struct", - "members": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "resource", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "value", - "type": "core::bool", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", - "kind": "struct", - "members": [ - { - "name": "program_hash", - "type": "core::felt252", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", - "kind": "struct", - "members": [ - { - "name": "program_hash", - "type": "core::felt252", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", - "kind": "struct", - "members": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::Event", - "kind": "enum", - "variants": [ - { - "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", - "kind": "nested" - }, - { - "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", - "kind": "nested" - }, - { - "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", - "kind": "nested" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::StateUpdated", - "kind": "struct", - "members": [ - { - "name": "da_hash", - "type": "core::felt252", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::Event", - "kind": "enum", - "variants": [ - { - "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", - "kind": "nested" - }, - { - "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", - "kind": "nested" - }, - { - "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", - "kind": "nested" - }, - { - "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", - "kind": "nested" - }, - { - "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", - "kind": "nested" - }, - { - "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", - "kind": "nested" - }, - { - "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", - "kind": "nested" - }, - { - "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", - "kind": "nested" - }, - { - "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", - "kind": "nested" - }, - { - "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", - "kind": "nested" - }, - { - "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", - "kind": "nested" - }, - { - "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", - "kind": "nested" - } - ] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json deleted file mode 100644 index 89abdcfec5..0000000000 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json +++ /dev/null @@ -1,389 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::actions::actions::Moved", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::actions::actions::Moved" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json deleted file mode 100644 index 9c63d0fc5d..0000000000 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_emote_message.json +++ /dev/null @@ -1,389 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "emote_messageImpl", - "interface_name": "dojo_examples::models::Iemote_message" - }, - { - "type": "enum", - "name": "dojo_examples::models::Emote", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Happy", - "type": "()" - }, - { - "name": "Sad", - "type": "()" - }, - { - "name": "Angry", - "type": "()" - }, - { - "name": "Love", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::EmoteMessage", - "members": [ - { - "name": "identity", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "emote", - "type": "dojo_examples::models::Emote" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Iemote_message", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::EmoteMessage" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::emote_message::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json deleted file mode 100644 index ec760c99fb..0000000000 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_message.json +++ /dev/null @@ -1,371 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "messageImpl", - "interface_name": "dojo_examples::models::Imessage" - }, - { - "type": "struct", - "name": "dojo_examples::models::Message", - "members": [ - { - "name": "identity", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "channel", - "type": "core::felt252" - }, - { - "name": "message", - "type": "core::byte_array::ByteArray" - }, - { - "name": "salt", - "type": "core::felt252" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Imessage", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::Message" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::message::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json b/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json deleted file mode 100644 index bceec42587..0000000000 --- a/examples/spawn-and-move/manifests/release/abis/deployments/models/dojo_examples_models_position.json +++ /dev/null @@ -1,377 +0,0 @@ -[ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "positionImpl", - "interface_name": "dojo_examples::models::Iposition" - }, - { - "type": "struct", - "name": "dojo_examples::models::Vec2", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Position", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "vec", - "type": "dojo_examples::models::Vec2" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Iposition", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::Position" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::position::Event", - "kind": "enum", - "variants": [] - } -] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml new file mode 100644 index 0000000000..d50705247c --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml @@ -0,0 +1,11 @@ +kind = "DojoContract" +class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +tag = "dojo_examples-actions" +manifest_name = "dojo_examples-actions-40b6994c" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml new file mode 100644 index 0000000000..b9109222f9 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -0,0 +1,11 @@ +kind = "DojoContract" +class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +tag = "dojo_examples-mock_token" +manifest_name = "dojo_examples-mock_token-31599eb2" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml new file mode 100644 index 0000000000..2b791ea2d5 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml @@ -0,0 +1,11 @@ +kind = "DojoContract" +class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +base_class_hash = "0x0" +abi = "manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json" +reads = [] +writes = [] +computed = [] +init_calldata = [] +tag = "dojo_examples-others" +manifest_name = "dojo_examples-others-61de2c18" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml deleted file mode 100644 index bf0f86489b..0000000000 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_actions_actions.toml +++ /dev/null @@ -1,10 +0,0 @@ -kind = "DojoContract" -class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" -original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" -base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples_actions_actions.json" -reads = [] -writes = [] -computed = [] -init_calldata = [] -name = "dojo_examples::actions::actions" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml deleted file mode 100644 index 65fbfcc8ad..0000000000 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_mock_token_mock_token.toml +++ /dev/null @@ -1,10 +0,0 @@ -kind = "DojoContract" -class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" -original_class_hash = "0x5c32bc974f96f82ded691bb95bf26b2783f874fffb50fe84a331acb75ecf5b2" -base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples_mock_token_mock_token.json" -reads = [] -writes = [] -computed = [] -init_calldata = [] -name = "dojo_examples::mock_token::mock_token" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml deleted file mode 100644 index 66cb83c9d6..0000000000 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples_others_others.toml +++ /dev/null @@ -1,10 +0,0 @@ -kind = "DojoContract" -class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples_others_others.json" -reads = [] -writes = [] -computed = [] -init_calldata = [] -name = "dojo_examples::others::others" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_base_base.toml b/examples/spawn-and-move/manifests/release/base/dojo-base.toml similarity index 65% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_base_base.toml rename to examples/spawn-and-move/manifests/release/base/dojo-base.toml index 6c4b5de67e..feb0efd085 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo_base_base.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-base.toml @@ -1,4 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -name = "dojo::base::base" +abi = "manifests/release/abis/base/dojo-base.json" +tag = "dojo-base" +manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/release/base/dojo-world.toml b/examples/spawn-and-move/manifests/release/base/dojo-world.toml new file mode 100644 index 0000000000..cad6228974 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/dojo-world.toml @@ -0,0 +1,6 @@ +kind = "Class" +class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +abi = "manifests/release/abis/base/dojo-world.json" +tag = "dojo-world" +manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml b/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml deleted file mode 100644 index e9badcfe4c..0000000000 --- a/examples/spawn-and-move/manifests/release/base/dojo_world_world.toml +++ /dev/null @@ -1,5 +0,0 @@ -kind = "Class" -class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -abi = "manifests/release/abis/base/dojo_world_world.json" -name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml new file mode 100644 index 0000000000..9e7ac1b5fa --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -0,0 +1,21 @@ +kind = "DojoModel" +class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +abi = "manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json" +tag = "dojo_examples-ContractInitialized" +manifest_name = "dojo_examples-ContractInitialized-376b7bd6" + +[[members]] +name = "contract_address" +type = "ContractAddress" +key = true + +[[members]] +name = "contract_class" +type = "ClassHash" +key = false + +[[members]] +name = "value" +type = "u8" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml new file mode 100644 index 0000000000..415899e171 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml @@ -0,0 +1,26 @@ +kind = "DojoModel" +class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +abi = "manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json" +tag = "dojo_examples-Message" +manifest_name = "dojo_examples-Message-1bb1d226" + +[[members]] +name = "identity" +type = "ContractAddress" +key = true + +[[members]] +name = "channel" +type = "felt252" +key = true + +[[members]] +name = "message" +type = "ByteArray" +key = false + +[[members]] +name = "salt" +type = "felt252" +key = true diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml new file mode 100644 index 0000000000..90d11271ae --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml @@ -0,0 +1,16 @@ +kind = "DojoModel" +class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +abi = "manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json" +tag = "dojo_examples-MockToken" +manifest_name = "dojo_examples-MockToken-38903c7c" + +[[members]] +name = "account" +type = "ContractAddress" +key = true + +[[members]] +name = "amount" +type = "u128" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml new file mode 100644 index 0000000000..3dc784d978 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml @@ -0,0 +1,16 @@ +kind = "DojoModel" +class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +abi = "manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json" +tag = "dojo_examples-Moved" +manifest_name = "dojo_examples-Moved-318ae40d" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml new file mode 100644 index 0000000000..50f4c1774f --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml @@ -0,0 +1,21 @@ +kind = "DojoModel" +class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +abi = "manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json" +tag = "dojo_examples-Moves" +manifest_name = "dojo_examples-Moves-2e2accba" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "remaining" +type = "u8" +key = false + +[[members]] +name = "last_direction" +type = "Direction" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml new file mode 100644 index 0000000000..762114119b --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -0,0 +1,26 @@ +kind = "DojoModel" +class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +abi = "manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json" +tag = "dojo_examples-PlayerConfig" +manifest_name = "dojo_examples-PlayerConfig-3adad785" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false + +[[members]] +name = "items" +type = "Array" +key = false + +[[members]] +name = "favorite_item" +type = "Option" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml new file mode 100644 index 0000000000..be845b84a8 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml @@ -0,0 +1,16 @@ +kind = "DojoModel" +class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +abi = "manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json" +tag = "dojo_examples-Position" +manifest_name = "dojo_examples-Position-1e145e26" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "vec" +type = "Vec2" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml new file mode 100644 index 0000000000..b41cbad8c7 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -0,0 +1,21 @@ +kind = "DojoModel" +class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +abi = "manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json" +tag = "dojo_examples-ServerProfile" +manifest_name = "dojo_examples-ServerProfile-4caad1e6" + +[[members]] +name = "player" +type = "ContractAddress" +key = true + +[[members]] +name = "server_id" +type = "u32" +key = true + +[[members]] +name = "name" +type = "ByteArray" +key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml deleted file mode 100644 index 74c1e890a1..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_actions_actions_moved.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -abi = "manifests/release/abis/base/models/dojo_examples_actions_actions_moved.json" -name = "dojo_examples::actions::actions::moved" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "direction" -type = "Direction" -key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml deleted file mode 100644 index fdc87b27cb..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_message.toml +++ /dev/null @@ -1,25 +0,0 @@ -kind = "DojoModel" -class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -abi = "manifests/release/abis/base/models/dojo_examples_models_message.json" -name = "dojo_examples::models::message" - -[[members]] -name = "identity" -type = "ContractAddress" -key = true - -[[members]] -name = "channel" -type = "felt252" -key = true - -[[members]] -name = "message" -type = "ByteArray" -key = false - -[[members]] -name = "salt" -type = "felt252" -key = true diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml deleted file mode 100644 index 3d0147bc11..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_mock_token.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" -original_class_hash = "0x6a21c56878ba470ac7a51f336ca6a59781de38e1810d2d20866ab2b52138a6d" -abi = "manifests/release/abis/base/models/dojo_examples_models_mock_token.json" -name = "dojo_examples::models::mock_token" - -[[members]] -name = "account" -type = "ContractAddress" -key = true - -[[members]] -name = "amount" -type = "u128" -key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml deleted file mode 100644 index 8954550f5e..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_moves.toml +++ /dev/null @@ -1,20 +0,0 @@ -kind = "DojoModel" -class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -abi = "manifests/release/abis/base/models/dojo_examples_models_moves.json" -name = "dojo_examples::models::moves" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "remaining" -type = "u8" -key = false - -[[members]] -name = "last_direction" -type = "Direction" -key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml deleted file mode 100644 index bbeae83193..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_player_config.toml +++ /dev/null @@ -1,25 +0,0 @@ -kind = "DojoModel" -class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -abi = "manifests/release/abis/base/models/dojo_examples_models_player_config.json" -name = "dojo_examples::models::player_config" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "name" -type = "ByteArray" -key = false - -[[members]] -name = "items" -type = "Array" -key = false - -[[members]] -name = "favorite_item" -type = "Option" -key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml deleted file mode 100644 index 562adaba78..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_models_position.toml +++ /dev/null @@ -1,15 +0,0 @@ -kind = "DojoModel" -class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -abi = "manifests/release/abis/base/models/dojo_examples_models_position.json" -name = "dojo_examples::models::position" - -[[members]] -name = "player" -type = "ContractAddress" -key = true - -[[members]] -name = "vec" -type = "Vec2" -key = false diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml deleted file mode 100644 index 51efb699ba..0000000000 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples_others_others_contract_initialized.toml +++ /dev/null @@ -1,20 +0,0 @@ -kind = "DojoModel" -class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -abi = "manifests/release/abis/base/models/dojo_examples_others_others_contract_initialized.json" -name = "dojo_examples::others::others::contract_initialized" - -[[members]] -name = "contract_address" -type = "ContractAddress" -key = true - -[[members]] -name = "contract_class" -type = "ClassHash" -key = false - -[[members]] -name = "value" -type = "u8" -key = false diff --git a/examples/spawn-and-move/manifests/release/manifest.json b/examples/spawn-and-move/manifests/release/manifest.json deleted file mode 100644 index 8ae464adc9..0000000000 --- a/examples/spawn-and-move/manifests/release/manifest.json +++ /dev/null @@ -1,3910 +0,0 @@ -{ - "world": { - "kind": "WorldContract", - "class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", - "original_class_hash": "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9", - "abi": [ - { - "type": "impl", - "name": "World", - "interface_name": "dojo::world::IWorld" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo::resource_metadata::ResourceMetadata", - "members": [ - { - "name": "resource_id", - "type": "core::felt252" - }, - { - "name": "metadata_uri", - "type": "core::byte_array::ByteArray" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::world::IWorld", - "items": [ - { - "type": "function", - "name": "metadata", - "inputs": [ - { - "name": "resource_id", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "dojo::resource_metadata::ResourceMetadata" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_metadata", - "inputs": [ - { - "name": "metadata", - "type": "dojo::resource_metadata::ResourceMetadata" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "model", - "inputs": [ - { - "name": "selector", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "(core::starknet::class_hash::ClassHash, core::starknet::contract_address::ContractAddress)" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "register_model", - "inputs": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "deploy_contract", - "inputs": [ - { - "name": "salt", - "type": "core::felt252" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "init_calldata", - "type": "core::array::Span::" - } - ], - "outputs": [ - { - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "state_mutability": "external" - }, - { - "type": "function", - "name": "upgrade_contract", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [ - { - "type": "core::starknet::class_hash::ClassHash" - } - ], - "state_mutability": "external" - }, - { - "type": "function", - "name": "uuid", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u32" - } - ], - "state_mutability": "external" - }, - { - "type": "function", - "name": "emit", - "inputs": [ - { - "name": "keys", - "type": "core::array::Array::" - }, - { - "name": "values", - "type": "core::array::Span::" - } - ], - "outputs": [], - "state_mutability": "view" - }, - { - "type": "function", - "name": "entity", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "keys", - "type": "core::array::Span::" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ], - "outputs": [ - { - "type": "core::array::Span::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_entity", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "keys", - "type": "core::array::Span::" - }, - { - "name": "values", - "type": "core::array::Span::" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "delete_entity", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "keys", - "type": "core::array::Span::" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "base", - "inputs": [], - "outputs": [ - { - "type": "core::starknet::class_hash::ClassHash" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "is_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "grant_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "revoke_owner", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "resource", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "is_writer", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [ - { - "type": "core::bool" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "grant_writer", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "revoke_writer", - "inputs": [ - { - "name": "model", - "type": "core::felt252" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "UpgradeableWorld", - "interface_name": "dojo::world::IUpgradeableWorld" - }, - { - "type": "interface", - "name": "dojo::world::IUpgradeableWorld", - "items": [ - { - "type": "function", - "name": "upgrade", - "inputs": [ - { - "name": "new_class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "UpgradeableState", - "interface_name": "dojo::interfaces::IUpgradeableState" - }, - { - "type": "struct", - "name": "dojo::interfaces::StorageUpdate", - "members": [ - { - "name": "key", - "type": "core::felt252" - }, - { - "name": "value", - "type": "core::felt252" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::interfaces::ProgramOutput", - "members": [ - { - "name": "prev_state_root", - "type": "core::felt252" - }, - { - "name": "new_state_root", - "type": "core::felt252" - }, - { - "name": "block_number", - "type": "core::felt252" - }, - { - "name": "block_hash", - "type": "core::felt252" - }, - { - "name": "config_hash", - "type": "core::felt252" - }, - { - "name": "world_da_hash", - "type": "core::felt252" - }, - { - "name": "message_to_starknet_segment", - "type": "core::array::Span::" - }, - { - "name": "message_to_appchain_segment", - "type": "core::array::Span::" - } - ] - }, - { - "type": "interface", - "name": "dojo::interfaces::IUpgradeableState", - "items": [ - { - "type": "function", - "name": "upgrade_state", - "inputs": [ - { - "name": "new_state", - "type": "core::array::Span::" - }, - { - "name": "program_output", - "type": "dojo::interfaces::ProgramOutput" - }, - { - "name": "program_hash", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "impl", - "name": "ConfigImpl", - "interface_name": "dojo::config::interface::IConfig" - }, - { - "type": "interface", - "name": "dojo::config::interface::IConfig", - "items": [ - { - "type": "function", - "name": "set_differ_program_hash", - "inputs": [ - { - "name": "program_hash", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "set_merger_program_hash", - "inputs": [ - { - "name": "program_hash", - "type": "core::felt252" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "get_differ_program_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "get_merger_program_hash", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_facts_registry", - "inputs": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "outputs": [], - "state_mutability": "external" - }, - { - "type": "function", - "name": "get_facts_registry", - "inputs": [], - "outputs": [ - { - "type": "core::starknet::contract_address::ContractAddress" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "constructor", - "name": "constructor", - "inputs": [ - { - "name": "contract_base", - "type": "core::starknet::class_hash::ClassHash" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::WorldSpawned", - "kind": "struct", - "members": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "creator", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::ContractDeployed", - "kind": "struct", - "members": [ - { - "name": "salt", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::ContractUpgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::WorldUpgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::MetadataUpdate", - "kind": "struct", - "members": [ - { - "name": "resource", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "uri", - "type": "core::byte_array::ByteArray", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::ModelRegistered", - "kind": "struct", - "members": [ - { - "name": "name", - "type": "core::byte_array::ByteArray", - "kind": "data" - }, - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "prev_class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - }, - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "prev_address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::StoreSetRecord", - "kind": "struct", - "members": [ - { - "name": "table", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "keys", - "type": "core::array::Span::", - "kind": "data" - }, - { - "name": "values", - "type": "core::array::Span::", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::StoreDelRecord", - "kind": "struct", - "members": [ - { - "name": "table", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "keys", - "type": "core::array::Span::", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::WriterUpdated", - "kind": "struct", - "members": [ - { - "name": "model", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "contract", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "value", - "type": "core::bool", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::OwnerUpdated", - "kind": "struct", - "members": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - }, - { - "name": "resource", - "type": "core::felt252", - "kind": "data" - }, - { - "name": "value", - "type": "core::bool", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::DifferProgramHashUpdate", - "kind": "struct", - "members": [ - { - "name": "program_hash", - "type": "core::felt252", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::MergerProgramHashUpdate", - "kind": "struct", - "members": [ - { - "name": "program_hash", - "type": "core::felt252", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::FactsRegistryUpdate", - "kind": "struct", - "members": [ - { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::config::component::Config::Event", - "kind": "enum", - "variants": [ - { - "name": "DifferProgramHashUpdate", - "type": "dojo::config::component::Config::DifferProgramHashUpdate", - "kind": "nested" - }, - { - "name": "MergerProgramHashUpdate", - "type": "dojo::config::component::Config::MergerProgramHashUpdate", - "kind": "nested" - }, - { - "name": "FactsRegistryUpdate", - "type": "dojo::config::component::Config::FactsRegistryUpdate", - "kind": "nested" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::StateUpdated", - "kind": "struct", - "members": [ - { - "name": "da_hash", - "type": "core::felt252", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::world::world::Event", - "kind": "enum", - "variants": [ - { - "name": "WorldSpawned", - "type": "dojo::world::world::WorldSpawned", - "kind": "nested" - }, - { - "name": "ContractDeployed", - "type": "dojo::world::world::ContractDeployed", - "kind": "nested" - }, - { - "name": "ContractUpgraded", - "type": "dojo::world::world::ContractUpgraded", - "kind": "nested" - }, - { - "name": "WorldUpgraded", - "type": "dojo::world::world::WorldUpgraded", - "kind": "nested" - }, - { - "name": "MetadataUpdate", - "type": "dojo::world::world::MetadataUpdate", - "kind": "nested" - }, - { - "name": "ModelRegistered", - "type": "dojo::world::world::ModelRegistered", - "kind": "nested" - }, - { - "name": "StoreSetRecord", - "type": "dojo::world::world::StoreSetRecord", - "kind": "nested" - }, - { - "name": "StoreDelRecord", - "type": "dojo::world::world::StoreDelRecord", - "kind": "nested" - }, - { - "name": "WriterUpdated", - "type": "dojo::world::world::WriterUpdated", - "kind": "nested" - }, - { - "name": "OwnerUpdated", - "type": "dojo::world::world::OwnerUpdated", - "kind": "nested" - }, - { - "name": "ConfigEvent", - "type": "dojo::config::component::Config::Event", - "kind": "nested" - }, - { - "name": "StateUpdated", - "type": "dojo::world::world::StateUpdated", - "kind": "nested" - } - ] - } - ], - "address": "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30", - "transaction_hash": "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d", - "block_number": 3, - "seed": "dojo_examples", - "metadata": { - "profile_name": "release", - "rpc_url": "http://localhost:5050/" - }, - "name": "dojo::world::world" - }, - "base": { - "kind": "Class", - "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": null, - "name": "dojo::base::base" - }, - "contracts": [ - { - "kind": "DojoContract", - "address": "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af", - "class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", - "original_class_hash": "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767", - "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": [ - { - "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" - }, - { - "type": "interface", - "name": "dojo::world::IDojoResourceProvider", - "items": [ - { - "type": "function", - "name": "dojo_resource", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" - }, - { - "type": "struct", - "name": "dojo::world::IWorldDispatcher", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "type": "interface", - "name": "dojo::world::IWorldProvider", - "items": [ - { - "type": "function", - "name": "world", - "inputs": [], - "outputs": [ - { - "type": "dojo::world::IWorldDispatcher" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "ActionsComputedImpl", - "interface_name": "dojo_examples::actions::IActionsComputed" - }, - { - "type": "struct", - "name": "dojo_examples::models::Vec2", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Position", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "vec", - "type": "dojo_examples::models::Vec2" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::IActionsComputed", - "items": [ - { - "type": "function", - "name": "tile_terrain", - "inputs": [ - { - "name": "vec", - "type": "dojo_examples::models::Vec2" - } - ], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "quadrant", - "inputs": [ - { - "name": "pos", - "type": "dojo_examples::models::Position" - } - ], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "ActionsImpl", - "interface_name": "dojo_examples::actions::IActions" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::IActions", - "items": [ - { - "type": "function", - "name": "spawn", - "inputs": [], - "outputs": [], - "state_mutability": "view" - }, - { - "type": "function", - "name": "move", - "inputs": [ - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ], - "outputs": [], - "state_mutability": "view" - }, - { - "type": "function", - "name": "set_player_config", - "inputs": [ - { - "name": "name", - "type": "core::byte_array::ByteArray" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "IDojoInitImpl", - "interface_name": "dojo_examples::actions::actions::IDojoInit" - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::IDojoInit", - "items": [ - { - "type": "function", - "name": "dojo_init", - "inputs": [], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" - }, - { - "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", - "items": [ - { - "type": "function", - "name": "upgrade", - "inputs": [ - { - "name": "new_class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", - "kind": "enum", - "variants": [ - { - "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "nested" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::actions::actions::Event", - "kind": "enum", - "variants": [ - { - "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" - } - ] - } - ], - "reads": [], - "writes": [ - "Moves", - "Position" - ], - "computed": [], - "init_calldata": [], - "name": "dojo_examples::actions::actions" - }, - { - "kind": "DojoContract", - "address": "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1", - "class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", - "original_class_hash": "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a", - "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": [ - { - "type": "impl", - "name": "DojoResourceProviderImpl", - "interface_name": "dojo::world::IDojoResourceProvider" - }, - { - "type": "interface", - "name": "dojo::world::IDojoResourceProvider", - "items": [ - { - "type": "function", - "name": "dojo_resource", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "WorldProviderImpl", - "interface_name": "dojo::world::IWorldProvider" - }, - { - "type": "struct", - "name": "dojo::world::IWorldDispatcher", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - } - ] - }, - { - "type": "interface", - "name": "dojo::world::IWorldProvider", - "items": [ - { - "type": "function", - "name": "world", - "inputs": [], - "outputs": [ - { - "type": "dojo::world::IWorldDispatcher" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "IDojoInitImpl", - "interface_name": "dojo_examples::others::others::IDojoInit" - }, - { - "type": "interface", - "name": "dojo_examples::others::others::IDojoInit", - "items": [ - { - "type": "function", - "name": "dojo_init", - "inputs": [ - { - "name": "actions_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "actions_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "UpgradableImpl", - "interface_name": "dojo::components::upgradeable::IUpgradeable" - }, - { - "type": "interface", - "name": "dojo::components::upgradeable::IUpgradeable", - "items": [ - { - "type": "function", - "name": "upgrade", - "inputs": [ - { - "name": "new_class_hash", - "type": "core::starknet::class_hash::ClassHash" - } - ], - "outputs": [], - "state_mutability": "external" - } - ] - }, - { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "struct", - "members": [ - { - "name": "class_hash", - "type": "core::starknet::class_hash::ClassHash", - "kind": "data" - } - ] - }, - { - "type": "event", - "name": "dojo::components::upgradeable::upgradeable::Event", - "kind": "enum", - "variants": [ - { - "name": "Upgraded", - "type": "dojo::components::upgradeable::upgradeable::Upgraded", - "kind": "nested" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::others::others::Event", - "kind": "enum", - "variants": [ - { - "name": "UpgradeableEvent", - "type": "dojo::components::upgradeable::upgradeable::Event", - "kind": "nested" - } - ] - } - ], - "reads": [], - "writes": [], - "computed": [], - "init_calldata": [ - "$class_hash:dojo_examples::actions::actions", - "$contract_address:dojo_examples::actions::actions", - "10" - ], - "name": "dojo_examples::others::others" - } - ], - "models": [ - { - "kind": "DojoModel", - "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, - { - "name": "direction", - "type": "Direction", - "key": false - } - ], - "class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", - "original_class_hash": "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c", - "abi": [ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movedImpl", - "interface_name": "dojo_examples::actions::actions::Imoved" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::actions::actions::Moved", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::actions::actions::Imoved", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::actions::actions::Moved" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::actions::actions::moved::Event", - "kind": "enum", - "variants": [] - } - ], - "name": "dojo_examples::actions::actions::moved" - }, - { - "kind": "DojoModel", - "members": [ - { - "name": "identity", - "type": "ContractAddress", - "key": true - }, - { - "name": "channel", - "type": "felt252", - "key": true - }, - { - "name": "message", - "type": "ByteArray", - "key": false - }, - { - "name": "salt", - "type": "felt252", - "key": true - } - ], - "class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", - "original_class_hash": "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5", - "abi": [ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "messageImpl", - "interface_name": "dojo_examples::models::Imessage" - }, - { - "type": "struct", - "name": "dojo_examples::models::Message", - "members": [ - { - "name": "identity", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "channel", - "type": "core::felt252" - }, - { - "name": "message", - "type": "core::byte_array::ByteArray" - }, - { - "name": "salt", - "type": "core::felt252" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Imessage", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::Message" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::message::Event", - "kind": "enum", - "variants": [] - } - ], - "name": "dojo_examples::models::message" - }, - { - "kind": "DojoModel", - "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, - { - "name": "remaining", - "type": "u8", - "key": false - }, - { - "name": "last_direction", - "type": "Direction", - "key": false - } - ], - "class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", - "original_class_hash": "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8", - "abi": [ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "movesImpl", - "interface_name": "dojo_examples::models::Imoves" - }, - { - "type": "enum", - "name": "dojo_examples::models::Direction", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Left", - "type": "()" - }, - { - "name": "Right", - "type": "()" - }, - { - "name": "Up", - "type": "()" - }, - { - "name": "Down", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Moves", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "remaining", - "type": "core::integer::u8" - }, - { - "name": "last_direction", - "type": "dojo_examples::models::Direction" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Imoves", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::Moves" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::moves::Event", - "kind": "enum", - "variants": [] - } - ], - "name": "dojo_examples::models::moves" - }, - { - "kind": "DojoModel", - "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, - { - "name": "name", - "type": "ByteArray", - "key": false - }, - { - "name": "items", - "type": "Array", - "key": false - }, - { - "name": "favorite_item", - "type": "Option", - "key": false - } - ], - "class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", - "original_class_hash": "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55", - "abi": [ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "player_configImpl", - "interface_name": "dojo_examples::models::Iplayer_config" - }, - { - "type": "struct", - "name": "dojo_examples::models::PlayerItem", - "members": [ - { - "name": "item_id", - "type": "core::integer::u32" - }, - { - "name": "quantity", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::PlayerConfig", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "name", - "type": "core::byte_array::ByteArray" - }, - { - "name": "items", - "type": "core::array::Array::" - }, - { - "name": "favorite_item", - "type": "core::option::Option::" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Iplayer_config", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::PlayerConfig" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::player_config::Event", - "kind": "enum", - "variants": [] - } - ], - "name": "dojo_examples::models::player_config" - }, - { - "kind": "DojoModel", - "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, - { - "name": "vec", - "type": "Vec2", - "key": false - } - ], - "class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", - "original_class_hash": "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff", - "abi": [ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "positionImpl", - "interface_name": "dojo_examples::models::Iposition" - }, - { - "type": "struct", - "name": "dojo_examples::models::Vec2", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "dojo_examples::models::Position", - "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "vec", - "type": "dojo_examples::models::Vec2" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::models::Iposition", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::models::Position" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::models::position::Event", - "kind": "enum", - "variants": [] - } - ], - "name": "dojo_examples::models::position" - }, - { - "kind": "DojoModel", - "members": [ - { - "name": "contract_address", - "type": "ContractAddress", - "key": true - }, - { - "name": "contract_class", - "type": "ClassHash", - "key": false - }, - { - "name": "value", - "type": "u8", - "key": false - } - ], - "class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", - "original_class_hash": "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c", - "abi": [ - { - "type": "impl", - "name": "DojoModelImpl", - "interface_name": "dojo::model::IModel" - }, - { - "type": "struct", - "name": "core::byte_array::ByteArray", - "members": [ - { - "name": "data", - "type": "core::array::Array::" - }, - { - "name": "pending_word", - "type": "core::felt252" - }, - { - "name": "pending_word_len", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "core::option::Option::", - "variants": [ - { - "name": "Some", - "type": "core::integer::u32" - }, - { - "name": "None", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::FieldLayout", - "members": [ - { - "name": "selector", - "type": "core::felt252" - }, - { - "name": "layout", - "type": "dojo::database::introspect::Layout" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Layout", - "variants": [ - { - "name": "Fixed", - "type": "core::array::Span::" - }, - { - "name": "Struct", - "type": "core::array::Span::" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - }, - { - "name": "Enum", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Member", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "ty", - "type": "dojo::database::introspect::Ty" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Struct", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "dojo::database::introspect::Enum", - "members": [ - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "attrs", - "type": "core::array::Span::" - }, - { - "name": "children", - "type": "core::array::Span::<(core::felt252, dojo::database::introspect::Ty)>" - } - ] - }, - { - "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "enum", - "name": "dojo::database::introspect::Ty", - "variants": [ - { - "name": "Primitive", - "type": "core::felt252" - }, - { - "name": "Struct", - "type": "dojo::database::introspect::Struct" - }, - { - "name": "Enum", - "type": "dojo::database::introspect::Enum" - }, - { - "name": "Tuple", - "type": "core::array::Span::" - }, - { - "name": "Array", - "type": "core::array::Span::" - }, - { - "name": "ByteArray", - "type": "()" - } - ] - }, - { - "type": "interface", - "name": "dojo::model::IModel", - "items": [ - { - "type": "function", - "name": "selector", - "inputs": [], - "outputs": [ - { - "type": "core::felt252" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "name", - "inputs": [], - "outputs": [ - { - "type": "core::byte_array::ByteArray" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "version", - "inputs": [], - "outputs": [ - { - "type": "core::integer::u8" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "unpacked_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "packed_size", - "inputs": [], - "outputs": [ - { - "type": "core::option::Option::" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "layout", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Layout" - } - ], - "state_mutability": "view" - }, - { - "type": "function", - "name": "schema", - "inputs": [], - "outputs": [ - { - "type": "dojo::database::introspect::Ty" - } - ], - "state_mutability": "view" - } - ] - }, - { - "type": "impl", - "name": "contract_initializedImpl", - "interface_name": "dojo_examples::others::others::Icontract_initialized" - }, - { - "type": "struct", - "name": "dojo_examples::others::others::ContractInitialized", - "members": [ - { - "name": "contract_address", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "contract_class", - "type": "core::starknet::class_hash::ClassHash" - }, - { - "name": "value", - "type": "core::integer::u8" - } - ] - }, - { - "type": "interface", - "name": "dojo_examples::others::others::Icontract_initialized", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "dojo_examples::others::others::ContractInitialized" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] - }, - { - "type": "event", - "name": "dojo_examples::others::others::contract_initialized::Event", - "kind": "enum", - "variants": [] - } - ], - "name": "dojo_examples::others::others::contract_initialized" - } - ] -} \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/manifest.toml b/examples/spawn-and-move/manifests/release/manifest.toml deleted file mode 100644 index 71ebf9944e..0000000000 --- a/examples/spawn-and-move/manifests/release/manifest.toml +++ /dev/null @@ -1,185 +0,0 @@ -[world] -kind = "WorldContract" -class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -original_class_hash = "0x3f63cecdc4964acafb921ba2934c6507d1b3c344edb64c2762cf08053169ab9" -abi = "manifests/release/abis/deployments/dojo_world_world.json" -address = "0x7efebb0c2d4cc285d48a97a7174def3be7fdd6b7bd29cca758fa2e17e03ef30" -transaction_hash = "0x60316eb232789f4d8352c6afdc36b76d33362d72b43bf78183b43f196779a9d" -block_number = 3 -seed = "dojo_examples" -name = "dojo::world::world" - -[world.metadata] -profile_name = "release" -rpc_url = "http://localhost:5050/" - -[base] -kind = "Class" -class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -name = "dojo::base::base" - -[[contracts]] -kind = "DojoContract" -address = "0x5c70a663d6b48d8e4c6aaa9572e3735a732ac3765700d470463e670587852af" -class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" -original_class_hash = "0x6d905953360cf18e3393d128c6ced40b38fc83b033412c8541fd4aba59d2767" -base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/release/abis/deployments/contracts/dojo_examples_actions_actions.json" -reads = [] -writes = [ - "Moves", - "Position", -] -computed = [] -init_calldata = [] -name = "dojo_examples::actions::actions" - -[[contracts]] -kind = "DojoContract" -address = "0x3f51cd82daaf5907d2fd082ae3f45ae2ef96ab61677f46abc16e0a54d3392d1" -class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -original_class_hash = "0x3ee016157303a7ce35a9fecdb5b8519159df620c5780527d61443636aaa3c3a" -base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/release/abis/deployments/contracts/dojo_examples_others_others.json" -reads = [] -writes = [] -computed = [] -init_calldata = [ - "$class_hash:dojo_examples::actions::actions", - "$contract_address:dojo_examples::actions::actions", - "10", -] -name = "dojo_examples::others::others" - -[[models]] -kind = "DojoModel" -class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -original_class_hash = "0x4ef89963afe500337aaf757ad52394ea8e311077a825b3de5a5f32d3457997c" -abi = "manifests/release/abis/deployments/models/dojo_examples_actions_actions_moved.json" -name = "dojo_examples::actions::actions::moved" - -[[models.members]] -name = "player" -type = "ContractAddress" -key = true - -[[models.members]] -name = "direction" -type = "Direction" -key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -original_class_hash = "0x33bdb1a470ea0ee7d77faa3c75151934b3b129c0bad7333ec6c2dad1b98ec5" -abi = "manifests/release/abis/deployments/models/dojo_examples_models_message.json" -name = "dojo_examples::models::message" - -[[models.members]] -name = "identity" -type = "ContractAddress" -key = true - -[[models.members]] -name = "channel" -type = "felt252" -key = true - -[[models.members]] -name = "message" -type = "ByteArray" -key = false - -[[models.members]] -name = "salt" -type = "felt252" -key = true - -[[models]] -kind = "DojoModel" -class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -original_class_hash = "0x456d85286b34249fffa0a13d1ac490cc1f5b02eb1a1c92d820c59d6b0f2eaa8" -abi = "manifests/release/abis/deployments/models/dojo_examples_models_moves.json" -name = "dojo_examples::models::moves" - -[[models.members]] -name = "player" -type = "ContractAddress" -key = true - -[[models.members]] -name = "remaining" -type = "u8" -key = false - -[[models.members]] -name = "last_direction" -type = "Direction" -key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -original_class_hash = "0x584d016a91d077c86ff1c014e0c4d735946d1084dd0d4c0a80cee6d04629e55" -abi = "manifests/release/abis/deployments/models/dojo_examples_models_player_config.json" -name = "dojo_examples::models::player_config" - -[[models.members]] -name = "player" -type = "ContractAddress" -key = true - -[[models.members]] -name = "name" -type = "ByteArray" -key = false - -[[models.members]] -name = "items" -type = "Array" -key = false - -[[models.members]] -name = "favorite_item" -type = "Option" -key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -original_class_hash = "0x27942375b09862291ece780c573e8c625df4ba41fd7524e0658ca75fff014ff" -abi = "manifests/release/abis/deployments/models/dojo_examples_models_position.json" -name = "dojo_examples::models::position" - -[[models.members]] -name = "player" -type = "ContractAddress" -key = true - -[[models.members]] -name = "vec" -type = "Vec2" -key = false - -[[models]] -kind = "DojoModel" -class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -original_class_hash = "0x4b29afc6db744bd87f7276869620348557c11b984e9f3fcb27c4d55efb0ab6c" -abi = "manifests/release/abis/deployments/models/dojo_examples_others_others_contract_initialized.json" -name = "dojo_examples::others::others::contract_initialized" - -[[models.members]] -name = "contract_address" -type = "ContractAddress" -key = true - -[[models.members]] -name = "contract_class" -type = "ClassHash" -key = false - -[[models.members]] -name = "value" -type = "u8" -key = false diff --git a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml deleted file mode 100644 index 188130a013..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_actions_actions.toml +++ /dev/null @@ -1,4 +0,0 @@ -init_calldata = [ ] -name = "dojo_examples::actions::actions" -reads = [ ] -writes = [ "Moves", "Position" ] diff --git a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml b/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml deleted file mode 100644 index 82545bca81..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/contracts/dojo_examples_others_others.toml +++ /dev/null @@ -1,8 +0,0 @@ -init_calldata = [ - "$class_hash:dojo_examples::actions::actions", - "$contract_address:dojo_examples::actions::actions", - "10", -] -name = "dojo_examples::others::others" -reads = [ ] -writes = [ ] diff --git a/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml b/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml deleted file mode 100644 index f706470d45..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/dojo_base_base.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo::base::base" diff --git a/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml b/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml deleted file mode 100644 index a3e686e3ef..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/dojo_world_world.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo::world::world" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml deleted file mode 100644 index 4958a7a15c..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_actions_actions_moved.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::actions::actions::moved" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml deleted file mode 100644 index 5d9412cae2..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_message.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::message" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml deleted file mode 100644 index a5ba5684a6..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_mock_token.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::mock_token" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml deleted file mode 100644 index dc8784e746..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_moves.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::moves" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml deleted file mode 100644 index 6af8240b36..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_player_config.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::player_config" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml deleted file mode 100644 index df38e71c32..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_models_position.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::models::position" diff --git a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml b/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml deleted file mode 100644 index f8f3053fe5..0000000000 --- a/examples/spawn-and-move/manifests/release/overlays/models/dojo_examples_others_others_contract_initialized.toml +++ /dev/null @@ -1 +0,0 @@ -name = "dojo_examples::others::others::contract_initialized" diff --git a/examples/spawn-and-move/overlays/dev/actions.toml b/examples/spawn-and-move/overlays/dev/actions.toml new file mode 100644 index 0000000000..31849b7894 --- /dev/null +++ b/examples/spawn-and-move/overlays/dev/actions.toml @@ -0,0 +1,2 @@ +tag = "dojo_examples-actions" +writes = ["dojo_examples-Moves", "dojo_examples-Position"] diff --git a/examples/spawn-and-move/overlays/dev/others.toml b/examples/spawn-and-move/overlays/dev/others.toml new file mode 100644 index 0000000000..effbcca1da --- /dev/null +++ b/examples/spawn-and-move/overlays/dev/others.toml @@ -0,0 +1,2 @@ +tag = "dojo_examples-others" +init_calldata = ["$contract_address:dojo_examples-actions", "$class_hash:dojo_examples-actions", "10"] diff --git a/examples/spawn-and-move/src/actions.cairo b/examples/spawn-and-move/src/actions.cairo index 241fe54ea3..a0d7753e0f 100644 --- a/examples/spawn-and-move/src/actions.cairo +++ b/examples/spawn-and-move/src/actions.cairo @@ -165,7 +165,7 @@ mod tests { // models let mut models = array![position::TEST_CLASS_HASH, moves::TEST_CLASS_HASH,]; // deploy world with models - let world = spawn_test_world(models); + let world = spawn_test_world("dojo_examples", models); // deploy systems contract let contract_address = world diff --git a/scripts/rebuild_test_artifacts.sh b/scripts/rebuild_test_artifacts.sh index 4546401044..addbdd1b72 100755 --- a/scripts/rebuild_test_artifacts.sh +++ b/scripts/rebuild_test_artifacts.sh @@ -14,9 +14,17 @@ rm -rf examples/spawn-and-move/manifests/dev/base rm -rf examples/spawn-and-move/manifests/dev/manifest.json rm -rf examples/spawn-and-move/manifests/dev/manifest.toml +rm -rf examples/spawn-and-move/manifests/release/abis +rm -rf examples/spawn-and-move/manifests/release/base +rm -rf examples/spawn-and-move/manifests/release/manifest.json +rm -rf examples/spawn-and-move/manifests/release/manifest.toml + rm -rf crates/torii/types-test/target rm -rf crates/torii/types-test/manifests +rm -rf crates/dojo-lang/src/manifest_test_data/compiler_cairo/target +rm -rf crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests + cargo run --bin dojo-world-abigen # Fix the cairo test to re-generate the code that is expected to be tested. @@ -25,7 +33,9 @@ CAIRO_FIX_TESTS=1 cargo test --package dojo-lang semantics # Re-run the minimal tests, this will re-build the projects + generate the build artifacts. cargo run -r --bin sozo -- build --manifest-path examples/spawn-and-move/Scarb.toml +cargo run -r --bin sozo -- build --manifest-path examples/spawn-and-move/Scarb.toml -P release cargo run -r --bin sozo -- build --manifest-path crates/torii/types-test/Scarb.toml +cargo run -r --bin sozo -- build --manifest-path crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.toml # Finally, to include all the examples manifest, you should re-deploy the examples. cargo run -r --bin sozo -- --offline migrate apply --manifest-path examples/spawn-and-move/Scarb.toml From 28d19dfaaa24aefec45f67aa5f7e1b3feb321986 Mon Sep 17 00:00:00 2001 From: glihm Date: Sat, 6 Jul 2024 21:23:49 -0600 Subject: [PATCH 81/88] fix: ensure metadata loading errors are correctly logged (#2149) --- bin/sozo/src/commands/auth.rs | 2 +- bin/sozo/src/commands/build.rs | 28 ++++++++++++++----- bin/sozo/src/commands/call.rs | 2 +- bin/sozo/src/commands/execute.rs | 2 +- bin/sozo/src/commands/model.rs | 2 +- bin/sozo/tests/register_test.rs | 2 +- crates/dojo-lang/src/compiler.rs | 2 +- crates/dojo-world/src/metadata.rs | 25 ++++++++++------- crates/sozo/ops/src/migration/mod.rs | 2 +- crates/sozo/ops/src/tests/migration.rs | 6 ++-- crates/sozo/ops/src/tests/setup.rs | 2 +- crates/torii/core/src/sql_test.rs | 4 +-- crates/torii/graphql/src/tests/mod.rs | 2 +- .../grpc/src/server/tests/entities_test.rs | 2 +- 14 files changed, 51 insertions(+), 32 deletions(-) diff --git a/bin/sozo/src/commands/auth.rs b/bin/sozo/src/commands/auth.rs index 550ece1124..67ab7a5016 100644 --- a/bin/sozo/src/commands/auth.rs +++ b/bin/sozo/src/commands/auth.rs @@ -64,7 +64,7 @@ impl AuthArgs { trace!(metadata=?env_metadata, "Loaded environment."); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws)?; match self.command { AuthCommand::Grant { kind, world, starknet, account, transaction } => { diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index da94807c98..8a21ef14dd 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -45,6 +45,23 @@ impl BuildArgs { pub fn run(self, config: &Config) -> Result<()> { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; + if let Ok(current_package) = ws.current_package() { + if current_package.target(&TargetKind::new("dojo")).is_none() { + return Err(anyhow::anyhow!( + "No Dojo target found in the {} package. Add [[target.dojo]] to the {} \ + manifest to enable Dojo features and compile with sozo.", + current_package.id.to_string(), + current_package.manifest_path() + )); + } + } + + // Namespaces are required to compute contracts/models data. Hence, we can't continue + // if no metadata are found. + // Once sozo will support package option, users will be able to do `-p` to select + // the package directly from the workspace instead of using `--manifest-path`. + let dojo_metadata = dojo_metadata_from_workspace(&ws)?; + let profile_name = ws.current_profile().expect("Scarb profile is expected at this point.").to_string(); @@ -126,13 +143,10 @@ impl BuildArgs { }; trace!(pluginManager=?bindgen, "Generating bindings."); - // Only generate bindgen if a current package is defined with dojo metadata. - if let Ok(dojo_metadata) = dojo_metadata_from_workspace(&ws) { - tokio::runtime::Runtime::new() - .unwrap() - .block_on(bindgen.generate(dojo_metadata.skip_migration)) - .expect("Error generating bindings"); - }; + tokio::runtime::Runtime::new() + .unwrap() + .block_on(bindgen.generate(dojo_metadata.skip_migration)) + .expect("Error generating bindings"); Ok(()) } diff --git a/bin/sozo/src/commands/call.rs b/bin/sozo/src/commands/call.rs index fcac0ac293..beb2497809 100644 --- a/bin/sozo/src/commands/call.rs +++ b/bin/sozo/src/commands/call.rs @@ -47,7 +47,7 @@ impl CallArgs { self.tag_or_address } else { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws)?; ensure_namespace(&self.tag_or_address, &default_namespace) }; diff --git a/bin/sozo/src/commands/execute.rs b/bin/sozo/src/commands/execute.rs index a100285df0..9d2dcf4faa 100644 --- a/bin/sozo/src/commands/execute.rs +++ b/bin/sozo/src/commands/execute.rs @@ -56,7 +56,7 @@ impl ExecuteArgs { self.tag_or_address } else { let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws)?; ensure_namespace(&self.tag_or_address, &default_namespace) }; diff --git a/bin/sozo/src/commands/model.rs b/bin/sozo/src/commands/model.rs index c0e1997582..5ad4d5412e 100644 --- a/bin/sozo/src/commands/model.rs +++ b/bin/sozo/src/commands/model.rs @@ -113,7 +113,7 @@ impl ModelArgs { trace!(args = ?self); let ws = scarb::ops::read_workspace(config.manifest_path(), config)?; let env_metadata = utils::load_metadata_from_config(config)?; - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws)?; config.tokio_handle().block_on(async { match self.command { diff --git a/bin/sozo/tests/register_test.rs b/bin/sozo/tests/register_test.rs index f9dd35f063..560ae8f103 100644 --- a/bin/sozo/tests/register_test.rs +++ b/bin/sozo/tests/register_test.rs @@ -28,7 +28,7 @@ async fn reregister_models() { let target_path = ws.target_dir().path_existent().unwrap().join(ws.config().profile().to_string()); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let migration = prepare_migration( source_project_dir.clone(), diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index 97eeff00b9..826d1dc4fc 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -87,7 +87,7 @@ impl Compiler for DojoCompiler { let props: Props = unit.main_component().target_props()?; let target_dir = unit.target_dir(ws); - let default_namespace = get_default_namespace_from_ws(ws); + let default_namespace = get_default_namespace_from_ws(ws)?; let compiler_config = build_compiler_config(&unit, ws); diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index 31774c5a3e..b796ae4636 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -53,10 +53,9 @@ fn build_artifact_from_filename( /// # Returns /// /// A [`String`] object containing the namespace. -pub fn get_default_namespace_from_ws(ws: &Workspace<'_>) -> String { - let metadata = dojo_metadata_from_workspace(ws) - .expect("Namespace key is already checked by the parsing of the Scarb.toml file."); - metadata.world.namespace +pub fn get_default_namespace_from_ws(ws: &Workspace<'_>) -> Result { + let metadata = dojo_metadata_from_workspace(ws)?; + Ok(metadata.world.namespace) } /// Build world metadata with data read from the project configuration. @@ -99,13 +98,18 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Result let source_dir = source_dir.join(profile.as_str()); let project_metadata = if let Ok(current_package) = ws.current_package() { - current_package.manifest.metadata.dojo()? + current_package + .manifest + .metadata + .dojo() + .with_context(|| format!("Error parsing manifest file `{}`", ws.manifest_path()))? } else { // On workspaces, dojo metadata are not accessible because if no current package is defined // (being the only package or using --package). return Err(anyhow!( - "No current package with dojo metadata found, this subcommand is not yet support for \ - workspaces." + "No current package with dojo metadata found, virtual manifest in workspace are not \ + supported. Until package compilation is supported, you will have to provide the path \ + to the Scarb.toml file using the --manifest-path option." )); }; @@ -438,13 +442,14 @@ impl MetadataExt for ManifestMetadata { .tool_metadata .as_ref() .and_then(|e| e.get("dojo")) - // TODO: see if we can make error more descriptive - .ok_or_else(|| anyhow!("Some of the fields in [tool.dojo] are required."))? + .with_context(|| "No [tool.dojo] section found in the manifest.".to_string())? .clone(); + // The details of which field has failed to be loaded are logged inside the `try_into` + // error. let project_metadata: ProjectMetadata = metadata .try_into() - .with_context(|| "Project metadata (i.e. [tool.dojo]) is not properly configured.")?; + .with_context(|| "Project metadata [tool.dojo] is not properly configured.")?; Ok(project_metadata) } diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index 281bffc1f4..fda02e8325 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -78,7 +78,7 @@ where let target_dir = ws.target_dir().path_existent().unwrap(); let target_dir = target_dir.join(ws.config().profile().as_str()); - let default_namespace = get_default_namespace_from_ws(ws); + let default_namespace = get_default_namespace_from_ws(ws)?; // Load local and remote World manifests. let (local_manifest, remote_manifest) = utils::load_world_manifests( diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 50f07a04b3..81847f2bca 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -205,7 +205,7 @@ async fn migration_with_correct_calldata_second_time_work_as_expected() { // adding correct calldata manifest.merge(overlay); } - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let mut world = WorldDiff::compute(manifest, Some(remote_manifest)); world.update_order(&default_namespace).expect("Failed to update order"); @@ -375,7 +375,7 @@ async fn migrate_with_auto_authorize() { let world_address = migration.world_address().expect("must be present"); let world = WorldContract::new(world_address, account); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let res = auto_authorize(&ws, &world, &txn_config, &manifest, &output, &default_namespace).await; assert!(res.is_ok()); @@ -408,7 +408,7 @@ async fn migration_with_mismatching_world_address_and_seed() { let base_dir = config.manifest_path().parent().unwrap().to_path_buf(); let target_dir = base_dir.join("target").join("dev"); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let strategy = prepare_migration_with_world_and_seed( base_dir, diff --git a/crates/sozo/ops/src/tests/setup.rs b/crates/sozo/ops/src/tests/setup.rs index 4ddb0f1459..664ff5e858 100644 --- a/crates/sozo/ops/src/tests/setup.rs +++ b/crates/sozo/ops/src/tests/setup.rs @@ -61,7 +61,7 @@ pub fn setup_migration(config: &Config) -> Result { let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); prepare_migration_with_world_and_seed( base_dir.into(), diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index 8477470734..b367eeab61 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -77,7 +77,7 @@ async fn test_load_from_remote() { let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let mut migration = prepare_migration( base_dir.into(), @@ -222,7 +222,7 @@ async fn test_load_from_remote_del() { let base_dir = manifest_path.parent().unwrap(); let target_dir = format!("{}/target/dev", base_dir); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let mut migration = prepare_migration( base_dir.into(), diff --git a/crates/torii/graphql/src/tests/mod.rs b/crates/torii/graphql/src/tests/mod.rs index f9b187c1e8..8bfba50696 100644 --- a/crates/torii/graphql/src/tests/mod.rs +++ b/crates/torii/graphql/src/tests/mod.rs @@ -291,7 +291,7 @@ pub async fn spinup_types_test() -> Result { let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let mut migration = prepare_migration( source_project_dir, diff --git a/crates/torii/grpc/src/server/tests/entities_test.rs b/crates/torii/grpc/src/server/tests/entities_test.rs index 8aeb9a0756..205fda416e 100644 --- a/crates/torii/grpc/src/server/tests/entities_test.rs +++ b/crates/torii/grpc/src/server/tests/entities_test.rs @@ -50,7 +50,7 @@ async fn test_entities_queries() { let target_path = ws.target_dir().path_existent().unwrap().join(config.profile().to_string()); - let default_namespace = get_default_namespace_from_ws(&ws); + let default_namespace = get_default_namespace_from_ws(&ws).unwrap(); let mut migration = prepare_migration( config.manifest_path().parent().unwrap().into(), From 2e04f54ceaa1c595e5d9ca369aaef640e189ac2a Mon Sep 17 00:00:00 2001 From: Tarrence van As Date: Sat, 6 Jul 2024 22:39:12 -0500 Subject: [PATCH 82/88] Prepare release: v1.0.0-alpha.0 (#2150) Co-authored-by: glihm --- Cargo.lock | 94 ++++++++++---------- Cargo.toml | 2 +- crates/katana/runner/runner-macro/Cargo.toml | 2 +- crates/sozo/ops/Cargo.toml | 2 +- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e116f949c..e0fe4a86b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1664,7 +1664,7 @@ dependencies = [ [[package]] name = "benches" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "clap", @@ -4199,7 +4199,7 @@ dependencies = [ [[package]] name = "common" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "reqwest 0.12.5", @@ -5068,7 +5068,7 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dojo-bindgen" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "async-trait", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", @@ -5086,15 +5086,15 @@ dependencies = [ [[package]] name = "dojo-core" -version = "0.7.3" +version = "1.0.0-alpha.0" [[package]] name = "dojo-examples-spawn-and-move" -version = "0.7.3" +version = "1.0.0-alpha.0" [[package]] name = "dojo-lang" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", @@ -5148,7 +5148,7 @@ dependencies = [ [[package]] name = "dojo-language-server" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "cairo-lang-language-server", "clap", @@ -5157,7 +5157,7 @@ dependencies = [ [[package]] name = "dojo-metrics" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "hyper 0.14.29", @@ -5175,7 +5175,7 @@ dependencies = [ [[package]] name = "dojo-test-utils" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -5210,7 +5210,7 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", "crypto-bigint", @@ -5227,7 +5227,7 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -5268,7 +5268,7 @@ dependencies = [ [[package]] name = "dojo-world-abigen" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8387,7 +8387,7 @@ dependencies = [ [[package]] name = "katana" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8395,7 +8395,7 @@ dependencies = [ "cfg-if", "clap", "clap_complete", - "common 0.7.3", + "common 1.0.0-alpha.0", "console", "dojo-metrics", "katana-core", @@ -8415,7 +8415,7 @@ dependencies = [ [[package]] name = "katana-cairo" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", @@ -8428,7 +8428,7 @@ dependencies = [ [[package]] name = "katana-codecs" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "bytes", "katana-primitives", @@ -8436,7 +8436,7 @@ dependencies = [ [[package]] name = "katana-codecs-derive" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "proc-macro2", "quote", @@ -8446,7 +8446,7 @@ dependencies = [ [[package]] name = "katana-core" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-contract 0.1.0", "alloy-network 0.1.0", @@ -8492,7 +8492,7 @@ dependencies = [ [[package]] name = "katana-db" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", @@ -8514,7 +8514,7 @@ dependencies = [ [[package]] name = "katana-executor" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8541,7 +8541,7 @@ dependencies = [ [[package]] name = "katana-node-bindings" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "serde", "serde_json", @@ -8555,7 +8555,7 @@ dependencies = [ [[package]] name = "katana-primitives" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8580,7 +8580,7 @@ dependencies = [ [[package]] name = "katana-provider" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8606,7 +8606,7 @@ dependencies = [ [[package]] name = "katana-rpc" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy", "anyhow", @@ -8650,7 +8650,7 @@ dependencies = [ [[package]] name = "katana-rpc-api" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "jsonrpsee 0.16.3", "katana-core", @@ -8661,7 +8661,7 @@ dependencies = [ [[package]] name = "katana-rpc-types" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -8683,7 +8683,7 @@ dependencies = [ [[package]] name = "katana-rpc-types-builder" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "katana-executor", @@ -8695,7 +8695,7 @@ dependencies = [ [[package]] name = "katana-runner" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -8711,7 +8711,7 @@ dependencies = [ [[package]] name = "katana-slot-controller" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "account_sdk", "alloy-primitives", @@ -8727,7 +8727,7 @@ dependencies = [ [[package]] name = "katana-tasks" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "futures", "rayon", @@ -12159,7 +12159,7 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "runner-macro" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "quote", "syn 2.0.68", @@ -12427,7 +12427,7 @@ dependencies = [ [[package]] name = "saya" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "cairo-proof-parser", @@ -12447,7 +12447,7 @@ dependencies = [ [[package]] name = "saya-core" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -12491,7 +12491,7 @@ dependencies = [ [[package]] name = "saya-provider" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "alloy-primitives", "anyhow", @@ -12664,7 +12664,7 @@ dependencies = [ [[package]] name = "scheduler" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "clap", "katana-primitives", @@ -13345,7 +13345,7 @@ dependencies = [ [[package]] name = "sozo" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "account_sdk", "anyhow", @@ -13406,7 +13406,7 @@ dependencies = [ [[package]] name = "sozo-ops" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "assert_fs", @@ -13459,7 +13459,7 @@ dependencies = [ [[package]] name = "sozo-signers" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "starknet 0.11.0", @@ -14935,7 +14935,7 @@ checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] name = "torii" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -14943,7 +14943,7 @@ dependencies = [ "camino", "chrono", "clap", - "common 0.7.3", + "common 1.0.0-alpha.0", "ctrlc", "dojo-metrics", "dojo-types", @@ -14980,7 +14980,7 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "async-trait", "camino", @@ -15009,7 +15009,7 @@ dependencies = [ [[package]] name = "torii-core" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -15048,7 +15048,7 @@ dependencies = [ [[package]] name = "torii-graphql" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "async-graphql", @@ -15089,7 +15089,7 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "bytes", "camino", @@ -15135,7 +15135,7 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "anyhow", "async-trait", @@ -15172,7 +15172,7 @@ dependencies = [ [[package]] name = "torii-server" -version = "0.7.3" +version = "1.0.0-alpha.0" dependencies = [ "base64 0.21.7", "http 0.2.12", @@ -15474,7 +15474,7 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "types-test" -version = "0.7.3" +version = "1.0.0-alpha.0" [[package]] name = "u256-literal" diff --git a/Cargo.toml b/Cargo.toml index a63f5e5799..0af6014b06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ edition = "2021" license = "Apache-2.0" license-file = "LICENSE" repository = "https://github.com/dojoengine/dojo/" -version = "0.7.3" +version = "1.0.0-alpha.0" [profile.performance] codegen-units = 1 diff --git a/crates/katana/runner/runner-macro/Cargo.toml b/crates/katana/runner/runner-macro/Cargo.toml index bc5896c2f2..61918e2068 100644 --- a/crates/katana/runner/runner-macro/Cargo.toml +++ b/crates/katana/runner/runner-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runner-macro" -version = "0.7.3" +version = "1.0.0-alpha.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/sozo/ops/Cargo.toml b/crates/sozo/ops/Cargo.toml index f88f3c6f04..443b2eadb6 100644 --- a/crates/sozo/ops/Cargo.toml +++ b/crates/sozo/ops/Cargo.toml @@ -54,4 +54,4 @@ assert_fs.workspace = true dojo-test-utils = { workspace = true, features = [ "build-examples" ] } ipfs-api-backend-hyper = { git = "https://github.com/ferristseng/rust-ipfs-api", rev = "af2c17f7b19ef5b9898f458d97a90055c3605633", features = [ "with-hyper-rustls" ] } katana-runner.workspace = true -tee = "0.1.0" \ No newline at end of file +tee = "0.1.0" From ff30e1d8a78c1ddba9f3dec30d6e13cd955e5558 Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 7 Jul 2024 07:22:15 -0600 Subject: [PATCH 83/88] devcontainer: bump rust to 1.79 --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 66bba6e674..471f71cf32 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -26,7 +26,7 @@ ENV LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 ENV TABLEGEN_170_PREFIX=/usr/lib/llvm-17 # To allow independent workflow of the container, the rust-toolchain is explicitely given. -RUN echo "1.76.0" > rust_toolchain_version +RUN echo "1.79.0" > rust_toolchain_version # Install cargo-binstall RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash From 7f5514d2a5be8d5aa127772e56f55fc336b389b5 Mon Sep 17 00:00:00 2001 From: lambda-0x <0xlambda@protonmail.com> Date: Mon, 8 Jul 2024 07:54:19 +0530 Subject: [PATCH 84/88] refactor: update manifest structure (#2153) * update manifest structure * fix abi path in manifest * fix test * fix: fix typo and remove dbg --------- Co-authored-by: glihm --- bin/sozo/src/commands/clean.rs | 55 ++++++----- bin/sozo/src/commands/migrate.rs | 4 +- crates/benches/src/deployer.rs | 4 +- crates/dojo-lang/src/compiler.rs | 20 ++-- .../contracts/ccf-cairo_v240-8d921297.json | 0 .../contracts/ccf-cairo_v260-465ec7fe.json | 0 .../{abis/base => base/abis}/dojo-base.json | 0 .../{abis/base => base/abis}/dojo-world.json | 0 .../contracts/ccf-cairo_v240-8d921297.toml | 2 +- .../contracts/ccf-cairo_v260-465ec7fe.toml | 2 +- .../manifests/dev/base/dojo-base.toml | 2 +- .../manifests/dev/base/dojo-world.toml | 2 +- crates/dojo-world/src/manifest/mod.rs | 10 +- crates/dojo-world/src/metadata.rs | 2 +- crates/dojo-world/src/metadata_test.rs | 2 +- crates/sozo/ops/src/migration/migrate.rs | 44 ++++++--- crates/torii/core/src/sql_test.rs | 1 - .../dojo_examples-actions-40b6994c.json | 0 .../dojo_examples-mock_token-31599eb2.json | 0 .../dojo_examples-others-61de2c18.json | 0 .../{abis/base => base/abis}/dojo-base.json | 0 .../{abis/base => base/abis}/dojo-world.json | 0 ...examples-ContractInitialized-376b7bd6.json | 0 .../dojo_examples-Message-1bb1d226.json | 0 .../dojo_examples-MockToken-38903c7c.json | 0 .../models/dojo_examples-Moved-318ae40d.json | 0 .../models/dojo_examples-Moves-2e2accba.json | 0 .../dojo_examples-PlayerConfig-3adad785.json | 0 .../dojo_examples-Position-1e145e26.json | 0 .../dojo_examples-ServerProfile-4caad1e6.json | 0 .../dojo_examples-actions-40b6994c.toml | 2 +- .../dojo_examples-mock_token-31599eb2.toml | 2 +- .../dojo_examples-others-61de2c18.toml | 2 +- .../manifests/dev/base/dojo-base.toml | 2 +- .../manifests/dev/base/dojo-world.toml | 2 +- ...examples-ContractInitialized-376b7bd6.toml | 2 +- .../dojo_examples-Message-1bb1d226.toml | 2 +- .../dojo_examples-MockToken-38903c7c.toml | 2 +- .../models/dojo_examples-Moved-318ae40d.toml | 2 +- .../models/dojo_examples-Moves-2e2accba.toml | 2 +- .../dojo_examples-PlayerConfig-3adad785.toml | 2 +- .../dojo_examples-Position-1e145e26.toml | 2 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 2 +- .../dojo_examples-actions-40b6994c.json | 0 .../dojo_examples-mock_token-31599eb2.json | 0 .../dojo_examples-others-61de2c18.json | 0 .../deployment/abis}/dojo-base.json | 0 .../abis}/dojo-world.json | 0 ...examples-ContractInitialized-376b7bd6.json | 0 .../dojo_examples-Message-1bb1d226.json | 0 .../dojo_examples-MockToken-38903c7c.json | 0 .../models/dojo_examples-Moved-318ae40d.json | 0 .../models/dojo_examples-Moves-2e2accba.json | 0 .../dojo_examples-PlayerConfig-3adad785.json | 0 .../dojo_examples-Position-1e145e26.json | 0 .../dojo_examples-ServerProfile-4caad1e6.json | 0 .../dev/{ => deployment}/manifest.json | 2 +- .../dev/{ => deployment}/manifest.toml | 26 ++--- .../dojo_examples-actions-40b6994c.json | 0 .../dojo_examples-mock_token-31599eb2.json | 0 .../dojo_examples-others-61de2c18.json | 0 .../release/base/abis/dojo-base.json | 98 +++++++++++++++++++ .../{abis/base => base/abis}/dojo-world.json | 0 ...examples-ContractInitialized-376b7bd6.json | 0 .../dojo_examples-Message-1bb1d226.json | 0 .../dojo_examples-MockToken-38903c7c.json | 0 .../models/dojo_examples-Moved-318ae40d.json | 0 .../models/dojo_examples-Moves-2e2accba.json | 0 .../dojo_examples-PlayerConfig-3adad785.json | 0 .../dojo_examples-Position-1e145e26.json | 0 .../dojo_examples-ServerProfile-4caad1e6.json | 0 .../dojo_examples-actions-40b6994c.toml | 2 +- .../dojo_examples-mock_token-31599eb2.toml | 2 +- .../dojo_examples-others-61de2c18.toml | 2 +- .../manifests/release/base/dojo-base.toml | 2 +- .../manifests/release/base/dojo-world.toml | 2 +- ...examples-ContractInitialized-376b7bd6.toml | 2 +- .../dojo_examples-Message-1bb1d226.toml | 2 +- .../dojo_examples-MockToken-38903c7c.toml | 2 +- .../models/dojo_examples-Moved-318ae40d.toml | 2 +- .../models/dojo_examples-Moves-2e2accba.toml | 2 +- .../dojo_examples-PlayerConfig-3adad785.toml | 2 +- .../dojo_examples-Position-1e145e26.toml | 2 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 2 +- 84 files changed, 224 insertions(+), 104 deletions(-) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/contracts/ccf-cairo_v240-8d921297.json (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/contracts/ccf-cairo_v260-465ec7fe.json (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/dojo-base.json (100%) rename crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/{abis/base => base/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/contracts/dojo_examples-actions-40b6994c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/contracts/dojo_examples-mock_token-31599eb2.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/contracts/dojo_examples-others-61de2c18.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/dojo-base.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-ContractInitialized-376b7bd6.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Message-1bb1d226.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-MockToken-38903c7c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Moved-318ae40d.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Moves-2e2accba.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-PlayerConfig-3adad785.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-Position-1e145e26.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/base => base/abis}/models/dojo_examples-ServerProfile-4caad1e6.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/contracts/dojo_examples-actions-40b6994c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/contracts/dojo_examples-mock_token-31599eb2.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/contracts/dojo_examples-others-61de2c18.json (100%) rename examples/spawn-and-move/manifests/{release/abis/base => dev/deployment/abis}/dojo-base.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-ContractInitialized-376b7bd6.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Message-1bb1d226.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-MockToken-38903c7c.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Moved-318ae40d.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Moves-2e2accba.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-PlayerConfig-3adad785.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-Position-1e145e26.json (100%) rename examples/spawn-and-move/manifests/dev/{abis/deployments => deployment/abis}/models/dojo_examples-ServerProfile-4caad1e6.json (100%) rename examples/spawn-and-move/manifests/dev/{ => deployment}/manifest.json (99%) rename examples/spawn-and-move/manifests/dev/{ => deployment}/manifest.toml (85%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/contracts/dojo_examples-actions-40b6994c.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/contracts/dojo_examples-mock_token-31599eb2.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/contracts/dojo_examples-others-61de2c18.json (100%) create mode 100644 examples/spawn-and-move/manifests/release/base/abis/dojo-base.json rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/dojo-world.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-ContractInitialized-376b7bd6.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Message-1bb1d226.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-MockToken-38903c7c.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Moved-318ae40d.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Moves-2e2accba.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-PlayerConfig-3adad785.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-Position-1e145e26.json (100%) rename examples/spawn-and-move/manifests/release/{abis/base => base/abis}/models/dojo_examples-ServerProfile-4caad1e6.json (100%) diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 54650fcd96..59a76f15c1 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -3,7 +3,7 @@ use std::fs; use anyhow::{Context, Result}; use camino::Utf8PathBuf; use clap::Args; -use dojo_world::manifest::{ABIS_DIR, BASE_DIR, MANIFESTS_DIR}; +use dojo_world::manifest::{BASE_DIR, MANIFESTS_DIR}; use scarb::core::Config; use scarb::ops; use tracing::trace; @@ -28,7 +28,7 @@ impl CleanArgs { /// * `profile_dir` - The directory where the profile files are located. pub fn clean_manifests(profile_dir: &Utf8PathBuf) -> Result<()> { trace!(?profile_dir, "Cleaning manifests."); - let dirs = vec![profile_dir.join(BASE_DIR), profile_dir.join(ABIS_DIR).join(BASE_DIR)]; + let dirs = vec![profile_dir.join(BASE_DIR)]; for d in dirs { if d.exists() { @@ -96,6 +96,8 @@ impl CleanArgs { #[cfg(test)] mod tests { use dojo_test_utils::compiler; + use dojo_world::manifest::DEPLOYMENT_DIR; + use dojo_world::metadata::ABIS_DIR; use scarb::compiler::Profile; use super::*; @@ -111,6 +113,8 @@ mod tests { Profile::DEV, ); + println!("path {:?}", config.manifest_path()); + let temp_project_dir = config.manifest_path().parent().unwrap().to_path_buf(); let clean_cmd = CleanArgs { full: false, all_profiles: false }; @@ -126,14 +130,14 @@ mod tests { let release_manifests_dir = temp_project_dir.join("manifests").join(release_profile_name); let dev_manifests_base_dir = dev_manifests_dir.join("base"); - let dev_manifests_abis_base_dir = dev_manifests_dir.join("abis").join("base"); + let dev_manifests_abis_base_dir = dev_manifests_dir.join("base").join("abis"); let release_manifests_base_dir = release_manifests_dir.join("base"); - let release_manifests_abis_base_dir = release_manifests_dir.join("abis").join("base"); - - let dev_manifests_abis_depl_dir = dev_manifests_dir.join("abis").join("deployments"); + let release_manifests_abis_base_dir = release_manifests_dir.join("base").join("abis"); - let dev_manifest_toml = dev_manifests_dir.join("manifest").with_extension("toml"); - let dev_manifest_json = dev_manifests_dir.join("manifest").with_extension("json"); + let dev_manifests_depl_dir = dev_manifests_dir.join("deployment"); + let dev_manifests_abis_depl_dir = dev_manifests_depl_dir.join("abis"); + let dev_manifest_toml = dev_manifests_depl_dir.join("manifest").with_extension("toml"); + let dev_manifest_json = dev_manifests_depl_dir.join("manifest").with_extension("json"); assert!(fs::read_dir(target_dev_dir).is_err(), "Expected 'target/dev' to be empty"); assert!( @@ -147,11 +151,11 @@ mod tests { ); assert!( fs::read_dir(dev_manifests_abis_base_dir).is_err(), - "Expected 'manifests/dev/abis/base' to be empty" + "Expected 'manifests/dev/base/abis' to be empty" ); assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_ok(), - "Expected 'manifests/dev/abis/deployments' to not be empty" + "Expected 'manifests/dev/deployment/abis' to not be empty" ); // we expect release profile to be not affected @@ -161,7 +165,7 @@ mod tests { ); assert!( fs::read_dir(release_manifests_abis_base_dir).is_ok(), - "Expected 'manifests/release/abis/base' to be non empty" + "Expected 'manifests/release/base/abis' to be non empty" ); assert!(dev_manifest_toml.exists(), "Expected 'manifest.toml' to exist"); @@ -172,7 +176,7 @@ mod tests { assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_err(), - "Expected 'manifests/dev/abis/deployments' to be empty" + "Expected 'manifests/dev/deployment/abis' to be empty" ); assert!(!dev_manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); assert!(!dev_manifest_json.exists(), "Expected 'manifest.json' to not exist"); @@ -200,18 +204,19 @@ mod tests { let target_dev_dir = temp_project_dir.join("target").join(dev_profile_name); let target_release_dir = temp_project_dir.join("target").join(release_profile_name); - let dev_manifests_dir = temp_project_dir.join("manifests").join(dev_profile_name); - let release_manifests_dir = temp_project_dir.join("manifests").join(release_profile_name); + let dev_manifests_dir = temp_project_dir.join(MANIFESTS_DIR).join(dev_profile_name); + let release_manifests_dir = temp_project_dir.join(MANIFESTS_DIR).join(release_profile_name); - let dev_manifests_base_dir = dev_manifests_dir.join("base"); - let dev_manifests_abis_base_dir = dev_manifests_dir.join("abis").join("base"); - let release_manifests_base_dir = release_manifests_dir.join("base"); - let release_manifests_abis_base_dir = release_manifests_dir.join("abis").join("base"); + let dev_manifests_base_dir = dev_manifests_dir.join(BASE_DIR); + let dev_manifests_abis_base_dir = dev_manifests_base_dir.join(ABIS_DIR); + let release_manifests_base_dir = release_manifests_dir.join(BASE_DIR); + let release_manifests_abis_base_dir = release_manifests_base_dir.join(ABIS_DIR); - let dev_manifests_abis_depl_dir = dev_manifests_dir.join("abis").join("deployments"); + let dev_manifests_deploy_dir = dev_manifests_dir.join(DEPLOYMENT_DIR); + let dev_manifests_abis_depl_dir = dev_manifests_deploy_dir.join(ABIS_DIR); - let dev_manifest_toml = dev_manifests_dir.join("manifest").with_extension("toml"); - let dev_manifest_json = dev_manifests_dir.join("manifest").with_extension("json"); + let dev_manifest_toml = dev_manifests_deploy_dir.join("manifest").with_extension("toml"); + let dev_manifest_json = dev_manifests_deploy_dir.join("manifest").with_extension("json"); assert!(fs::read_dir(target_dev_dir).is_err(), "Expected 'target/dev' to be empty"); assert!(fs::read_dir(target_release_dir).is_err(), "Expected 'target/release' to be empty"); @@ -222,11 +227,11 @@ mod tests { ); assert!( fs::read_dir(dev_manifests_abis_base_dir).is_err(), - "Expected 'manifests/dev/abis/base' to be empty" + "Expected 'manifests/dev/base/abis' to be empty" ); assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_ok(), - "Expected 'manifests/dev/abis/deployments' to not be empty" + "Expected 'manifests/dev/deployment/abis' to not be empty" ); assert!( @@ -235,7 +240,7 @@ mod tests { ); assert!( fs::read_dir(release_manifests_abis_base_dir).is_err(), - "Expected 'manifests/release/abis/base' to be empty" + "Expected 'manifests/release/base/abis' to be empty" ); assert!(dev_manifest_toml.exists(), "Expected 'manifest.toml' to exist"); @@ -246,7 +251,7 @@ mod tests { assert!( fs::read_dir(&dev_manifests_abis_depl_dir).is_err(), - "Expected 'manifests/dev/abis/deployments' to be empty" + "Expected 'manifests/dev/deployment/abis' to be empty" ); assert!(!dev_manifest_toml.exists(), "Expected 'manifest.toml' to not exist"); assert!(!dev_manifest_json.exists(), "Expected 'manifest.json' to not exist"); diff --git a/bin/sozo/src/commands/migrate.rs b/bin/sozo/src/commands/migrate.rs index c697a15e7c..cc0b28559a 100644 --- a/bin/sozo/src/commands/migrate.rs +++ b/bin/sozo/src/commands/migrate.rs @@ -81,8 +81,10 @@ impl MigrateArgs { None }; + let profile_name = + ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); - if !manifest_dir.join(MANIFESTS_DIR).exists() { + if !manifest_dir.join(MANIFESTS_DIR).join(profile_name).exists() { return Err(anyhow!("Build project using `sozo build` first")); } diff --git a/crates/benches/src/deployer.rs b/crates/benches/src/deployer.rs index 9dcf7e961e..ad4db203a1 100644 --- a/crates/benches/src/deployer.rs +++ b/crates/benches/src/deployer.rs @@ -5,7 +5,7 @@ use anyhow::{anyhow, bail, Context, Ok, Result}; use clap::Parser; use dojo_lang::compiler::DojoCompiler; use dojo_lang::plugin::CairoPluginRepository; -use dojo_world::manifest::{DeploymentManifest, DEPLOYMENTS_DIR, MANIFESTS_DIR}; +use dojo_world::manifest::{DeploymentManifest, DEPLOYMENT_DIR, MANIFESTS_DIR}; use futures::executor::block_on; use katana_runner::KatanaRunner; use scarb::compiler::CompilerRepository; @@ -97,7 +97,7 @@ async fn prepare_migration_args(args: SozoArgs) -> Result { let manifest_dir = manifest_path.parent().unwrap(); let manifest = DeploymentManifest::load_from_path( - &manifest_dir.join(MANIFESTS_DIR).join("dev").join(DEPLOYMENTS_DIR).with_extension("toml"), + &manifest_dir.join(MANIFESTS_DIR).join("dev").join(DEPLOYMENT_DIR).with_extension("toml"), ) .expect("failed to load manifest"); diff --git a/crates/dojo-lang/src/compiler.rs b/crates/dojo-lang/src/compiler.rs index 826d1dc4fc..54e4f631b6 100644 --- a/crates/dojo-lang/src/compiler.rs +++ b/crates/dojo-lang/src/compiler.rs @@ -223,10 +223,12 @@ fn update_files( ) -> anyhow::Result<()> { let profile_name = ws.current_profile().expect("Scarb profile expected to be defined.").to_string(); - let profile_dir = Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name); + let relative_manifest_dir = Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name); + + // relative path to manifests and abi + let base_manifests_dir = Utf8PathBuf::new().join(relative_manifest_dir).join(BASE_DIR); + let base_abis_dir = Utf8PathBuf::new().join(&base_manifests_dir).join(ABIS_DIR); - let relative_manifests_dir = Utf8PathBuf::new().join(&profile_dir).join(BASE_DIR); - let relative_abis_dir = Utf8PathBuf::new().join(&profile_dir).join(ABIS_DIR).join(BASE_DIR); let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); fn get_compiled_artifact_from_map<'a>( @@ -247,8 +249,8 @@ fn update_files( let (hash, class) = get_compiled_artifact_from_map(&compiled_artifacts, qualified_path)?; let filename = naming::get_filename_from_tag(tag); write_manifest_and_abi( - &relative_manifests_dir, - &relative_abis_dir, + &base_manifests_dir, + &base_abis_dir, &manifest_dir, &mut Manifest::new( // abi path will be written by `write_manifest` @@ -334,8 +336,8 @@ fn update_files( for (_, (manifest, class, module_id)) in contracts.iter_mut() { write_manifest_and_abi( - &relative_manifests_dir.join(CONTRACTS_DIR), - &relative_abis_dir.join(CONTRACTS_DIR), + &base_manifests_dir.join(CONTRACTS_DIR), + &base_abis_dir.join(CONTRACTS_DIR), &manifest_dir, manifest, &class.abi, @@ -360,8 +362,8 @@ fn update_files( for (_, (manifest, class, module_id)) in models.iter_mut() { write_manifest_and_abi( - &relative_manifests_dir.join(MODELS_DIR), - &relative_abis_dir.join(MODELS_DIR), + &base_manifests_dir.join(MODELS_DIR), + &base_abis_dir.join(MODELS_DIR), &manifest_dir, manifest, &class.abi, diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-base.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-base.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json similarity index 100% rename from crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/abis/base/dojo-world.json rename to crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/abis/dojo-world.json diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml index be3fb94735..2dc026c126 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" original_class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json" +abi = "manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json" reads = [] writes = [] computed = [] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml index f4443a58d4..df70ed0ff9 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" original_class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json" +abi = "manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json" reads = [] writes = [] computed = [] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml index 4e2fc2e0bb..35f4edd8d1 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/base/dojo-base.json" +abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml index 94821ba3f7..2e7374451b 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "manifests/dev/abis/base/dojo-world.json" +abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-world/src/manifest/mod.rs b/crates/dojo-world/src/manifest/mod.rs index 876a1f814e..48397654f3 100644 --- a/crates/dojo-world/src/manifest/mod.rs +++ b/crates/dojo-world/src/manifest/mod.rs @@ -41,10 +41,10 @@ pub const WORLD_QUALIFIED_PATH: &str = "dojo::world::world"; pub const BASE_QUALIFIED_PATH: &str = "dojo::base::base"; pub const MANIFESTS_DIR: &str = "manifests"; +pub const DEPLOYMENT_DIR: &str = "deployment"; pub const TARGET_DIR: &str = "target"; pub const BASE_DIR: &str = "base"; pub const OVERLAYS_DIR: &str = "overlays"; -pub const DEPLOYMENTS_DIR: &str = "deployments"; pub const ABIS_DIR: &str = "abis"; pub const CONTRACTS_DIR: &str = "contracts"; @@ -366,25 +366,25 @@ impl DeploymentManifest { Ok(()) } - pub fn write_to_path_json(&self, path: &Utf8PathBuf, profile_dir: &Utf8PathBuf) -> Result<()> { + pub fn write_to_path_json(&self, path: &Utf8PathBuf, root_dir: &Utf8PathBuf) -> Result<()> { fs::create_dir_all(path.parent().unwrap())?; // Embedding ABIs into the manifest. let mut manifest_with_abis = self.clone(); if let Some(abi_format) = &manifest_with_abis.world.inner.abi { - manifest_with_abis.world.inner.abi = Some(abi_format.to_embed(profile_dir)?); + manifest_with_abis.world.inner.abi = Some(abi_format.to_embed(root_dir)?); } for contract in &mut manifest_with_abis.contracts { if let Some(abi_format) = &contract.inner.abi { - contract.inner.abi = Some(abi_format.to_embed(profile_dir)?); + contract.inner.abi = Some(abi_format.to_embed(root_dir)?); } } for model in &mut manifest_with_abis.models { if let Some(abi_format) = &model.inner.abi { - model.inner.abi = Some(abi_format.to_embed(profile_dir)?); + model.inner.abi = Some(abi_format.to_embed(root_dir)?); } } diff --git a/crates/dojo-world/src/metadata.rs b/crates/dojo-world/src/metadata.rs index b796ae4636..e948cf2ada 100644 --- a/crates/dojo-world/src/metadata.rs +++ b/crates/dojo-world/src/metadata.rs @@ -93,7 +93,7 @@ pub fn dojo_metadata_from_workspace(ws: &Workspace<'_>) -> Result let manifest_dir = ws.manifest_path().parent().unwrap().to_path_buf(); let manifest_dir = manifest_dir.join(MANIFESTS_DIR).join(profile.as_str()); - let abi_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); + let abi_dir = manifest_dir.join(BASE_DIR).join(ABIS_DIR); let source_dir = ws.target_dir().path_existent().unwrap(); let source_dir = source_dir.join(profile.as_str()); diff --git a/crates/dojo-world/src/metadata_test.rs b/crates/dojo-world/src/metadata_test.rs index adf9156617..ff32eda35c 100644 --- a/crates/dojo-world/src/metadata_test.rs +++ b/crates/dojo-world/src/metadata_test.rs @@ -131,7 +131,7 @@ async fn get_full_dojo_metadata_from_workspace() { let manifest_dir = manifest_dir.join(MANIFESTS_DIR).join(profile.as_str()); let target_dir = ws.target_dir().path_existent().unwrap(); let target_dir = target_dir.join(profile.as_str()); - let abis_dir = manifest_dir.join(ABIS_DIR).join(BASE_DIR); + let abis_dir = manifest_dir.join(BASE_DIR).join(ABIS_DIR); let dojo_metadata = dojo_metadata_from_workspace(&ws).expect("No current package with dojo metadata found."); diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index e2fcfcecbc..c38c40b0f2 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -9,9 +9,9 @@ use dojo_world::contracts::naming::{ }; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ - AbiFormat, BaseManifest, DeploymentManifest, DojoContract, DojoModel, Manifest, + AbiFormat, BaseManifest, Class, DeploymentManifest, DojoContract, DojoModel, Manifest, ManifestMethods, WorldContract as ManifestWorldContract, WorldMetadata, ABIS_DIR, BASE_DIR, - DEPLOYMENTS_DIR, MANIFESTS_DIR, + DEPLOYMENT_DIR, MANIFESTS_DIR, }; use dojo_world::metadata::{dojo_metadata_from_workspace, ResourceMetadata}; use dojo_world::migration::class::ClassMigration; @@ -807,8 +807,10 @@ pub async fn update_manifests_and_abis( let ui = ws.config().ui(); ui.print_step(5, "✨", "Updating manifests..."); - let deployed_path = manifest_dir.join("manifest").with_extension("toml"); - let deployed_path_json = manifest_dir.join("manifest").with_extension("json"); + let deployment_dir = manifest_dir.join(DEPLOYMENT_DIR); + + let deployed_path = deployment_dir.join("manifest").with_extension("toml"); + let deployed_path_json = deployment_dir.join("manifest").with_extension("json"); let mut local_manifest: DeploymentManifest = local_manifest.into(); @@ -862,12 +864,19 @@ pub async fn update_manifests_and_abis( } }); - // copy abi files from `abi/base` to `abi/deployments/{chain_id}` and update abi path in + // copy abi files from `base/abi` to `deployment/abi` and update abi path in // local_manifest update_manifest_abis(&mut local_manifest, manifest_dir, profile_name).await; - local_manifest.write_to_path_toml(&deployed_path)?; - local_manifest.write_to_path_json(&deployed_path_json, manifest_dir)?; + local_manifest + .write_to_path_toml(&deployed_path) + .with_context(|| "Failed to write toml manifest")?; + + let root_dir = ws.manifest_path().parent().unwrap().to_path_buf(); + + local_manifest + .write_to_path_json(&deployed_path_json, &root_dir) + .with_context(|| "Failed to write json manifest")?; ui.print("\n✨ Done."); Ok(()) @@ -887,25 +896,26 @@ async fn update_manifest_abis( ) where T: ManifestMethods, { - // manifests/dev/abis/base/contract/dojo-world.json -> abis/base/contract/dojo-world.json let base_relative_path = manifest.inner.abi().unwrap().to_path().unwrap(); + + // manifests/dev/base/abis/contract/contract.json -> base/abis/contract/contract.json let base_relative_path = base_relative_path .strip_prefix(Utf8PathBuf::new().join(MANIFESTS_DIR).join(profile_name)) .unwrap(); - // abis/base/dojo-world.json -> dojo-world.json + // base/abis/contract/contract.json -> contract/contract.json let stripped_path = base_relative_path - .strip_prefix(Utf8PathBuf::new().join(ABIS_DIR).join(BASE_DIR)) + .strip_prefix(Utf8PathBuf::new().join(BASE_DIR).join(ABIS_DIR)) .unwrap(); - // abis/deployments/dojo-world.json + // deployment/abis/dojo-world.json let deployed_relative_path = - Utf8PathBuf::new().join(ABIS_DIR).join(DEPLOYMENTS_DIR).join(stripped_path); + Utf8PathBuf::new().join(DEPLOYMENT_DIR).join(ABIS_DIR).join(stripped_path); - // /abis/base/dojo-world.json + // /base/abis/dojo-world.json let full_base_path = manifest_dir.join(base_relative_path); - // /abis/deployments/dojo-world.json + // /deployment/abis/dojo-world.json let full_deployed_path = manifest_dir.join(deployed_relative_path.clone()); fs::create_dir_all(full_deployed_path.parent().unwrap()) @@ -914,12 +924,16 @@ async fn update_manifest_abis( fs::copy(full_base_path, full_deployed_path).await.expect("Failed to copy abi file"); - manifest.inner.set_abi(Some(AbiFormat::Path(deployed_relative_path))); + manifest.inner.set_abi(Some(AbiFormat::Path( + Utf8PathBuf::from(MANIFESTS_DIR).join(profile_name).join(deployed_relative_path), + ))); } inner_helper::(manifest_dir, profile_name, &mut local_manifest.world) .await; + inner_helper::(manifest_dir, profile_name, &mut local_manifest.base).await; + for contract in local_manifest.contracts.iter_mut() { inner_helper::(manifest_dir, profile_name, contract).await; } diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index b367eeab61..a1d3d55e37 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -64,7 +64,6 @@ async fn test_load_from_remote() { SqliteConnectOptions::from_str("sqlite::memory:").unwrap().create_if_missing(true); let pool = SqlitePoolOptions::new().max_connections(5).connect_with(options).await.unwrap(); sqlx::migrate!("../migrations").run(&pool).await.unwrap(); - let source_project_dir = Utf8PathBuf::from("../../../examples/spawn-and-move/"); let dojo_core_path = Utf8PathBuf::from("../../dojo-core"); diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json rename to examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json rename to examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json rename to examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/dojo-base.json rename to examples/spawn-and-move/manifests/dev/base/abis/dojo-base.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json b/examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/dojo-world.json rename to examples/spawn-and-move/manifests/dev/base/abis/dojo-world.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json diff --git a/examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json rename to examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml index 34d9543e28..99bc7921ee 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples-actions-40b6994c.json" +abi = "manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml index 1a2a64dea4..a0d11e457e 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml index 31438c1f0f..07b05e0714 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x0" -abi = "manifests/dev/abis/base/contracts/dojo_examples-others-61de2c18.json" +abi = "manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-base.toml b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml index 4e2fc2e0bb..35f4edd8d1 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-base.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/base/dojo-base.json" +abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml index 94821ba3f7..2e7374451b 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "manifests/dev/abis/base/dojo-world.json" +abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index 0aacc170a4..f226e89204 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "manifests/dev/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml index 698d0a8f0e..1a2e2802f7 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "manifests/dev/abis/base/models/dojo_examples-Message-1bb1d226.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml index b607d23d57..23435c0a3a 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "manifests/dev/abis/base/models/dojo_examples-MockToken-38903c7c.json" +abi = "manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml index c8e044bd5a..b90e61eafe 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "manifests/dev/abis/base/models/dojo_examples-Moved-318ae40d.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml index 0a661e61c7..c652d944a0 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "manifests/dev/abis/base/models/dojo_examples-Moves-2e2accba.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml index a83db11151..22d3ca018e 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "manifests/dev/abis/base/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml index 6eea086fef..db21e81459 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "manifests/dev/abis/base/models/dojo_examples-Position-1e145e26.json" +abi = "manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml index 4b77f78c88..4055b284ec 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "manifests/dev/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-actions-40b6994c.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/contracts/dojo_examples-others-61de2c18.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo-base.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/dojo-base.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/dojo-base.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json b/examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/dojo-world.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/dojo-world.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Message-1bb1d226.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-MockToken-38903c7c.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Moves-2e2accba.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-Position-1e145e26.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json diff --git a/examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 100% rename from examples/spawn-and-move/manifests/dev/abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json rename to examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json diff --git a/examples/spawn-and-move/manifests/dev/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json similarity index 99% rename from examples/spawn-and-move/manifests/dev/manifest.json rename to examples/spawn-and-move/manifests/dev/deployment/manifest.json index 162816500f..655b688a82 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1122,7 +1122,7 @@ "kind": "Class", "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "abi": "manifests/dev/abis/base/dojo-base.json", + "abi": "manifests/dev/deployment/abis/dojo-base.json", "tag": "dojo-base", "manifest_name": "dojo-base" }, diff --git a/examples/spawn-and-move/manifests/dev/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml similarity index 85% rename from examples/spawn-and-move/manifests/dev/manifest.toml rename to examples/spawn-and-move/manifests/dev/deployment/manifest.toml index ad80716ce8..7097b14bc4 100644 --- a/examples/spawn-and-move/manifests/dev/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml @@ -2,7 +2,7 @@ kind = "WorldContract" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "abis/deployments/dojo-world.json" +abi = "manifests/dev/deployment/abis/dojo-world.json" address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" transaction_hash = "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287" block_number = 3 @@ -17,7 +17,7 @@ rpc_url = "http://localhost:5050/" kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/dev/abis/base/dojo-base.json" +abi = "manifests/dev/deployment/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" @@ -27,7 +27,7 @@ address = "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "abis/deployments/contracts/dojo_examples-actions-40b6994c.json" +abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [ "dojo_examples-Moves", @@ -44,7 +44,7 @@ address = "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "abis/deployments/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] @@ -58,7 +58,7 @@ address = "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "abis/deployments/contracts/dojo_examples-others-61de2c18.json" +abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] @@ -74,7 +74,7 @@ manifest_name = "dojo_examples-others-61de2c18" kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "abis/deployments/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" @@ -97,7 +97,7 @@ key = false kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "abis/deployments/models/dojo_examples-Message-1bb1d226.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" @@ -125,7 +125,7 @@ key = true kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "abis/deployments/models/dojo_examples-MockToken-38903c7c.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" @@ -143,7 +143,7 @@ key = false kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "abis/deployments/models/dojo_examples-Moved-318ae40d.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" @@ -161,7 +161,7 @@ key = false kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "abis/deployments/models/dojo_examples-Moves-2e2accba.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" @@ -184,7 +184,7 @@ key = false kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "abis/deployments/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" @@ -212,7 +212,7 @@ key = false kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "abis/deployments/models/dojo_examples-Position-1e145e26.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" @@ -230,7 +230,7 @@ key = false kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "abis/deployments/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json rename to examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json rename to examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json rename to examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json diff --git a/examples/spawn-and-move/manifests/release/base/abis/dojo-base.json b/examples/spawn-and-move/manifests/release/base/abis/dojo-base.json new file mode 100644 index 0000000000..ee9ceaac66 --- /dev/null +++ b/examples/spawn-and-move/manifests/release/base/abis/dojo-base.json @@ -0,0 +1,98 @@ +[ + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::components::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::components::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::components::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::components::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "dojo::base::base::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::components::upgradeable::upgradeable::Event", + "kind": "flat" + } + ] + } +] \ No newline at end of file diff --git a/examples/spawn-and-move/manifests/release/abis/base/dojo-world.json b/examples/spawn-and-move/manifests/release/base/abis/dojo-world.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/dojo-world.json rename to examples/spawn-and-move/manifests/release/base/abis/dojo-world.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json diff --git a/examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json similarity index 100% rename from examples/spawn-and-move/manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json rename to examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml index d50705247c..dd16bfa324 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples-actions-40b6994c.json" +abi = "manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml index b9109222f9..e11d4ceb3c 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples-mock_token-31599eb2.json" +abi = "manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml index 2b791ea2d5..6dd2fc4ebf 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml @@ -2,7 +2,7 @@ kind = "DojoContract" class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" base_class_hash = "0x0" -abi = "manifests/release/abis/base/contracts/dojo_examples-others-61de2c18.json" +abi = "manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] computed = [] diff --git a/examples/spawn-and-move/manifests/release/base/dojo-base.toml b/examples/spawn-and-move/manifests/release/base/dojo-base.toml index feb0efd085..83de14f171 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-base.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -abi = "manifests/release/abis/base/dojo-base.json" +abi = "manifests/release/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/release/base/dojo-world.toml b/examples/spawn-and-move/manifests/release/base/dojo-world.toml index cad6228974..7249b9c358 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -abi = "manifests/release/abis/base/dojo-world.json" +abi = "manifests/release/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index 9e7ac1b5fa..ef09f4f8da 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -abi = "manifests/release/abis/base/models/dojo_examples-ContractInitialized-376b7bd6.json" +abi = "manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml index 415899e171..fdb190ac8c 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -abi = "manifests/release/abis/base/models/dojo_examples-Message-1bb1d226.json" +abi = "manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml index 90d11271ae..71fa47c3e7 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -abi = "manifests/release/abis/base/models/dojo_examples-MockToken-38903c7c.json" +abi = "manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml index 3dc784d978..4bb3b5cc3f 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -abi = "manifests/release/abis/base/models/dojo_examples-Moved-318ae40d.json" +abi = "manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml index 50f4c1774f..4eb4aa9f97 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -abi = "manifests/release/abis/base/models/dojo_examples-Moves-2e2accba.json" +abi = "manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml index 762114119b..4c0855b673 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -abi = "manifests/release/abis/base/models/dojo_examples-PlayerConfig-3adad785.json" +abi = "manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml index be845b84a8..0b5a593985 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -abi = "manifests/release/abis/base/models/dojo_examples-Position-1e145e26.json" +abi = "manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml index b41cbad8c7..19ca33fbe3 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,7 +1,7 @@ kind = "DojoModel" class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -abi = "manifests/release/abis/base/models/dojo_examples-ServerProfile-4caad1e6.json" +abi = "manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" From 4a46303678aa463965a881505133ce4d126b0570 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Sun, 7 Jul 2024 22:55:32 -0400 Subject: [PATCH 85/88] refactor(torii-grpc): empty hashed keys in subscription match all entities (#2154) refactor: empty hashed keys in subscription match all entities --- crates/torii/grpc/src/server/subscriptions/entity.rs | 2 +- crates/torii/grpc/src/server/subscriptions/event_message.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/torii/grpc/src/server/subscriptions/entity.rs b/crates/torii/grpc/src/server/subscriptions/entity.rs index 79666a170a..d58c55969e 100644 --- a/crates/torii/grpc/src/server/subscriptions/entity.rs +++ b/crates/torii/grpc/src/server/subscriptions/entity.rs @@ -109,7 +109,7 @@ impl Service { // matches the key pattern of the subscriber. match &sub.keys { Some(EntityKeysClause::HashedKeys(hashed_keys)) => { - if !hashed_keys.contains(&hashed) { + if !hashed_keys.is_empty() && !hashed_keys.contains(&hashed) { continue; } } diff --git a/crates/torii/grpc/src/server/subscriptions/event_message.rs b/crates/torii/grpc/src/server/subscriptions/event_message.rs index 5e6c249129..9074800dd9 100644 --- a/crates/torii/grpc/src/server/subscriptions/event_message.rs +++ b/crates/torii/grpc/src/server/subscriptions/event_message.rs @@ -108,7 +108,7 @@ impl Service { // matches the key pattern of the subscriber. match &sub.keys { Some(EntityKeysClause::HashedKeys(hashed_keys)) => { - if !hashed_keys.contains(&hashed) { + if !hashed_keys.is_empty() && !hashed_keys.contains(&hashed) { continue; } } From 617fafba19d1f2f7cdc1a135bbcfdc4372db7a9c Mon Sep 17 00:00:00 2001 From: glihm Date: Sun, 7 Jul 2024 21:09:27 -0600 Subject: [PATCH 86/88] feat: bump cairo and scarb to latest nightly (#2152) * bump cairo and scarb to latest nightly * fix: fmt + clippy * fix: fix cairo test and update devcontainer rust version * fix: revert devcontainer to be done in an other PR * ci: update devcontainer * fix: fmt with new toolchain version * fix: remove dedup profiles as fixed in Scarb --- .github/workflows/ci.yml | 18 +- Cargo.lock | 1300 ++++++++--------- Cargo.toml | 48 +- bin/sozo/src/commands/build.rs | 5 +- bin/sozo/src/commands/clean.rs | 6 +- bin/sozo/src/commands/mod.rs | 4 +- crates/dojo-core/Scarb.lock | 4 +- crates/dojo-core/Scarb.toml | 6 +- crates/dojo-core/src/base_test.cairo | 2 +- crates/dojo-core/src/world.cairo | 10 +- crates/dojo-lang/src/compiler_test.rs | 5 +- .../compiler_cairo/Scarb.lock | 4 +- .../contracts/ccf-cairo_v240-8d921297.toml | 4 +- .../contracts/ccf-cairo_v260-465ec7fe.toml | 4 +- .../manifests/dev/base/dojo-base.toml | 4 +- .../manifests/dev/base/dojo-world.toml | 4 +- crates/dojo-lang/src/plugin.rs | 4 + crates/dojo-lang/src/plugin_test_data/print | 19 + crates/dojo-lang/src/plugin_test_data/system | 50 + crates/dojo-lang/src/scarb_internal/mod.rs | 6 +- crates/dojo-lang/src/semantics/test_data/set | 5 + crates/dojo-test-utils/build.rs | 5 +- crates/dojo-test-utils/src/compiler.rs | 5 +- crates/dojo-world/abigen/src/main.rs | 11 +- crates/dojo-world/src/contracts/model_test.rs | 2 +- crates/katana/node-bindings/src/json.rs | 1 + crates/katana/storage/provider/src/error.rs | 4 +- crates/torii/types-test/Scarb.lock | 4 +- crates/torii/types-test/Scarb.toml | 2 +- examples/spawn-and-move/Scarb.lock | 4 +- examples/spawn-and-move/Scarb.toml | 4 +- .../dojo_examples-actions-40b6994c.toml | 4 +- .../dojo_examples-mock_token-31599eb2.toml | 4 +- .../dojo_examples-others-61de2c18.toml | 4 +- .../manifests/dev/base/dojo-base.toml | 4 +- .../manifests/dev/base/dojo-world.toml | 4 +- ...examples-ContractInitialized-376b7bd6.toml | 4 +- .../dojo_examples-Message-1bb1d226.toml | 4 +- .../dojo_examples-MockToken-38903c7c.toml | 4 +- .../models/dojo_examples-Moved-318ae40d.toml | 4 +- .../models/dojo_examples-Moves-2e2accba.toml | 4 +- .../dojo_examples-PlayerConfig-3adad785.toml | 4 +- .../dojo_examples-Position-1e145e26.toml | 4 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 4 +- .../manifests/dev/deployment/manifest.json | 68 +- .../manifests/dev/deployment/manifest.toml | 68 +- .../dojo_examples-actions-40b6994c.toml | 4 +- .../dojo_examples-mock_token-31599eb2.toml | 4 +- .../dojo_examples-others-61de2c18.toml | 4 +- .../manifests/release/base/dojo-base.toml | 4 +- .../manifests/release/base/dojo-world.toml | 4 +- ...examples-ContractInitialized-376b7bd6.toml | 4 +- .../dojo_examples-Message-1bb1d226.toml | 4 +- .../dojo_examples-MockToken-38903c7c.toml | 4 +- .../models/dojo_examples-Moved-318ae40d.toml | 4 +- .../models/dojo_examples-Moves-2e2accba.toml | 4 +- .../dojo_examples-PlayerConfig-3adad785.toml | 4 +- .../dojo_examples-Position-1e145e26.toml | 4 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 4 +- rust-toolchain.toml | 2 +- 60 files changed, 937 insertions(+), 859 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcb238f9c1..6b0c327595 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - RUST_VERSION: 1.76.0 + RUST_VERSION: 1.79.0 jobs: build: @@ -31,7 +31,7 @@ jobs: needs: ensure-docker runs-on: ubuntu-latest-32-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -54,7 +54,7 @@ jobs: ensure-wasm: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -114,7 +114,7 @@ jobs: needs: build runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/download-artifact@v4 with: @@ -129,7 +129,7 @@ jobs: needs: build runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/download-artifact@v4 with: @@ -143,7 +143,7 @@ jobs: dojo-world-bindings-check: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -152,7 +152,7 @@ jobs: clippy: runs-on: ubuntu-latest-4-cores container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -161,7 +161,7 @@ jobs: fmt: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 @@ -170,7 +170,7 @@ jobs: docs: runs-on: ubuntu-latest container: - image: ghcr.io/dojoengine/dojo-dev:v0.7.2 + image: ghcr.io/dojoengine/dojo-dev:ff30e1d steps: - uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 diff --git a/Cargo.lock b/Cargo.lock index e0fe4a86b6..f12cc5c211 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,7 +21,7 @@ dependencies = [ "async-trait", "base64 0.21.7", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=e67d925)", - "cairo-lang-starknet 2.6.4", + "cairo-lang-starknet 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "coset", "ecdsa", "futures", @@ -1860,10 +1860,10 @@ dependencies = [ "ark-secp256r1", "cached", "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-casm 2.6.3", + "cairo-lang-runner 2.6.3", + "cairo-lang-starknet-classes 2.6.3", + "cairo-lang-utils 2.6.3", "cairo-vm 0.9.2", "derive_more", "indexmap 2.2.6", @@ -2268,7 +2268,7 @@ name = "cairo-lang-casm" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-utils 2.6.3", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2278,10 +2278,11 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6296d5748288d9fb97175d31aff9f68ea3f602456923895e512b078e9a2210a0" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2292,10 +2293,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6296d5748288d9fb97175d31aff9f68ea3f602456923895e512b078e9a2210a0" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-utils 2.6.4", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "indoc 2.0.5", "num-bigint", "num-traits 0.2.19", @@ -2309,17 +2309,17 @@ version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ "anyhow", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-defs 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-lowering 2.6.3", + "cairo-lang-parser 2.6.3", + "cairo-lang-project 2.6.3", + "cairo-lang-semantic 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-generator 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "salsa", "smol_str", "thiserror", @@ -2327,22 +2327,22 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7be5083c3328dad2248a94f0a24b3520c588e7d3bd5891770e4c91d3facade3" dependencies = [ "anyhow", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "indoc 2.0.5", + "cairo-lang-defs 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-project 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "salsa", "smol_str", "thiserror", @@ -2351,21 +2351,21 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7be5083c3328dad2248a94f0a24b3520c588e7d3bd5891770e4c91d3facade3" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-lowering 2.6.4", - "cairo-lang-parser 2.6.4", - "cairo-lang-project 2.6.4", - "cairo-lang-semantic 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-generator 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-generator 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "indoc 2.0.5", "salsa", "smol_str", "thiserror", @@ -2376,24 +2376,24 @@ name = "cairo-lang-debug" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-utils 2.6.3", ] [[package]] name = "cairo-lang-debug" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a3cbf67fd766cb7ed48b72e6abf7041857518c9b9fd42475a60c138671c6603" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cairo-lang-debug" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3cbf67fd766cb7ed48b72e6abf7041857518c9b9fd42475a60c138671c6603" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-utils 2.6.4", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", ] [[package]] @@ -2401,12 +2401,12 @@ name = "cairo-lang-defs" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-parser 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "itertools 0.11.0", "salsa", "smol_str", @@ -2414,16 +2414,17 @@ dependencies = [ [[package]] name = "cairo-lang-defs" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "itertools 0.12.1", +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b284e41dfc158dfbdc02612dbfdb27a55547d23063bdc53105eeec41d8df006" +dependencies = [ + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", "salsa", "smol_str", ] @@ -2431,16 +2432,15 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b284e41dfc158dfbdc02612dbfdb27a55547d23063bdc53105eeec41d8df006" -dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-parser 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", - "itertools 0.11.0", +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" +dependencies = [ + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", "salsa", "smol_str", ] @@ -2450,33 +2450,47 @@ name = "cairo-lang-diagnostics" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-utils 2.6.3", "itertools 0.11.0", ] [[package]] name = "cairo-lang-diagnostics" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6314b24901af8be75cd0e1363e3ff1a8020066372501f4cfc9161726b06ec2a" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "itertools 0.12.1", + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", ] [[package]] name = "cairo-lang-diagnostics" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6314b24901af8be75cd0e1363e3ff1a8020066372501f4cfc9161726b06ec2a" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-utils 2.6.4", - "itertools 0.11.0", + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", +] + +[[package]] +name = "cairo-lang-doc" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" +dependencies = [ + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-formatter", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", + "salsa", ] [[package]] @@ -2484,26 +2498,26 @@ name = "cairo-lang-eq-solver" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-utils 2.6.3", "good_lp", ] [[package]] name = "cairo-lang-eq-solver" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f95f5c8f7ea75580d164b5304251022e3d47f43fc1c778a01381b55ca9f268c" dependencies = [ - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "good_lp", ] [[package]] name = "cairo-lang-eq-solver" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f95f5c8f7ea75580d164b5304251022e3d47f43fc1c778a01381b55ca9f268c" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-utils 2.6.4", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "good_lp", ] @@ -2512,8 +2526,8 @@ name = "cairo-lang-filesystem" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-utils 2.6.3", "path-clean", "salsa", "serde", @@ -2522,11 +2536,12 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e58b80f0b413ef1320358fde1a0877fc3fbf740f5cead0de3e947a1bc3bfd4" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "path-clean", "salsa", "serde", @@ -2536,11 +2551,10 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e58b80f0b413ef1320358fde1a0877fc3fbf740f5cead0de3e947a1bc3bfd4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "path-clean", "salsa", "serde", @@ -2549,15 +2563,15 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "diffy", "ignore", "itertools 0.12.1", @@ -2569,27 +2583,30 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-doc", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-formatter", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", "salsa", "scarb-metadata 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "serde_json", + "smol_str", "tokio", "tower-lsp", "tracing", @@ -2602,15 +2619,15 @@ name = "cairo-lang-lowering" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-defs 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-parser 2.6.3", + "cairo-lang-proc-macros 2.6.3", + "cairo-lang-semantic 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "id-arena", "itertools 0.11.0", "log", @@ -2623,20 +2640,21 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe6d604a06ea96c05b3666f2e8fac63cb8709e13667de272912f81db004a16b" +dependencies = [ + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-proc-macros 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "id-arena", - "itertools 0.12.1", + "itertools 0.11.0", "log", "num-bigint", "num-traits 0.2.19", @@ -2648,20 +2666,19 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe6d604a06ea96c05b3666f2e8fac63cb8709e13667de272912f81db004a16b" -dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-parser 2.6.4", - "cairo-lang-proc-macros 2.6.4", - "cairo-lang-semantic 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" +dependencies = [ + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-proc-macros 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "id-arena", - "itertools 0.11.0", + "itertools 0.12.1", "log", "num-bigint", "num-traits 0.2.19", @@ -2673,7 +2690,7 @@ dependencies = [ [[package]] name = "cairo-lang-macro" version = "0.0.1" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "cairo-lang-macro-attributes", "cairo-lang-macro-stable", @@ -2683,7 +2700,7 @@ dependencies = [ [[package]] name = "cairo-lang-macro-attributes" version = "0.0.1" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "quote", "scarb-stable-hash", @@ -2693,18 +2710,18 @@ dependencies = [ [[package]] name = "cairo-lang-macro-stable" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" [[package]] name = "cairo-lang-parser" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax-codegen 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-syntax-codegen 2.6.3", + "cairo-lang-utils 2.6.3", "colored", "itertools 0.11.0", "num-bigint", @@ -2716,16 +2733,17 @@ dependencies = [ [[package]] name = "cairo-lang-parser" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf1c279de47a77422f81b8a98023cd523cf0ae79f7153d60c4cf8b62b8ece2f" dependencies = [ - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax-codegen 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax-codegen 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "colored", - "itertools 0.12.1", + "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", "salsa", @@ -2736,16 +2754,15 @@ dependencies = [ [[package]] name = "cairo-lang-parser" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf1c279de47a77422f81b8a98023cd523cf0ae79f7153d60c4cf8b62b8ece2f" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-syntax-codegen 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax-codegen 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "colored", - "itertools 0.11.0", + "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "salsa", @@ -2758,12 +2775,12 @@ name = "cairo-lang-plugins" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-defs 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-parser 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "indent", "indoc 2.0.5", "itertools 0.11.0", @@ -2773,18 +2790,19 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" -dependencies = [ - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1177a07498bdf45cba62f0c727388ff7433072847dbf701c58fa3c3e358154e" +dependencies = [ + "cairo-lang-defs 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "indent", "indoc 2.0.5", - "itertools 0.12.1", + "itertools 0.11.0", "salsa", "smol_str", ] @@ -2792,18 +2810,17 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1177a07498bdf45cba62f0c727388ff7433072847dbf701c58fa3c3e358154e" -dependencies = [ - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-parser 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" +dependencies = [ + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "indent", "indoc 2.0.5", - "itertools 0.11.0", + "itertools 0.12.1", "salsa", "smol_str", ] @@ -2813,17 +2830,18 @@ name = "cairo-lang-proc-macros" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", "quote", "syn 2.0.68", ] [[package]] name = "cairo-lang-proc-macros" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c90d812ec983c5a8e3173aca3fc55036b9739201c89f30271ee14a4c1189379" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "quote", "syn 2.0.68", ] @@ -2831,10 +2849,9 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c90d812ec983c5a8e3173aca3fc55036b9739201c89f30271ee14a4c1189379" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-debug 2.6.4", + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "quote", "syn 2.0.68", ] @@ -2844,8 +2861,8 @@ name = "cairo-lang-project" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-utils 2.6.3", "serde", "smol_str", "thiserror", @@ -2854,11 +2871,12 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3985495d7e9dc481e97135d7139cfa098024351fb51d5feef8366b5fbc104807" dependencies = [ - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde", "smol_str", "thiserror", @@ -2868,11 +2886,10 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3985495d7e9dc481e97135d7139cfa098024351fb51d5feef8366b5fbc104807" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-filesystem 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "serde", "smol_str", "thiserror", @@ -2889,15 +2906,15 @@ dependencies = [ "ark-secp256r1", "ark-std 0.4.0", "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-casm 2.6.3", + "cairo-lang-lowering 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-ap-change 2.6.3", + "cairo-lang-sierra-generator 2.6.3", + "cairo-lang-sierra-to-casm 2.6.3", + "cairo-lang-sierra-type-size 2.6.3", + "cairo-lang-starknet 2.6.3", + "cairo-lang-utils 2.6.3", "cairo-vm 0.9.2", "itertools 0.11.0", "keccak", @@ -2911,21 +2928,21 @@ dependencies = [ [[package]] name = "cairo-lang-runner" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "ark-ff 0.4.2", "ark-secp256k1", "ark-secp256r1", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-ap-change 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-generator 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-to-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-type-size 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-vm 1.0.0-rc3", "itertools 0.12.1", "keccak", @@ -2935,7 +2952,6 @@ dependencies = [ "rand", "sha2 0.10.8", "smol_str", - "starknet-crypto 0.6.2", "starknet-types-core", "thiserror", ] @@ -2945,15 +2961,15 @@ name = "cairo-lang-semantic" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-defs 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-parser 2.6.3", + "cairo-lang-plugins 2.6.3", + "cairo-lang-proc-macros 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "id-arena", "indoc 2.0.5", "itertools 0.11.0", @@ -2966,53 +2982,53 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-proc-macros 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-test-utils", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5cfadbb9ca3479a6b5c02c0a125a5747835ba57a2de9c4e9764f42d85abe059" +dependencies = [ + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-plugins 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-proc-macros 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "id-arena", "indoc 2.0.5", - "itertools 0.12.1", + "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", "once_cell", "salsa", "smol_str", - "toml 0.8.14", ] [[package]] name = "cairo-lang-semantic" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5cfadbb9ca3479a6b5c02c0a125a5747835ba57a2de9c4e9764f42d85abe059" -dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-parser 2.6.4", - "cairo-lang-plugins 2.6.4", - "cairo-lang-proc-macros 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" +dependencies = [ + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-plugins 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-proc-macros 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-test-utils", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "id-arena", "indoc 2.0.5", - "itertools 0.11.0", + "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", "once_cell", "salsa", "smol_str", + "toml 0.8.14", ] [[package]] @@ -3022,7 +3038,7 @@ source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-utils 2.6.3", "const-fnv1a-hash", "convert_case 0.6.0", "derivative", @@ -3042,15 +3058,17 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74a57492267a5a8891866b6e48cdefa508b5f05931a5f8eaf004b9de15b1ffd6" dependencies = [ "anyhow", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-felt", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "const-fnv1a-hash", "convert_case 0.6.0", "derivative", - "itertools 0.12.1", + "itertools 0.11.0", "lalrpop", "lalrpop-util", "num-bigint", @@ -3061,33 +3079,33 @@ dependencies = [ "serde_json", "sha3", "smol_str", - "starknet-types-core", "thiserror", ] [[package]] name = "cairo-lang-sierra" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a57492267a5a8891866b6e48cdefa508b5f05931a5f8eaf004b9de15b1ffd6" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-utils 2.6.4", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "const-fnv1a-hash", "convert_case 0.6.0", "derivative", - "itertools 0.11.0", + "itertools 0.12.1", "lalrpop", "lalrpop-util", "num-bigint", + "num-integer", "num-traits 0.2.19", + "once_cell", "regex", "salsa", "serde", "serde_json", "sha3", "smol_str", + "starknet-types-core", "thiserror", ] @@ -3096,10 +3114,10 @@ name = "cairo-lang-sierra-ap-change" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-eq-solver 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-type-size 2.6.3", + "cairo-lang-utils 2.6.3", "itertools 0.11.0", "num-traits 0.2.19", "thiserror", @@ -3107,15 +3125,15 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fdbb4bd95477123653b9200bd4e9dceae95a914f6fe85b2bed83b223e36fb5a" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "itertools 0.12.1", - "num-bigint", + "cairo-lang-eq-solver 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", "num-traits 0.2.19", "thiserror", ] @@ -3123,14 +3141,14 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fdbb4bd95477123653b9200bd4e9dceae95a914f6fe85b2bed83b223e36fb5a" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-eq-solver 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-type-size 2.6.4", - "cairo-lang-utils 2.6.4", - "itertools 0.11.0", + "cairo-lang-eq-solver 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-type-size 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", + "num-bigint", "num-traits 0.2.19", "thiserror", ] @@ -3140,10 +3158,10 @@ name = "cairo-lang-sierra-gas" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-eq-solver 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-type-size 2.6.3", + "cairo-lang-utils 2.6.3", "itertools 0.11.0", "num-traits 0.2.19", "thiserror", @@ -3151,15 +3169,15 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882cb178f1b79aabf70acce1d87b08d569d8a4b0ce8b1d8f538a02cdb36789db" dependencies = [ - "cairo-lang-eq-solver 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "itertools 0.12.1", - "num-bigint", + "cairo-lang-eq-solver 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", "num-traits 0.2.19", "thiserror", ] @@ -3167,14 +3185,14 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882cb178f1b79aabf70acce1d87b08d569d8a4b0ce8b1d8f538a02cdb36789db" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-eq-solver 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-type-size 2.6.4", - "cairo-lang-utils 2.6.4", - "itertools 0.11.0", + "cairo-lang-eq-solver 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-type-size 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", + "num-bigint", "num-traits 0.2.19", "thiserror", ] @@ -3184,16 +3202,16 @@ name = "cairo-lang-sierra-generator" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-defs 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-lowering 2.6.3", + "cairo-lang-parser 2.6.3", + "cairo-lang-semantic 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "itertools 0.11.0", "num-traits 0.2.19", "once_cell", @@ -3203,48 +3221,48 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" -dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "itertools 0.12.1", +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d80c9d29e6d3f4ab60e698ebe2de84dcf90570c3dd1cfa7b01bd5c42470331c" +dependencies = [ + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-parser 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.11.0", "num-traits 0.2.19", "once_cell", "salsa", - "serde", - "serde_json", "smol_str", ] [[package]] name = "cairo-lang-sierra-generator" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d80c9d29e6d3f4ab60e698ebe2de84dcf90570c3dd1cfa7b01bd5c42470331c" -dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-lowering 2.6.4", - "cairo-lang-parser 2.6.4", - "cairo-lang-semantic 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", - "itertools 0.11.0", +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" +dependencies = [ + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "itertools 0.12.1", "num-traits 0.2.19", "once_cell", "salsa", + "serde", + "serde_json", "smol_str", ] @@ -3255,12 +3273,12 @@ source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd dependencies = [ "assert_matches", "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-gas 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-casm 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-ap-change 2.6.3", + "cairo-lang-sierra-gas 2.6.3", + "cairo-lang-sierra-type-size 2.6.3", + "cairo-lang-utils 2.6.3", "indoc 2.0.5", "itertools 0.11.0", "num-bigint", @@ -3270,42 +3288,42 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ac02c90be2630ae861db6af226090da92741020519768332dd2c07e24d94c75" dependencies = [ "assert_matches", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-ap-change 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-gas 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-type-size 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-felt", + "cairo-lang-casm 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-ap-change 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-gas 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-type-size 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "indoc 2.0.5", - "itertools 0.12.1", + "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", - "starknet-types-core", "thiserror", ] [[package]] name = "cairo-lang-sierra-to-casm" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ac02c90be2630ae861db6af226090da92741020519768332dd2c07e24d94c75" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "assert_matches", - "cairo-felt", - "cairo-lang-casm 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-ap-change 2.6.4", - "cairo-lang-sierra-gas 2.6.4", - "cairo-lang-sierra-type-size 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-ap-change 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-gas 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-type-size 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "indoc 2.0.5", - "itertools 0.11.0", + "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", + "starknet-types-core", "thiserror", ] @@ -3314,27 +3332,27 @@ name = "cairo-lang-sierra-type-size" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-sierra 2.6.3", + "cairo-lang-utils 2.6.3", ] [[package]] name = "cairo-lang-sierra-type-size" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d102b10989f9637b1c916dd950cbd1bd8bb1b6a7aaa1a3035390be0683b92d85" dependencies = [ - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cairo-lang-sierra-type-size" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d102b10989f9637b1c916dd950cbd1bd8bb1b6a7aaa1a3035390be0683b92d85" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-sierra 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", ] [[package]] @@ -3344,18 +3362,18 @@ source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-compiler 2.6.3", + "cairo-lang-defs 2.6.3", + "cairo-lang-diagnostics 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-lowering 2.6.3", + "cairo-lang-plugins 2.6.3", + "cairo-lang-semantic 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-generator 2.6.3", + "cairo-lang-starknet-classes 2.6.3", + "cairo-lang-syntax 2.6.3", + "cairo-lang-utils 2.6.3", "const_format", "indent", "indoc 2.0.5", @@ -3369,62 +3387,62 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27921a2bf82d191d28afd570b913341080c8fc25c83bf870dbf1252570b1b41" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-felt", + "cairo-lang-compiler 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-defs 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-diagnostics 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-lowering 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-plugins 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-semantic 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-generator 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-starknet-classes 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-syntax 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "const_format", "indent", "indoc 2.0.5", - "itertools 0.12.1", + "itertools 0.11.0", "once_cell", "serde", "serde_json", "smol_str", - "starknet-types-core", "thiserror", ] [[package]] name = "cairo-lang-starknet" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27921a2bf82d191d28afd570b913341080c8fc25c83bf870dbf1252570b1b41" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.6.4", - "cairo-lang-defs 2.6.4", - "cairo-lang-diagnostics 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-lowering 2.6.4", - "cairo-lang-plugins 2.6.4", - "cairo-lang-semantic 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-generator 2.6.4", - "cairo-lang-starknet-classes 2.6.4", - "cairo-lang-syntax 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-plugins 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-generator 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "const_format", "indent", "indoc 2.0.5", - "itertools 0.11.0", + "itertools 0.12.1", "once_cell", "serde", "serde_json", "smol_str", + "starknet-types-core", "thiserror", ] @@ -3434,10 +3452,10 @@ version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ "cairo-felt", - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-casm 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-sierra-to-casm 2.6.3", + "cairo-lang-utils 2.6.3", "convert_case 0.6.0", "itertools 0.11.0", "num-bigint", @@ -3454,15 +3472,17 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8623b076ef3569e4262da5da270a84658b1ff242fe0c9624fbe432e7a937d101" dependencies = [ - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-felt", + "cairo-lang-casm 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-sierra-to-casm 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "convert_case 0.6.0", - "itertools 0.12.1", + "itertools 0.11.0", "num-bigint", "num-integer", "num-traits 0.2.19", @@ -3472,23 +3492,20 @@ dependencies = [ "sha3", "smol_str", "starknet-crypto 0.6.2", - "starknet-types-core", "thiserror", ] [[package]] name = "cairo-lang-starknet-classes" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8623b076ef3569e4262da5da270a84658b1ff242fe0c9624fbe432e7a937d101" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-felt", - "cairo-lang-casm 2.6.4", - "cairo-lang-sierra 2.6.4", - "cairo-lang-sierra-to-casm 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-to-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "convert_case 0.6.0", - "itertools 0.11.0", + "itertools 0.12.1", "num-bigint", "num-integer", "num-traits 0.2.19", @@ -3497,7 +3514,7 @@ dependencies = [ "serde_json", "sha3", "smol_str", - "starknet-crypto 0.6.2", + "starknet-types-core", "thiserror", ] @@ -3506,9 +3523,9 @@ name = "cairo-lang-syntax" version = "2.6.3" source = "git+https://github.com/starkware-libs/cairo?tag=v2.6.3#2203a47f8a098cd4718d03bd109ca014049419e7" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-debug 2.6.3", + "cairo-lang-filesystem 2.6.3", + "cairo-lang-utils 2.6.3", "num-bigint", "num-traits 0.2.19", "salsa", @@ -3518,12 +3535,13 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c62f5bd74e249636e7c48d8b95e6cc0ee991206d4a6cbe5c2624184a828e70b" dependencies = [ - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-debug 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-filesystem 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cairo-lang-utils 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint", "num-traits 0.2.19", "salsa", @@ -3534,12 +3552,11 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c62f5bd74e249636e7c48d8b95e6cc0ee991206d4a6cbe5c2624184a828e70b" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ - "cairo-lang-debug 2.6.4", - "cairo-lang-filesystem 2.6.4", - "cairo-lang-utils 2.6.4", + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "num-bigint", "num-traits 0.2.19", "salsa", @@ -3558,8 +3575,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a744747e9ab03b65480265304490f3e29d99e4cb297e39d0e6fdb047c1bc86a7" dependencies = [ "genco", "xshell", @@ -3568,8 +3586,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a744747e9ab03b65480265304490f3e29d99e4cb297e39d0e6fdb047c1bc86a7" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "genco", "xshell", @@ -3577,23 +3594,23 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-generator 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "indoc 2.0.5", "itertools 0.12.1", "num-bigint", @@ -3604,19 +3621,19 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "anyhow", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-runner 2.6.4", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-generator 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-to-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "colored", "itertools 0.12.1", "num-traits 0.2.19", @@ -3626,11 +3643,11 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ "cairo-lang-formatter", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "colored", "log", "pretty_assertions", @@ -3653,34 +3670,34 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.6.3" -source = "git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632#d9984ef58e2f704909e271f2f01327f520ded632" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6f98e8769412907ceb106c21c70907cc0c87ca0a2a44c82b6229a695a6f9b48" dependencies = [ - "env_logger 0.11.3", "hashbrown 0.14.5", "indexmap 2.2.6", - "itertools 0.12.1", - "log", + "itertools 0.11.0", "num-bigint", "num-traits 0.2.19", "schemars", "serde", - "time", ] [[package]] name = "cairo-lang-utils" version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f98e8769412907ceb106c21c70907cc0c87ca0a2a44c82b6229a695a6f9b48" +source = "git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c#43cf361d9b6b26ec8cd5ee076dd15341bde7577c" dependencies = [ + "env_logger 0.11.3", "hashbrown 0.14.5", "indexmap 2.2.6", - "itertools 0.11.0", + "itertools 0.12.1", + "log", "num-bigint", "num-traits 0.2.19", "schemars", "serde", + "time", ] [[package]] @@ -4456,7 +4473,7 @@ dependencies = [ [[package]] name = "create-output-dir" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "anyhow", "core-foundation", @@ -4867,16 +4884,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ - "derive_builder_macro 0.12.0", -] - -[[package]] -name = "derive_builder" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" -dependencies = [ - "derive_builder_macro 0.20.0", + "derive_builder_macro", ] [[package]] @@ -4891,38 +4899,16 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder_core" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" -dependencies = [ - "darling 0.20.9", - "proc-macro2", - "quote", - "syn 2.0.68", -] - [[package]] name = "derive_builder_macro" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ - "derive_builder_core 0.12.0", + "derive_builder_core", "syn 1.0.109", ] -[[package]] -name = "derive_builder_macro" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" -dependencies = [ - "derive_builder_core 0.20.0", - "syn 2.0.68", -] - [[package]] name = "derive_more" version = "0.99.18" @@ -5098,24 +5084,24 @@ version = "1.0.0-alpha.0" dependencies = [ "anyhow", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-debug 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-debug 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-formatter", - "cairo-lang-lowering 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-parser 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-generator 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-lowering 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-plugins 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-generator 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-test-plugin", "cairo-lang-test-utils", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "convert_case 0.6.0", "directories", @@ -5180,10 +5166,10 @@ dependencies = [ "anyhow", "assert_fs", "async-trait", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "dojo-lang", "dojo-world", @@ -5234,10 +5220,10 @@ dependencies = [ "assert_matches", "async-trait", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "convert_case 0.6.0", "dojo-lang", @@ -5270,8 +5256,8 @@ dependencies = [ name = "dojo-world-abigen" version = "1.0.0-alpha.0" dependencies = [ - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "scarb", "scarb-ui", @@ -8417,12 +8403,12 @@ dependencies = [ name = "katana-cairo" version = "1.0.0-alpha.0" dependencies = [ - "cairo-lang-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-runner 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?tag=v2.6.3)", + "cairo-lang-casm 2.6.3", + "cairo-lang-runner 2.6.3", + "cairo-lang-sierra 2.6.3", + "cairo-lang-starknet 2.6.3", + "cairo-lang-starknet-classes 2.6.3", + "cairo-lang-utils 2.6.3", "cairo-vm 0.9.2", ] @@ -8495,7 +8481,7 @@ name = "katana-db" version = "1.0.0-alpha.0" dependencies = [ "anyhow", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-vm 0.9.2", "criterion", "katana-primitives", @@ -8612,8 +8598,8 @@ dependencies = [ "anyhow", "assert_matches", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "dojo-metrics", "dojo-test-utils", "dojo-world", @@ -11527,6 +11513,16 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "ra_ap_toolchain" +version = "0.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53393fc4d85057bcca4dd2d7fa24929a094bb94712980814695f56cb9aa0b1e2" +dependencies = [ + "camino", + "home", +] + [[package]] name = "radium" version = "0.7.0" @@ -12522,38 +12518,41 @@ dependencies = [ [[package]] name = "scarb" -version = "2.6.3" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +version = "2.6.4" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "anyhow", "async-trait", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-diagnostics 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-diagnostics 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-formatter", "cairo-lang-macro", "cairo-lang-macro-stable", - "cairo-lang-semantic 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-syntax 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-parser 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-semantic 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-to-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-syntax 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "clap", + "convert_case 0.6.0", "create-output-dir", "data-encoding", "deno_task_shell", - "derive_builder 0.20.0", + "derive_builder", "directories", "dunce", "fs4", "fs_extra", "futures", "gix", + "gix-path", "glob", "ignore", "include_dir", @@ -12563,10 +12562,11 @@ dependencies = [ "once_cell", "pathdiff", "petgraph", + "ra_ap_toolchain", "redb", "reqwest 0.11.27", "scarb-build-metadata", - "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43)", + "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79)", "scarb-stable-hash", "scarb-ui", "semver 1.0.23", @@ -12596,8 +12596,8 @@ dependencies = [ [[package]] name = "scarb-build-metadata" -version = "2.6.3" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +version = "2.6.4" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "cargo_metadata", ] @@ -12618,10 +12618,10 @@ dependencies = [ [[package]] name = "scarb-metadata" version = "1.12.0" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "camino", - "derive_builder 0.20.0", + "derive_builder", "semver 1.0.23", "serde", "serde_json", @@ -12631,7 +12631,7 @@ dependencies = [ [[package]] name = "scarb-stable-hash" version = "1.0.0" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "data-encoding", "xxhash-rust", @@ -12640,14 +12640,14 @@ dependencies = [ [[package]] name = "scarb-ui" version = "0.1.5" -source = "git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43#f1aa7b09507a84d209d83b2fa80472c82605cc43" +source = "git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79#4b75f435f68248a7c096ec0fa5939ecdd92e2d79" dependencies = [ "anyhow", "camino", "clap", "console", "indicatif", - "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=f1aa7b09507a84d209d83b2fa80472c82605cc43)", + "scarb-metadata 1.12.0 (git+https://github.com/software-mansion/scarb?rev=4b75f435f68248a7c096ec0fa5939ecdd92e2d79)", "serde", "serde_json", "tracing-core", @@ -13353,17 +13353,17 @@ dependencies = [ "async-trait", "bigdecimal 0.4.5", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-plugins 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-to-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-test-plugin", "cairo-lang-test-runner", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "clap", "clap-verbosity-flag", @@ -13413,17 +13413,17 @@ dependencies = [ "async-trait", "bigdecimal 0.4.5", "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?tag=v0.3.0)", - "cairo-lang-compiler 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-defs 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-filesystem 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-plugins 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-project 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-sierra-to-casm 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", - "cairo-lang-starknet-classes 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-compiler 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-defs 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-filesystem 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-plugins 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-project 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-sierra-to-casm 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", + "cairo-lang-starknet-classes 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "cairo-lang-test-plugin", - "cairo-lang-utils 2.6.3 (git+https://github.com/starkware-libs/cairo?rev=d9984ef58e2f704909e271f2f01327f520ded632)", + "cairo-lang-utils 2.6.4 (git+https://github.com/starkware-libs/cairo?rev=43cf361d9b6b26ec8cd5ee076dd15341bde7577c)", "camino", "clap", "colored", @@ -14124,7 +14124,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "365ec5c0662466f299762bd012012da30e9a28319000cfade372b8787111f202" dependencies = [ - "cairo-lang-starknet-classes 2.6.4", + "cairo-lang-starknet-classes 2.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more", "hex", "indexmap 2.2.6", @@ -15941,7 +15941,7 @@ source = "git+https://github.com/cartridge-gg/wasm-webauthn?rev=972693f#972693fd dependencies = [ "ciborium", "coset", - "derive_builder 0.12.0", + "derive_builder", "js-sys", "serde", "serde-wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 0af6014b06..051997f1ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,28 +115,28 @@ auto_impl = "1.2.0" base64 = "0.21.2" bigdecimal = "0.4.1" bytes = "1.6" -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] } -cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" } +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c", features = [ "testing" ] } +cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c", features = [ "testing" ] } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" } cairo-proof-parser = { git = "https://github.com/cartridge-gg/cairo-proof-parser", branch = "v0.3.0/new-felt" } cairo-vm = "0.9.2" camino = { version = "1.1.2", features = [ "serde1" ] } @@ -172,8 +172,8 @@ rpassword = "7.2.0" rstest = "0.18.2" rstest_reuse = "0.6.0" salsa = "0.16.1" -scarb = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } -scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" } +scarb = { git = "https://github.com/software-mansion/scarb", rev = "4b75f435f68248a7c096ec0fa5939ecdd92e2d79" } +scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "4b75f435f68248a7c096ec0fa5939ecdd92e2d79" } semver = "1.0.5" serde = { version = "1.0", features = [ "derive" ] } serde_json = { version = "1.0", features = [ "arbitrary_precision" ] } diff --git a/bin/sozo/src/commands/build.rs b/bin/sozo/src/commands/build.rs index 8a21ef14dd..1f2d4598a3 100644 --- a/bin/sozo/src/commands/build.rs +++ b/bin/sozo/src/commands/build.rs @@ -78,8 +78,9 @@ impl BuildArgs { let compile_info = compile_workspace( config, CompileOpts { - include_targets: vec![], - exclude_targets: vec![TargetKind::TEST], + include_target_names: vec![], + include_target_kinds: vec![], + exclude_target_kinds: vec![TargetKind::TEST], features: features_opts, }, )?; diff --git a/bin/sozo/src/commands/clean.rs b/bin/sozo/src/commands/clean.rs index 59a76f15c1..79af666bdd 100644 --- a/bin/sozo/src/commands/clean.rs +++ b/bin/sozo/src/commands/clean.rs @@ -45,11 +45,7 @@ impl CleanArgs { trace!(ws=?ws, "Workspace read successfully."); let profile_names = if self.all_profiles { - let mut profiles = ws.profile_names().expect("given method never returns an error"); - // currently scarb can return duplicate profiles and since the vector is sorted we can - // remove duplicates by calling dedup - profiles.dedup(); - profiles + ws.profile_names() } else { vec![ ws.current_profile().expect("Scarb profile is expected at this point.").to_string(), diff --git a/bin/sozo/src/commands/mod.rs b/bin/sozo/src/commands/mod.rs index 158fd8bfed..788d0b8fe2 100644 --- a/bin/sozo/src/commands/mod.rs +++ b/bin/sozo/src/commands/mod.rs @@ -53,8 +53,8 @@ pub enum Commands { Init(InitArgs), #[command(about = "Remove generated artifacts, manifests and abis")] Clean(CleanArgs), - #[command(about = "Run a migration, declaring and deploying contracts as necessary to \ - update the world")] + #[command(about = "Run a migration, declaring and deploying contracts as necessary to update \ + the world")] Migrate(Box), #[command(about = "Developer mode: watcher for building and migration")] Dev(DevArgs), diff --git a/crates/dojo-core/Scarb.lock b/crates/dojo-core/Scarb.lock index 7ce0b7bfe8..d94b531218 100644 --- a/crates/dojo-core/Scarb.lock +++ b/crates/dojo-core/Scarb.lock @@ -10,5 +10,5 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.4.1" -source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" +version = "0.7.2" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.3#e8539d5b199efbd51c89c75da32f6592de5d9262" diff --git a/crates/dojo-core/Scarb.toml b/crates/dojo-core/Scarb.toml index 96ca4ac712..0aa197423e 100644 --- a/crates/dojo-core/Scarb.toml +++ b/crates/dojo-core/Scarb.toml @@ -1,9 +1,9 @@ [package] -cairo-version = "=2.6.3" +cairo-version = "=2.6.4" description = "The Dojo Core library for autonomous worlds." name = "dojo" version = "0.7.3" [dependencies] -dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.2" } -starknet = "=2.6.3" +dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.3" } +starknet = "=2.6.4" diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index 0532c1fa1b..958e893906 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -178,7 +178,7 @@ mod invalid_model { fn selector(self: @ContractState) -> felt252 { // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x3f692e9669a95a2ace68e1eec4fdc26594d4b1413d78a62262249d9108c4194 + 0x1130142d6bff3c9cb891a270922a4c6dbf4c222b675cdc1341905b17341e3ab } fn namespace(self: @ContractState) -> ByteArray { diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index bfe194ff02..d9decc460a 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -92,7 +92,7 @@ mod world { contract_address_const, get_caller_address, get_contract_address, get_tx_info, contract_address::ContractAddressIntoFelt252, ClassHash, Zeroable, ContractAddress, syscalls::{deploy_syscall, emit_event_syscall, replace_class_syscall}, SyscallResult, - SyscallResultTrait, SyscallResultTraitImpl + SyscallResultTrait, SyscallResultTraitImpl, storage::Map, }; use dojo::database; @@ -227,12 +227,12 @@ mod world { contract_base: ClassHash, nonce: usize, models_count: usize, - resources: LegacyMap::, - owners: LegacyMap::<(felt252, ContractAddress), bool>, - writers: LegacyMap::<(felt252, ContractAddress), bool>, + resources: Map::, + owners: Map::<(felt252, ContractAddress), bool>, + writers: Map::<(felt252, ContractAddress), bool>, #[substorage(v0)] config: Config::Storage, - initialized_contract: LegacyMap::, + initialized_contract: Map::, } #[derive(Drop, starknet::Store, Default, Debug)] diff --git a/crates/dojo-lang/src/compiler_test.rs b/crates/dojo-lang/src/compiler_test.rs index 01d71a6075..627fc85c86 100644 --- a/crates/dojo-lang/src/compiler_test.rs +++ b/crates/dojo-lang/src/compiler_test.rs @@ -17,8 +17,9 @@ fn test_compiler_cairo_features() { let compile_info = scarb_internal::compile_workspace( &config, CompileOpts { - include_targets: vec![], - exclude_targets: vec![TargetKind::TEST], + include_target_names: vec![], + include_target_kinds: vec![], + exclude_target_kinds: vec![TargetKind::TEST], features: features_opts, }, ) diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock index aaf6fd8731..8841ad26aa 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/Scarb.lock @@ -17,5 +17,5 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.4.1" -source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" +version = "0.7.2" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.3#e8539d5b199efbd51c89c75da32f6592de5d9262" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml index 2dc026c126..2fd8e54479 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v240-8d921297.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" -original_class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702" +class_hash = "0x1b29f38120f222120acf9b3d66f7015d47c0b11d4e9acdfefa243958c60909d" +original_class_hash = "0x1b29f38120f222120acf9b3d66f7015d47c0b11d4e9acdfefa243958c60909d" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/ccf-cairo_v240-8d921297.json" reads = [] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml index df70ed0ff9..cd8f1e26b2 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/contracts/ccf-cairo_v260-465ec7fe.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" -original_class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333" +class_hash = "0x412449a631f6652b3bbe27841fb6776639e493baad1a5894daeb9260d1b0a63" +original_class_hash = "0x412449a631f6652b3bbe27841fb6776639e493baad1a5894daeb9260d1b0a63" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/ccf-cairo_v260-465ec7fe.json" reads = [] diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml index 35f4edd8d1..aa92e94fac 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" +original_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml index 2e7374451b..08b3a3437f 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-lang/src/plugin.rs b/crates/dojo-lang/src/plugin.rs index 37b91398a8..fd6b46491c 100644 --- a/crates/dojo-lang/src/plugin.rs +++ b/crates/dojo-lang/src/plugin.rs @@ -549,6 +549,10 @@ impl MacroPlugin for BuiltinDojoPlugin { "computed".to_string(), ] } + + fn declared_derives(&self) -> Vec { + vec!["Introspect".to_string(), "IntrospectPacked".to_string()] + } } pub struct CairoPluginRepository(scarb::compiler::plugin::CairoPluginRepository); diff --git a/crates/dojo-lang/src/plugin_test_data/print b/crates/dojo-lang/src/plugin_test_data/print index 3e161917e9..0698716613 100644 --- a/crates/dojo-lang/src/plugin_test_data/print +++ b/crates/dojo-lang/src/plugin_test_data/print @@ -113,3 +113,22 @@ Enemy::OtherPlayer(v) => { core::debug::PrintTrait::print('OtherPlayer'); core:: } //! > expected_diagnostics +error: Unknown derive `Print` - a plugin might be missing. + --> test_src/lib.cairo:4:10 +#[derive(Print)] + ^***^ + +error: Unknown derive `Print` - a plugin might be missing. + --> test_src/lib.cairo:12:10 +#[derive(Print)] + ^***^ + +error: Unknown derive `Print` - a plugin might be missing. + --> test_src/lib.cairo:19:10 +#[derive(Print)] + ^***^ + +error: Unknown derive `Print` - a plugin might be missing. + --> test_src/lib.cairo:28:10 +#[derive(Print)] + ^***^ diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index 645bb25f34..aff6b4d446 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -515,6 +515,11 @@ error: Unsupported attribute. #[dojo::contract(namespace: 'my_namespace')] ^******************************************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:11:1 +#[dojo::contract(namespace: 'my_namespace')] +^******************************************^ + error: Unsupported attribute. --> test_src/lib.cairo:11:1 #[dojo::contract(namespace: 'my_namespace')] @@ -555,6 +560,11 @@ error: Unsupported attribute. #[dojo::contract(namespace: "my_namespace")] ^******************************************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:21:1 +#[dojo::contract(namespace: "my_namespace")] +^******************************************^ + error: Unsupported attribute. --> test_src/lib.cairo:21:1 #[dojo::contract(namespace: "my_namespace")] @@ -595,6 +605,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:28:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:28:1 #[dojo::contract] @@ -630,11 +645,21 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:38:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:38:1 #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:46:20 + #[derive(Drop, starknet::Event)] + ^*************^ + error: Unsupported attribute. --> test_src/lib.cairo:38:1 #[dojo::contract] @@ -700,6 +725,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:64:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:64:1 #[dojo::contract] @@ -750,6 +780,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:124:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:124:1 #[dojo::contract] @@ -795,6 +830,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:171:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:171:1 #[dojo::contract] @@ -835,6 +875,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:222:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:222:1 #[dojo::contract] @@ -875,6 +920,11 @@ error: Unsupported attribute. #[dojo::contract] ^***************^ +error: Unknown derive `starknet::Event` - a plugin might be missing. + --> test_src/lib.cairo:239:1 +#[dojo::contract] +^***************^ + error: Unsupported attribute. --> test_src/lib.cairo:239:1 #[dojo::contract] diff --git a/crates/dojo-lang/src/scarb_internal/mod.rs b/crates/dojo-lang/src/scarb_internal/mod.rs index 638c7a0d74..d58eb2ff2e 100644 --- a/crates/dojo-lang/src/scarb_internal/mod.rs +++ b/crates/dojo-lang/src/scarb_internal/mod.rs @@ -93,10 +93,10 @@ pub fn compile_workspace(config: &Config, opts: CompileOpts) -> Result>(); diff --git a/crates/dojo-lang/src/semantics/test_data/set b/crates/dojo-lang/src/semantics/test_data/set index 85a3ef80a7..d41133d396 100644 --- a/crates/dojo-lang/src/semantics/test_data/set +++ b/crates/dojo-lang/src/semantics/test_data/set @@ -224,6 +224,11 @@ Block( ) //! > semantic_diagnostics +error: Plugin diagnostic: Unknown derive `Model` - a plugin might be missing. + --> lib.cairo:3:29 +#[derive(Copy, Drop, Serde, Model)] + ^***^ + warning[E0001]: Unused variable. Consider ignoring by prefixing with `_`. --> lib.cairo:9:22 fn test_func() { let key: felt252 = 0xb0b; diff --git a/crates/dojo-test-utils/build.rs b/crates/dojo-test-utils/build.rs index 44f01457b9..881098a1ad 100644 --- a/crates/dojo-test-utils/build.rs +++ b/crates/dojo-test-utils/build.rs @@ -57,8 +57,9 @@ fn main() { compile_workspace( &config, CompileOpts { - include_targets: vec![], - exclude_targets: vec![TargetKind::TEST], + include_target_kinds: vec![], + exclude_target_kinds: vec![TargetKind::TEST], + include_target_names: vec![], features: features_opts, }, ) diff --git a/crates/dojo-test-utils/src/compiler.rs b/crates/dojo-test-utils/src/compiler.rs index e355673982..2d58848812 100644 --- a/crates/dojo-test-utils/src/compiler.rs +++ b/crates/dojo-test-utils/src/compiler.rs @@ -80,8 +80,9 @@ pub fn copy_build_project_temp( compile_workspace( &config, CompileOpts { - include_targets: vec![], - exclude_targets: vec![TargetKind::TEST], + include_target_names: vec![], + include_target_kinds: vec![], + exclude_target_kinds: vec![TargetKind::TEST], features: features_opts, }, ) diff --git a/crates/dojo-world/abigen/src/main.rs b/crates/dojo-world/abigen/src/main.rs index af3806a485..3b052b91e2 100644 --- a/crates/dojo-world/abigen/src/main.rs +++ b/crates/dojo-world/abigen/src/main.rs @@ -104,12 +104,12 @@ fn compile_dojo_core() { file, r#" [package] -cairo-version = "2.4.0" +cairo-version = "=2.6.4" name = "dojo" -version = "0.4.4" +version = "0.7.3" [dependencies] -starknet = "2.4.0" +starknet = "=2.6.4" [[target.starknet-contract]] sierra = true @@ -129,8 +129,9 @@ sierra = true scarb::ops::compile( packages, CompileOpts { - include_targets: vec![], - exclude_targets: vec![TargetKind::TEST], + include_target_names: vec![], + include_target_kinds: vec![], + exclude_target_kinds: vec![TargetKind::TEST], features: features_opts, }, &ws, diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index 5fa132f905..a3ff762cb6 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -81,7 +81,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x059e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34") + felt!("0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13") ); let moves = world.model_reader("dojo_examples", "Moves").await.unwrap(); diff --git a/crates/katana/node-bindings/src/json.rs b/crates/katana/node-bindings/src/json.rs index ca717d38a1..9c85a6d411 100644 --- a/crates/katana/node-bindings/src/json.rs +++ b/crates/katana/node-bindings/src/json.rs @@ -12,6 +12,7 @@ //! 0x640466ebd2ce505209d3e5c4494b4276ed8f1cde764d757eb48831961f7cdea\"}]],\"address\":\"0.0.0.0: //! 5050\",\"seed\":\"0\"}"},"target":"katana::cli"} //! ``` +#![allow(dead_code)] use serde::Deserialize; diff --git a/crates/katana/storage/provider/src/error.rs b/crates/katana/storage/provider/src/error.rs index c02fda220d..3876bbeec7 100644 --- a/crates/katana/storage/provider/src/error.rs +++ b/crates/katana/storage/provider/src/error.rs @@ -73,9 +73,7 @@ pub enum ProviderError { /// Error when a contract nonce change entry is not found but the block number of when the /// change happen exists in the nonce change list. - #[error( - "Missing contract nonce change entry for contract {contract_address} at block {block}" - )] + #[error("Missing contract nonce change entry for contract {contract_address} at block {block}")] MissingContractNonceChangeEntry { /// The block number of when the change happen. block: BlockNumber, diff --git a/crates/torii/types-test/Scarb.lock b/crates/torii/types-test/Scarb.lock index 50ca9b8af4..8d835bdb65 100644 --- a/crates/torii/types-test/Scarb.lock +++ b/crates/torii/types-test/Scarb.lock @@ -10,8 +10,8 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.4.1" -source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" +version = "0.7.2" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.3#e8539d5b199efbd51c89c75da32f6592de5d9262" [[package]] name = "types_test" diff --git a/crates/torii/types-test/Scarb.toml b/crates/torii/types-test/Scarb.toml index 2f24b842f6..6ff4049f66 100644 --- a/crates/torii/types-test/Scarb.toml +++ b/crates/torii/types-test/Scarb.toml @@ -1,5 +1,5 @@ [package] -cairo-version = "2.6.3" +cairo-version = "=2.6.4" name = "types_test" version = "0.7.3" diff --git a/examples/spawn-and-move/Scarb.lock b/examples/spawn-and-move/Scarb.lock index 6d38546cd6..9fd20e2292 100644 --- a/examples/spawn-and-move/Scarb.lock +++ b/examples/spawn-and-move/Scarb.lock @@ -17,5 +17,5 @@ dependencies = [ [[package]] name = "dojo_plugin" -version = "0.4.1" -source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4" +version = "0.7.2" +source = "git+https://github.com/dojoengine/dojo?tag=v0.7.3#e8539d5b199efbd51c89c75da32f6592de5d9262" diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index dfcf6791ad..0daf0d3ed4 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -1,5 +1,5 @@ [package] -cairo-version = "=2.6.3" +cairo-version = "=2.6.4" name = "dojo_examples" version = "0.7.3" # Use the prelude with the less imports as possible @@ -29,7 +29,7 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" +world_address = "0x6ffdafc135828e1428d94e9587bc36382cdf42a8cd463876b534be20a956397" # `release` profile # diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml index 99bc7921ee..0ef293bcd8 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" -original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +original_class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml index a0d11e457e..b385c1eb5f 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" -original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +original_class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml index 07b05e0714..246e93b7a1 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" -original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +original_class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-base.toml b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml index 35f4edd8d1..aa92e94fac 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-base.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" +original_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml index 2e7374451b..08b3a3437f 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index f226e89204..deca2eecd1 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" +original_class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" abi = "manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml index 1a2e2802f7..58363d2a85 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" +original_class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" abi = "manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml index 23435c0a3a..8faf9fa5f0 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" +original_class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" abi = "manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml index b90e61eafe..b52523d008 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" +original_class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" abi = "manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml index c652d944a0..319270b42b 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" +original_class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" abi = "manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml index 22d3ca018e..59a2ecd684 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" +original_class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" abi = "manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml index db21e81459..b010833f66 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" +original_class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" abi = "manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml index 4055b284ec..bff35fb980 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" +original_class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" abi = "manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json index 655b688a82..cd7ce19061 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2", - "original_class_hash": "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2", + "class_hash": "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92", + "original_class_hash": "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92", "abi": [ { "type": "impl", @@ -1108,8 +1108,8 @@ ] } ], - "address": "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb", - "transaction_hash": "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287", + "address": "0x6ffdafc135828e1428d94e9587bc36382cdf42a8cd463876b534be20a956397", + "transaction_hash": "0x3dd147768d44804d306e22ab63943a7307a160367ff4cbbc9b65870f88850e2", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -1120,8 +1120,8 @@ }, "base": { "kind": "Class", - "class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", - "original_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", + "original_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": "manifests/dev/deployment/abis/dojo-base.json", "tag": "dojo-base", "manifest_name": "dojo-base" @@ -1129,10 +1129,10 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623", - "class_hash": "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75", - "original_class_hash": "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75", - "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "address": "0x5954132061c8ba9fed715a01a2a1064d2d3791ef4c2f6203c790457362abfb5", + "class_hash": "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6", + "original_class_hash": "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6", + "base_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": [ { "type": "impl", @@ -1513,10 +1513,10 @@ }, { "kind": "DojoContract", - "address": "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2", - "class_hash": "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2", - "original_class_hash": "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2", - "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "address": "0x34fa6c359d9f888d120d761eee8f8391ca4d8fd57ea7baa91b7fd1aabdbc343", + "class_hash": "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e", + "original_class_hash": "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e", + "base_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": [ { "type": "impl", @@ -1721,10 +1721,10 @@ }, { "kind": "DojoContract", - "address": "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344", - "class_hash": "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9", - "original_class_hash": "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9", - "base_class_hash": "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46", + "address": "0x6d375b5b8a43fee9ccb152fbb621ac1dae8c18a45f12c44933528908ed0b280", + "class_hash": "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6", + "original_class_hash": "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6", + "base_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": [ { "type": "impl", @@ -1965,8 +1965,8 @@ "key": false } ], - "class_hash": "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a", - "original_class_hash": "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a", + "class_hash": "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a", + "original_class_hash": "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a", "abi": [ { "type": "impl", @@ -2394,8 +2394,8 @@ "key": true } ], - "class_hash": "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b", - "original_class_hash": "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b", + "class_hash": "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a", + "original_class_hash": "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a", "abi": [ { "type": "impl", @@ -2817,8 +2817,8 @@ "key": false } ], - "class_hash": "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519", - "original_class_hash": "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519", + "class_hash": "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb", + "original_class_hash": "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb", "abi": [ { "type": "impl", @@ -3232,8 +3232,8 @@ "key": false } ], - "class_hash": "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4", - "original_class_hash": "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4", + "class_hash": "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38", + "original_class_hash": "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38", "abi": [ { "type": "impl", @@ -3678,8 +3678,8 @@ "key": false } ], - "class_hash": "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609", - "original_class_hash": "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609", + "class_hash": "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a", + "original_class_hash": "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a", "abi": [ { "type": "impl", @@ -4133,8 +4133,8 @@ "key": false } ], - "class_hash": "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca", - "original_class_hash": "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca", + "class_hash": "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec", + "original_class_hash": "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec", "abi": [ { "type": "impl", @@ -4570,8 +4570,8 @@ "key": false } ], - "class_hash": "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34", - "original_class_hash": "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34", + "class_hash": "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13", + "original_class_hash": "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13", "abi": [ { "type": "impl", @@ -5004,8 +5004,8 @@ "key": false } ], - "class_hash": "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b", - "original_class_hash": "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b", + "class_hash": "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47", + "original_class_hash": "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47", "abi": [ { "type": "impl", diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml index 7097b14bc4..23c249df01 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x104dd156d76aeab45146a10869637f161ca6cf9f804704f8bbb12ae5b1b5cfb" -transaction_hash = "0x280e50610d4467bfe1be1adaae7f77642adbe2ad4106cb861e28441e94ff287" +address = "0x6ffdafc135828e1428d94e9587bc36382cdf42a8cd463876b534be20a956397" +transaction_hash = "0x3dd147768d44804d306e22ab63943a7307a160367ff4cbbc9b65870f88850e2" block_number = 3 seed = "dojo_examples" manifest_name = "dojo-world" @@ -15,18 +15,18 @@ rpc_url = "http://localhost:5050/" [base] kind = "Class" -class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" +original_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x2a570e12405096e725508ba1f4ade127edd42e0fcb5890b8f12f76ef043623" -class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" -original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" -base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +address = "0x5954132061c8ba9fed715a01a2a1064d2d3791ef4c2f6203c790457362abfb5" +class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +original_class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +base_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] writes = [ @@ -40,10 +40,10 @@ manifest_name = "dojo_examples-actions-40b6994c" [[contracts]] kind = "DojoContract" -address = "0x26f33e8d81dad06c79c2d944ea519a850e007eb8432ae20d38db82caea590b2" -class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" -original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" -base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +address = "0x34fa6c359d9f888d120d761eee8f8391ca4d8fd57ea7baa91b7fd1aabdbc343" +class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +original_class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +base_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] writes = [] @@ -54,10 +54,10 @@ manifest_name = "dojo_examples-mock_token-31599eb2" [[contracts]] kind = "DojoContract" -address = "0x3304896afaa421f362b3b8e8586773f9a7fcaca050b3fd6885400908803f344" -class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" -original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" -base_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +address = "0x6d375b5b8a43fee9ccb152fbb621ac1dae8c18a45f12c44933528908ed0b280" +class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +original_class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +base_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] writes = [] @@ -72,8 +72,8 @@ manifest_name = "dojo_examples-others-61de2c18" [[models]] kind = "DojoModel" -class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" +original_class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" abi = "manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" @@ -95,8 +95,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" +original_class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" abi = "manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" @@ -123,8 +123,8 @@ key = true [[models]] kind = "DojoModel" -class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" +original_class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" abi = "manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" @@ -141,8 +141,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" +original_class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" @@ -159,8 +159,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" +original_class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" @@ -182,8 +182,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" +original_class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" abi = "manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" @@ -210,8 +210,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" +original_class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" abi = "manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" @@ -228,8 +228,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" +original_class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" abi = "manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml index dd16bfa324..63be5c1917 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" -original_class_hash = "0x7b394d087b5cf4f3b740253c591138bf98d177ef0d9b5c00b0477a145f3fb75" +class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +original_class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml index e11d4ceb3c..783896e36c 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" -original_class_hash = "0x6a55b3f612b0bc5e55603d805c188c0220aa53017fd2f690abe8bad50867ef2" +class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +original_class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml index 6dd2fc4ebf..b1b631a5a1 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" -original_class_hash = "0x3a61e2fafaee0ca4ed5166fbb417270563b4d8518cd1e086733cc346e8ea6b9" +class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +original_class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/dojo-base.toml b/examples/spawn-and-move/manifests/release/base/dojo-base.toml index 83de14f171..78eebf072f 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-base.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-base.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" -original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46" +class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" +original_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/release/base/abis/dojo-base.json" tag = "dojo-base" manifest_name = "dojo-base" diff --git a/examples/spawn-and-move/manifests/release/base/dojo-world.toml b/examples/spawn-and-move/manifests/release/base/dojo-world.toml index 7249b9c358..15ff18b97f 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" -original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2" +class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" abi = "manifests/release/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index ef09f4f8da..cbeb4ea2dd 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" -original_class_hash = "0x1ba185f6f09a7a73f32e6e1d6767c182abe5635d3107c79b64dfdb9f25b3c3a" +class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" +original_class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" abi = "manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml index fdb190ac8c..ee0d8f81bb 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" -original_class_hash = "0x6d9703c6df6af6f097cfdd2e7f838f4fd2b2f2ae27bf27e76065ffb903f9c9b" +class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" +original_class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" abi = "manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml index 71fa47c3e7..7256f93a45 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" -original_class_hash = "0x637d1d7966a14967047e31f3512c694e32b4d6a6dda4afe4b225a8b6f8f3519" +class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" +original_class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" abi = "manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml index 4bb3b5cc3f..3899657efa 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" -original_class_hash = "0x838672e7f67cd6e67336283805b0ef168c814e65b6ba1d3a7a5f31c10559c4" +class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" +original_class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" abi = "manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml index 4eb4aa9f97..1c19d06578 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" -original_class_hash = "0x4e9b10687f487bc0fe159affa3963cf0f7548136a2b614914e11af4497d609" +class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" +original_class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" abi = "manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml index 4c0855b673..054ff54ab4 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" -original_class_hash = "0x3b94d89f5b3589438b8ffcf2cbc8061670deee1d0f81247ab2346d8991b4eca" +class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" +original_class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" abi = "manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml index 0b5a593985..4499459ee0 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" -original_class_hash = "0x59e57c16c3bc8c59a768a342496837275e399509366640620a0682826275a34" +class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" +original_class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" abi = "manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml index 19ca33fbe3..e3d572b447 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" -original_class_hash = "0x38986e1b875d48b2931932879412cf0b6c52d0e04aaac6e2780995b3f47b91b" +class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" +original_class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" abi = "manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 624eb0ea63..628740b12f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.76.0" +channel = "1.79.0" From f9256ea5f5ade18800c39c96664049d5a37d86e5 Mon Sep 17 00:00:00 2001 From: Larko <59736843+Larkooo@users.noreply.github.com> Date: Mon, 8 Jul 2024 00:03:40 -0400 Subject: [PATCH 87/88] feat(dojo-bindgen): add namespace to unity bindgen (#2155) --- crates/dojo-bindgen/src/plugins/unity/mod.rs | 37 ++++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/crates/dojo-bindgen/src/plugins/unity/mod.rs b/crates/dojo-bindgen/src/plugins/unity/mod.rs index dadd24dd20..f83fa84b50 100644 --- a/crates/dojo-bindgen/src/plugins/unity/mod.rs +++ b/crates/dojo-bindgen/src/plugins/unity/mod.rs @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf}; use async_trait::async_trait; use cainome::parser::tokens::{Composite, CompositeType, Function, FunctionOutputKind, Token}; -use dojo_world::contracts::naming; +use dojo_world::contracts::naming::{self, get_namespace_from_tag}; use crate::error::BindgenResult; use crate::plugins::BuiltinPlugin; @@ -178,35 +178,38 @@ public abstract record {}() : Enum {{", // Token should be a model // This will be formatted into a C# class inheriting from ModelInstance // Fields are mapped using C# and unity SDK types - fn format_model(model: &Composite) -> String { + fn format_model(namespace: &str, model: &Composite) -> String { let fields = model .inners .iter() .map(|field| { format!( - "[ModelField(\"{}\")]\n public {} {};", + "[ModelField(\"{}\")]\n public {} {};", field.name, UnityPlugin::map_type(&field.token), field.name, ) }) .collect::>() - .join("\n\n "); + .join("\n\n "); format!( " -// Model definition for `{}` model -public class {} : ModelInstance {{ - {} - - // Start is called before the first frame update - void Start() {{ - }} - - // Update is called once per frame - void Update() {{ +namespace {namespace} {{ + // Model definition for `{}` model + public class {} : ModelInstance {{ + {} + + // Start is called before the first frame update + void Start() {{ + }} + + // Update is called once per frame + void Update() {{ + }} }} }} + ", model.type_path, model.type_name(), @@ -255,7 +258,11 @@ public class {} : ModelInstance {{ out += "\n"; - out += UnityPlugin::format_model(model_struct.expect("model struct not found")).as_str(); + out += UnityPlugin::format_model( + &get_namespace_from_tag(&model.tag), + model_struct.expect("model struct not found"), + ) + .as_str(); out } From 7c09e4a0ab62843f133cf99798e334321c31b97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Baranx?= Date: Mon, 8 Jul 2024 06:10:34 +0200 Subject: [PATCH 88/88] fix selector functions for models and contracts (#2156) --- crates/dojo-core/src/base_test.cairo | 12 +- crates/dojo-core/src/contract.cairo | 13 +- crates/dojo-core/src/model.cairo | 32 +- crates/dojo-core/src/resource_metadata.cairo | 22 +- crates/dojo-core/src/utils_test.cairo | 4 +- crates/dojo-core/src/world.cairo | 22 +- crates/dojo-core/src/world_test.cairo | 12 +- crates/dojo-lang/src/contract.rs | 41 +- .../manifests/dev/base/dojo-world.toml | 4 +- crates/dojo-lang/src/model.rs | 52 +- crates/dojo-lang/src/plugin_test_data/model | 980 +++++++++++------- crates/dojo-lang/src/plugin_test_data/system | 153 ++- crates/dojo-world/src/contracts/model.rs | 2 +- crates/dojo-world/src/contracts/model_test.rs | 2 +- crates/dojo-world/src/contracts/naming.rs | 23 +- crates/sozo/ops/src/auth.rs | 4 +- crates/sozo/ops/src/migration/migrate.rs | 4 +- crates/sozo/ops/src/tests/migration.rs | 6 +- crates/torii/client/src/client/mod.rs | 4 +- crates/torii/client/src/client/storage.rs | 6 +- .../torii/client/src/client/subscription.rs | 10 +- crates/torii/core/src/sql.rs | 10 +- crates/torii/core/src/sql_test.rs | 14 +- .../graphql/src/tests/subscription_test.rs | 6 +- crates/torii/grpc/src/server/mod.rs | 14 +- crates/torii/grpc/src/types/mod.rs | 5 +- crates/torii/libp2p/src/server/mod.rs | 4 +- examples/spawn-and-move/Scarb.toml | 2 +- .../dojo_examples-actions-40b6994c.json | 23 +- .../dojo_examples-mock_token-31599eb2.json | 23 +- .../dojo_examples-others-61de2c18.json | 23 +- ...examples-ContractInitialized-376b7bd6.json | 27 +- .../dojo_examples-Message-1bb1d226.json | 27 +- .../dojo_examples-MockToken-38903c7c.json | 27 +- .../models/dojo_examples-Moved-318ae40d.json | 27 +- .../models/dojo_examples-Moves-2e2accba.json | 27 +- .../dojo_examples-PlayerConfig-3adad785.json | 27 +- .../dojo_examples-Position-1e145e26.json | 27 +- .../dojo_examples-ServerProfile-4caad1e6.json | 27 +- .../dojo_examples-actions-40b6994c.toml | 4 +- .../dojo_examples-mock_token-31599eb2.toml | 4 +- .../dojo_examples-others-61de2c18.toml | 4 +- .../manifests/dev/base/dojo-world.toml | 4 +- ...examples-ContractInitialized-376b7bd6.toml | 4 +- .../dojo_examples-Message-1bb1d226.toml | 4 +- .../dojo_examples-MockToken-38903c7c.toml | 4 +- .../models/dojo_examples-Moved-318ae40d.toml | 4 +- .../models/dojo_examples-Moves-2e2accba.toml | 4 +- .../dojo_examples-PlayerConfig-3adad785.toml | 4 +- .../dojo_examples-Position-1e145e26.toml | 4 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 4 +- .../dojo_examples-actions-40b6994c.json | 23 +- .../dojo_examples-mock_token-31599eb2.json | 23 +- .../dojo_examples-others-61de2c18.json | 23 +- ...examples-ContractInitialized-376b7bd6.json | 27 +- .../dojo_examples-Message-1bb1d226.json | 27 +- .../dojo_examples-MockToken-38903c7c.json | 27 +- .../models/dojo_examples-Moved-318ae40d.json | 27 +- .../models/dojo_examples-Moves-2e2accba.json | 27 +- .../dojo_examples-PlayerConfig-3adad785.json | 27 +- .../dojo_examples-Position-1e145e26.json | 27 +- .../dojo_examples-ServerProfile-4caad1e6.json | 27 +- .../manifests/dev/deployment/manifest.json | 343 ++++-- .../manifests/dev/deployment/manifest.toml | 58 +- .../dojo_examples-actions-40b6994c.json | 23 +- .../dojo_examples-mock_token-31599eb2.json | 23 +- .../dojo_examples-others-61de2c18.json | 23 +- ...examples-ContractInitialized-376b7bd6.json | 27 +- .../dojo_examples-Message-1bb1d226.json | 27 +- .../dojo_examples-MockToken-38903c7c.json | 27 +- .../models/dojo_examples-Moved-318ae40d.json | 27 +- .../models/dojo_examples-Moves-2e2accba.json | 27 +- .../dojo_examples-PlayerConfig-3adad785.json | 27 +- .../dojo_examples-Position-1e145e26.json | 27 +- .../dojo_examples-ServerProfile-4caad1e6.json | 27 +- .../dojo_examples-actions-40b6994c.toml | 4 +- .../dojo_examples-mock_token-31599eb2.toml | 4 +- .../dojo_examples-others-61de2c18.toml | 4 +- .../manifests/release/base/dojo-world.toml | 4 +- ...examples-ContractInitialized-376b7bd6.toml | 4 +- .../dojo_examples-Message-1bb1d226.toml | 4 +- .../dojo_examples-MockToken-38903c7c.toml | 4 +- .../models/dojo_examples-Moved-318ae40d.toml | 4 +- .../models/dojo_examples-Moves-2e2accba.toml | 4 +- .../dojo_examples-PlayerConfig-3adad785.toml | 4 +- .../dojo_examples-Position-1e145e26.toml | 4 +- .../dojo_examples-ServerProfile-4caad1e6.toml | 4 +- 87 files changed, 1763 insertions(+), 1052 deletions(-) diff --git a/crates/dojo-core/src/base_test.cairo b/crates/dojo-core/src/base_test.cairo index 958e893906..40b6414822 100644 --- a/crates/dojo-core/src/base_test.cairo +++ b/crates/dojo-core/src/base_test.cairo @@ -112,7 +112,7 @@ trait IMetadataOnly { fn selector(self: @T) -> felt252; fn name(self: @T) -> ByteArray; fn namespace(self: @T) -> ByteArray; - fn namespace_selector(self: @T) -> felt252; + fn namespace_hash(self: @T) -> felt252; } #[starknet::contract] @@ -131,7 +131,7 @@ mod invalid_legacy_model { "dojo" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn namespace_hash(self: @ContractState) -> felt252 { dojo::utils::hash(@Self::namespace(self)) } @@ -158,7 +158,7 @@ mod invalid_legacy_model_world { "dojo" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn namespace_hash(self: @ContractState) -> felt252 { dojo::utils::hash(@Self::namespace(self)) } @@ -178,14 +178,14 @@ mod invalid_model { fn selector(self: @ContractState) -> felt252 { // NOTE: Need to update this value if address changes // Pre-computed address of a contract deployed through the world. - 0x1130142d6bff3c9cb891a270922a4c6dbf4c222b675cdc1341905b17341e3ab + 0x21b19f95ff0f382a069dc7034f95584b300133665ee506789c76ba729e42b66 } fn namespace(self: @ContractState) -> ByteArray { "dojo" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn namespace_hash(self: @ContractState) -> felt252 { dojo::utils::hash(@Self::namespace(self)) } @@ -212,7 +212,7 @@ mod invalid_model_world { "dojo" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn namespace_hash(self: @ContractState) -> felt252 { dojo::utils::hash(@Self::namespace(self)) } diff --git a/crates/dojo-core/src/contract.cairo b/crates/dojo-core/src/contract.cairo index c791225c3e..c9aa602947 100644 --- a/crates/dojo-core/src/contract.cairo +++ b/crates/dojo-core/src/contract.cairo @@ -1,15 +1,10 @@ #[starknet::interface] trait IContract { fn contract_name(self: @T) -> ByteArray; - fn selector(self: @T) -> felt252; - - /// Returns the namespace of a contract. fn namespace(self: @T) -> ByteArray; - - // Returns the namespace selector built from its name. - /// namespace_selector = hash(namespace_name) - fn namespace_selector(self: @T) -> felt252; - - // Returns the contract tag fn tag(self: @T) -> ByteArray; + + fn name_hash(self: @T) -> felt252; + fn namespace_hash(self: @T) -> felt252; + fn selector(self: @T) -> felt252; } diff --git a/crates/dojo-core/src/model.cairo b/crates/dojo-core/src/model.cairo index f577b41d58..d26d43f54a 100644 --- a/crates/dojo-core/src/model.cairo +++ b/crates/dojo-core/src/model.cairo @@ -8,22 +8,22 @@ trait Model { /// Returns the name of the model as it was written in Cairo code. fn name() -> ByteArray; + + /// Returns the namespace of the model as it was written in the `dojo::model` attribute. + fn namespace() -> ByteArray; + + // Returns the model tag which combines the namespace and the name. + fn tag() -> ByteArray; + fn version() -> u8; /// Returns the model selector built from its name and its namespace. - /// model selector = hash(hash(namespace_name), hash(model_name)) + /// model selector = hash(namespace_hash, model_hash) fn selector() -> felt252; fn instance_selector(self: @T) -> felt252; - /// Returns the namespace of the model as it was written in the `dojo::model` attribute. - fn namespace() -> ByteArray; - - /// Returns the model namespace selector built from its namespace. - /// namespace_selector = hash(namespace_name) - fn namespace_selector() -> felt252; - - // Returns the model tag - fn tag() -> ByteArray; + fn name_hash() -> felt252; + fn namespace_hash() -> felt252; fn keys(self: @T) -> Span; fn values(self: @T) -> Span; @@ -34,12 +34,14 @@ trait Model { #[starknet::interface] trait IModel { - fn selector(self: @T) -> felt252; fn name(self: @T) -> ByteArray; - fn version(self: @T) -> u8; fn namespace(self: @T) -> ByteArray; - fn namespace_selector(self: @T) -> felt252; fn tag(self: @T) -> ByteArray; + fn version(self: @T) -> u8; + + fn selector(self: @T) -> felt252; + fn name_hash(self: @T) -> felt252; + fn namespace_hash(self: @T) -> felt252; fn unpacked_size(self: @T) -> Option; fn packed_size(self: @T) -> Option; fn layout(self: @T) -> dojo::database::introspect::Layout; @@ -63,6 +65,6 @@ fn deploy_and_get_metadata( let name = model.name(); let selector = model.selector(); let namespace = model.namespace(); - let namespace_selector = model.namespace_selector(); - Result::Ok((contract_address, name, selector, namespace, namespace_selector)) + let namespace_hash = model.namespace_hash(); + Result::Ok((contract_address, name, selector, namespace, namespace_hash)) } diff --git a/crates/dojo-core/src/resource_metadata.cairo b/crates/dojo-core/src/resource_metadata.cairo index 270742a521..601f05f391 100644 --- a/crates/dojo-core/src/resource_metadata.cairo +++ b/crates/dojo-core/src/resource_metadata.cairo @@ -50,6 +50,14 @@ impl ResourceMetadataModel of dojo::model::Model { "ResourceMetadata" } + fn namespace() -> ByteArray { + "__DOJO__" + } + + fn tag() -> ByteArray { + "__DOJO__-ResourceMetadata" + } + #[inline(always)] fn version() -> u8 { 1 @@ -57,9 +65,7 @@ impl ResourceMetadataModel of dojo::model::Model { #[inline(always)] fn selector() -> felt252 { - poseidon::poseidon_hash_span( - array![Self::namespace_selector(), dojo::utils::hash(@Self::name())].span() - ) + poseidon::poseidon_hash_span(array![Self::namespace_hash(), Self::name_hash()].span()) } #[inline(always)] @@ -67,18 +73,14 @@ impl ResourceMetadataModel of dojo::model::Model { Self::selector() } - fn namespace() -> ByteArray { - "__DOJO__" + fn name_hash() -> felt252 { + dojo::utils::hash(@Self::name()) } - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { dojo::utils::hash(@Self::namespace()) } - fn tag() -> ByteArray { - "__DOJO__:ResourceMetadata" - } - #[inline(always)] fn keys(self: @ResourceMetadata) -> Span { let mut serialized = core::array::ArrayTrait::new(); diff --git a/crates/dojo-core/src/utils_test.cairo b/crates/dojo-core/src/utils_test.cairo index 2a28ed4546..a0a9c14744 100644 --- a/crates/dojo-core/src/utils_test.cairo +++ b/crates/dojo-core/src/utils_test.cairo @@ -11,7 +11,7 @@ fn test_hash_computation() { // Be sure that the namespace hash computed in `dojo-lang` in Rust is equal // to the one computed in Cairo by dojo::utils:hash let namespace = dojo::model::Model::::namespace(); - let namespace_selector = dojo::model::Model::::namespace_selector(); + let namespace_hash = dojo::model::Model::::namespace_hash(); - assert(dojo::utils::hash(@namespace) == namespace_selector, 'invalid computed hash'); + assert(dojo::utils::hash(@namespace) == namespace_hash, 'invalid computed hash'); } diff --git a/crates/dojo-core/src/world.cairo b/crates/dojo-core/src/world.cairo index d9decc460a..2db09d2f80 100644 --- a/crates/dojo-core/src/world.cairo +++ b/crates/dojo-core/src/world.cairo @@ -526,7 +526,7 @@ mod world { let caller = get_caller_address(); let salt = self.models_count.read(); - let (address, name, selector, namespace, namespace_selector) = + let (address, name, selector, namespace, namespace_hash) = dojo::model::deploy_and_get_metadata( salt.into(), class_hash ) @@ -538,11 +538,9 @@ mod world { starknet::contract_address::ContractAddressZeroable::zero(), ); + assert(self._is_namespace_registered(namespace_hash), Errors::NAMESPACE_NOT_REGISTERED); assert( - self._is_namespace_registered(namespace_selector), Errors::NAMESPACE_NOT_REGISTERED - ); - assert( - self.can_write_namespace(namespace_selector, get_caller_address()), + self.can_write_namespace(namespace_hash, get_caller_address()), Errors::NO_NAMESPACE_WRITE_ACCESS ); @@ -653,12 +651,10 @@ mod world { let dispatcher = IContractDispatcher { contract_address }; let namespace = dispatcher.namespace(); let name = dispatcher.contract_name(); - let namespace_selector = dispatcher.namespace_selector(); - assert( - self._is_namespace_registered(namespace_selector), Errors::NAMESPACE_NOT_REGISTERED - ); + let namespace_hash = dispatcher.namespace_hash(); + assert(self._is_namespace_registered(namespace_hash), Errors::NAMESPACE_NOT_REGISTERED); assert( - self.can_write_namespace(namespace_selector, get_caller_address()), + self.can_write_namespace(namespace_hash, get_caller_address()), Errors::NO_NAMESPACE_WRITE_ACCESS ); @@ -931,9 +927,9 @@ mod world { /// Indicates if the provided namespace is already registered #[inline(always)] - fn _is_namespace_registered(self: @ContractState, namespace_selector: felt252) -> bool { + fn _is_namespace_registered(self: @ContractState, namespace_hash: felt252) -> bool { // TODO: use match self.resources... directly when https://github.com/starkware-libs/cairo/pull/5743 fixed - let resource: ResourceData = self.resources.read(namespace_selector); + let resource: ResourceData = self.resources.read(namespace_hash); match resource { ResourceData::Namespace => true, _ => false @@ -965,7 +961,7 @@ mod world { && !self.is_account_owner(model_id) && !self.is_account_writer(model_id) { let model = IModelDispatcher { contract_address: model_address }; - self._check_basic_write_access(model.namespace_selector(), contract) + self._check_basic_write_access(model.namespace_hash(), contract) } else { true } diff --git a/crates/dojo-core/src/world_test.cairo b/crates/dojo-core/src/world_test.cairo index 955ad4a8a6..1958726cfd 100644 --- a/crates/dojo-core/src/world_test.cairo +++ b/crates/dojo-core/src/world_test.cairo @@ -260,7 +260,7 @@ trait IMetadataOnly { fn selector(self: @T) -> felt252; fn name(self: @T) -> ByteArray; fn namespace(self: @T) -> ByteArray; - fn namespace_selector(self: @T) -> felt252; + fn namespace_hash(self: @T) -> felt252; } #[starknet::contract] @@ -278,7 +278,7 @@ mod resource_metadata_malicious { "dojo" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn namespace_hash(self: @ContractState) -> felt252 { dojo::utils::hash(@Self::namespace(self)) } @@ -1493,7 +1493,7 @@ fn test_write_model_for_namespace_owner() { let contract = starknet::contract_address_const::<0xdeadbeef>(); // the caller account is a model namespace owner - world.grant_owner(account, dojo::model::Model::::namespace_selector()); + world.grant_owner(account, dojo::model::Model::::namespace_hash()); starknet::testing::set_account_contract_address(account); starknet::testing::set_contract_address(contract); @@ -1524,7 +1524,7 @@ fn test_write_model_for_namespace_writer() { let account = starknet::contract_address_const::<0xb0b>(); let contract = starknet::contract_address_const::<0xdeadbeef>(); - world.grant_writer(dojo::model::Model::::namespace_selector(), contract); + world.grant_writer(dojo::model::Model::::namespace_hash(), contract); // the account does not own anything starknet::testing::set_account_contract_address(account); @@ -1557,7 +1557,7 @@ fn test_write_namespace_for_namespace_owner() { let account = starknet::contract_address_const::<0xb0b>(); let contract = starknet::contract_address_const::<0xdeadbeef>(); - world.grant_owner(account, dojo::model::Model::::namespace_selector()); + world.grant_owner(account, dojo::model::Model::::namespace_hash()); // the account owns the Foo model namespace so it should be able to deploy // and register the model. @@ -1574,7 +1574,7 @@ fn test_write_namespace_for_namespace_writer() { let account = starknet::contract_address_const::<0xb0b>(); let contract = starknet::contract_address_const::<0xdeadbeef>(); - world.grant_writer(dojo::model::Model::::namespace_selector(), account); + world.grant_writer(dojo::model::Model::::namespace_hash(), account); // the account has write access to the Foo model namespace so it should be able // to deploy and register the model. diff --git a/crates/dojo-lang/src/contract.rs b/crates/dojo-lang/src/contract.rs index 0bd61a7611..fb6f787c39 100644 --- a/crates/dojo-lang/src/contract.rs +++ b/crates/dojo-lang/src/contract.rs @@ -73,8 +73,10 @@ impl DojoContract { } let contract_tag = naming::get_tag(&contract_namespace, &name); - let contract_name_selector = naming::compute_bytearray_hash(&name); - let contract_namespace_selector = naming::compute_bytearray_hash(&contract_namespace); + let contract_name_hash = naming::compute_bytearray_hash(&name); + let contract_namespace_hash = naming::compute_bytearray_hash(&contract_namespace); + let contract_selector = + naming::compute_selector_from_hashes(contract_namespace_hash, contract_name_hash); if let MaybeModuleBody::Some(body) = module_ast.body(db) { let mut body_nodes: Vec<_> = body @@ -165,21 +167,26 @@ impl DojoContract { fn contract_name(self: @ContractState) -> ByteArray { \"$name$\" } - fn selector(self: @ContractState) -> felt252 { - $contract_name_selector$ - } fn namespace(self: @ContractState) -> ByteArray { \"$contract_namespace$\" } - fn namespace_selector(self: @ContractState) -> felt252 { - $contract_namespace_selector$ - } - fn tag(self: @ContractState) -> ByteArray { \"$contract_tag$\" } + + fn name_hash(self: @ContractState) -> felt252 { + $contract_name_hash$ + } + + fn namespace_hash(self: @ContractState) -> felt252 { + $contract_namespace_hash$ + } + + fn selector(self: @ContractState) -> felt252 { + $contract_selector$ + } } #[abi(embed_v0)] @@ -198,18 +205,22 @@ impl DojoContract { ", &UnorderedHashMap::from([ ("name".to_string(), RewriteNode::Text(name.to_string())), - ( - "contract_name_selector".to_string(), - RewriteNode::Text(contract_name_selector.to_string()), - ), ("body".to_string(), RewriteNode::new_modified(body_nodes)), ( "contract_namespace".to_string(), RewriteNode::Text(contract_namespace.clone()), ), ( - "contract_namespace_selector".to_string(), - RewriteNode::Text(contract_namespace_selector.to_string()), + "contract_name_hash".to_string(), + RewriteNode::Text(contract_name_hash.to_string()), + ), + ( + "contract_namespace_hash".to_string(), + RewriteNode::Text(contract_namespace_hash.to_string()), + ), + ( + "contract_selector".to_string(), + RewriteNode::Text(contract_selector.to_string()), ), ("contract_tag".to_string(), RewriteNode::Text(contract_tag)), ]), diff --git a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml index 08b3a3437f..83a7a20228 100644 --- a/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml +++ b/crates/dojo-lang/src/manifest_test_data/compiler_cairo/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" -original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" +original_class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/crates/dojo-lang/src/model.rs b/crates/dojo-lang/src/model.rs index 29da3a0603..18bdd3ed80 100644 --- a/crates/dojo-lang/src/model.rs +++ b/crates/dojo-lang/src/model.rs @@ -230,7 +230,7 @@ pub fn handle_model_struct( _ => ( RewriteNode::Text(DEFAULT_MODEL_VERSION.to_string()), RewriteNode::Text( - naming::compute_model_selector_from_hash(model_namespace_hash, model_name_hash) + naming::compute_selector_from_hashes(model_namespace_hash, model_name_hash) .to_string(), ), ), @@ -344,6 +344,16 @@ impl $type_name$Model of dojo::model::Model<$type_name$> { \"$type_name$\" } + #[inline(always)] + fn namespace() -> ByteArray { + \"$model_namespace$\" + } + + #[inline(always)] + fn tag() -> ByteArray { + \"$model_tag$\" + } + #[inline(always)] fn version() -> u8 { $model_version$ @@ -360,19 +370,14 @@ impl $type_name$Model of dojo::model::Model<$type_name$> { } #[inline(always)] - fn namespace() -> ByteArray { - \"$model_namespace$\" + fn name_hash() -> felt252 { + $model_name_hash$ } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { $model_namespace_hash$ } - - #[inline(always)] - fn tag() -> ByteArray { - \"$model_tag$\" - } #[inline(always)] fn keys(self: @$type_name$) -> Span { @@ -431,30 +436,34 @@ mod $contract_name$ { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::<$type_name$>::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::<$type_name$>::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::<$type_name$>::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::<$type_name$>::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::<$type_name$>::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::<$type_name$>::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::<$type_name$>::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::<$type_name$>::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::<$type_name$>::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::<$type_name$>::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::<$type_name$>::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::<$type_name$>::size() } @@ -488,6 +497,7 @@ mod $contract_name$ { ("model_version".to_string(), model_version), ("model_selector".to_string(), model_selector), ("model_namespace".to_string(), RewriteNode::Text(model_namespace.clone())), + ("model_name_hash".to_string(), RewriteNode::Text(model_name_hash.to_string())), ( "model_namespace_hash".to_string(), RewriteNode::Text(model_namespace_hash.to_string()), diff --git a/crates/dojo-lang/src/plugin_test_data/model b/crates/dojo-lang/src/plugin_test_data/model index 620747c774..fd85ef4652 100644 --- a/crates/dojo-lang/src/plugin_test_data/model +++ b/crates/dojo-lang/src/plugin_test_data/model @@ -427,6 +427,16 @@ impl BadModelMultipleVersionsModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelMultipleVersions" + } + #[inline(always)] fn version() -> u8 { 0 @@ -443,19 +453,14 @@ impl BadModelMultipleVersionsModel of dojo::model::Model ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 3538888628466873673221842373412072042558277047191927145880480325050722136660 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-BadModelMultipleVersions" - } #[inline(always)] fn keys(self: @BadModelMultipleVersions) -> Span { @@ -514,30 +519,34 @@ mod bad_model_multiple_versions { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -635,6 +644,16 @@ impl BadModelBadVersionTypeModel of dojo::model::Model { "BadModelBadVersionType" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelBadVersionType" + } + #[inline(always)] fn version() -> u8 { 1 @@ -651,19 +670,14 @@ impl BadModelBadVersionTypeModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 760683829940564015458541272487101565210915690045377810379189532484191344547 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-BadModelBadVersionType" - } #[inline(always)] fn keys(self: @BadModelBadVersionType) -> Span { @@ -722,30 +736,34 @@ mod bad_model_bad_version_type { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -843,6 +861,16 @@ impl BadModelNoVersionValueModel of dojo::model::Model { "BadModelNoVersionValue" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelNoVersionValue" + } + #[inline(always)] fn version() -> u8 { 1 @@ -859,19 +887,14 @@ impl BadModelNoVersionValueModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 2459365230136118590954025890011480023818926626380754992635699340900694864996 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-BadModelNoVersionValue" - } #[inline(always)] fn keys(self: @BadModelNoVersionValue) -> Span { @@ -930,30 +953,34 @@ mod bad_model_no_version_value { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1051,6 +1078,16 @@ impl BadModelUnexpectedArgWithValueModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelUnexpectedArgWithValue" + } + #[inline(always)] fn version() -> u8 { 1 @@ -1067,19 +1104,14 @@ impl BadModelUnexpectedArgWithValueModel of dojo::model::Model ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 3586339245084542986020591057627093254376225984628310828088084183494435682971 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-BadModelUnexpectedArgWithValue" - } #[inline(always)] fn keys(self: @BadModelUnexpectedArgWithValue) -> Span { @@ -1138,30 +1170,34 @@ mod bad_model_unexpected_arg_with_value { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1259,6 +1295,16 @@ impl BadModelUnexpectedArgModel of dojo::model::Model { "BadModelUnexpectedArg" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelUnexpectedArg" + } + #[inline(always)] fn version() -> u8 { 1 @@ -1275,19 +1321,14 @@ impl BadModelUnexpectedArgModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 246403407829267991441535935236143476032296881039254363860883767387993960270 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-BadModelUnexpectedArg" - } #[inline(always)] fn keys(self: @BadModelUnexpectedArg) -> Span { @@ -1346,30 +1387,34 @@ mod bad_model_unexpected_arg { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1467,6 +1512,16 @@ impl BadModelNotSupportedVersionModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-BadModelNotSupportedVersion" + } + #[inline(always)] fn version() -> u8 { 1 @@ -1483,19 +1538,14 @@ impl BadModelNotSupportedVersionModel of dojo::model::Model ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 1812257929012908024237871796629728977392496349235879470060252299886369485820 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-BadModelNotSupportedVersion" - } #[inline(always)] fn keys(self: @BadModelNotSupportedVersion) -> Span { @@ -1554,30 +1604,34 @@ mod bad_model_not_supported_version { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1675,6 +1729,16 @@ impl Modelv0Model of dojo::model::Model { "Modelv0" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Modelv0" + } + #[inline(always)] fn version() -> u8 { 0 @@ -1691,19 +1755,14 @@ impl Modelv0Model of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 2212879130471315306779111820244908968466545702031328551192231795237740448313 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-Modelv0" - } #[inline(always)] fn keys(self: @Modelv0) -> Span { @@ -1762,30 +1821,34 @@ mod modelv_0 { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -1883,6 +1946,16 @@ impl ModelWithBadNamespaceFormatModel of dojo::model::Model ByteArray { + "MyNamespace" + } + + #[inline(always)] + fn tag() -> ByteArray { + "MyNamespace-ModelWithBadNamespaceFormat" + } + #[inline(always)] fn version() -> u8 { 1 @@ -1899,19 +1972,14 @@ impl ModelWithBadNamespaceFormatModel of dojo::model::Model ByteArray { - "MyNamespace" + fn name_hash() -> felt252 { + 513559242384681567568052881519197161166285694153303371154270254637843894159 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 2518247443458975119180817677753479732439290689944304814934908400279022945373 } - - #[inline(always)] - fn tag() -> ByteArray { - "MyNamespace-ModelWithBadNamespaceFormat" - } #[inline(always)] fn keys(self: @ModelWithBadNamespaceFormat) -> Span { @@ -1970,30 +2038,34 @@ mod model_with_bad_namespace_format { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2091,6 +2163,16 @@ impl ModelWithShortStringNamespaceModel of dojo::model::Model ByteArray { + "my_namespace" + } + + #[inline(always)] + fn tag() -> ByteArray { + "my_namespace-ModelWithShortStringNamespace" + } + #[inline(always)] fn version() -> u8 { 1 @@ -2107,19 +2189,14 @@ impl ModelWithShortStringNamespaceModel of dojo::model::Model ByteArray { - "my_namespace" + fn name_hash() -> felt252 { + 4646597166239297873853881466258165424425132957303541470648153031188639878 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 1685136890688416384941629523783652800960468745356230625531475538826800548713 } - - #[inline(always)] - fn tag() -> ByteArray { - "my_namespace-ModelWithShortStringNamespace" - } #[inline(always)] fn keys(self: @ModelWithShortStringNamespace) -> Span { @@ -2178,30 +2255,34 @@ mod model_with_short_string_namespace { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2299,6 +2380,16 @@ impl ModelWithStringNamespaceModel of dojo::model::Model ByteArray { + "my_namespace" + } + + #[inline(always)] + fn tag() -> ByteArray { + "my_namespace-ModelWithStringNamespace" + } + #[inline(always)] fn version() -> u8 { 1 @@ -2315,19 +2406,14 @@ impl ModelWithStringNamespaceModel of dojo::model::Model ByteArray { - "my_namespace" + fn name_hash() -> felt252 { + 36187013840655350498900857372670392628596870210415176261336407419317644423 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 1685136890688416384941629523783652800960468745356230625531475538826800548713 } - - #[inline(always)] - fn tag() -> ByteArray { - "my_namespace-ModelWithStringNamespace" - } #[inline(always)] fn keys(self: @ModelWithStringNamespace) -> Span { @@ -2386,30 +2472,34 @@ mod model_with_string_namespace { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2507,6 +2597,16 @@ impl PositionModel of dojo::model::Model { "Position" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Position" + } + #[inline(always)] fn version() -> u8 { 1 @@ -2523,19 +2623,14 @@ impl PositionModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 2899920299641094436341712346886623904698864491830316325765258522168980161362 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-Position" - } #[inline(always)] fn keys(self: @Position) -> Span { @@ -2594,30 +2689,34 @@ mod position { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2715,6 +2814,16 @@ impl RolesModel of dojo::model::Model { "Roles" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Roles" + } + #[inline(always)] fn version() -> u8 { 1 @@ -2731,19 +2840,14 @@ impl RolesModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 2030971736961612564423689930729061756599290850089001157163423482274886199516 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-Roles" - } #[inline(always)] fn keys(self: @Roles) -> Span { @@ -2802,30 +2906,34 @@ mod roles { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -2915,6 +3023,16 @@ impl OnlyKeyModelModel of dojo::model::Model { "OnlyKeyModel" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-OnlyKeyModel" + } + #[inline(always)] fn version() -> u8 { 1 @@ -2931,19 +3049,14 @@ impl OnlyKeyModelModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 1001826121797570811408809643478760373535949956555931325019299477987282578617 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-OnlyKeyModel" - } #[inline(always)] fn keys(self: @OnlyKeyModel) -> Span { @@ -3002,30 +3115,34 @@ mod only_key_model { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3115,6 +3232,16 @@ impl U256KeyModelModel of dojo::model::Model { "U256KeyModel" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-U256KeyModel" + } + #[inline(always)] fn version() -> u8 { 1 @@ -3131,19 +3258,14 @@ impl U256KeyModelModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 1848733002266458148515852001373055968326209639346734967305014900020806934517 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-U256KeyModel" - } #[inline(always)] fn keys(self: @U256KeyModel) -> Span { @@ -3202,30 +3324,34 @@ mod u_256_key_model { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3328,6 +3454,16 @@ impl PlayerModel of dojo::model::Model { "Player" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-Player" + } + #[inline(always)] fn version() -> u8 { 1 @@ -3344,19 +3480,14 @@ impl PlayerModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 1073075359926275415180704315933677548333097210683379121732618306925003101845 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-Player" - } #[inline(always)] fn keys(self: @Player) -> Span { @@ -3415,30 +3546,34 @@ mod player { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3550,6 +3685,16 @@ impl ModelWithSimpleArrayModel of dojo::model::Model { "ModelWithSimpleArray" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithSimpleArray" + } + #[inline(always)] fn version() -> u8 { 1 @@ -3566,19 +3711,14 @@ impl ModelWithSimpleArrayModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 173141902001925402715103859951360389436088950156916962046507357841237663931 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-ModelWithSimpleArray" - } #[inline(always)] fn keys(self: @ModelWithSimpleArray) -> Span { @@ -3637,30 +3777,34 @@ mod model_with_simple_array { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3768,6 +3912,16 @@ impl ModelWithByteArrayModel of dojo::model::Model { "ModelWithByteArray" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithByteArray" + } + #[inline(always)] fn version() -> u8 { 1 @@ -3784,19 +3938,14 @@ impl ModelWithByteArrayModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 2176409715042145900636260236501596599545103472111273072320531220776338338674 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-ModelWithByteArray" - } #[inline(always)] fn keys(self: @ModelWithByteArray) -> Span { @@ -3855,30 +4004,34 @@ mod model_with_byte_array { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -3990,6 +4143,16 @@ impl ModelWithComplexArrayModel of dojo::model::Model { "ModelWithComplexArray" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithComplexArray" + } + #[inline(always)] fn version() -> u8 { 1 @@ -4006,19 +4169,14 @@ impl ModelWithComplexArrayModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 2866472224509756243720005045848892642397514372569303051745174230372637769655 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-ModelWithComplexArray" - } #[inline(always)] fn keys(self: @ModelWithComplexArray) -> Span { @@ -4077,30 +4235,34 @@ mod model_with_complex_array { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -4219,6 +4381,16 @@ impl ModelWithTupleModel of dojo::model::Model { "ModelWithTuple" } + #[inline(always)] + fn namespace() -> ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithTuple" + } + #[inline(always)] fn version() -> u8 { 1 @@ -4235,19 +4407,14 @@ impl ModelWithTupleModel of dojo::model::Model { } #[inline(always)] - fn namespace() -> ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 3222351670132870101782632958288197874250493316621507272653773018669253981260 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-ModelWithTuple" - } #[inline(always)] fn keys(self: @ModelWithTuple) -> Span { @@ -4306,30 +4473,34 @@ mod model_with_tuple { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } @@ -4457,6 +4628,16 @@ impl ModelWithTupleNoPrimitivesModel of dojo::model::Model ByteArray { + "dojo_plugin" + } + + #[inline(always)] + fn tag() -> ByteArray { + "dojo_plugin-ModelWithTupleNoPrimitives" + } + #[inline(always)] fn version() -> u8 { 1 @@ -4473,19 +4654,14 @@ impl ModelWithTupleNoPrimitivesModel of dojo::model::Model ByteArray { - "dojo_plugin" + fn name_hash() -> felt252 { + 157059227407493660591195028728750607977045261142495925435047270200565107096 } #[inline(always)] - fn namespace_selector() -> felt252 { + fn namespace_hash() -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - - #[inline(always)] - fn tag() -> ByteArray { - "dojo_plugin-ModelWithTupleNoPrimitives" - } #[inline(always)] fn keys(self: @ModelWithTupleNoPrimitives) -> Span { @@ -4544,30 +4720,34 @@ mod model_with_tuple_no_primitives { #[abi(embed_v0)] impl DojoModelImpl of dojo::model::IModel{ - fn selector(self: @ContractState) -> felt252 { - dojo::model::Model::::selector() - } - fn name(self: @ContractState) -> ByteArray { dojo::model::Model::::name() } + fn namespace(self: @ContractState) -> ByteArray { + dojo::model::Model::::namespace() + } + + fn tag(self: @ContractState) -> ByteArray { + dojo::model::Model::::tag() + } + fn version(self: @ContractState) -> u8 { dojo::model::Model::::version() } - - fn namespace(self: @ContractState) -> ByteArray { - dojo::model::Model::::namespace() + + fn selector(self: @ContractState) -> felt252 { + dojo::model::Model::::selector() } - fn namespace_selector(self: @ContractState) -> felt252 { - dojo::model::Model::::namespace_selector() + fn name_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::name_hash() } - fn tag(self: @ContractState) -> ByteArray { - dojo::model::Model::::tag() + fn namespace_hash(self: @ContractState) -> felt252 { + dojo::model::Model::::namespace_hash() } - + fn unpacked_size(self: @ContractState) -> Option { dojo::database::introspect::Introspect::::size() } diff --git a/crates/dojo-lang/src/plugin_test_data/system b/crates/dojo-lang/src/plugin_test_data/system index aff6b4d446..9c832941be 100644 --- a/crates/dojo-lang/src/plugin_test_data/system +++ b/crates/dojo-lang/src/plugin_test_data/system @@ -976,20 +976,25 @@ mod testcomponent2 { fn contract_name(self: @ContractState) -> ByteArray { "spawn" } - fn selector(self: @ContractState) -> felt252 { - 2776321589048333240377325502911505147617911439383944762363370901236132332849 - } fn namespace(self: @ContractState) -> ByteArray { "my_namespace" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "my_namespace-spawn" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2776321589048333240377325502911505147617911439383944762363370901236132332849 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 1685136890688416384941629523783652800960468745356230625531475538826800548713 } - fn tag(self: @ContractState) -> ByteArray { - "my_namespace-spawn" + fn selector(self: @ContractState) -> felt252 { + 927765609926166707747357189894656840364326580388522007560729768978560453318 } } @@ -1051,20 +1056,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "proxy" } - fn selector(self: @ContractState) -> felt252 { - 379211399603323842291430789821178524592027629543381998047225121027704003915 - } fn namespace(self: @ContractState) -> ByteArray { "my_namespace" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "my_namespace-proxy" + } + + fn name_hash(self: @ContractState) -> felt252 { + 379211399603323842291430789821178524592027629543381998047225121027704003915 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 1685136890688416384941629523783652800960468745356230625531475538826800548713 } - fn tag(self: @ContractState) -> ByteArray { - "my_namespace-proxy" + fn selector(self: @ContractState) -> felt252 { + 1517897915978631541665409557725081861100844369870047691780983681552158397188 } } @@ -1123,20 +1133,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "ctxnamed" } - fn selector(self: @ContractState) -> felt252 { - 1120614286815912604239420768209466007446460277061516527925636408561239543041 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-ctxnamed" + } + + fn name_hash(self: @ContractState) -> felt252 { + 1120614286815912604239420768209466007446460277061516527925636408561239543041 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-ctxnamed" + fn selector(self: @ContractState) -> felt252 { + 623565658600000333752908975824209395490663664165083881849022643225286426420 } } @@ -1198,20 +1213,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "withevent" } - fn selector(self: @ContractState) -> felt252 { - 2196275886623691942883456540767114081898043897719876113518403014973431884540 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-withevent" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2196275886623691942883456540767114081898043897719876113518403014973431884540 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-withevent" + fn selector(self: @ContractState) -> felt252 { + 2582359560254878564957629514448262994748633755439313237356383717683931939594 } } @@ -1274,20 +1294,25 @@ impl TestEventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "withcomponent" } - fn selector(self: @ContractState) -> felt252 { - 999850881662666048155666650426666132968026605763740651763663703103974774091 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-withcomponent" + } + + fn name_hash(self: @ContractState) -> felt252 { + 999850881662666048155666650426666132968026605763740651763663703103974774091 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-withcomponent" + fn selector(self: @ContractState) -> felt252 { + 1893210824839004090894033724660704927789166883140571787032524912616670830055 } } @@ -1369,20 +1394,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "MyFaultyContract" } - fn selector(self: @ContractState) -> felt252 { - 3439743807865759203015037013733809315384408083697880336790137144257764256358 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-MyFaultyContract" + } + + fn name_hash(self: @ContractState) -> felt252 { + 3439743807865759203015037013733809315384408083697880336790137144257764256358 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-MyFaultyContract" + fn selector(self: @ContractState) -> felt252 { + 1974917320104648462406919942169147060276288716394308386802867612090262110929 } } @@ -1453,20 +1483,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "MyNominalContract" } - fn selector(self: @ContractState) -> felt252 { - 1172628497499445169993220559087829230676589931723677494032285307738203070578 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-MyNominalContract" + } + + fn name_hash(self: @ContractState) -> felt252 { + 1172628497499445169993220559087829230676589931723677494032285307738203070578 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-MyNominalContract" + fn selector(self: @ContractState) -> felt252 { + 71500767592493013583062359997839280192942880614138784688801482747283680564 } } @@ -1548,20 +1583,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "init_test" } - fn selector(self: @ContractState) -> felt252 { - 1673722391095039242574232979635399085098867563460816803458086922970092209409 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-init_test" + } + + fn name_hash(self: @ContractState) -> felt252 { + 1673722391095039242574232979635399085098867563460816803458086922970092209409 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-init_test" + fn selector(self: @ContractState) -> felt252 { + 2312260519337406018659809228867734996705610542881011325166202975638859071009 } } @@ -1621,20 +1661,25 @@ impl EventDrop of core::traits::Drop::; fn contract_name(self: @ContractState) -> ByteArray { "no_init_test" } - fn selector(self: @ContractState) -> felt252 { - 2188407785440294979090510634648735461326850740369373015349552249835679156474 - } fn namespace(self: @ContractState) -> ByteArray { "dojo_plugin" } - fn namespace_selector(self: @ContractState) -> felt252 { + fn tag(self: @ContractState) -> ByteArray { + "dojo_plugin-no_init_test" + } + + fn name_hash(self: @ContractState) -> felt252 { + 2188407785440294979090510634648735461326850740369373015349552249835679156474 + } + + fn namespace_hash(self: @ContractState) -> felt252 { 3437408695301308226171664635441698996501144546809569617702850025816833723775 } - fn tag(self: @ContractState) -> ByteArray { - "dojo_plugin-no_init_test" + fn selector(self: @ContractState) -> felt252 { + 1995220858231254863157765882916485903598645700674102689896181167500490584020 } } diff --git a/crates/dojo-world/src/contracts/model.rs b/crates/dojo-world/src/contracts/model.rs index 64182c8dba..6c0742e848 100644 --- a/crates/dojo-world/src/contracts/model.rs +++ b/crates/dojo-world/src/contracts/model.rs @@ -92,7 +92,7 @@ where name: &str, world: &'a WorldContractReader

, ) -> Result, ModelError> { - let model_selector = naming::compute_model_selector_from_names(namespace, name); + let model_selector = naming::compute_selector_from_names(namespace, name); let (class_hash, contract_address) = world.model(&model_selector).block_id(world.block_id).call().await?; diff --git a/crates/dojo-world/src/contracts/model_test.rs b/crates/dojo-world/src/contracts/model_test.rs index a3ff762cb6..3277deb1ef 100644 --- a/crates/dojo-world/src/contracts/model_test.rs +++ b/crates/dojo-world/src/contracts/model_test.rs @@ -81,7 +81,7 @@ async fn test_model() { assert_eq!( position.class_hash(), - felt!("0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13") + felt!("0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40") ); let moves = world.model_reader("dojo_examples", "Moves").await.unwrap(); diff --git a/crates/dojo-world/src/contracts/naming.rs b/crates/dojo-world/src/contracts/naming.rs index 5f9141a323..d910e98837 100644 --- a/crates/dojo-world/src/contracts/naming.rs +++ b/crates/dojo-world/src/contracts/naming.rs @@ -51,7 +51,7 @@ pub fn get_filename_from_tag(tag: &str) -> String { return tag.to_string(); } - let mut selector = format!("{:x}", compute_model_selector_from_tag(tag)); + let mut selector = format!("{:x}", compute_selector_from_tag(tag)); selector.truncate(SELECTOR_CHUNK_SIZE); format!("{tag}{TAG_SEPARATOR}{selector}") @@ -62,19 +62,16 @@ pub fn compute_bytearray_hash(namespace: &str) -> Felt { poseidon_hash_many(&ByteArray::cairo_serialize(&ba)) } -pub fn compute_model_selector_from_tag(tag: &str) -> Felt { +pub fn compute_selector_from_tag(tag: &str) -> Felt { let (namespace, name) = split_tag(tag).unwrap(); - compute_model_selector_from_names(&namespace, &name) + compute_selector_from_names(&namespace, &name) } -pub fn compute_model_selector_from_names(namespace: &str, model_name: &str) -> Felt { - compute_model_selector_from_hash( - compute_bytearray_hash(namespace), - compute_bytearray_hash(model_name), - ) +pub fn compute_selector_from_names(namespace: &str, name: &str) -> Felt { + compute_selector_from_hashes(compute_bytearray_hash(namespace), compute_bytearray_hash(name)) } -pub fn compute_model_selector_from_hash(namespace_hash: Felt, model_hash: Felt) -> Felt { +pub fn compute_selector_from_hashes(namespace_hash: Felt, model_hash: Felt) -> Felt { poseidon_hash_many(&[namespace_hash, model_hash]) } @@ -125,8 +122,8 @@ mod tests { } #[test] - fn test_compute_model_selector_from_tag_success() { - let selector = compute_model_selector_from_tag("namespace-model"); + fn test_compute_selector_from_tag_success() { + let selector = compute_selector_from_tag("namespace-model"); assert_eq!( selector, Felt::from_hex("0x6cfe11a346c1bb31de8f454d65880454952e22d9adc2374fe67734196e0cbcb") @@ -135,8 +132,8 @@ mod tests { } #[test] - fn test_compute_model_selector_from_names_success() { - let selector = compute_model_selector_from_names("namespace", "model"); + fn test_compute_selector_from_names_success() { + let selector = compute_selector_from_names("namespace", "model"); assert_eq!( selector, Felt::from_hex("0x6cfe11a346c1bb31de8f454d65880454952e22d9adc2374fe67734196e0cbcb") diff --git a/crates/sozo/ops/src/auth.rs b/crates/sozo/ops/src/auth.rs index f9a1942aeb..64b3bdadbb 100644 --- a/crates/sozo/ops/src/auth.rs +++ b/crates/sozo/ops/src/auth.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use anyhow::{Context, Result}; use dojo_world::contracts::model::ModelError; use dojo_world::contracts::naming::{ - compute_bytearray_hash, compute_model_selector_from_tag, ensure_namespace, + compute_bytearray_hash, compute_selector_from_tag, ensure_namespace, }; use dojo_world::contracts::world::WorldContract; use dojo_world::contracts::WorldContractReader; @@ -294,7 +294,7 @@ where _ => {} }; - compute_model_selector_from_tag(&tag) + compute_selector_from_tag(&tag) } ResourceType::Namespace(name) => compute_bytearray_hash(name), }; diff --git a/crates/sozo/ops/src/migration/migrate.rs b/crates/sozo/ops/src/migration/migrate.rs index c38c40b0f2..90e61b5c8c 100644 --- a/crates/sozo/ops/src/migration/migrate.rs +++ b/crates/sozo/ops/src/migration/migrate.rs @@ -5,7 +5,7 @@ use cainome::cairo_serde::ByteArray; use camino::Utf8PathBuf; use dojo_world::contracts::abi::world; use dojo_world::contracts::naming::{ - compute_model_selector_from_tag, get_name_from_tag, get_namespace_from_tag, + compute_selector_from_tag, get_name_from_tag, get_namespace_from_tag, }; use dojo_world::contracts::{cairo_utils, WorldContract}; use dojo_world::manifest::{ @@ -344,7 +344,7 @@ where if let Some(m) = dojo_metadata.resources_artifacts.get(&model_tag) { ipfs.push(upload_on_ipfs_and_create_resource( &ui, - compute_model_selector_from_tag(&model_tag), + compute_selector_from_tag(&model_tag), m.clone(), )); } diff --git a/crates/sozo/ops/src/tests/migration.rs b/crates/sozo/ops/src/tests/migration.rs index 81847f2bca..ad061f59f7 100644 --- a/crates/sozo/ops/src/tests/migration.rs +++ b/crates/sozo/ops/src/tests/migration.rs @@ -4,7 +4,7 @@ use std::str; use cainome::cairo_serde::ContractAddress; use camino::Utf8Path; use dojo_test_utils::migration::prepare_migration_with_world_and_seed; -use dojo_world::contracts::naming::compute_model_selector_from_tag; +use dojo_world::contracts::naming::compute_selector_from_tag; use dojo_world::contracts::{WorldContract, WorldContractReader}; use dojo_world::manifest::{ BaseManifest, DeploymentManifest, OverlayManifest, BASE_DIR, MANIFESTS_DIR, OVERLAYS_DIR, @@ -324,7 +324,7 @@ async fn migrate_with_metadata() { // .await; // check model metadata // for m in migration.models { - // let selector = compute_model_selector_from_tag(&m.diff.tag); + // let selector = compute_selector_from_tag(&m.diff.tag); // check_artifact_metadata(&client, &world_reader, selector, &m.diff.tag, &dojo_metadata) // .await; // } @@ -391,7 +391,7 @@ async fn migrate_with_auto_authorize() { let contract = manifest.contracts.iter().find(|a| a.inner.tag == c.diff.tag).unwrap(); for model in &contract.inner.writes { - let model_selector = compute_model_selector_from_tag(model); + let model_selector = compute_selector_from_tag(model); let contract_address = ContractAddress(contract_address); let is_writer = world_reader.is_writer(&model_selector, &contract_address).call().await.unwrap(); diff --git a/crates/torii/client/src/client/mod.rs b/crates/torii/client/src/client/mod.rs index 2b5eb88962..e1265227de 100644 --- a/crates/torii/client/src/client/mod.rs +++ b/crates/torii/client/src/client/mod.rs @@ -175,7 +175,7 @@ impl Client { /// the RPC. pub async fn model(&self, keys: &ModelKeysClause) -> Result, Error> { let (namespace, model) = keys.model.split_once('-').unwrap(); - let model_selector = naming::compute_model_selector_from_names(namespace, model); + let model_selector = naming::compute_selector_from_names(namespace, model); let Some(mut schema) = self.metadata.read().model(&model_selector).map(|m| m.schema.clone()) else { @@ -289,7 +289,7 @@ impl Client { let model_reader = self.world_reader.model_reader(namespace, model).await?; let values = model_reader.entity_storage(&keys).await?; self.storage.set_model_storage( - naming::compute_model_selector_from_names(namespace, model), + naming::compute_selector_from_names(namespace, model), keys, values, )?; diff --git a/crates/torii/client/src/client/storage.rs b/crates/torii/client/src/client/storage.rs index 772b838a93..b5da49d1cc 100644 --- a/crates/torii/client/src/client/storage.rs +++ b/crates/torii/client/src/client/storage.rs @@ -139,7 +139,7 @@ mod tests { use dojo_types::schema::Ty; use dojo_types::WorldMetadata; - use dojo_world::contracts::naming::compute_model_selector_from_names; + use dojo_world::contracts::naming::compute_selector_from_names; use parking_lot::RwLock; use starknet::macros::felt; @@ -147,7 +147,7 @@ mod tests { fn create_dummy_metadata() -> WorldMetadata { let models = HashMap::from([( - compute_model_selector_from_names("Test", "Position"), + compute_selector_from_names("Test", "Position"), dojo_types::schema::ModelMetadata { namespace: "Test".into(), name: "Position".into(), @@ -175,7 +175,7 @@ mod tests { assert!(storage.storage.read().is_empty(), "storage must be empty initially"); - let model_selector = compute_model_selector_from_names("Test", "Position"); + let model_selector = compute_selector_from_names("Test", "Position"); let model = storage.metadata.read().model(&model_selector).cloned().unwrap(); let expected_storage_addresses = diff --git a/crates/torii/client/src/client/subscription.rs b/crates/torii/client/src/client/subscription.rs index c2a35ef532..7bd7f7bca1 100644 --- a/crates/torii/client/src/client/subscription.rs +++ b/crates/torii/client/src/client/subscription.rs @@ -62,7 +62,7 @@ impl SubscribedModels { let (namespace, model) = keys.model.split_once('-').ok_or(Error::InvalidModelName(keys.model.clone()))?; - let selector = naming::compute_model_selector_from_names(namespace, model); + let selector = naming::compute_selector_from_names(namespace, model); let model_packed_size = self .metadata @@ -90,7 +90,7 @@ impl SubscribedModels { let (namespace, model) = keys.model.split_once('-').ok_or(Error::InvalidModelName(keys.model.clone()))?; - let selector = naming::compute_model_selector_from_names(namespace, model); + let selector = naming::compute_selector_from_names(namespace, model); let model_packed_size = self .metadata @@ -245,7 +245,7 @@ mod tests { use dojo_types::schema::Ty; use dojo_types::WorldMetadata; - use dojo_world::contracts::naming::compute_model_selector_from_names; + use dojo_world::contracts::naming::compute_selector_from_names; use parking_lot::RwLock; use starknet::macros::felt; use torii_grpc::types::ModelKeysClause; @@ -254,7 +254,7 @@ mod tests { fn create_dummy_metadata() -> WorldMetadata { let components = HashMap::from([( - compute_model_selector_from_names("Test", "Position"), + compute_selector_from_names("Test", "Position"), dojo_types::schema::ModelMetadata { namespace: "Test".into(), name: "Position".into(), @@ -277,7 +277,7 @@ mod tests { let packed_size: u32 = 1; let mut expected_storage_addresses = compute_all_storage_addresses( - compute_model_selector_from_names("Test", "Position"), + compute_selector_from_names("Test", "Position"), &keys, packed_size, ) diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 6b530e602e..a16f5c1d5a 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -6,7 +6,7 @@ use chrono::Utc; use dojo_types::primitive::Primitive; use dojo_types::schema::{EnumOption, Member, Ty}; use dojo_world::contracts::abi::model::Layout; -use dojo_world::contracts::naming::compute_model_selector_from_names; +use dojo_world::contracts::naming::compute_selector_from_names; use dojo_world::metadata::WorldMetadata; use sqlx::pool::PoolConnection; use sqlx::{Pool, Sqlite}; @@ -105,7 +105,7 @@ impl Sql { unpacked_size: u32, block_timestamp: u64, ) -> Result<()> { - let selector = compute_model_selector_from_names(namespace, &model.name()); + let selector = compute_selector_from_names(namespace, &model.name()); let insert_models = "INSERT INTO models (id, namespace, name, class_hash, contract_address, layout, \ @@ -165,8 +165,7 @@ impl Sql { let (model_namespace, model_name) = namespaced_name.split_once('-').unwrap(); let entity_id = format!("{:#x}", poseidon_hash_many(&keys)); - let model_id = - format!("{:#x}", compute_model_selector_from_names(model_namespace, model_name)); + let model_id = format!("{:#x}", compute_selector_from_names(model_namespace, model_name)); self.query_queue.enqueue( "INSERT INTO entity_model (entity_id, model_id) VALUES (?, ?) ON CONFLICT(entity_id, \ @@ -225,8 +224,7 @@ impl Sql { let (model_namespace, model_name) = namespaced_name.split_once('-').unwrap(); let entity_id = format!("{:#x}", poseidon_hash_many(&keys)); - let model_id = - format!("{:#x}", compute_model_selector_from_names(model_namespace, model_name)); + let model_id = format!("{:#x}", compute_selector_from_names(model_namespace, model_name)); self.query_queue.enqueue( "INSERT INTO event_model (entity_id, model_id) VALUES (?, ?) ON CONFLICT(entity_id, \ diff --git a/crates/torii/core/src/sql_test.rs b/crates/torii/core/src/sql_test.rs index a1d3d55e37..4bb96ff80c 100644 --- a/crates/torii/core/src/sql_test.rs +++ b/crates/torii/core/src/sql_test.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use camino::Utf8PathBuf; use dojo_test_utils::compiler; use dojo_test_utils::migration::prepare_migration; -use dojo_world::contracts::naming::compute_model_selector_from_names; +use dojo_world::contracts::naming::compute_selector_from_names; use dojo_world::contracts::world::WorldContractReader; use dojo_world::metadata::{dojo_metadata_from_workspace, get_default_namespace_from_ws}; use dojo_world::migration::TxnConfig; @@ -141,10 +141,7 @@ async fn test_load_from_remote() { .await .unwrap(); - assert_eq!( - id, - format!("{:#x}", compute_model_selector_from_names("dojo_examples", "Position")) - ); + assert_eq!(id, format!("{:#x}", compute_selector_from_names("dojo_examples", "Position"))); assert_eq!(name, "Position"); assert_eq!(namespace, "dojo_examples"); assert_eq!(packed_size, 1); @@ -159,7 +156,7 @@ async fn test_load_from_remote() { .await .unwrap(); - assert_eq!(id, format!("{:#x}", compute_model_selector_from_names("dojo_examples", "Moves"))); + assert_eq!(id, format!("{:#x}", compute_selector_from_names("dojo_examples", "Moves"))); assert_eq!(name, "Moves"); assert_eq!(namespace, "dojo_examples"); assert_eq!(packed_size, 0); @@ -174,10 +171,7 @@ async fn test_load_from_remote() { .await .unwrap(); - assert_eq!( - id, - format!("{:#x}", compute_model_selector_from_names("dojo_examples", "PlayerConfig")) - ); + assert_eq!(id, format!("{:#x}", compute_selector_from_names("dojo_examples", "PlayerConfig"))); assert_eq!(name, "PlayerConfig"); assert_eq!(namespace, "dojo_examples"); assert_eq!(packed_size, 0); diff --git a/crates/torii/graphql/src/tests/subscription_test.rs b/crates/torii/graphql/src/tests/subscription_test.rs index 1bc74b6e98..015df8789c 100644 --- a/crates/torii/graphql/src/tests/subscription_test.rs +++ b/crates/torii/graphql/src/tests/subscription_test.rs @@ -7,7 +7,7 @@ mod tests { use dojo_types::primitive::Primitive; use dojo_types::schema::{Enum, EnumOption, Member, Struct, Ty}; use dojo_world::contracts::abi::model::Layout; - use dojo_world::contracts::naming::compute_model_selector_from_names; + use dojo_world::contracts::naming::compute_selector_from_names; use serial_test::serial; use sqlx::SqlitePool; use starknet::core::types::{Event, Felt}; @@ -256,7 +256,7 @@ mod tests { // 0. Preprocess model value let namespace = "types_test".to_string(); let model_name = "Subrecord".to_string(); - let model_id = format!("{:#x}", compute_model_selector_from_names(&namespace, &model_name)); + let model_id = format!("{:#x}", compute_selector_from_names(&namespace, &model_name)); let class_hash = Felt::TWO; let contract_address = Felt::THREE; let block_timestamp: u64 = 1710754478_u64; @@ -320,7 +320,7 @@ mod tests { // 0. Preprocess model value let namespace = "types_test".to_string(); let model_name = "Subrecord".to_string(); - let model_id = format!("{:#x}", compute_model_selector_from_names(&namespace, &model_name)); + let model_id = format!("{:#x}", compute_selector_from_names(&namespace, &model_name)); let class_hash = Felt::TWO; let contract_address = Felt::THREE; let block_timestamp: u64 = 1710754478_u64; diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index 55d7092865..dc23a1e559 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -13,7 +13,7 @@ use std::str::FromStr; use std::sync::Arc; use dojo_types::schema::Ty; -use dojo_world::contracts::naming::compute_model_selector_from_names; +use dojo_world::contracts::naming::compute_selector_from_names; use futures::Stream; use proto::world::{ MetadataRequest, MetadataResponse, RetrieveEntitiesRequest, RetrieveEntitiesResponse, @@ -344,7 +344,7 @@ impl DojoWorld { let model_ids_str = model_ids .iter() .map(|(namespace, model)| { - format!("'{:#x}'", compute_model_selector_from_names(namespace, model)) + format!("'{:#x}'", compute_selector_from_names(namespace, model)) }) .collect::>() .join(","); @@ -393,7 +393,7 @@ impl DojoWorld { let (namespace, name) = model .split_once('-') .ok_or(QueryError::InvalidNamespacedModel(model.clone()))?; - let model_id = compute_model_selector_from_names(namespace, name); + let model_id = compute_selector_from_names(namespace, name); Ok(format!("INSTR(model_ids, '{:#x}') > 0", model_id)) }) .collect::, Error>>()? @@ -509,7 +509,7 @@ impl DojoWorld { HAVING INSTR(model_ids, '{:#x}') > 0 LIMIT 1 "#, - compute_model_selector_from_names(namespace, model) + compute_selector_from_names(namespace, model) ); let (models_str,): (String,) = sqlx::query_as(&models_query).fetch_one(&self.pool).await?; @@ -608,7 +608,7 @@ impl DojoWorld { .model .split_once('-') .ok_or(QueryError::InvalidNamespacedModel(member.model.clone()))?; - let model_id: Felt = compute_model_selector_from_names(namespace, model); + let model_id: Felt = compute_selector_from_names(namespace, model); having_clauses.push(format!("INSTR(model_ids, '{:#x}') > 0", model_id)); } _ => return Err(QueryError::UnsupportedQuery.into()), @@ -722,7 +722,7 @@ impl DojoWorld { name: &str, ) -> Result { // selector - let model = compute_model_selector_from_names(namespace, name); + let model = compute_selector_from_names(namespace, name); let (name, class_hash, contract_address, packed_size, unpacked_size, layout): ( String, @@ -765,7 +765,7 @@ impl DojoWorld { .split_once('-') .ok_or(QueryError::InvalidNamespacedModel(keys.model.clone()))?; - let selector = compute_model_selector_from_names(namespace, model); + let selector = compute_selector_from_names(namespace, model); let proto::types::ModelMetadata { packed_size, .. } = self.model_metadata(namespace, model).await?; diff --git a/crates/torii/grpc/src/types/mod.rs b/crates/torii/grpc/src/types/mod.rs index dd576b6ebb..dc757db20b 100644 --- a/crates/torii/grpc/src/types/mod.rs +++ b/crates/torii/grpc/src/types/mod.rs @@ -157,10 +157,7 @@ impl TryFrom for dojo_types::WorldMetadata { .into_iter() .map(|component| { Ok(( - naming::compute_model_selector_from_names( - &component.namespace, - &component.name, - ), + naming::compute_selector_from_names(&component.namespace, &component.name), component.try_into()?, )) }) diff --git a/crates/torii/libp2p/src/server/mod.rs b/crates/torii/libp2p/src/server/mod.rs index 4a64043dab..9a7c20e148 100644 --- a/crates/torii/libp2p/src/server/mod.rs +++ b/crates/torii/libp2p/src/server/mod.rs @@ -10,7 +10,7 @@ use chrono::Utc; use crypto_bigint::U256; use dojo_types::primitive::Primitive; use dojo_types::schema::Ty; -use dojo_world::contracts::naming::compute_model_selector_from_names; +use dojo_world::contracts::naming::compute_selector_from_names; use futures::StreamExt; use indexmap::IndexMap; use libp2p::core::multiaddr::Protocol; @@ -631,7 +631,7 @@ async fn validate_message( ) })?; - (compute_model_selector_from_names(namespace, name), model_name) + (compute_selector_from_names(namespace, name), model_name) } else { return Err(Error::InvalidMessageError("Model name is not a string".to_string())); } diff --git a/examples/spawn-and-move/Scarb.toml b/examples/spawn-and-move/Scarb.toml index 0daf0d3ed4..408f29ab3c 100644 --- a/examples/spawn-and-move/Scarb.toml +++ b/examples/spawn-and-move/Scarb.toml @@ -29,7 +29,7 @@ rpc_url = "http://localhost:5050/" # Default account for katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" -world_address = "0x6ffdafc135828e1428d94e9587bc36382cdf42a8cd463876b534be20a956397" +world_address = "0x504b804eeac62e68d12dc030e56b8f62cb047950c346e60a974da02795f6aba" # `release` profile # diff --git a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json index 310e06be9e..16ee68e05e 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json index 17da9b2135..776977acd1 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json index 2e0c485d8b..f9e4b7448b 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json index a46919adf4..133257a2c1 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json index 8e8af178cf..858f51d13c 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json index b02c79f885..36b29c9dd7 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json index 5138063ef3..adf73384b2 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json index c5404bf877..3e61365dee 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json index a70cb0881d..0185cc11f9 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json index cb815337ec..1f298063d0 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json index 31f5457868..031b2dcc9e 100644 --- a/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json +++ b/examples/spawn-and-move/manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml index 0ef293bcd8..b3fc65dfe2 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-actions-40b6994c.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" -original_class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +class_hash = "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d" +original_class_hash = "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml index b385c1eb5f..137baf0aaa 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" -original_class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +class_hash = "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef" +original_class_hash = "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml index 246e93b7a1..70a3bb5255 100644 --- a/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/dev/base/contracts/dojo_examples-others-61de2c18.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" -original_class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +class_hash = "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7" +original_class_hash = "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7" base_class_hash = "0x0" abi = "manifests/dev/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] diff --git a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml index 08b3a3437f..83a7a20228 100644 --- a/examples/spawn-and-move/manifests/dev/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/dev/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" -original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" +original_class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" abi = "manifests/dev/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index deca2eecd1..869c91f694 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" -original_class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" +class_hash = "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65" +original_class_hash = "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65" abi = "manifests/dev/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml index 58363d2a85..2b346792c9 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" -original_class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" +class_hash = "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3" +original_class_hash = "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3" abi = "manifests/dev/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml index 8faf9fa5f0..49ff33284a 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" -original_class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" +class_hash = "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d" +original_class_hash = "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d" abi = "manifests/dev/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml index b52523d008..c9b859f0f8 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" -original_class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" +class_hash = "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1" +original_class_hash = "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1" abi = "manifests/dev/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml index 319270b42b..9fe89cb7d6 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" -original_class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" +class_hash = "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89" +original_class_hash = "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89" abi = "manifests/dev/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml index 59a2ecd684..6bfcf12738 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" -original_class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" +class_hash = "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82" +original_class_hash = "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82" abi = "manifests/dev/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml index b010833f66..3b1057bd6f 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-Position-1e145e26.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" -original_class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" +class_hash = "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40" +original_class_hash = "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40" abi = "manifests/dev/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml index bff35fb980..c4313186ea 100644 --- a/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/dev/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" -original_class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" +class_hash = "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f" +original_class_hash = "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f" abi = "manifests/dev/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json index 310e06be9e..16ee68e05e 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json index 17da9b2135..776977acd1 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json index 2e0c485d8b..f9e4b7448b 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json index a46919adf4..133257a2c1 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json index 8e8af178cf..858f51d13c 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json index b02c79f885..36b29c9dd7 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json index 5138063ef3..adf73384b2 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json index c5404bf877..3e61365dee 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json index a70cb0881d..0185cc11f9 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json index cb815337ec..1f298063d0 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json index 31f5457868..031b2dcc9e 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json +++ b/examples/spawn-and-move/manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.json b/examples/spawn-and-move/manifests/dev/deployment/manifest.json index cd7ce19061..99501691fc 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.json +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.json @@ -1,8 +1,8 @@ { "world": { "kind": "WorldContract", - "class_hash": "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92", - "original_class_hash": "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92", + "class_hash": "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51", + "original_class_hash": "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51", "abi": [ { "type": "impl", @@ -1108,8 +1108,8 @@ ] } ], - "address": "0x6ffdafc135828e1428d94e9587bc36382cdf42a8cd463876b534be20a956397", - "transaction_hash": "0x3dd147768d44804d306e22ab63943a7307a160367ff4cbbc9b65870f88850e2", + "address": "0x504b804eeac62e68d12dc030e56b8f62cb047950c346e60a974da02795f6aba", + "transaction_hash": "0x65168705b42b38a0b9e290dfb079e023fa1960febb9fd7069fce5e369e3b56f", "block_number": 3, "seed": "dojo_examples", "metadata": { @@ -1129,9 +1129,9 @@ "contracts": [ { "kind": "DojoContract", - "address": "0x5954132061c8ba9fed715a01a2a1064d2d3791ef4c2f6203c790457362abfb5", - "class_hash": "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6", - "original_class_hash": "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6", + "address": "0x2e85647f570d2a4abdffdd668823702548d20d1d6aaef74b6a4eb9670a32798", + "class_hash": "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d", + "original_class_hash": "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d", "base_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": [ { @@ -1174,18 +1174,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -1196,7 +1196,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -1207,11 +1207,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" @@ -1513,9 +1524,9 @@ }, { "kind": "DojoContract", - "address": "0x34fa6c359d9f888d120d761eee8f8391ca4d8fd57ea7baa91b7fd1aabdbc343", - "class_hash": "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e", - "original_class_hash": "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e", + "address": "0x6a06eb156f956f1691bce4a4573c97b1a5f08d3bfa65fc25c4ed4b55d3e61a1", + "class_hash": "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef", + "original_class_hash": "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef", "base_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": [ { @@ -1558,18 +1569,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -1580,7 +1591,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -1591,11 +1602,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" @@ -1721,9 +1743,9 @@ }, { "kind": "DojoContract", - "address": "0x6d375b5b8a43fee9ccb152fbb621ac1dae8c18a45f12c44933528908ed0b280", - "class_hash": "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6", - "original_class_hash": "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6", + "address": "0x6359537114e0a62c63f52f2fb3c0e6241c9a2fcbd9dc9df221c867662aa31e9", + "class_hash": "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7", + "original_class_hash": "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7", "base_class_hash": "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4", "abi": [ { @@ -1766,18 +1788,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -1788,7 +1810,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -1799,11 +1821,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" @@ -1965,8 +1998,8 @@ "key": false } ], - "class_hash": "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a", - "original_class_hash": "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a", + "class_hash": "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65", + "original_class_hash": "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65", "abi": [ { "type": "impl", @@ -2209,18 +2242,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -2242,18 +2286,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -2264,11 +2308,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -2394,8 +2438,8 @@ "key": true } ], - "class_hash": "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a", - "original_class_hash": "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a", + "class_hash": "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3", + "original_class_hash": "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3", "abi": [ { "type": "impl", @@ -2638,18 +2682,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -2671,18 +2726,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -2693,11 +2748,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -2817,8 +2872,8 @@ "key": false } ], - "class_hash": "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb", - "original_class_hash": "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb", + "class_hash": "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d", + "original_class_hash": "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d", "abi": [ { "type": "impl", @@ -3061,18 +3116,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -3094,18 +3160,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -3116,11 +3182,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -3232,8 +3298,8 @@ "key": false } ], - "class_hash": "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38", - "original_class_hash": "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38", + "class_hash": "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1", + "original_class_hash": "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1", "abi": [ { "type": "impl", @@ -3476,18 +3542,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -3509,18 +3586,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -3531,11 +3608,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -3678,8 +3755,8 @@ "key": false } ], - "class_hash": "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a", - "original_class_hash": "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a", + "class_hash": "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89", + "original_class_hash": "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89", "abi": [ { "type": "impl", @@ -3922,18 +3999,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -3955,18 +4043,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -3977,11 +4065,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -4133,8 +4221,8 @@ "key": false } ], - "class_hash": "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec", - "original_class_hash": "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec", + "class_hash": "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82", + "original_class_hash": "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82", "abi": [ { "type": "impl", @@ -4377,18 +4465,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -4410,18 +4509,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -4432,11 +4531,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -4570,8 +4669,8 @@ "key": false } ], - "class_hash": "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13", - "original_class_hash": "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13", + "class_hash": "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40", + "original_class_hash": "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40", "abi": [ { "type": "impl", @@ -4814,18 +4913,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -4847,18 +4957,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -4869,11 +4979,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" @@ -5004,8 +5114,8 @@ "key": false } ], - "class_hash": "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47", - "original_class_hash": "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47", + "class_hash": "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f", + "original_class_hash": "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f", "abi": [ { "type": "impl", @@ -5248,18 +5358,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -5281,18 +5402,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -5303,11 +5424,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml index 23c249df01..6c9080ead0 100644 --- a/examples/spawn-and-move/manifests/dev/deployment/manifest.toml +++ b/examples/spawn-and-move/manifests/dev/deployment/manifest.toml @@ -1,10 +1,10 @@ [world] kind = "WorldContract" -class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" -original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" +original_class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" abi = "manifests/dev/deployment/abis/dojo-world.json" -address = "0x6ffdafc135828e1428d94e9587bc36382cdf42a8cd463876b534be20a956397" -transaction_hash = "0x3dd147768d44804d306e22ab63943a7307a160367ff4cbbc9b65870f88850e2" +address = "0x504b804eeac62e68d12dc030e56b8f62cb047950c346e60a974da02795f6aba" +transaction_hash = "0x65168705b42b38a0b9e290dfb079e023fa1960febb9fd7069fce5e369e3b56f" block_number = 3 seed = "dojo_examples" manifest_name = "dojo-world" @@ -23,9 +23,9 @@ manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" -address = "0x5954132061c8ba9fed715a01a2a1064d2d3791ef4c2f6203c790457362abfb5" -class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" -original_class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +address = "0x2e85647f570d2a4abdffdd668823702548d20d1d6aaef74b6a4eb9670a32798" +class_hash = "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d" +original_class_hash = "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d" base_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] @@ -40,9 +40,9 @@ manifest_name = "dojo_examples-actions-40b6994c" [[contracts]] kind = "DojoContract" -address = "0x34fa6c359d9f888d120d761eee8f8391ca4d8fd57ea7baa91b7fd1aabdbc343" -class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" -original_class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +address = "0x6a06eb156f956f1691bce4a4573c97b1a5f08d3bfa65fc25c4ed4b55d3e61a1" +class_hash = "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef" +original_class_hash = "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef" base_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] @@ -54,9 +54,9 @@ manifest_name = "dojo_examples-mock_token-31599eb2" [[contracts]] kind = "DojoContract" -address = "0x6d375b5b8a43fee9ccb152fbb621ac1dae8c18a45f12c44933528908ed0b280" -class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" -original_class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +address = "0x6359537114e0a62c63f52f2fb3c0e6241c9a2fcbd9dc9df221c867662aa31e9" +class_hash = "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7" +original_class_hash = "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7" base_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4" abi = "manifests/dev/deployment/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] @@ -72,8 +72,8 @@ manifest_name = "dojo_examples-others-61de2c18" [[models]] kind = "DojoModel" -class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" -original_class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" +class_hash = "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65" +original_class_hash = "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65" abi = "manifests/dev/deployment/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" @@ -95,8 +95,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" -original_class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" +class_hash = "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3" +original_class_hash = "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3" abi = "manifests/dev/deployment/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" @@ -123,8 +123,8 @@ key = true [[models]] kind = "DojoModel" -class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" -original_class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" +class_hash = "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d" +original_class_hash = "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d" abi = "manifests/dev/deployment/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" @@ -141,8 +141,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" -original_class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" +class_hash = "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1" +original_class_hash = "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" @@ -159,8 +159,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" -original_class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" +class_hash = "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89" +original_class_hash = "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89" abi = "manifests/dev/deployment/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" @@ -182,8 +182,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" -original_class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" +class_hash = "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82" +original_class_hash = "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82" abi = "manifests/dev/deployment/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" @@ -210,8 +210,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" -original_class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" +class_hash = "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40" +original_class_hash = "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40" abi = "manifests/dev/deployment/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" @@ -228,8 +228,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" -original_class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" +class_hash = "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f" +original_class_hash = "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f" abi = "manifests/dev/deployment/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6" diff --git a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json index 310e06be9e..16ee68e05e 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json +++ b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json index 17da9b2135..776977acd1 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json +++ b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json index 2e0c485d8b..f9e4b7448b 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json +++ b/examples/spawn-and-move/manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json @@ -39,18 +39,18 @@ }, { "type": "function", - "name": "selector", + "name": "namespace", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace", + "name": "tag", "inputs": [], "outputs": [ { @@ -61,7 +61,7 @@ }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -72,11 +72,22 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json index a46919adf4..133257a2c1 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json index 8e8af178cf..858f51d13c 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json index b02c79f885..36b29c9dd7 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json index 5138063ef3..adf73384b2 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json index c5404bf877..3e61365dee 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json index a70cb0881d..0185cc11f9 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json index cb815337ec..1f298063d0 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json index 31f5457868..031b2dcc9e 100644 --- a/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json +++ b/examples/spawn-and-move/manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json @@ -240,18 +240,29 @@ "items": [ { "type": "function", - "name": "selector", + "name": "name", "inputs": [], "outputs": [ { - "type": "core::felt252" + "type": "core::byte_array::ByteArray" } ], "state_mutability": "view" }, { "type": "function", - "name": "name", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", "inputs": [], "outputs": [ { @@ -273,18 +284,18 @@ }, { "type": "function", - "name": "namespace", + "name": "selector", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" }, { "type": "function", - "name": "namespace_selector", + "name": "name_hash", "inputs": [], "outputs": [ { @@ -295,11 +306,11 @@ }, { "type": "function", - "name": "tag", + "name": "namespace_hash", "inputs": [], "outputs": [ { - "type": "core::byte_array::ByteArray" + "type": "core::felt252" } ], "state_mutability": "view" diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml index 63be5c1917..aa9b1571cd 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-actions-40b6994c.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" -original_class_hash = "0x32f7e90e503b8e7b828a1b5c2d24d97cca86eebb967d03fcad5cd305388f3a6" +class_hash = "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d" +original_class_hash = "0x647694c15fff8476c82ea146d0dbdbbb17d3425d5ba05a7320e4322f916df1d" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-actions-40b6994c.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml index 783896e36c..1ead2c6821 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-mock_token-31599eb2.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" -original_class_hash = "0xbfaafc36111f7cc26ed8616dae151bc891142fef3a35090378262b0fb1bb3e" +class_hash = "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef" +original_class_hash = "0x97cd4fb3acfe9e6a024589ea34db2fc587586d699ef3732ce627e1771158ef" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-mock_token-31599eb2.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml index b1b631a5a1..eb147736c9 100644 --- a/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml +++ b/examples/spawn-and-move/manifests/release/base/contracts/dojo_examples-others-61de2c18.toml @@ -1,6 +1,6 @@ kind = "DojoContract" -class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" -original_class_hash = "0x15679777d999d9981b48c2b6d7db0bded1743d20fa037f8ccb61926c421f8c6" +class_hash = "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7" +original_class_hash = "0x479bfb12dcba5398d77303e7a665fc3fedb16f2d7f9cb1f5d7e2beb3b7e2ba7" base_class_hash = "0x0" abi = "manifests/release/base/abis/contracts/dojo_examples-others-61de2c18.json" reads = [] diff --git a/examples/spawn-and-move/manifests/release/base/dojo-world.toml b/examples/spawn-and-move/manifests/release/base/dojo-world.toml index 15ff18b97f..97f4f8c522 100644 --- a/examples/spawn-and-move/manifests/release/base/dojo-world.toml +++ b/examples/spawn-and-move/manifests/release/base/dojo-world.toml @@ -1,6 +1,6 @@ kind = "Class" -class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" -original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92" +class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" +original_class_hash = "0x210dd8e484e5555dc74a4a600b17878fc108911719b04139309acc874160c51" abi = "manifests/release/base/abis/dojo-world.json" tag = "dojo-world" manifest_name = "dojo-world" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml index cbeb4ea2dd..16812dfe4a 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ContractInitialized-376b7bd6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" -original_class_hash = "0x728e99bfb4eb78333f233877df397568a2dd1178fbcef9f1aca871f89c59e2a" +class_hash = "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65" +original_class_hash = "0x1da39caefeb15d61baa9d1d71f21ed79cf5650aa215b583e7f453c0d7d4ee65" abi = "manifests/release/base/abis/models/dojo_examples-ContractInitialized-376b7bd6.json" tag = "dojo_examples-ContractInitialized" manifest_name = "dojo_examples-ContractInitialized-376b7bd6" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml index ee0d8f81bb..e485ac545a 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Message-1bb1d226.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" -original_class_hash = "0x119411fb88153fe44ad11d41b25e865fc52b9bce6ce196b813a5fcf7a42739a" +class_hash = "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3" +original_class_hash = "0x572bf6d3cbcd69fd6404a993110c3b84379882587b21b7ad5b2761088cb19c3" abi = "manifests/release/base/abis/models/dojo_examples-Message-1bb1d226.json" tag = "dojo_examples-Message" manifest_name = "dojo_examples-Message-1bb1d226" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml index 7256f93a45..2457a5a817 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-MockToken-38903c7c.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" -original_class_hash = "0x50b9989aedf757df9b0a8e235b78d7e185fd4a6cbf05d61da097e19e5cf4efb" +class_hash = "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d" +original_class_hash = "0x4463c89586bc5015a7bc97e9e4af123330842b20aa6f6587c795d6d35907a9d" abi = "manifests/release/base/abis/models/dojo_examples-MockToken-38903c7c.json" tag = "dojo_examples-MockToken" manifest_name = "dojo_examples-MockToken-38903c7c" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml index 3899657efa..a54ed13890 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moved-318ae40d.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" -original_class_hash = "0x3fd5ae468509ca258d45283bddd24dca8f9b09469a56dc0275f0a0f5413a38" +class_hash = "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1" +original_class_hash = "0x36b7886db455f41fac4263da9f0d21190bb575c8555bde1c3357486495c0be1" abi = "manifests/release/base/abis/models/dojo_examples-Moved-318ae40d.json" tag = "dojo_examples-Moved" manifest_name = "dojo_examples-Moved-318ae40d" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml index 1c19d06578..e18e7e922d 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Moves-2e2accba.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" -original_class_hash = "0x2d5c3490b29ddf08728213221a87566a2fa92e58e7ed688a146642a316e718a" +class_hash = "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89" +original_class_hash = "0x23ec6500e0f3e8c64c6fb3ee3ed3259d81c0bde627c8c9c1177da098189dd89" abi = "manifests/release/base/abis/models/dojo_examples-Moves-2e2accba.json" tag = "dojo_examples-Moves" manifest_name = "dojo_examples-Moves-2e2accba" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml index 054ff54ab4..6fd10ebb99 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-PlayerConfig-3adad785.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" -original_class_hash = "0x2e51c67a84751e6eac040a1ac757f7131ed3d8cb2979d985ee677b9b81856ec" +class_hash = "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82" +original_class_hash = "0x13f8294fde1c2605e9825782ae293b3bae2291e6cbd20d4ef8878ff044d4b82" abi = "manifests/release/base/abis/models/dojo_examples-PlayerConfig-3adad785.json" tag = "dojo_examples-PlayerConfig" manifest_name = "dojo_examples-PlayerConfig-3adad785" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml index 4499459ee0..6922844ed1 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-Position-1e145e26.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" -original_class_hash = "0x2fd0f7bf2373f0232270ac826f9a5bb206b04687ef7ee07f5ce3f688baf6c13" +class_hash = "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40" +original_class_hash = "0x7104c882f56f62ef1f2453319bf6a1f5784b5f33b63b65506c38d62c3e3fd40" abi = "manifests/release/base/abis/models/dojo_examples-Position-1e145e26.json" tag = "dojo_examples-Position" manifest_name = "dojo_examples-Position-1e145e26" diff --git a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml index e3d572b447..2002f5c0ef 100644 --- a/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml +++ b/examples/spawn-and-move/manifests/release/base/models/dojo_examples-ServerProfile-4caad1e6.toml @@ -1,6 +1,6 @@ kind = "DojoModel" -class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" -original_class_hash = "0x72d7c4cb46128c15db1993b664bc61043846f51e2bc737a3e9253409cd24f47" +class_hash = "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f" +original_class_hash = "0x48dfe99daae31ced8d121079c148d084311483f047519d2d3fae363f15c7a1f" abi = "manifests/release/base/abis/models/dojo_examples-ServerProfile-4caad1e6.json" tag = "dojo_examples-ServerProfile" manifest_name = "dojo_examples-ServerProfile-4caad1e6"